| Author |
Comment/Response |
JuanC
|
09/17/12 6:50pm
I don't know why FindRoot is not working to solve a simple system of 4 nonlinear equations. When I write the equations one by one, f1==0, f2==0,... etc, it works, but if I want to group my equations on a List (e.g. fss) and use: FindRoot[fss == {0,0,0,0}... it wouldn't work. Here is a portion of the code:
xss0 = Table[vt[[i]] -> v[[i]], {i, nvar}]
xss1 = Table[vt1[[i]] -> v[[i]], {i, nvar}];
xss = Flatten[{xss0, xss1}]
fss = ff /. xss
In[704]:= fss
Out[704]= {-(0.624787/(1 - H)) + (0.225128 KK^0.4 z)/(c H^0.4),
1/c - (0.98 (0.98 + (0.4 H^0.6 z)/KK^0.6))/c, -c - 0.02 KK +
H^0.6 KK^0.4 z, 0.1 z - 0.1 TextCell[""]}
In[705]:= ceros = Table[0, {Length[v]}];
In[706]:= sstate =
FindRoot[fss == ceros, {KK, 1.0001}, {z, 0.1}, {c, 1.000001}, {H,
0.10001}, DampingFactor -> 1, MaxIterations -> 50000]
During evaluation of In[706]:= FindRoot::nlnum: The function value {-0.637666,0.0297534,-0.994882,0.01 -0.1 }
is not a list of numbers with dimensions {4} at {KK,z,c,H} = {1.0001,0.1,1.,0.10001}. >>
During evaluation of In[706]:= FindRoot::nlnum: The function value {-0.637666,0.0297534,-0.994882,0.01 -0.1 }
is not a list of numbers with dimensions {4} at {KK,z,c,H} = {1.0001,0.1,1.,0.10001}. >>
URL: , |
|