solution for symbolic equation: matlab can't find a solution for my equation
3 views (last 30 days)
Show older comments
i have this equation
J(x) =(4*C*Mo*mom*mom1*mus*sin(o)*(C^2 + 3*x^2))/(l*pi*(C^2 - x^2)^3) - (12*C*Mo*mom*mom1*x*cos(o)*(C^2 - x^2)^3*(C^2 + x^2))/(pi*(C + x)^7*(C - x)^7)==0
x is the only variable and the other parameters are positive real numbers
i try to find a solution for x based on the others parameter (there are many solutions, i found it on paper), but using the command solve i get this
root(3*mus*z^4*sin(o) + 3*l*z^3*cos(o) - 2*C^2*mus*z^2*sin(o) + 3*C^2*l*z*cos(o) - C^4*mus*sin(o), z)
this is the same solution i found on paper and thats how i know there are at least 2 real solutions but the program doesn't go on and don't give me the actual family of solution
0 Comments
Answers (1)
Paul
on 27 Nov 2021
Use the ReturnConditions option to see all of the solutions
syms x C Mo mom mom1 mus o l
J(x) =(4*C*Mo*mom*mom1*mus*sin(o)*(C^2 + 3*x^2))/(l*sym(pi)*(C^2 - x^2)^3) - (12*C*Mo*mom*mom1*x*cos(o)*(C^2 - x^2)^3*(C^2 + x^2))/(sym(pi)*(C + x)^7*(C - x)^7)==0;
sol = solve(J(x),x,'ReturnConditions',true)
sol.x
However, specifying all the parameters as real and positive yields a much different result
syms x C Mo mom mom1 mus o l positive
J(x) =(4*C*Mo*mom*mom1*mus*sin(o)*(C^2 + 3*x^2))/(l*sym(pi)*(C^2 - x^2)^3) - (12*C*Mo*mom*mom1*x*cos(o)*(C^2 - x^2)^3*(C^2 + x^2))/(sym(pi)*(C + x)^7*(C - x)^7)==0;
sol = solve(J(x),x,'ReturnConditions',true)
Ignoring analytic constraints leads to something a bit simpler
syms x C Mo mom mom1 mus o l positive
J(x) =(4*C*Mo*mom*mom1*mus*sin(o)*(C^2 + 3*x^2))/(l*sym(pi)*(C^2 - x^2)^3) - (12*C*Mo*mom*mom1*x*cos(o)*(C^2 - x^2)^3*(C^2 + x^2))/(sym(pi)*(C + x)^7*(C - x)^7)==0;
sol = solve(J(x),x,'ReturnConditions',true,'IgnoreAnalyticConstraints',true)
2 Comments
See Also
Categories
Find more on Function Creation 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!