I am facing problems in solving this question... I put my code .. please help

조회 수: 1 (최근 30일)
Rama a
Rama a 2021년 6월 7일
답변: Sulaymon Eshkabilov 2021년 6월 8일
I am facing problems in solving this question .. I will put my code and please help me to correct my working
Consider the following Differential Equation
diff(y,t,2) + A*diff(y,t) + B == C + 5*cos(1500*t)
A-Solve it (write code) for t≥0 using zero initial conditions.
B- Determine the response of the LTI systems for the given input and initial conditions: y (0)= 0, dy/dt(0) =A
A=3 B=4 C=4
syms t y(t) %symbolic variable
A = 3; B = 4; C = 4;
ode = diff(y,t,2) + A*diff(y,t) + B == C + 5*cos(1500*t); %given eqn
con1 = y(0) == 0; %y(0)
Dy(t) = diff(y,t); %y'(t)
con2 = Dy(0) == 3; %y'(0)
solution = dsolve(ode,[con1 con2]) %output y(t)
digits(3); %precision
simpleSolution = simplify(vpa(solution)) %simplified representation
fplot(solution, [0 20])
hold on
fplot(Dy(t), [0 20])
hold off
xlabel("t ->");ylabel("y(t) ->");title("Output");
  댓글 수: 1
Walter Roberson
Walter Roberson 2021년 6월 8일
You seem to have already solved the first part?
It is not clear to me which LTI system is being referred to for the second part?

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

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 8일
What are the LTI system and the input signal ?
LTI system simulation can be done easily with: tf() and lsim(). Example:
A = 1; B = 2; C = 3;
TF = tf(1, [A B C]); % LTI system: A*DDy + B*Dy + C*y = u(t)
t = linspace(0, 1, 2000);
u = cos(t);
[R, time] = lsim(TF, u, t);
plot(time, R)

카테고리

Help CenterFile Exchange에서 Time and Frequency Domain Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by