Laplace transform of sawtooth function for 2nd order ode
Mostra commenti meno recenti
Hi all,
I have taken the rhs laplace for a sawtooth equation where:
f(t)=2t for 0<t<1
and f(t+1)=f(t)
T=2
>> syms s t lapf
lapf =simplify(int('exp(-s*t)*2*t','t=0 .. 2')/(1-exp(-s)))
pretty(lapf)
lapf =
-(2/s^2 - (2*(2*s + 1))/(s^2*exp(2*s)))/(1/exp(s) - 1)
Now I need to solve the differential equation: y'' + y = f(t)
Here, f(t) is the sawtooth function above.
I am having some difficulty marrying the two. Any suggestions would be appreciated.
Thank you!
5 Commenti
Aquatris
il 25 Nov 2018
You take the laplace transform of both sides of the equation (assuming 0 initial conditions);
s^2*Y(s)+Y(s) = F(s)
Y(s) = F(s)/(s^2+1)
Then do the algebra and apply inverse laplace to find the solution in time domain. If there are nonzero initial conditions, use them in the laplace transform.
spcrooks
il 25 Nov 2018
Aquatris
il 26 Nov 2018
I don't understand your question. Do you want to numerically solve it? In that case you can define the equation as a state space equation if you are familiar with it;
% Time domain equation; y''+y = f
% Select system states; x = [y y']'
% State Space equation; x' = Ax + Bu;
% y = Cx
A = [0 1;-1 0];
B = [0 1]';
C = eye(2);
sys = ss(A,B,C,0);
t = 0:0.001:10; % time vector;
u = sawtooth(t);% input sawtooth vector
y = lsim(sys,u,t);
spcrooks
il 26 Nov 2018
Aquatris
il 26 Nov 2018
If thats what you want to do, and you are sure about the laplace transform of your sawtooth function, then the answer is easy;
Y = -(2/s^2 - (2*(2*s + 1))/(s^2*exp(2*s)))/(1/exp(s) - 1)/(s^2+1)
You already determined F in your question (the variable lapf), so why are you confused?
Risposte (0)
Categorie
Scopri di più su Mathematics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!