フィルターのクリア

Manipulation of complex expressions

1 回表示 (過去 30 日間)
Michael
Michael 2021 年 10 月 27 日
コメント済み: Michael 2021 年 10 月 27 日
Hello,
I have a problem with the manipulation of a complex expression. My code looks loke this:
syms('R', 'positive')
syms('C', 'positive')
syms('omega', 'positive')
Z_s = R + 1 / j / omega / C
Z_s = 
syms('U_2')
syms('U_C')
U_2 = 1 / j / omega / C / Z_s * U_C
U_2 = 
U_2 = simplifyFraction(U_2)
U_2 = 
Z_p = 1 / (j * omega * C + 1 / Z_s)
Z_p = 
syms('U_1')
U_C = Z_p / (R + Z_p) * U_1
U_C = 
U_C = simplifyFraction(U_C)
U_C = 
Until here everything is fine. Now I substitute U_C in U_2 with the above result.
U_2 = subs(U_C, U_C)
U_2 = 
U_2 = simplifyFraction(U_2)
U_2 = 
That is avery complicated expression. How can I simplify this fraction? There are common divisors in this fraction and it is possible to reduce it into
.
How can I achieve this with the Symbolic Toolbox?
Kind regards
Michael

採用された回答

Paul
Paul 2021 年 10 月 27 日
The final substitution into U_2 needs to be changed as shown below.
syms('R', 'positive')
syms('C', 'positive')
syms('omega', 'positive')
Z_s = R + 1 / 1j / omega / C; % chnage j to 1j throughout
syms('U_2')
syms('U_C')
U_2 = 1 / 1j / omega / C / Z_s * U_C;
U_2 = simplifyFraction(U_2);
Z_p = 1 / (1j * omega * C + 1 / Z_s);
syms('U_1')
U_C = Z_p / (R + Z_p) * U_1;
U_C = simplifyFraction(U_C);
U_2 = subs(U_2); % this line changed, update U_2 with current value of U_C
U_2 = simplifyFraction(U_2)
U_2 = 
  1 件のコメント
Michael
Michael 2021 年 10 月 27 日
Great, that's it.
Thank you!
Michael

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by