필터 지우기
필터 지우기

Rotating Frame in MATLAB

조회 수: 1 (최근 30일)
Meena Farag
Meena Farag 2016년 4월 10일
편집: Meena Farag 2016년 4월 10일
I am trying to simulate the rotating frame using ode45. I am trying to solve the equation
(Inertial frame) d^2R/dt^2 = (rot frame) d^2R/dt^2 + 2WxdR/dt + Wx(WxR)
Where R = [x y z] W = 1 (angular velocity) initial conditions x = 1, y = 0, z = 0 (position)
using ode45 the simulation spirals outward without bound, when it should just simulate a circle (the rotating frame). I guess I need a boundary condition? Here is my function and script
function xdot = Xdot(t, R)
global om
xdot = zeros(6,1);
xdot(1:3,1) = R(4:6,1); %vel
xdot(4:6,1) = -2*cross(om,R(4:6,1))-cross(om,cross(om,R(1:3,1)));
running the script
rpos = [1 0 0]; % position
om = [0, 0, 1]; %(rad/s) angular velocity
rvel = cross(om,rpos);
%numerical integration
[tout,yout] = ode45('Xdot',[0 20],[rpos rvel]);
plot(yout(:,1),yout(:,2), '.')
Please help, I know this is a simple problem.. I'm not sure why I'm having trouble with it.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Assembly에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by