How to develop a Euler Method (Aerospace) script
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello MATLAB Geniuses, I am new to MATLAB and trying to learn on my own. Oh yeah, am old too….lol.
Have a flight data MS Excel (.csv) dataset with Pitch, Roll, & Yaw Angle (degrees) data. Data is recorded at 8 Hz/sec.
Desire is to use the Euler Method – Aerospace to determine the Psi, Phi, and Theta values, the Psidot, Phidot, and Thetadot values, and the q,p, and r values by importing the .csv file and running a script.
Key to my understanding is how the script is written; if someone would write one for me.
They the plan is to use Simulink and develop a file to use in MATLAB. Once the above is done, then the plan is to use the Psi, Phi, and Theta data in FlightGear.
Anyone out there that can assist will save me a lot of time; as I try and learn the basic fundamentals of MATLAB!
I can send you the dataset .csv/.xlsx file; just let me know.
Thank you, all, or any that can assist.
Respectfully,
Tim Ashcom
0 Kommentare
Antworten (1)
Iain
am 31 Jul. 2013
A script is just a text file (with the extension "m", containing lines of matlab code.
numbers = xlsread('D:\mydatahere\flightdata.csv');
frequency = 8; %8 hz
% Numbers now contains all of the numbers (funnily enough) from that file.
psi = numbers(:,1); % assuming that your psi data is the first column etc..
phi = numbers(:,2);
theta = numbers(:,3);
psidot = diff(psi) * frequency; % differentiation - the "dots" are 1 element shorter than the actuals.
phidot = diff(phi) * frequency;
thetadot = diff(theta)*frequency;
%I'm not quite sure how you want to get to p, q & r, but it's probably something like:
p = phidot .* cos(theta(2:end)) + (1./cos(theta)).*thetadot ;
Putting a "." in front of ^, * and / makes the operation element-wise, rather than using the rules for matrix multiplication etc.
Siehe auch
Kategorien
Mehr zu Aerospace Applications finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!