Simplify the exponential equation

5 ビュー (過去 30 日間)
Raj Arora
Raj Arora 2023 年 5 月 4 日
編集済み: Raj Arora 2023 年 5 月 4 日
I have an equation, which is in exponential format (y = A.exp(B.x)) where A and B are polynomial of order 3 which is a function of z, I have given the equation below. Is it possible to simplify this equation, by simplify means can we shorten this equation or can we put this equation in much more presentable way.
Simplify command is anyway not working with this.
y = exp(x*(0.1852*z^3 - 0.7827*z^2 + 0.8524*z + 0.8605))*(- 0.1061*z^3 + 0.23*z^2 + 0.5244*z + 0.0225)
  1 件のコメント
Rik
Rik 2023 年 5 月 4 日
How would you manually simplify this? I don't personally think changing the shape of the function makes it much simpler.

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

回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 5 月 4 日
No. That is the most compact version that you can reasonably expect.
You can break it into pieces, but then what?
y = str2sym('exp(x*(0.1852*z^3 - 0.7827*z^2 + 0.8524*z + 0.8605))*(- 0.1061*z^3 + 0.23*z^2 + 0.5244*z + 0.0225)')
y = 
ch = children(y)
ch = 1×2 cell array
{[exp(x*(0.1852*z^3 - 0.7827*z^2 + 0.8524*z + 0.8605))]} {[- 0.1061*z^3 + 0.23*z^2 + 0.5244*z + 0.0225]}
syms A B
Aval = ch{2};
Bval = children(children(ch{1},1),2);
nice_y = [sym('y') == subs(y, {Aval, Bval}, {A, B});
A == Aval;
B == Bval];
nice_y
nice_y = 
But you probably could have done that by not creating y in that form in the first place, and using your existing A and B.
  3 件のコメント
Walter Roberson
Walter Roberson 2023 年 5 月 4 日
The values you get out of my code are polynomial functions.
If the task is to extract the polynomials from an expression of that particular form, then the task is do-able using code similar to the above. In practice I would probably make it more robust, perhaps using functions such as findSymType or related to be sure that I had picked the appropriate parts, instead of relying on positions. (The exact decomposition can get a bit weird depending on the sign of the z^1 coefficient in A)
Raj Arora
Raj Arora 2023 年 5 月 4 日
編集済み: Raj Arora 2023 年 5 月 4 日
Thanks Walter, for your valuable comments, anyway I will accept your response. I raised one querry on matlab 2-3 days back. But I didnot find any appropriate answer to it. So I did it the best possible way I can. This problem is actually related to that, if you can see that querry (previous one) and if you can give some insight about it that will be helpful.

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

カテゴリ

Help Center および File ExchangePolynomials についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by