Response to an impulse(delta dirac)
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Shubham
am 8 Mär. 2021
Bearbeitet: Shubham
am 9 Mär. 2021
This is my question there is a spring mass damper system.....hit by a step input at t=0 of magnitude 20N for 2 sec.....I know the logic b I dont know how to execute this in ode45
F = Force = 20 for 0<t<2 sec
0 Kommentare
Akzeptierte Antwort
Bjorn Gustavsson
am 8 Mär. 2021
That's not what I understand a Dirac-pulse to be. This is a 2 second long constant-force push. Implement it as such - on for 2 seconds off after. You do this easiest by dividing the problem into 2 segments - the first 2 s with a constant force and your initial initial conditions, then the remaining 8 s with no force and the end-solution of the first period as initial conditions to the second part. (The ODE-integrating functions are typically sensitive to discrete jumps, that can be handled with the events function, but this piecing-together trick is a KISS-solution. In this case with a discrete jump for the highest derivative you might be fine):
[ta,xa] = ode45(f_with_force,[0 2],[0 0],op); %% initial condition are 0
[tb,xb] = ode45(f_without_force,[2 10],xa(end,:),op); %% initial condition are 0
plot([ta(:);tb(:)],[xa(:,1);xb(:,1)])
HTH
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Assembly finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!