hi guys . i am trying to solve Ode but solution stuck at some point . i tried ode45 & ode15s but problem is still present
3 views (last 30 days)
Show older comments
function dx=pendulum_eom(t,x)
% pendulum parameters
M=1.5;
m=.5;
l=.4;
k1=0; % linear velocity friction coefficient
k2=.02; % rotional velocity friction coefficint
g=9.81;
F=0; % force applied to the cart
%-----%
dx=zeros(4,1); % system states
% equation of motion
dx(1,1)=x(2);
dx(2,1)=1/(M+m-m*cos(x(3))^2)*(m*l*x(4)^2*sin(x(3))-m*g*sin(2*x(3))/2-k2*x(4)*cos(x(3))-k1*x(2)+F);
dx(3,1)=x(4);
dx(4,1)=1/(m*l*(M+m-m*cos(x(3))^2))*(-0.5*l*m^2*x(4)^2^sin(2*x(3))-m*cos(x(3))*(F-k1*x(2))+(M+m)*m*g*sin(x(3))-(M+m)*k2*x(4));
end

%
1 Comment
Walter Roberson
on 6 Mar 2017
Are you encountering an error message? If not then what should we be looking at to be able to tell that there is a problem or not?
Answers (0)
See Also
Categories
Find more on Ordinary Differential Equations 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!