Matlab code used for vehicle dynamics

In summary, the code is missing a function called engine_gillespie() which is assumed to exist but is not defined. This could potentially cause errors in the code.
  • #1
mmmann1
1
0
Please help me recognize what is wrong with this professor supplied code...

clear all
options=odeset('events', @events_passing)
[t,z]=ode45(@passing,[0,10],[0,50*88/60],options)
plot(t,z)

function [value,isterminal,direction]=events_passing(t,z)
value=z(2)-88;
isterminal=1;
direction=0;
end


%Gillespie Data Page32
function torque=engine_gillespie(omega)
torque_coeff =[-1.5752e-006 7.9768e-004 1.8454e-001 9.9834e+001];
torque=polyval(torque_coeff,omega);

function f=passing(t,z)
f=zeros(2,1);
x=z(1);
v=z(2);
g=32.2;
M=2500/g;
I_e=0.8/12;
I_t=0.5/12;
I_d=1.2/12;
I_w=11/12;
N_t=1.36;
N_f=2.92;
N_tf=N_t*N_f;
Re=12.59/12;
rho=0.00236;
c_d=0.32;
A=20;
f0=0.015;


M_r=(I_e+I_t)*N_tf^2/Re^2+I_d*N_f^2/Re^2+4*I_w/Re^2;
M_equivalent=M+M_r;

dvdt=(engine_gillespie(v*N_tf/Re)*N_tf/Re-f0*M*g-0.5*rho*A*c_d*v^2-M*g*sin(atan(.02)))/M_equivalent;
f(1)=v;
f(2)=dvdt;
 
Physics news on Phys.org
  • #2
endThere is no engine_gillespie() function defined in the code. The code assumes that it exists and it is not defined.
 

What is Matlab code used for vehicle dynamics?

Matlab code used for vehicle dynamics is a programming language and software environment commonly used by scientists and engineers to analyze and simulate vehicle motion and behavior. It is widely used in the automotive industry for vehicle performance analysis and design optimization.

How does Matlab code help in studying vehicle dynamics?

Matlab code provides a powerful platform for studying vehicle dynamics by allowing users to model and simulate various driving scenarios and analyze the behavior of the vehicle. It also offers tools for visualizing and interpreting the results of these simulations.

What are the key components of Matlab code for vehicle dynamics?

The key components of Matlab code for vehicle dynamics include mathematical modeling and simulation tools, data analysis and visualization tools, and optimization algorithms. It also offers various toolboxes specifically designed for vehicle dynamics, such as the Vehicle Dynamics Toolbox and the Automotive Simulation Models Toolbox.

Can Matlab code be used for real-time vehicle dynamics simulations?

Yes, Matlab code can be used for real-time simulations of vehicle dynamics. This is achieved by using the Real-Time Workshop and Simulink Coder tools, which allow for the generation of C or C++ code from Matlab models that can be implemented on hardware for real-time testing and validation.

Are there any resources available for learning Matlab code for vehicle dynamics?

Yes, there are numerous resources available for learning Matlab code for vehicle dynamics, including online tutorials, textbooks, and training courses. Additionally, Matlab has a comprehensive documentation and support system that can assist users in learning and using the software for vehicle dynamics analysis.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
823
Back
Top