I am new to Mathematica so please bear with me. I have an equation that has around 7 parameters and one unknown. I was able to use FindRoot
to solve it; however, I want to do the same for around 1000 rows of parameters. I usually do this in Excel were I just drag down the same command for all rows to get the result for each row. I tried to use the Table
, Matrix
, and other commands but couldn't understand how it works. I think there is something wrong with my understanding on how Mathematica works. Any suggestions on guiding me is greatly appreciated.
Edit#1
For example,
a b c f(x)=ax^2+bx+c Findroot f(x)
2 3 3 f(x)=2x^2+3x+3 ?
2 2 1 f(x)=2x^2+2x+1 ?
5 3 5 f(x)=5x^2+3x+5 ?
. . . . .
. . . . .
. . . . .
2 8 3 f(x)=2x^2+8x+3 ?
Edit#2
I tried the following as suggested by @belisarius ;however, i get " FindRoot::nveq: The number of equations does not match the number of variables in "
params = {{{61.07213, 118.844, 127.4626, 133.3232, 140.4969, 154.6745,
0.0725203, 0.0459785, 0.0538076, 0.1009101,
0.1382398, -0.0140873}, {349.7488, 115.493, 114.1906, 112.2911,
110.223, 108.051, 0.1205766, 0.1778708, 0.1969301, 0.2107067,
0.2875397, -0.0140873}, {579.7379, 332.051, 383.5087, 437.5052,
493.8236, 556.8684, 0.2324231, 0.2111662, 0.1930639, 0.1914745,
0.2012774, -0.0140873}}};
f[{m_, b0_, b1_, b2_, b3_, b4_, roe1_, roe2_, roe3_, roe4_, roe5_,
gCT_}] :=
FindRoot[b0 + (b0 (-R + roe1))/(1 + R) + (
b1 (-R + roe2))/(1 + R)^2 + (b2 (-R + roe3))/(1 + R)^3 + (
b3 (-R + roe4))/(1 + R)^4 + (
b4 (-R + roe5))/(1 +
R)^5 + ((1 + gCT) b4 (-R + roe5))/((1 + R)^5 (-gCT + R)) - m, {R,
0}]
f /@ params
Any ideas on why I get this result?
param
. You should have only two levels $\endgroup$