How can i solve this equation with matlab ?

1 view (last 30 days)
Duygu Demirpençe
Duygu Demirpençe on 22 Oct 2017
Edited: per isakson on 22 Oct 2017
x=-(2*10^4)*k
y=(2*10^4)*k
z=-3+1*(sqrt(y+0.6)-sqrt(0.6))
k=(10^(-4))*(x-z)^2
How can i find, x,y,z and k with matlab?

Answers (1)

Star Strider
Star Strider on 22 Oct 2017
If you have the Symbolic Math Toolbox (with a slightly revised version of your equations) this works:
syms x y z k
Eq1 = x == -2E4*k;
Eq2 = y == 2E4*k;
Eq3 = z == -3+(sqrt(y+0.6)-sqrt(0.6));
Eq4 = k == 1E-4*(x-z)^2;
[x,y,z,k] = solve(Eq1, Eq2, Eq3, Eq4, [x y z k])
To get one set of numerical solutions, use vpasolve, and explore the solution space.
See the documentation on solve and vpasolve for details.
  4 Comments
Duygu Demirpençe
Duygu Demirpençe on 22 Oct 2017
Ok. i found. Thank you. By the way how can i find iterative approach ?
Star Strider
Star Strider on 22 Oct 2017
I am not certain what ‘iterative approach’ you are referring to.
Consider using the Optimization Toolbox fsolve function, and a large number of initial parameter estimates to solve for all the roots.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!