SlideShare a Scribd company logo
DATA ANALYSIS USING MATLAB
Our online Tutors are available 24*7 to provide Help with Data Analysis
Homework/Assignment or a long term Graduate/Undergraduate Data Analysis Project. Our
Tutors being experienced and proficient in Data Analysis ensure to provide high quality Data
Analysis Homework Help. Upload your Data Analysis Assignment at ‘Submit Your
Assignment’ button or email it to info@assignmentpedia.com. You can use our ‘Live Chat’
option to schedule an Online Tutoring session with our Data Analysis Tutors.
INTERPLANETARY PORK CHOP PLOTS
This sample assignment shows a MATLAB Script for Creating Pork Chop Plots of Ballistic Earth-to-Mars
Trajectories
jplephem (et, ntarg, ncent)
function rrd = jplephem (et, ntarg, ncent)
% reads the jpl planetary ephemeris and gives
% the position and velocity of the point 'ntarg'
% with respect to point 'ncent'
% input
% et = julian ephemeris date at which interpolation is wanted
% ntarg = integer number of 'target' point
% ncent = integer number of center point
% the numbering convention for 'ntarg' and 'ncent' is:
% 1 = mercury 8 = neptune
% 2 = venus 9 = pluto
% 3 = earth 10 = moon
% 4 = mars 11 = sun
% 5 = jupiter 12 = solar-system barycenter
% 6 = saturn 13 = earth-moon barycenter
% 7 = uranus 14 = nutations (longitude and obliq)
% 15 = librations, if on ephemeris file
% if nutations are wanted, set ntarg = 14.
% for librations, set ntarg = 15. set ncent = 0.
% output
% rrd = output 6-word array containing position and velocity
% of point 'ntarg' relative to 'ncent'. the units are au and
% au/day. for librations the units are radians and radians
% per day. in the case of nutations the first four words of
% rrd will be set to nutations and rates, having units of
% radians and radians/day.
% the option is available to have the units in km and km/sec.
% for this, set km = 1 via global in the calling program.
% Orbital Mechanics with Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global cval ss au emrat ncon ipt np nv twot pc vc
global iephem ephname bary pvsun nrl fid lpt
rrd = zeros(6, 1);
list = zeros(12, 1);
et2 = zeros(2, 1);
% load time array
et2(1) = et;
et2(2) = 0;
% first entry?
if (iephem == 1)
pvsun = zeros(6, 1);
% read header file data
fid = fopen(ephname, 'r');
ttl = fread(fid, 252);
cnam = fread(fid, 2400);
ss = fread(fid, 3, 'double');
ncon = fread(fid, 1, 'int');
% astronomical unit
au = fread(fid, 1, 'double');
% earth-moon ratio
emrat = fread(fid, 1, 'double');
ipt = fread(fid, [3 12], 'int');
numde = fread(fid, 1, 'int');
lpt = fread(fid, 3, 'int');
% move to next record
status = fseek(fid, 8144, 'bof');
% read "constant" values
cval = fread(fid, 400, 'double');
% initialization
nrl = 0;
bary = 0;
pc(1) = 1;
pc(2) = 0;
vc(2) = 1;
np = 2;
nv = 3;
twot = 0;
iephem = 0;
end
if (ntarg == ncent)
return;
end
%%%%%%%%%%%%%%%%%%%%%%
% nutations requested?
%%%%%%%%%%%%%%%%%%%%%%
if (ntarg == 14)
if (ipt(2, 12) > 0)
list(11) = 2;
[pv, rrd] = state(et2, list);
list(11) = 0;
return;
else
fprintf('nnpleph - no nutations on this ephemeris file n');
return;
end
end
%%%%%%%%%%%%%%%%%%%%%%%
% librations requested?
%%%%%%%%%%%%%%%%%%%%%%%
if (ntarg == 15)
if (lpt(2) > 0)
list(12) = 2;
[pv, rrd] = state(et2, list);
list(12) = 0;
for i = 1:1:6
rrd(i) = pv(i, 11);
end
return
else
fprintf('nn no librations on this ephemeris file n');
return;
end
end
% force barycentric output by function 'state'
bsave = bary;
bary = 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% set up proper entries in 'list' array for state call
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for i = 1:1:2
k = ntarg;
if (i == 2)
k = ncent;
end
if (k <= 10)
list(k) = 2;
end
if (k == 10)
list(3) = 2;
end
if (k == 3)
list(10) = 2;
end
if (k == 13)
list(3) = 2;
end
end
%%%%%%%%%%%%%%%%%%%%
% make call to state
%%%%%%%%%%%%%%%%%%%%
[pv, rrd] = state(et2, list);
if (ntarg == 11 || ncent == 11)
for i = 1:1:6
pv(i, 11) = pvsun(i);
end
end
if (ntarg == 12 || ncent == 12)
for i = 1:1:6
pv(i, 12) = 0;
end
end
if (ntarg == 13 || ncent == 13)
for i = 1:1:6
pv(i, 13) = pv(i, 3);
end
end
if (ntarg * ncent == 30 && ntarg + ncent == 13)
for i = 1:1:6
pv(i, 3) = 0;
end
else
if (list(3) == 2)
for i = 1:1:6
pv(i, 3) = pv(i, 3) - pv(i, 10) / (1 + emrat);
end
end
if (list(10) == 2)
for i = 1:1:6
pv(i, 10) = pv(i, 3) + pv(i, 10);
end
end
end
for i = 1:1:6
rrd(i) = pv(i, ntarg) - pv(i, ncent);
end
bary = bsave;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [pv, nut] = state(et2, list)
% reads and interpolates the jpl planetary ephemeris file
% input
% et2 2-word julian ephemeris epoch at which interpolation
% is wanted. any combination of et2(1) + et2(2) which falls
% within the time span on the file is a permissible epoch.
% a. for ease in programming, the user may put the
% entire epoch in et2(1) and set et2(2) = 0.
% b. for maximum interpolation accuracy, set et2(1) equal
% to the most recent midnight at or before interpolation
% epoch and set et2(2) equal to fractional part of a day
% elapsed between et2(1) and epoch.
% c. as an alternative, it may prove convenient to set
% et2(1) = some fixed epoch, such as start of integration,
% and et2(2) = elapsed interval between and epoch.
% list 12-word integer array specifying what interpolation
% is wanted for each of the bodies on the file.
%
% list(i) = 0 => no interpolation for body i
% = 1 => position only
% = 2 => position and velocity
% the designation of the astronomical bodies by i is:
% i = 1 => mercury
% = 2 => venus
% = 3 => earth-moon barycenter
% = 4 => mars
% = 5 => jupiter
% = 6 => saturn
% = 7 => uranus
% = 8 => neptune
% = 9 => pluto
% = 10 => geocentric moon
% = 11 => nutations in longitude and obliquity
% = 12 => lunar librations (if on file)
% output
% pv 6 x 11 array that will contain requested interpolated
% quantities. the body specified by list(i) will have its
% state in the array starting at pv(1, i). (on any given
% call, only those words in 'pv' which are affected by the
% first 10 'list' entries (and by list(12) if librations are
% on the file) are set. the rest of the 'pv' array
% is untouched). the order of components starting in
% pv(1, i) is x, y, z, dx, dy, dz.
% all output vectors are referenced to the earth mean
% equator and equinox of j2000 if the de number is 200 or
% greater; of b1950 if the de number is less than 200.
% the moon state is always geocentric; the other nine states
% are either heliocentric or solar-system barycentric,
% depending on the setting of common flags (see below).
% lunar librations, if on file, are put into pv(k, 11) if
% list(12) is 1 or 2.
%
% nut 4-word array that will contain nutations and rates,
% depending on the setting of list(11). the order of
% quantities in nut is:
% d psi (nutation in longitude)
% d epsilon (nutation in obliquity)
% d psi dot
% d epsilon dot
% global
% km logical flag defining physical units of the output states
% = 1 => kilometers and kilometers/second
% = 0 => au and au/day
% default value = 0 (km determines time unit
% for nutations and librations. angle unit is always radians.)
% bary logical flag defining output center.
% only the 9 planets are affected.
% bary = 1 => center is solar-system barycenter
% = 0 => center is sun
% default value = 0
% pvsun 6-word array containing the barycentric position and
% velocity of the sun
global ss au ipt lpt
global nrl fid km bary pvsun coef
nut = zeros(4, 1);
pv = zeros(6, 11);
if (et2(1) == 0)
return
end
s = et2(1) - 0.5;
tmp = split(s);
pjd(1) = tmp(1);
pjd(2) = tmp(2);
tmp = split(et2(2));
pjd(3) = tmp(1);
pjd(4) = tmp(2);
pjd(1) = pjd(1) + pjd(3) + 0.5;
pjd(2) = pjd(2) + pjd(4);
tmp = split(pjd(2));
pjd(3) = tmp(1);
pjd(4) = tmp(2);
pjd(1) = pjd(1) + pjd(3);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% error return for epoch out of range
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (pjd(1) + pjd(4) < ss(1) || pjd(1) + pjd(4) > ss(2))
fprintf('nn error in state - epoch out of range n');
return;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% calculate record number and relative time in interval
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
nr = fix((pjd(1) - ss(1)) / ss(3)) + 2;
if (pjd(1) == ss(2))
nr = nr - 1;
end
t(1) = ((pjd(1) - ((nr-2) * ss(3) + ss(1))) + pjd(4)) / ss(3);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% read correct record if not in core
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (nr ~= nrl)
nrl = nr;
status = fseek(fid, nr * 8144, 'bof');
coef = fread(fid, 1018, 'double');
end
if (km == 1)
t(2) = ss(3) * 86400;
aufac = 1;
else
t(2) = ss(3);
aufac = 1 / au;
end
% interpolate barycentric state vector of sun
tmpv = zeros(3, 2);
ibuf = ipt(1, 11);
ncf = ipt(2, 11);
na = ipt(3, 11);
tmpv = interp(ibuf, t, ncf, 3, na, 2);
k = 0;
for j = 1:1:2
for i = 1:1:3
k = k + 1;
pvsun(k) = tmpv(i, j) * aufac;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% check and interpolate bodies requested
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tmpv = zeros(3, 2);
tempv = zeros(6, 1);
for i = 1:1:10
if (list(i) ~= 0)
ibuf = ipt(1, i);
ncf = ipt(2, i);
na = ipt(3, i);
tmpv = interp(ibuf, t, ncf, 3, na, list(i));
k = 0;
for j = 1:1:2
for m = 1:1:3
k = k + 1;
tempv(k) = tmpv(m, j);
end
end
for j = 1:1:6
if (i <= 9 && bary == 0)
pv(j, i) = tempv(j) * aufac - pvsun(j);
else
pv(j, i) = tempv(j) * aufac;
end
end
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% do nutations if requested (and if on file)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (list(11) > 0 && ipt(2, 12) > 0)
ibuf = ipt(1, 12);
ncf = ipt(2, 12);
na = ipt(3, 12);
nut = interp(ibuf, t, ncf, 2, na, list(11));
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% get librations if requested (and if on file)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (list(12) > 0 && lpt(2) > 0)
tmpv = interp(lpt(1), t, lpt(2), 3, lpt(3), list(12));
for i = 1:1:3
pv(i, 11) = tmpv(i, 1);
pv(i + 3, 11) = tmpv(i, 2);
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function pv = interp(ibuf, t, ncf, ncm, na, ifl)
% this function differentiates and interpolates a set
% of chebyshev coefficients to give position and velocity
% input
% buf 1st location of array of chebyshev coefficients of position
% t t(1) is fractional time in interval covered by
% coefficients at which interpolation is wanted
% (0 <= t(1) <= 1). t(2) is length of whole
% interval in input time units.
% ncf number of coefficients per component
% ncm number of components per set of coefficients
% na number of sets of coefficients in full array
% (i.e., number of sub-intervals in full interval)
% ifl integer flag
% = 1 for positions only
% = 2 for pos and vel
% output
% pv interpolated quantities requested. dimension
% expected is pv(ncm, ifl)
global coef np nv twot pc vc
pv = zeros(6, 12);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% get correct sub-interval number for this set of
% coefficients and get normalized chebyshev time
% within that subinterval.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dna = na;
dt1 = fix(t(1));
temp = dna * t(1);
ll = fix(temp - dt1) + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% tc is the normalized chebyshev time (-1 <= tc <= 1)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tc = 2 * (mod(temp, 1) + dt1) - 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% check to see whether chebyshev time has changed,
% and compute new polynomial values if it has.
% (the element pc(2) is the value of t1(tc) and hence
% contains the value of tc on the previous call)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (tc ~= pc(2))
np = 2;
nv = 3;
pc(2) = tc;
twot = tc + tc;
end
% be sure that at least 'ncf' polynomials have been evaluated
% and are stored in the array 'pc'.
if (np < ncf)
for i = np + 1:1:ncf
pc(i) = twot * pc(i - 1) - pc(i - 2);
end
np = ncf;
end
bcoef = ncf * na * ncm;
cbody = zeros(bcoef, 1);
n = ibuf;
for m = 1:1:bcoef
cbody(m) = coef(n);
n = n + 1;
end
cbuf = zeros(ncf, ncm, na);
n = 0;
for l = 1:1:na
for i = 1:1:ncm
for j = 1:1:ncf
n = n + 1;
cbuf(j, i, l) = cbody(n);
end
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% interpolate to get position for each component
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for i = 1:1:ncm
pv(i, 1) = 0;
for j = ncf:-1:1
pv(i, 1) = pv(i, 1) + pc(j) * cbuf(j, i, ll);
end
end
if (ifl <= 1)
return
end
% if velocity interpolation is wanted, be sure enough
% derivative polynomials have been generated and stored.
vfac = (dna + dna) / t(2);
vc(3) = twot + twot;
if (nv < ncf)
for i = nv + 1:1:ncf
vc(i) = twot * vc(i - 1) + pc(i - 1) + pc(i - 1) - vc(i - 2);
end
nv = ncf;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% interpolate to get velocity for each component
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for i = 1:1:ncm
pv(i, 2) = 0;
for j = ncf:-1:2
pv(i, 2) = pv(i, 2) + vc(j) * cbuf(j, i, ll);
end
pv(i, 2) = pv(i, 2) * vfac;
end
%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%
function fr = split(tt)
% this function breaks a number into a integer
% and a fractional part.
% input
% tt = input number
% output
% fr = 2-word output array
% fr(1) contains integer part
% fr(2) contains fractional part
% for negative input numbers, fr(1) contains the next
% more negative integer; fr(2) contains a positive fraction.
fr = zeros(2, 1);
fr(1) = fix(tt);
fr(2) = tt - fr(1);
if (tt >= 0 || fr(2) == 0)
return
end
% make adjustments for negative input number
fr(1) = fr(1) - 1;
fr(2) = fr(2) + 1;
visit us at www.assignmentpedia.com or email us at info@assignmentpedia.com or call us at +1 520 8371215

