how to get numerical solution to system of non-linear equations?
Show older comments
Any one knows how to get numerical solution to system of non-linear equations?
If vg is varying from 0 to 2 in steps of 0.01, i.e vg=linspace(0,2,N), N=100 n is varying from 1 to N
eq1(n) = (xo2(n) xo(n) xar(n) - 1-Vg(n))=0;
eq2(n) =(2*xo2(n) xo(n) -4*xar(n)-4*Vg(n))=0;
eq3(n) = (2.063E-4*xo2(n) - xo(n)^2)=0;
how to solve roots (xo, xo2, xar) for the above three equations at each value of Vg(0 to 2 in steps of 0.01)?
1 Comment
Walter Roberson
on 29 Dec 2015
Is xo2(n) xo(n) xar(n) expressing implicit multiplication between the terms?
Is xo(n) expressing multiplication or is it expressing array indexing?
Answers (2)
Alan Weiss
on 28 Dec 2015
1 vote
If you have Optimization Toolbox, look into Systems of Nonlinear Equations. You will have to formulate your problem as one of a single vector variable x.
Alan Weiss
MATLAB mathematical toolbox documentation
Walter Roberson
on 29 Dec 2015
If you have the Symbolic Toolbox then assuming that multiplication is being used and that (n) represents indexing, then you can solve() to get exact solutions. A cubic equation is involved, multiplied by a quadratic, so there are (3*2) = 6 solutions. For example one of the solution sets is
xo(n) = (Vg(n) + (Vg(n)^2 + 2*Vg(n)+2)^(1/2)) / ((9452254/975) * Vg(n) * (Vg(n)^2 + 2*Vg(n) + 2)^(1/2) + (9452254/975) * Vg(n)^2 + (9452254/975) *Vg(n) + 9452254/975)^(1/3)
xo2(n) = ((9452254/975) * Vg(n) * (Vg(n)^2 + 2 * Vg(n) + 2)^(1/2) + (9452254/975) * Vg(n)^2 + (9452254/975) * Vg(n) + 9452254/975)^(1/3)
xar(n) = -(1/2) * Vg(n) + (1/2) * (Vg(n)^2 + 2 * Vg(n) + 2)^(1/2)
Categories
Find more on Mathematics and Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!