Rotational motion modelling in Matlab

3 views (last 30 days)
Bhabani Nayak
Bhabani Nayak on 16 Nov 2015
Answered: Subhra Saha on 18 Nov 2015
I want to model the following two equations in matlab, but i don't know what is the correct procedure to do it. Any form of suggestion would be helpful.
I want to model this for the following speed profile.
%Ref - NicolaSysnet
v = [20*ones(1,50*1e4) 20*2.^(-(1:(50*1e4))/(50*1e4)) 10+20/(50*1e4)*(1:(50*1e4)) 30*ones(1,50*1e4)];
plot(v)
disp('Velocity 72kph exponentially decreasing to 36kph then linearly increasing to 144kph')
pause
x = cumsum(v)/1e4;
theta = x / R;
How should i proceed to model these two equations??

Answers (1)

Subhra Saha
Subhra Saha on 18 Nov 2015
You can convert the equations into a system of first order equations and then use the ODE45 solver to solve the equations. If this solver does not solve the equations, you can use the other solvers like ode23, ode113.
Please refer to the link below for more information: http://www.mathworks.com/help/matlab/ref/ode45.html
Also you can use dsolve to model these equations, but you would need the Symbolic Math Toolbox for this purpose and it can be slower too as compared to ode45 solvers. For more information on dsolve, refer to the link below:

Community Treasure Hunt

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

Start Hunting!