Symbolic rewriting of trigonometric functions with a exponential function.

8 ビュー (過去 30 日間)
DH
DH 2023 年 5 月 22 日
回答済み: Dyuman Joshi 2023 年 5 月 22 日
I use MATLAB2023a with symbolic math toolbox.
I want to rewrite a symbolic equation by summing several cosine and sine terms.
How can I make use of the following rule in MATLAB?
Specifically, I want to combine cos and sin in the following code.
clear; clc;
syms y(t);
eqn = y(t) == 0.00225*exp(-5.0*t)*(71.0*cos(8.11*t) + 43.8*sin(8.11*t))
eqn = 
rewrite(eqn, 'sincos') %% failed :(
ans = 
simplify(eqn) %% failed :(
ans = 
combine(eqn) %% failed :(
ans = 
Thank you in advance.

採用された回答

Dyuman Joshi
Dyuman Joshi 2023 年 5 月 22 日
rewrite() does not produce the following conversion.
You can do the following -
syms t
%Define expressions separately
y1 = (71.0*cos(8.11*t) + 43.8*sin(8.11*t));
y2 = 0.00225*exp(-5.0*t);
%rewrite the sum of sin and cos using combine()
out = combine(y1,'sincos')
out = 
%multiply the expressions to get the final/desired output
fun = y2*out
fun = 

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFormula Manipulation and Simplification についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by