I tried to solve lapalce but not getting the value (Xs). Find the code below, Is there any issues in the code?
syms x(t) Xs
eqn = diff(x,t,2)+2*diff(x,t)+26*x(t) == 10*cos(t)*(heaviside(t-pi));
eqnLT = laplace(eqn)
eqnLT = 
eqnLT = subs(eqnLT,laplace(x(t)), Xs);
eqnLT = subs(eqnLT, {x(0), diff(x(t), t, 0)}, {1/2,1});
Xs = solve(eqnLT, Xs)
Xs = 

 채택된 답변

Star Strider
Star Strider 2022년 1월 16일

0 개 추천

I do not see any specific problems.
syms x(t) Xs s
eqn = diff(x,t,2)+2*diff(x,t)+26*x(t) == 10*cos(t)*(heaviside(t-pi));
eqnLT = laplace(eqn)
eqnLT = 
eqnLT = subs(eqnLT,laplace(x(t)), Xs);
eqnLT = subs(eqnLT, {x(0), diff(x(t), t, 0)}, {1/2,1})
eqnLT = 
Xs = isolate(eqnLT, Xs)
Xs = 
X(s) = rhs(Xs)
X(s) = 
Perhaps the isolate function will do what you want.
.

댓글 수: 4

Need to plot using below getting error:" Input must be a function handle or symbolic function." while using isolate
figure(1)
fplot(Xs, [-10 100])
The equation needs to be set up correctly, and here it is not.
There is a typographical error in:
eqnLT = subs(eqnLT, {x(0), diff(x(t), t, 0)}, {1/2,1})
since it should be:
eqnLT = subs(eqnLT, {x(0), subs(diff(x(t), t), t, 0)}, {1/2,1});
and with that change:
syms x(t) Xs s X(s)
eqn = diff(x,t,2)+2*diff(x,t)+26*x(t) == 10*cos(t)*(heaviside(t-pi));
eqnLT = laplace(eqn);
eqnLT = subs(eqnLT,laplace(x(t)), X(s));
eqnLT = subs(eqnLT, {x(0), subs(diff(x(t), t), t, 0)}, {1/2,1});
eqnLT = isolate(eqnLT, X(s))
eqnLT = 
It does not eimplify further. (I checked.)
.
BEENA BASHEER
BEENA BASHEER 2022년 1월 16일
Wow! It helps me a lot! Thanks!
Star Strider
Star Strider 2022년 1월 16일
As always, my pleasure!
.

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2022년 1월 16일

0 개 추천

syms x(t) Xs
eqn = diff(x,t,2)+2*diff(x,t)+26*x(t) == 10*cos(t)*(heaviside(t-pi));
eqnLT = laplace(eqn)
eqnLT = 
eqnLT = subs(eqnLT,laplace(x(t)), Xs);
dx = diff(x,t);
eqnLT = subs(eqnLT, {x(0), dx(0)}, {1/2,1});
Xs = solve(eqnLT, Xs)
Xs = 

댓글 수: 1

%write a matlab code to find the solution of following differential
%equation using Laplace transform method
%d^2y/dx^2-3dy/dx+2y=sinx, y(0)=2, y'(0)=2

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

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

질문:

2022년 1월 16일

댓글:

2024년 5월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by