- #1
people
- 6
- 0
hi, everybody
i got for homework a pendulum on a cart.
i solved the system and got two equations.
(m+M)x'' + M L theta'' = F
x'' + L theta'' + g* theta = 0
F = 1000 N, m = 500 kg, M = 1250 kg, l = 10m
i know how to put them in state space and solve them with SS block in
simulink.but i don't know how to solve the system with ode23. there are
no initial conditions stated in a task, i guess there are zero.
i understand this sintax
function xdot = vdpol(t,x)
xdot = [x(1).*(1-x(2).^2)-x(2); x(1)]
t0 = 0; tf = 20;
x0 = [0 0.25]'; % Initial conditions
[t,x] = ode23('vdpol',t0,tf,x0);
plot(t,x)
but don't know how to use it on those eq.
i got for homework a pendulum on a cart.
i solved the system and got two equations.
(m+M)x'' + M L theta'' = F
x'' + L theta'' + g* theta = 0
F = 1000 N, m = 500 kg, M = 1250 kg, l = 10m
i know how to put them in state space and solve them with SS block in
simulink.but i don't know how to solve the system with ode23. there are
no initial conditions stated in a task, i guess there are zero.
i understand this sintax
function xdot = vdpol(t,x)
xdot = [x(1).*(1-x(2).^2)-x(2); x(1)]
t0 = 0; tf = 20;
x0 = [0 0.25]'; % Initial conditions
[t,x] = ode23('vdpol',t0,tf,x0);
plot(t,x)
but don't know how to use it on those eq.