More Related Content

What's hot

Ning_Mei.ASSIGN03
Ning_Mei.ASSIGN03Ning_Mei.ASSIGN03
Ning_Mei.ASSIGN03
宁 梅
 
Ning_Mei.ASSIGN01
Ning_Mei.ASSIGN01Ning_Mei.ASSIGN01
Ning_Mei.ASSIGN01
宁 梅
 
Solutions manual for hydrologic analysis and design 4th edition by mc cuen ib...
Solutions manual for hydrologic analysis and design 4th edition by mc cuen ib...Solutions manual for hydrologic analysis and design 4th edition by mc cuen ib...
Solutions manual for hydrologic analysis and design 4th edition by mc cuen ib...
frazob
 
Marshall – Olkin distributions in R
Marshall – Olkin distributions in RMarshall – Olkin distributions in R
Marshall – Olkin distributions in R
Achilleas Papatsimpas
 
Computer Controlled Systems (solutions manual). Astrom. 3rd edition 1997
Computer Controlled Systems (solutions manual). Astrom. 3rd edition 1997Computer Controlled Systems (solutions manual). Astrom. 3rd edition 1997
Computer Controlled Systems (solutions manual). Astrom. 3rd edition 1997
JOAQUIN REA
 
C070409013
C070409013C070409013
C070409013
IJERD Editor
 
