I have complex equation of the form x=(y/c1)+K*(y/c1)^n ??

1 次查看(过去 30 天)
I have complex equation of the form x=(y/c1)+K*(y/c1)^n ?? where c1, K, n are constants. The typical values are 90e9, 5e12 and 6.1245. i need to obtain y for a x and i need to obtain it for a range of values.
  1 个评论
James Tursa
James Tursa 2016-4-8
"... i need to obtain y for a x ..."
Do you mean you are trying to solve the equation for y when you are given a value of x? And you want to do this for a range of x values?

请先登录,再进行评论。

回答(2 个)

Walter Roberson
Walter Roberson 2016-4-8
There is no analytic solution to that for n > 3. You will need to use numeric methods such as fzero()

John D'Errico
John D'Errico 2016-4-8
syms n y c1 K
E = x==(y/c1)+K*(y/c1)^n;
E0 = subs(E,{c1,K,n},{90e9, 5e12, 6.1245});
There will be multiple solutions. vpasolve finds them well enough, though fzero would also work.
vpasolve(E0(1))
ans =
685108721.21251019872317593852318
vpasolve(E0(2))
ans =
838327989.34904713260360139778459
vpasolve(E0(3))
ans =
- 727372205.91495288136399524186001 - 472855561.58678110600582657021201i
vpasolve(E0(4))
ans =
740586777.76325202886393577885394
...

Community Treasure Hunt

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

Start Hunting!

Translated by