Symbolic variables: Isolate a variable in an equation?

10 ビュー (過去 30 日間)
Artur M. G. Lourenço
Artur M. G. Lourenço 2011 年 9 月 23 日
コメント済み: Walter Roberson 2018 年 1 月 8 日
I always have trouble isolating symbolic variables in equations. See this for example:
8*x1 + 2*x2 + 3*x3 - 51 = 0
want to isolate x1, manually know is this:
x1 = (51 - 2*x2 - 3*x3)/8
how can I do this in matlab? Thanks in advance.

採用された回答

Walter Roberson
Walter Roberson 2011 年 9 月 23 日
solve(8*x1 + 2*x2 + 3*x3 - 51, x1)
  1 件のコメント
Artur M. G. Lourenço
Artur M. G. Lourenço 2011 年 9 月 23 日
Thanks again. I was trying this, but I do not know because once was not working. Now it worked. It must have been symbiosis through the monitor.
thanks again.

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

その他の回答 (1 件)

Arash Moharjeri
Arash Moharjeri 2017 年 11 月 10 日
編集済み: Walter Roberson 2017 年 11 月 10 日
Hi all,
I am trying to rearrange the below equation to solve for R0.
This is how I have written the equation in MATLAB.
syms R0 H hs K_h rw P
EQN= (H - power((power(hs,2))+((P/K_h)*((power(R0,2)*log(R0/rw))-(power(R0,2)-power(rw,2))*0.5)),0.5) == 0);
EQN2=isolate (EQN, R0)
When I run isolate, it doesn't give me an error but it doesn't give me a correct answer either. It gives me the original equation.
Can anyone assist me with this issue? Is it because the equation is too complicated to rearrange ?
Thanks
  7 件のコメント
andrea giovannini
andrea giovannini 2018 年 1 月 8 日
Hi, I can't say the ranges for the values, because I'm working to built a completely general Bayesian Network to estimate the scour depth. I'll try with the numerical method and see what happens. Thank a lot for your time and disponibility.
Walter Roberson
Walter Roberson 2018 年 1 月 8 日
Estimating the scour depth given the depth of the river and the other aspects would be fairly different mathematically than attempting to find the depth of the river with that formula.
Dc = ((3*d*u+8*v)*exp(-RootOf(-2*n*Z*(72*exp(Z)*u*y-3*d*u-8*v)-9*y^(5/3)*sqrt(s)*sqrt(2)*(ln(2)+ln(5))*exp(Z),Z))-36*y*u)/(36*u)
where RootOf(-2*n*Z*(72*exp(Z)*u*y-3*d*u-8*v)-9*y^(5/3)*sqrt(s)*sqrt(2)*(ln(2)+ln(5))*exp(Z),Z) means the set of Z such that -2*n*Z*(72*exp(Z)*u*y-3*d*u-8*v)-9*y^(5/3)*sqrt(s)*sqrt(2)*(ln(2)+ln(5))*exp(Z) is 0 -- the roots of that expression.
That expression does not have a closed form solution, but it would be pretty tractable to solve numerically I think, whereas I think solving for y would be more difficult numerically.

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

Community Treasure Hunt

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

Start Hunting!

Translated by