Pham,Nhat_ResearchPoster
Pham,Nhat_ResearchPosterPham,Nhat_ResearchPoster
Pham,Nhat_ResearchPoster
Nhat Pham
 

What's hot (7)

Ning_Mei.ASSIGN03
Ning_Mei.ASSIGN03Ning_Mei.ASSIGN03
Ning_Mei.ASSIGN03
 
Ning_Mei.ASSIGN01
Ning_Mei.ASSIGN01Ning_Mei.ASSIGN01
Ning_Mei.ASSIGN01
 
Solutions manual for hydrologic analysis and design 4th edition by mc cuen ib...
Solutions manual for hydrologic analysis and design 4th edition by mc cuen ib...Solutions manual for hydrologic analysis and design 4th edition by mc cuen ib...
Solutions manual for hydrologic analysis and design 4th edition by mc cuen ib...
 
Marshall – Olkin distributions in R
Marshall – Olkin distributions in RMarshall – Olkin distributions in R
Marshall – Olkin distributions in R
 
Computer Controlled Systems (solutions manual). Astrom. 3rd edition 1997
Computer Controlled Systems (solutions manual). Astrom. 3rd edition 1997Computer Controlled Systems (solutions manual). Astrom. 3rd edition 1997
Computer Controlled Systems (solutions manual). Astrom. 3rd edition 1997
 
