How to extract real and imag part from symbolic expression

11 ビュー (過去 30 日間)
Ivan
Ivan 2019 年 10 月 27 日
コメント済み: Walter Roberson 2019 年 10 月 28 日
Hi,
I have the following symbolic expression:
a=((6*pi*a0)/(6*pi-j*(kn^3*a0)));
ap=a/(1-a/(16*pi*R^3)*((eps_s-eps_w)/(eps_s+eps_w)));
all parametrs are difined as a real.
when I type real(ap) or imag(ap) it can not extract these parts. What could be the solution of this problem?
Thx
  3 件のコメント
Ivan
Ivan 2019 年 10 月 27 日
No, j is here written as an imaginary unit, sqrt(-1).
Walter Roberson
Walter Roberson 2019 年 10 月 28 日
You are right, MATLAB has difficulty finding those components.

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

回答 (1 件)

Walter Roberson
Walter Roberson 2019 年 10 月 28 日
simplify( expand( real(ap) ) )
simplify( expand( imag(ap) ) )
  2 件のコメント
Ivan
Ivan 2019 年 10 月 28 日
I have tried out already. It still does not work properly.
In general, I was surprised that Matlab is weak to calculate such simple expressions.
Do you have maybe other ideas about how to overcome this problem?
Walter Roberson
Walter Roberson 2019 年 10 月 28 日
What do you mean by "it still does not work properly" ?
I did not check every term, but the results look to be the same as what I obtained using Maple .
There does not appear to be any simple form for the expressions.

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

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by