I've been looking around but I can't seem to figure out how I should use fsolve to solve my system of nonlinear equations.
so I have a function k
, and I know that I want .01
as the starting value (required input for fsolve I believe). I also know that k(1000) =12
Lastly, I have a formula for k
,
k(N) = (1/(k(N).^.5 + .9*k(N) -k(N+1))) - ((.94 * .5 *k(N+1)^(1-.5) + .9)/(k(N+1)^.5 +
.9*k(N+1) - k(N+2)))
with N 1:1000
. I figured I could just say fsolve(k(N), .01), but with the formula in place of k(N)
(or is defining k(N)
in a separate function necessary?), but I exceed the dimensions of N
and also have issues with dimensions matching since there is N, N+1, and N+2
in the equation.
I think my issue may be stemming from the fact that I have defined vector valued functions where in reality I want them to be single valued, from 1:1000
,but I don't know how to represent this in matlab (obviously I can't type in 1000 equations).
Any ideas, suggestions, or comments?