Solving 3 unknowns from 50 Nonlinear equation

2 views (last 30 days)
I have a set of three unknowns which I need to resolve from 50 different non linear equation. Which method should I use in matlab? I found out that fsolve can do that, but then I faced another issue. A part of the equation is constant number and a part of the equation is a 1x50 matrix. How should I feed it to the equation.
The equation is, eqn = Tn - (Tind/2)*(1+ erf(Z*sqrt(3.14)*(N-Nc))); Here, N is matrix and I have to solve for Tn, Nc and Z. I have a constant values for Tind.
Thanks

Accepted Answer

Matt J
Matt J on 4 Nov 2018
Edited: Matt J on 4 Nov 2018
Just combine all the unknown variables into a single vector p,
fun = @(p) p(1) - (Tind/2)*(1+ erf(p(2)*sqrt(3.14)*(N-p(3:end) ))) ;
p0=[Tn0,Z0,Nc0]; %initial guess
p=fsolve(fun,p0)

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!