C070409013
C070409013C070409013
C070409013
 
Pham,Nhat_ResearchPoster
Pham,Nhat_ResearchPosterPham,Nhat_ResearchPoster
Pham,Nhat_ResearchPoster
 

Similar to Data Analysis

3 (a) calculate thy potential at point P located a distance z above .pdf
 3 (a) calculate thy potential at point P located a distance z above  .pdf 3 (a) calculate thy potential at point P located a distance z above  .pdf
3 (a) calculate thy potential at point P located a distance z above .pdf
Info489948
 
PSOGlobalSearching
PSOGlobalSearchingPSOGlobalSearching
PSOGlobalSearching
Shiyan (诗言) Wei (韦)
 
Matlab kod taslağı
Matlab kod taslağıMatlab kod taslağı
Matlab kod taslağı
Merve Cvdr
 
Radar cross section project
Radar cross section projectRadar cross section project
Radar cross section project
Assignmentpedia
 
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdfIncorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
aartechindia
 
Please show the whole code... Im very confused. Matlab code for ea.pdf
Please show the whole code... Im very confused. Matlab code for ea.pdfPlease show the whole code... Im very confused. Matlab code for ea.pdf
Please show the whole code... Im very confused. Matlab code for ea.pdf
arshiartpalace
 
Numericam Methods using Matlab.pdf
Numericam Methods using Matlab.pdfNumericam Methods using Matlab.pdf
Numericam Methods using Matlab.pdf
Dhiraj Bhaskar
 
SDF Hysteretic System 1 - Differential Vaiana Rosati Model
SDF Hysteretic System 1 - Differential Vaiana Rosati Model SDF Hysteretic System 1 - Differential Vaiana Rosati Model
SDF Hysteretic System 1 - Differential Vaiana Rosati Model
University of Naples Federico II
 
Please use the same variables and only write the TODO part #!-usr-bi.pdf
Please use the same variables and only write the TODO part   #!-usr-bi.pdfPlease use the same variables and only write the TODO part   #!-usr-bi.pdf
Please use the same variables and only write the TODO part #!-usr-bi.pdf
asenterprisestyagi
 
Consider a 4-Link robot manipulator shown below. Use the forward kine.pdf
Consider a 4-Link robot manipulator shown below. Use the forward kine.pdfConsider a 4-Link robot manipulator shown below. Use the forward kine.pdf
Consider a 4-Link robot manipulator shown below. Use the forward kine.pdf
meerobertsonheyde608
 
Aaron Ellison Keynote: Reaching the 99%
Aaron Ellison Keynote: Reaching the 99%Aaron Ellison Keynote: Reaching the 99%
Aaron Ellison Keynote: Reaching the 99%
David LeBauer
 
Help with root locus homework1
Help with root locus homework1Help with root locus homework1
Help with root locus homework1
Assignmentpedia
 
Fourier series example
Fourier series exampleFourier series example
Fourier series example
Abi finni
 
Recursion in C
Recursion in CRecursion in C
Recursion in C
Lakshmi Sarvani Videla
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyr
Romain Francois
 
Anomaly Detection in Sequences of Short Text Using Iterative Language Models
Anomaly Detection in Sequences of Short Text Using Iterative Language ModelsAnomaly Detection in Sequences of Short Text Using Iterative Language Models
Anomaly Detection in Sequences of Short Text Using Iterative Language Models
Cynthia Freeman
 
Chang etal 2012a
Chang etal 2012aChang etal 2012a
Chang etal 2012a
Arthur Weglein
 
Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...
Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...
Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...
Arthur Weglein
 
Estimating structured vector autoregressive models
Estimating structured vector autoregressive modelsEstimating structured vector autoregressive models
Estimating structured vector autoregressive models
Akira Tanimoto
 
Eli plots visualizing innumerable number of correlations
Eli plots   visualizing innumerable number of correlationsEli plots   visualizing innumerable number of correlations
Eli plots visualizing innumerable number of correlations
Leonardo Auslender
 

Similar to Data Analysis (20)

3 (a) calculate thy potential at point P located a distance z above .pdf
 3 (a) calculate thy potential at point P located a distance z above  .pdf 3 (a) calculate thy potential at point P located a distance z above  .pdf
