car_crash_sim.m - r Crash Simulation clear all clc global...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
%Car Crash Simulation clear all; clc; global m_b l_b m_h l_h m_l l_l g F_c k x_ab t %General constants g = 9.8; %Force due to crash F_c=1800; %Stiffness of seat belt k=10000; %Airbag characterstics x_ab = 3 * 0.3048; %Constants for the body %head m_h = 5; l_h =0.8 * 0.3048; %body m_b = 40; l_b = 2.5*0.3048; %leg m_l = 35; l_l = 0.3048*1.2; %ode45 %time Tspan=[0 1]; %head x_0=[0 0 0 0 0 0]; % the_0=[0 0 0 0 0 ]; % x_b0=[0 0]; % the_b0=[0 0]; %Event Function options = odeset('Events',@event_function_airbag); % [t,x]=ode45(@master,Tspan,x_0); [t,x]=ode45(@master,Tspan,x_0,options); figure(1) plot(t,x(:,3),'-k'); grid on; set(gca,'fontsize',18,'fontweight','bold');
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
xlabel('Time, s','FontSize',20,'FontWeight','Bold'); ylabel('Disp, m','FontSize',20,'FontWeight','Bold'); figure(2) plot(t,x(:,2),'-b'); grid on; set(gca,'fontsize',18,'fontweight','bold'); xlabel('Time, s','FontSize',20,'FontWeight','Bold'); ylabel('Theta, rad','FontSize',20,'FontWeight','Bold'); figure(3) plot(t,x(:,1),'-r');
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern