Filter löschen
Filter löschen

How to develop a Euler Method (Aerospace) script

3 Ansichten (letzte 30 Tage)
Timothy Ashcom
Timothy Ashcom am 31 Jul. 2013
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

Antworten (1)

Iain
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.
  1 Kommentar
Timothy Ashcom
Timothy Ashcom am 31 Jul. 2013
lain,
Appreciate your response. Think I understand what you provided but not sure how to accomplish in MATLAB 2013a; please excuse my ignorance. But will attempt tonight.
Could I send you the flight dataset? If so, can send when can get your e-mail.
Would you write the steps down to do all this in a separate document and send to me? That would truly be appreciated! E-mail: tsa8786@aol.com
In the flight dataset spread sheet, had assistance and he created the Psi, Phi, and theta data using a different program. In that dataset, you will see where he calculated the p, q, and r values. So I am trying to duplicate within MATLAB.
When the MATLAB Code file is done, can it be exported, saved, and/or converted into a MS Excel document; with all formula's used? Guess we can title this code file as: Euler Vector Velocity Calc.m
Appreciate your time and efforts!
Respectfully,
Tim Ashcom

Melden Sie sich an, um zu kommentieren.

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!

Translated by