3 (a) calculate thy potential at point P located a distance z above .pdf
 
PSOGlobalSearching
PSOGlobalSearchingPSOGlobalSearching
PSOGlobalSearching
 
Matlab kod taslağı
Matlab kod taslağıMatlab kod taslağı
Matlab kod taslağı
 
Radar cross section project
Radar cross section projectRadar cross section project
Radar cross section project
 
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdfIncorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
 
Please show the whole code... Im very confused. Matlab code for ea.pdf
Please show the whole code... Im very confused. Matlab code for ea.pdfPlease show the whole code... Im very confused. Matlab code for ea.pdf
Please show the whole code... Im very confused. Matlab code for ea.pdf
 
Numericam Methods using Matlab.pdf
Numericam Methods using Matlab.pdfNumericam Methods using Matlab.pdf
Numericam Methods using Matlab.pdf
 
SDF Hysteretic System 1 - Differential Vaiana Rosati Model
SDF Hysteretic System 1 - Differential Vaiana Rosati Model SDF Hysteretic System 1 - Differential Vaiana Rosati Model
SDF Hysteretic System 1 - Differential Vaiana Rosati Model
 
Please use the same variables and only write the TODO part #!-usr-bi.pdf
Please use the same variables and only write the TODO part   #!-usr-bi.pdfPlease use the same variables and only write the TODO part   #!-usr-bi.pdf
Please use the same variables and only write the TODO part #!-usr-bi.pdf
 
Consider a 4-Link robot manipulator shown below. Use the forward kine.pdf
Consider a 4-Link robot manipulator shown below. Use the forward kine.pdfConsider a 4-Link robot manipulator shown below. Use the forward kine.pdf
Consider a 4-Link robot manipulator shown below. Use the forward kine.pdf
 
Aaron Ellison Keynote: Reaching the 99%
Aaron Ellison Keynote: Reaching the 99%Aaron Ellison Keynote: Reaching the 99%
Aaron Ellison Keynote: Reaching the 99%
 
Help with root locus homework1
Help with root locus homework1Help with root locus homework1
Help with root locus homework1
 
Fourier series example
Fourier series exampleFourier series example
Fourier series example
 
Recursion in C
Recursion in CRecursion in C
Recursion in C
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyr
 
Anomaly Detection in Sequences of Short Text Using Iterative Language Models
Anomaly Detection in Sequences of Short Text Using Iterative Language ModelsAnomaly Detection in Sequences of Short Text Using Iterative Language Models
Anomaly Detection in Sequences of Short Text Using Iterative Language Models
 
Chang etal 2012a
Chang etal 2012aChang etal 2012a
Chang etal 2012a
 
Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...
Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...
Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...
 
Estimating structured vector autoregressive models
Estimating structured vector autoregressive modelsEstimating structured vector autoregressive models
Estimating structured vector autoregressive models
 
Eli plots visualizing innumerable number of correlations
Eli plots   visualizing innumerable number of correlationsEli plots   visualizing innumerable number of correlations
Eli plots visualizing innumerable number of correlations
 

More from Assignmentpedia

Transmitter side components
Transmitter side componentsTransmitter side components
Transmitter side components
Assignmentpedia
 
Single object range detection
Single object range detectionSingle object range detection
Single object range detection
Assignmentpedia
 
Sequential radar tracking
Sequential radar trackingSequential radar tracking
Sequential radar tracking
Assignmentpedia
 
Resolution project
Resolution projectResolution project
Resolution project
Assignmentpedia
 
Radar application project help
Radar application project helpRadar application project help
Radar application project help
Assignmentpedia
 
Parallel computing homework help
Parallel computing homework helpParallel computing homework help
Parallel computing homework help
Assignmentpedia
 
Network costing analysis
Network costing analysisNetwork costing analysis
Network costing analysis
Assignmentpedia
 
Matlab simulation project
Matlab simulation projectMatlab simulation project
Matlab simulation project
Assignmentpedia
 
Matlab programming project
Matlab programming projectMatlab programming project
Matlab programming project
Assignmentpedia
 
Links design
Links designLinks design
Links design
Assignmentpedia
 
Image processing project using matlab
Image processing project using matlabImage processing project using matlab
Image processing project using matlab
Assignmentpedia
 
Transmitter subsystem
Transmitter subsystemTransmitter subsystem
Transmitter subsystem
Assignmentpedia
 
Computer Networks Homework Help
Computer Networks Homework HelpComputer Networks Homework Help
Computer Networks Homework Help
Assignmentpedia
 
Theory of computation homework help
Theory of computation homework helpTheory of computation homework help
Theory of computation homework help
Assignmentpedia
 
Econometrics Homework Help
Econometrics Homework HelpEconometrics Homework Help
Econometrics Homework Help
Assignmentpedia
 
Video Codec
Video CodecVideo Codec
Video Codec
Assignmentpedia
 
Radar Spectral Analysis
Radar Spectral AnalysisRadar Spectral Analysis
Radar Spectral Analysis
Assignmentpedia
 
Pi Controller
Pi ControllerPi Controller
Pi Controller
Assignmentpedia
 
Help With Digital Communication Project
Help With  Digital Communication ProjectHelp With  Digital Communication Project
Help With Digital Communication Project
Assignmentpedia
 
Fpga Design Project
Fpga Design ProjectFpga Design Project
Fpga Design Project
Assignmentpedia
 

More from Assignmentpedia (20)

Transmitter side components
Transmitter side componentsTransmitter side components
Transmitter side components
 
