Response to an impulse(delta dirac)

4 visualizaciones (últimos 30 días)
Shubham
Shubham el 8 de Mzo. de 2021
Editada: Shubham el 9 de Mzo. de 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

Respuesta aceptada

Bjorn Gustavsson
Bjorn Gustavsson el 8 de Mzo. de 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

Más respuestas (0)

Categorías

Más información sobre Simscape Fluids en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by