View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
MATLAB simulation of fixed-mass rigid-body 6DOF

4.1 | 20 ratings Rate this file 37 Downloads (last 30 days) File Size: 2.08 KB File ID: #3367 Version:

MATLAB simulation of fixed-mass rigid-body 6DOF


Stacey Gage (view profile)


30 Apr 2003 (Updated )

Calculate aircraft fixed-mass rigid-body six-degrees-of-freedom equations of motion using MATLAB ODE

| Watch this File

File Information

% SIXDOF Calculate aircraft fixed-mass rigid-body six-degrees-of-freedom
% equations of motion using MATLAB ODE45 solver.
% =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
% Inputs:
% =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
% Forces = 3x1 vector of forces in body coordinates
% Moments = 3x1 vectory of moments in body coordinates
% Mass = fixed mass of the aircraft
% Inertia = 3x3 Inertia Tensor matrix
% tarray = time series vector
% Ipos_i = 3x1 vector of initial position
% Ivel_b = 3x1 vector of initial velocity (body)
% Irates_b = 3x1 vector of initial body rates
% Ieuler = 3x1 vector of initial euler angles
% =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
% Outputs:
% =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
% t = simulation time
% y(1:3) = body rates
% y(4:6) = velocity in body coordinates
% y(7:9) = position in body coordinates

Required Products MATLAB
MATLAB release MATLAB 6.5 (R13)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (20)
01 Jul 2016 Joao Santos

Note: the equation for the body-frame position is wrong.

dr/dt = v is only valid in a inertial frame, not on a rotating frame.

The right equation is

dr/dt = v - (omega)x(r), where x is the cross product between 2 vectors.

Then, the code is

y(4:6) - cross(y(1:3), y(7:9))

The rotation part works perfectly though, thanks

20 Dec 2014 Dimitrios

13 Nov 2014 Matthew

There is little reason for this *single* file to be highly rated. Errors as mentioned previously Mar 2008 have NOT been corrected.

The author apparently wants to play with the new custom toolbox toy. Nothing else here.

29 Nov 2012 Marine

Marine (view profile)

24 Jul 2009 Edmund Brekke

The Euler angles should have been included in the output.

05 Dec 2008 Giannis Dalezios

Hello everyone!
That's a very good program!
Can anybody help me to get as an output the euler angles value...?
What should I supplement?
I tried something but unfortunately i didn't get the presumed result.


03 May 2008 spika spika

09 Mar 2008 F Z

Great file, great help for people (like me) who are looking for software to simulate unconstrained motion of a rigid body. Quick comment: the code has a small bug...

In line 86:
Ipos_i = dcm*Ipos_i; % 3-by-3 by 1-by-3

Can be simply changed to:
Ipos_i = dcm*Ipos_i'; % 3-by-3 by 1-by-3
Ipos_i = Ipos_i';

Or something fancier. In any case, this is a great piece of code, and it is rather self-explanatory so disregard other reviews asking to make comments in the code.

In my humble opinion, if the derivation is unclear, one should write out (by hand) the equations to get a clearer picture. There are also short tutorials on the subject available (e.g., search for SIGGRAPH '97 unconstrained motion).

29 Feb 2008 Sum Yew Kong

Very Good matlab function, especially for undergraduates to understand 6dof concept and to use this for case study simulation.

05 Sep 2007 manoj choudhary

20 Oct 2006 Asen Marinov

28 Oct 2005 ian lang

very good.

16 May 2005 ery irianto

hebat dong.
aku minta simulasi dinamik yang lain ya!

08 Feb 2005 Arthur Sugiharto

This is a very best simulation i ever found... hehehe...

12 May 2004 bensahaila hocine

je suis hocine ,je cherche des documents sur la simmulatuin avec maleb et qui concerne les signaux aléatoires (domaine des telecommunication).
je vous remirci.

02 Mar 2004 xenia hernandez

20 Jan 2004 raghu reddy

08 Jan 2004 Randall Hudson

The code looks good. I would increase the rating to five if the code included more details in the description.

08 Jan 2004 Randall Hudson

This is my first download. I hope the description is an accurate description of the application. I am assuming the download includes the code. Not knowing exactly what I am getting is why I rated this 3. I will know more when I download the file.

10 Jun 2003 li li

12 Nov 2014 1.1

update to MATLAB Toolbox File format

01 Sep 2016

Updated license

Contact us