Single object range detection
Single object range detectionSingle object range detection
Single object range detection
 
Sequential radar tracking
Sequential radar trackingSequential radar tracking
Sequential radar tracking
 
Resolution project
Resolution projectResolution project
Resolution project
 
Radar application project help
Radar application project helpRadar application project help
Radar application project help
 
Parallel computing homework help
Parallel computing homework helpParallel computing homework help
Parallel computing homework help
 
Network costing analysis
Network costing analysisNetwork costing analysis
Network costing analysis
 
Matlab simulation project
Matlab simulation projectMatlab simulation project
Matlab simulation project
 
Matlab programming project
Matlab programming projectMatlab programming project
Matlab programming project
 
Links design
Links designLinks design
Links design
 
Image processing project using matlab
Image processing project using matlabImage processing project using matlab
Image processing project using matlab
 
Transmitter subsystem
Transmitter subsystemTransmitter subsystem
Transmitter subsystem
 
Computer Networks Homework Help
Computer Networks Homework HelpComputer Networks Homework Help
Computer Networks Homework Help
 
Theory of computation homework help
Theory of computation homework helpTheory of computation homework help
Theory of computation homework help
 
Econometrics Homework Help
Econometrics Homework HelpEconometrics Homework Help
Econometrics Homework Help
 
Video Codec
Video CodecVideo Codec
Video Codec
 
Radar Spectral Analysis
Radar Spectral AnalysisRadar Spectral Analysis
Radar Spectral Analysis
 
Pi Controller
Pi ControllerPi Controller
Pi Controller
 
Help With Digital Communication Project
Help With  Digital Communication ProjectHelp With  Digital Communication Project
Help With Digital Communication Project
 
Fpga Design Project
Fpga Design ProjectFpga Design Project
Fpga Design Project
 

Recently uploaded

How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
spdendr
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
Chevonnese Chevers Whyte, MBA, B.Sc.
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdfIGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
Amin Marwan
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 

Recently uploaded (20)

How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdfIGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 

