フィルターのクリア

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 Center および File ExchangeAssembly についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by