# Knowing the closed form solution of dx/dt = 2 sin 3t − 4x, how do I construct my Simulink?

조회 수: 2(최근 30일)
Angelica Belo 2021년 9월 4일
댓글: Angelica Belo 2021년 9월 5일
By inputting the following code in Matlab,
​​syms x(t)
eqn = diff(x) == 2*sin(3*t) - 4*x;
S = dsolve(eqn,x(0) == 0)
The output would be,
S = (6*exp(-4*t))/25 - (2*cos(3*t + atan(4/3)))/5
I know that my Simulink should be constructed as: However I'm struggling to find how to construct the (2*cos(3*t + atan(4/3)))/5 using the two Sine waves.
I was thinking that both of their properties would be: But I'm currently not sure if this is correct.
Any help would be greatly appreciated thank you!
##### 댓글 수: 2표시숨기기 이전 댓글 수: 1
Angelica Belo 2021년 9월 4일
We were given the blocks to start with and unfortunately we need to integrate the two sine blocks for this question.

댓글을 달려면 로그인하십시오.

### 채택된 답변

Paul 2021년 9월 4일
So you need to express
-cos(3*t + atan(4/3))
as the sum of two sine waves. If you're allowed to make the amplitude of one of the sine waves zero, then we know that a -cos can be expressed in terms of single sin. Here's an example that you should be able to adapt to your problem
syms a
simplify(sin(a + 3*pi/2))
ans = Once you relate "a" to your problem, you'll be able to implement sin(a + 3*pi/2) in one Sine block, and the other Sine block won't matter as long as its Amplitude parameter is zero.
##### 댓글 수: 1표시숨기기 없음
Angelica Belo 2021년 9월 5일
Thank you so much for all your help!
I got it now :)

댓글을 달려면 로그인하십시오.

R2021a

### Community Treasure Hunt

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

Start Hunting!