Data Analysis

  • 1. DATA ANALYSIS USING MATLAB Our online Tutors are available 24*7 to provide Help with Data Analysis Homework/Assignment or a long term Graduate/Undergraduate Data Analysis Project. Our Tutors being experienced and proficient in Data Analysis ensure to provide high quality Data Analysis Homework Help. Upload your Data Analysis Assignment at ‘Submit Your Assignment’ button or email it to info@assignmentpedia.com. You can use our ‘Live Chat’ option to schedule an Online Tutoring session with our Data Analysis Tutors. INTERPLANETARY PORK CHOP PLOTS This sample assignment shows a MATLAB Script for Creating Pork Chop Plots of Ballistic Earth-to-Mars Trajectories jplephem (et, ntarg, ncent) function rrd = jplephem (et, ntarg, ncent) % reads the jpl planetary ephemeris and gives % the position and velocity of the point 'ntarg' % with respect to point 'ncent' % input % et = julian ephemeris date at which interpolation is wanted % ntarg = integer number of 'target' point % ncent = integer number of center point % the numbering convention for 'ntarg' and 'ncent' is: % 1 = mercury 8 = neptune % 2 = venus 9 = pluto % 3 = earth 10 = moon % 4 = mars 11 = sun % 5 = jupiter 12 = solar-system barycenter % 6 = saturn 13 = earth-moon barycenter % 7 = uranus 14 = nutations (longitude and obliq) % 15 = librations, if on ephemeris file % if nutations are wanted, set ntarg = 14. % for librations, set ntarg = 15. set ncent = 0. % output
  • 2. % rrd = output 6-word array containing position and velocity % of point 'ntarg' relative to 'ncent'. the units are au and % au/day. for librations the units are radians and radians % per day. in the case of nutations the first four words of % rrd will be set to nutations and rates, having units of % radians and radians/day. % the option is available to have the units in km and km/sec. % for this, set km = 1 via global in the calling program. % Orbital Mechanics with Matlab %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% global cval ss au emrat ncon ipt np nv twot pc vc global iephem ephname bary pvsun nrl fid lpt rrd = zeros(6, 1); list = zeros(12, 1); et2 = zeros(2, 1); % load time array et2(1) = et; et2(2) = 0; % first entry? if (iephem == 1) pvsun = zeros(6, 1); % read header file data fid = fopen(ephname, 'r'); ttl = fread(fid, 252); cnam = fread(fid, 2400); ss = fread(fid, 3, 'double'); ncon = fread(fid, 1, 'int'); % astronomical unit
  • 3. au = fread(fid, 1, 'double'); % earth-moon ratio emrat = fread(fid, 1, 'double'); ipt = fread(fid, [3 12], 'int'); numde = fread(fid, 1, 'int'); lpt = fread(fid, 3, 'int'); % move to next record status = fseek(fid, 8144, 'bof'); % read "constant" values cval = fread(fid, 400, 'double'); % initialization nrl = 0; bary = 0; pc(1) = 1; pc(2) = 0; vc(2) = 1; np = 2; nv = 3; twot = 0; iephem = 0; end if (ntarg == ncent) return; end %%%%%%%%%%%%%%%%%%%%%% % nutations requested? %%%%%%%%%%%%%%%%%%%%%% if (ntarg == 14) if (ipt(2, 12) > 0)
  • 4. list(11) = 2; [pv, rrd] = state(et2, list); list(11) = 0; return; else fprintf('nnpleph - no nutations on this ephemeris file n'); return; end end %%%%%%%%%%%%%%%%%%%%%%% % librations requested? %%%%%%%%%%%%%%%%%%%%%%% if (ntarg == 15) if (lpt(2) > 0) list(12) = 2; [pv, rrd] = state(et2, list); list(12) = 0; for i = 1:1:6 rrd(i) = pv(i, 11); end return else fprintf('nn no librations on this ephemeris file n'); return; end end % force barycentric output by function 'state' bsave = bary; bary = 1; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % set up proper entries in 'list' array for state call %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for i = 1:1:2 k = ntarg;
  • 5. if (i == 2) k = ncent; end if (k <= 10) list(k) = 2; end if (k == 10) list(3) = 2; end if (k == 3) list(10) = 2; end if (k == 13) list(3) = 2; end end %%%%%%%%%%%%%%%%%%%% % make call to state %%%%%%%%%%%%%%%%%%%% [pv, rrd] = state(et2, list); if (ntarg == 11 || ncent == 11) for i = 1:1:6 pv(i, 11) = pvsun(i); end end if (ntarg == 12 || ncent == 12) for i = 1:1:6 pv(i, 12) = 0; end end if (ntarg == 13 || ncent == 13) for i = 1:1:6 pv(i, 13) = pv(i, 3); end end if (ntarg * ncent == 30 && ntarg + ncent == 13) for i = 1:1:6 pv(i, 3) = 0;
  • 6. end else if (list(3) == 2) for i = 1:1:6 pv(i, 3) = pv(i, 3) - pv(i, 10) / (1 + emrat); end end if (list(10) == 2) for i = 1:1:6 pv(i, 10) = pv(i, 3) + pv(i, 10); end end end for i = 1:1:6 rrd(i) = pv(i, ntarg) - pv(i, ncent); end bary = bsave; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [pv, nut] = state(et2, list) % reads and interpolates the jpl planetary ephemeris file % input % et2 2-word julian ephemeris epoch at which interpolation % is wanted. any combination of et2(1) + et2(2) which falls % within the time span on the file is a permissible epoch. % a. for ease in programming, the user may put the % entire epoch in et2(1) and set et2(2) = 0. % b. for maximum interpolation accuracy, set et2(1) equal % to the most recent midnight at or before interpolation % epoch and set et2(2) equal to fractional part of a day % elapsed between et2(1) and epoch. % c. as an alternative, it may prove convenient to set % et2(1) = some fixed epoch, such as start of integration, % and et2(2) = elapsed interval between and epoch. % list 12-word integer array specifying what interpolation % is wanted for each of the bodies on the file. %
  • 7. % list(i) = 0 => no interpolation for body i % = 1 => position only % = 2 => position and velocity % the designation of the astronomical bodies by i is: % i = 1 => mercury % = 2 => venus % = 3 => earth-moon barycenter % = 4 => mars % = 5 => jupiter % = 6 => saturn % = 7 => uranus % = 8 => neptune % = 9 => pluto % = 10 => geocentric moon % = 11 => nutations in longitude and obliquity % = 12 => lunar librations (if on file) % output % pv 6 x 11 array that will contain requested interpolated % quantities. the body specified by list(i) will have its % state in the array starting at pv(1, i). (on any given % call, only those words in 'pv' which are affected by the % first 10 'list' entries (and by list(12) if librations are % on the file) are set. the rest of the 'pv' array % is untouched). the order of components starting in % pv(1, i) is x, y, z, dx, dy, dz. % all output vectors are referenced to the earth mean % equator and equinox of j2000 if the de number is 200 or % greater; of b1950 if the de number is less than 200. % the moon state is always geocentric; the other nine states % are either heliocentric or solar-system barycentric, % depending on the setting of common flags (see below). % lunar librations, if on file, are put into pv(k, 11) if % list(12) is 1 or 2. % % nut 4-word array that will contain nutations and rates, % depending on the setting of list(11). the order of % quantities in nut is: % d psi (nutation in longitude) % d epsilon (nutation in obliquity) % d psi dot % d epsilon dot
  • 8. % global % km logical flag defining physical units of the output states % = 1 => kilometers and kilometers/second % = 0 => au and au/day % default value = 0 (km determines time unit % for nutations and librations. angle unit is always radians.) % bary logical flag defining output center. % only the 9 planets are affected. % bary = 1 => center is solar-system barycenter % = 0 => center is sun % default value = 0 % pvsun 6-word array containing the barycentric position and % velocity of the sun global ss au ipt lpt global nrl fid km bary pvsun coef nut = zeros(4, 1); pv = zeros(6, 11); if (et2(1) == 0) return end s = et2(1) - 0.5; tmp = split(s); pjd(1) = tmp(1); pjd(2) = tmp(2); tmp = split(et2(2)); pjd(3) = tmp(1); pjd(4) = tmp(2); pjd(1) = pjd(1) + pjd(3) + 0.5; pjd(2) = pjd(2) + pjd(4);
  • 9. tmp = split(pjd(2)); pjd(3) = tmp(1); pjd(4) = tmp(2); pjd(1) = pjd(1) + pjd(3); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % error return for epoch out of range %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if (pjd(1) + pjd(4) < ss(1) || pjd(1) + pjd(4) > ss(2)) fprintf('nn error in state - epoch out of range n'); return; end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % calculate record number and relative time in interval %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nr = fix((pjd(1) - ss(1)) / ss(3)) + 2; if (pjd(1) == ss(2)) nr = nr - 1; end t(1) = ((pjd(1) - ((nr-2) * ss(3) + ss(1))) + pjd(4)) / ss(3); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % read correct record if not in core %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if (nr ~= nrl) nrl = nr; status = fseek(fid, nr * 8144, 'bof'); coef = fread(fid, 1018, 'double'); end if (km == 1) t(2) = ss(3) * 86400; aufac = 1; else t(2) = ss(3); aufac = 1 / au; end
  • 10. % interpolate barycentric state vector of sun tmpv = zeros(3, 2); ibuf = ipt(1, 11); ncf = ipt(2, 11); na = ipt(3, 11); tmpv = interp(ibuf, t, ncf, 3, na, 2); k = 0; for j = 1:1:2 for i = 1:1:3 k = k + 1; pvsun(k) = tmpv(i, j) * aufac; end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % check and interpolate bodies requested %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% tmpv = zeros(3, 2); tempv = zeros(6, 1); for i = 1:1:10 if (list(i) ~= 0) ibuf = ipt(1, i); ncf = ipt(2, i); na = ipt(3, i); tmpv = interp(ibuf, t, ncf, 3, na, list(i)); k = 0; for j = 1:1:2 for m = 1:1:3 k = k + 1; tempv(k) = tmpv(m, j); end end for j = 1:1:6 if (i <= 9 && bary == 0) pv(j, i) = tempv(j) * aufac - pvsun(j);
  • 11. else pv(j, i) = tempv(j) * aufac; end end end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % do nutations if requested (and if on file) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if (list(11) > 0 && ipt(2, 12) > 0) ibuf = ipt(1, 12); ncf = ipt(2, 12); na = ipt(3, 12); nut = interp(ibuf, t, ncf, 2, na, list(11)); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % get librations if requested (and if on file) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if (list(12) > 0 && lpt(2) > 0) tmpv = interp(lpt(1), t, lpt(2), 3, lpt(3), list(12)); for i = 1:1:3 pv(i, 11) = tmpv(i, 1); pv(i + 3, 11) = tmpv(i, 2); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function pv = interp(ibuf, t, ncf, ncm, na, ifl) % this function differentiates and interpolates a set % of chebyshev coefficients to give position and velocity % input % buf 1st location of array of chebyshev coefficients of position % t t(1) is fractional time in interval covered by % coefficients at which interpolation is wanted % (0 <= t(1) <= 1). t(2) is length of whole
  • 12. % interval in input time units. % ncf number of coefficients per component % ncm number of components per set of coefficients % na number of sets of coefficients in full array % (i.e., number of sub-intervals in full interval) % ifl integer flag % = 1 for positions only % = 2 for pos and vel % output % pv interpolated quantities requested. dimension % expected is pv(ncm, ifl) global coef np nv twot pc vc pv = zeros(6, 12); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % get correct sub-interval number for this set of % coefficients and get normalized chebyshev time % within that subinterval. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dna = na; dt1 = fix(t(1)); temp = dna * t(1); ll = fix(temp - dt1) + 1; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % tc is the normalized chebyshev time (-1 <= tc <= 1) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% tc = 2 * (mod(temp, 1) + dt1) - 1; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % check to see whether chebyshev time has changed, % and compute new polynomial values if it has. % (the element pc(2) is the value of t1(tc) and hence % contains the value of tc on the previous call) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • 13. if (tc ~= pc(2)) np = 2; nv = 3; pc(2) = tc; twot = tc + tc; end % be sure that at least 'ncf' polynomials have been evaluated % and are stored in the array 'pc'. if (np < ncf) for i = np + 1:1:ncf pc(i) = twot * pc(i - 1) - pc(i - 2); end np = ncf; end bcoef = ncf * na * ncm; cbody = zeros(bcoef, 1); n = ibuf; for m = 1:1:bcoef cbody(m) = coef(n); n = n + 1; end cbuf = zeros(ncf, ncm, na); n = 0; for l = 1:1:na for i = 1:1:ncm for j = 1:1:ncf n = n + 1; cbuf(j, i, l) = cbody(n); end end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % interpolate to get position for each component %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for i = 1:1:ncm pv(i, 1) = 0;
  • 14. for j = ncf:-1:1 pv(i, 1) = pv(i, 1) + pc(j) * cbuf(j, i, ll); end end if (ifl <= 1) return end % if velocity interpolation is wanted, be sure enough % derivative polynomials have been generated and stored. vfac = (dna + dna) / t(2); vc(3) = twot + twot; if (nv < ncf) for i = nv + 1:1:ncf vc(i) = twot * vc(i - 1) + pc(i - 1) + pc(i - 1) - vc(i - 2); end nv = ncf; end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % interpolate to get velocity for each component %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for i = 1:1:ncm pv(i, 2) = 0; for j = ncf:-1:2 pv(i, 2) = pv(i, 2) + vc(j) * cbuf(j, i, ll); end pv(i, 2) = pv(i, 2) * vfac; end %%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%% function fr = split(tt) % this function breaks a number into a integer % and a fractional part. % input % tt = input number
  • 15. % output % fr = 2-word output array % fr(1) contains integer part % fr(2) contains fractional part % for negative input numbers, fr(1) contains the next % more negative integer; fr(2) contains a positive fraction. fr = zeros(2, 1); fr(1) = fix(tt); fr(2) = tt - fr(1); if (tt >= 0 || fr(2) == 0) return end % make adjustments for negative input number fr(1) = fr(1) - 1; fr(2) = fr(2) + 1; visit us at www.assignmentpedia.com or email us at info@assignmentpedia.com or call us at +1 520 8371215