Issues Using Dirac Function Trying to add Impulse Force at specific time
Show older comments
I am working on a project to simulate a car moving across a bridge as a coupled Vehicle-Bridge system and I am trying to add a collision with a rock at the midpoint of the bridge. The collision is modeled as an impulse load and I have been trying to use dirac delta to apply the impulse load at the desired time when the front of the car, where the impact occurs, reaches the middle of the bridge. The vehicle speed is constant, so this time is known.
I am modeling the impact load as fimp = Io*dirac(t-timp); and plugging it into my external force vectors where required from my derivation, but when I run the code, there is no change in the output that was modeled previously, so the impulse force is not being included. I know dirac delta only gives and answer when the input is zero, so for my scenario when t = timp, so I imagine that may be the issue where the times output by ode45 do not perfectly line up with my impact time, so there is never a value when the input is zero. Is there a way to get this to work as I am intending, or am I using dirac incorrectly and need to take a different approach?
MATLAB Code:
%System Parameters
a = 4.5; M = 2.5e3; I = 3.2e2;
k = 5e5; c = 3.6e3; v0 = 18; g = 9.81;
rho = 8e2; EI = 7e8; L = 400;
%Impact Parameters
Io = 1.2e3;
timp = ((L/2)-2*a)/v0;
%Parameter Matrices
%Beam
Mm = rho*L*[1/630 1/2772; 1/2772 1/12012];
Km = EI/(L^3)*[4/5 6/35; 6/35 2/35];
%Rigid Body
Mr = [M 0; 0 I];
Dr = c*[1 -a; -a a^2]+c*[1 a; a a^2];
Kr = k*[1 -a; -a a^2]+k*[1 a; a a^2];
%Admissible function inputs
syms t
Phix1 = [((v0*t/L)^2)*(1-(v0*t/L))^2 ((v0*t/L)^3)*(1-(v0*t/L))^3];
Phix1T = [((v0*t/L)^2)*(1-(v0*t/L))^2; ((v0*t/L)^3)*(1-(v0*t/L))^3];
Phix2 = [(((v0*t+2*a)/L)^2)*(1-((v0*t+2*a)/L))^2 (((v0*t+2*a)/L)^3)*(1-((v0*t+2*a)/L))^3];
Phix2T = [(((v0*t+2*a)/L)^2)*(1-((v0*t+2*a)/L))^2; (((v0*t+2*a)/L)^3)*(1-((v0*t+2*a)/L))^3];
%Dirac delta functions
fimp = Io*dirac(t-timp);
%Combined
Dc = c*Phix1T*Phix1+c*Phix2T*Phix2;
Dbr = c*Phix1T*[1 -a]+c*Phix2T*[1 a];
Drb = transpose(Dbr);
Kc = k*Phix1T*Phix1+k*Phix2T*Phix2;
Kbr = k*Phix1T*[1 -a]+k*Phix2T*[1 a];
Krb = transpose(Kbr);
%Assembly Matrices
Ma = [Mm zeros(2,2); zeros(2,2) Mr];
Ca = [Dc -Dbr; -Drb Dr];
Ka = [Km+Kc -Kbr; -Krb Kr];
Fa = [0; 0; -M*g+fimp; a*fimp];
%State Representation Matrices
Minv = Ma^-1;
p = [0; 0; 0; 0; Minv*Fa];
Ident = [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1];
A = [zeros(4,4) Ident; -Minv*Ka -Minv*Ca];
Asimp = simplify(A);
Afunc = matlabFunction(Asimp);
Pfunc = matlabFunction(p);
%ODE Solver
tspan = [0 (L-2*a)/v0];
iniCon = [0; 0; .035; 0.015/a; 0; 0; 0.15; -0.45/a];
[t,z] = ode45(@(t,z) Afunc(t)*z + Pfunc(t), tspan, iniCon);
%Solve for y1 and y2
y1 = z(:,3)-a*z(:,4);
y2 = z(:,3)+a*z(:,4);
%Plots
subplot(2,1,1)
plot(t,y1)
grid on
title('Displacement of y_{1}(t)')
xlabel('Time (s)')
ylabel('Displacement (m)')
subplot(2,1,2)
plot(t,y2)
grid on
title('Displacement of y_{2}(t)')
xlabel('Time (s)')
ylabel('Displacement (m)')
Accepted Answer
More Answers (0)
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!