How can i solve this equation with matlab ?
1 view (last 30 days)
Show older comments
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?
0 Comments
Answers (1)
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
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.
See Also
Categories
Find more on Calculus 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!