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
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
Sherwin 2022 年 4 月 8 日
Yes but I want a parametrical equation for x, without assigning any numerical values to the parameters.
Torsten
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
Sherwin 2022 年 4 月 8 日
So sorry there is a typo in my formula I meant s = diff(Z,u)= sqrt((r^2+e3*G*H*x^4e2-f^3*b)/(c^7+r*x*w*p));
Torsten
Torsten 2022 年 4 月 8 日
And you really mean x^4e2, thus x^400 ?
Sherwin
Sherwin 2022 年 4 月 8 日
This is just a sample function. I wanted to know the MATLAB function for that. My real function is far more complicated.
Walter Roberson
Walter Roberson 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))
s = 
sol = solve(s, x, 'returnconditions', true)
sol = struct with fields:
x: z1 parameters: z1 conditions: c^7*diff(Z(u), u)^2 + p*r*w*z1*diff(Z(u), u)^2 + b*f^3 == r^2 + G*H*e3*z1^400 & c^7 + p*r*w*z1 ~= 0 & signIm(diff(Z(u), u)*1i) == 1
sol.x
ans = 
sol.conditions
ans = 
ch1 = children(sol.conditions, 1);
isolate(ch1, sol.parameters)
ans = 
You cannot get any further because there is no closed form solution to polynomals with degree 400.
Sherwin
Sherwin 2022 年 4 月 8 日
Dear Walter, thank you so much as always for your detailed solution. Would you please give me some explanation as what should be done in this case? As I mentioned before, my main function is far more complicated than this and I have several of them. Would you please give me a general procedure?
Walter Roberson
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
Sherwin 2022 年 4 月 8 日
Thank you so much.

サインインしてコメントする。

カテゴリ

質問済み:

2022 年 4 月 8 日

コメント済み:

2022 年 4 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by