solution for symbolic equation: matlab can't find a solution for my equation
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Paul
2021-11-27
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)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Function Creation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!