FindRoot and vector equations
- To: mathgroup at smc.vnet.net
- Subject: [mg36254] FindRoot and vector equations
- From: anhjunk at hotmail.com (anhjunk)
- Date: Wed, 28 Aug 2002 04:16:15 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I need some help with using FindRoot. I want to solve a system of nonlinear equations numerically. Each equation in the system is an equation with vector variables. The equations are such that it is difficult to convert them to equations involving only the components of the vector variables. I have tried the following two possibilities without success. In what follows I am using a MADE UP EXAMPLE. In this example it is easy to write the equations in terms of only the components. Furthermore the correct solution is obvious. But I made up the example for illustration only. ----------------------------Try 1-------------------------------------------- q = {{x[1], y[1]}, {x[2], y[2]}}; FindRoot[{q[[1]] + q[[2]] Sqrt[q[[2]].q[[2]]] == {0, 0}, q[[1]] + q[[2]] == {0, 0}}, {q[[1]], {0, 0}}, {q[[2]], {0, 0}}] This results in the error message : FindRoot::"fddis": Start specification {q[[1]],{0,0}} does not contain distinct starting values. ----------------------------Try 2--------------------------------------------- FindRoot[{q[[1]] + q[[2]] Sqrt[q[[2]].q[[2]]] == {0, 0}, q[[1]] + q[[2]] == {0, 0}}, {x[1], 0}, {x[2], 0}, {y[1], 0}, {y[2], 0}] This results in the error message : FindRoot::"frnum": "Function {0.,0.},{0.,0.}} is not a length 4 list of numbers at {x[1],x[2],y[1],y[2]} = {0., 0., 0., 0.} Questions 1) How do I fix these two methods ? 2) What do the error messages mean ? Please keep in mind that this example is made up and trivial to solve without Mathematica. It is being used for illustration purpose only. Thanks