How to customize a complex differentiated equation?
이전 댓글 표시
I have an equation as s = diff(Z,u)= sqrt((r^2+e3*G*H*x^4e2-f^3*b)/(c^7+r*x*w*p));
I want to put this equation (diffrentiated term) equal to 0 and get x (x on one side and everything else on the other side). x is the only variable in this equation and the rest are parameters. How can I do that in MATLAB?
답변 (1개)
Torsten
2022년 4월 8일
0 개 추천
The term is 0 if r^2+e3*G*H**x^4e2-f^3*b = 0. Can you solve for x ?
댓글 수: 9
Sherwin
2022년 4월 8일
Torsten
2022년 4월 8일
You don't need to assign values to parameters.
If you tell us what H**x^4e2 means, we can give you the solution.
Sherwin
2022년 4월 8일
Torsten
2022년 4월 8일
And you really mean x^4e2, thus x^400 ?
Sherwin
2022년 4월 8일
syms b c e3 f G H p r w x Z(u)
assume(G ~= 0)
assume(H ~= 0)
assume(e3 ~= 0)
s = diff(Z(u),u) == sqrt((r^2+e3*G*H*x^4e2-f^3*b)/(c^7+r*x*w*p))
sol = solve(s, x, 'returnconditions', true)
sol.x
sol.conditions
ch1 = children(sol.conditions, 1);
isolate(ch1, sol.parameters)
You cannot get any further because there is no closed form solution to polynomals with degree 400.
Sherwin
2022년 4월 8일
Walter Roberson
2022년 4월 8일
diff(Z, u) is independent of x, so you can replace that term by a variable.
Now multiply both sides by the denominator, getting a polynomial in x on one side and square root of a polynomial on the other. square both sides to get a polynomial in x and both sides. Subtract one side from the other, getting a polynomial on one side and 0 on the other side. You can now use sym2poly to extract the coefficients as a vector.
Now substitute specific numeric values into the vector. double() to make the vector pure numeric. roots() to generate the potential solutions.
Now substitute the roots and the values for the coefficients back into the original (after the replacement of the derivative with a symbol) in order to validate them. Taking the square along the way potentially introduced false roots.
Sherwin
2022년 4월 8일
카테고리
도움말 센터 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

