dspace function
Implementation
Map<String, dynamic> dspace(Map<String, dynamic> options) {
final irez = options['irez'];
final d2201 = options['d2201'];
final d2211 = options['d2211'];
final d3210 = options['d3210'];
final d3222 = options['d3222'];
final d4410 = options['d4410'];
final d4422 = options['d4422'];
final d5220 = options['d5220'];
final d5232 = options['d5232'];
final d5421 = options['d5421'];
final d5433 = options['d5433'];
final dedt = options['dedt'];
final del1 = options['del1'];
final del2 = options['del2'];
final del3 = options['del3'];
final didt = options['didt'];
final dmdt = options['dmdt'];
final dnodt = options['dnodt'];
final domdt = options['domdt'];
final argpo = options['argpo'];
final argpdot = options['argpdot'];
final t = options['t'];
final tc = options['tc'];
final gsto = options['gsto'];
final xfact = options['xfact'];
final xlamo = options['xlamo'];
final no = options['no'];
var atime = options['atime'];
var em = options['em'];
var argpm = options['argpm'];
var inclm = options['inclm'];
var xli = options['xli'];
var mm = options['mm'];
var xni = options['xni'];
var nodem = options['nodem'];
var nm = options['nm'];
final fasx2 = 0.13130908;
final fasx4 = 2.8843198;
final fasx6 = 0.37448087;
final g22 = 5.7686396;
final g32 = 0.95240898;
final g44 = 1.8014998;
final g52 = 1.0508330;
final g54 = 4.4108898;
final rptim =
4.37526908801129966e-3;
final stepp = 720.0;
final stepn = -720.0;
final step2 = 259200.0;
var delt;
var x2li;
var x2omi;
var xl;
var xldot;
var xnddt;
var xndt;
var xomi;
var dndt = 0.0;
var ft = 0.0;
final theta = (gsto + (tc * rptim)) % twoPi;
em += dedt * t;
inclm += didt * t;
argpm += domdt * t;
nodem += dnodt * t;
mm += dmdt * t;
if (irez != 0) {
if (atime == 0.0 || t * atime <= 0.0 || abs(t) < abs(atime)) {
atime = 0.0;
xni = no;
xli = xlamo;
}
if (t > 0.0) {
delt = stepp;
} else {
delt = stepn;
}
var iretn = 381;
while (iretn == 381) {
if (irez != 2) {
xndt = (del1 * Math.sin(xli - fasx2)) +
(del2 * Math.sin(2.0 * (xli - fasx4))) +
(del3 * Math.sin(3.0 * (xli - fasx6)));
xldot = xni + xfact;
xnddt = (del1 * Math.cos(xli - fasx2)) +
(2.0 * del2 * Math.cos(2.0 * (xli - fasx4))) +
(3.0 * del3 * Math.cos(3.0 * (xli - fasx6)));
xnddt *= xldot;
} else {
xomi = argpo + (argpdot * atime);
x2omi = xomi + xomi;
x2li = xli + xli;
xndt = (d2201 * Math.sin((x2omi + xli) - g22)) +
(d2211 * Math.sin(xli - g22)) +
(d3210 * Math.sin((xomi + xli) - g32)) +
(d3222 * Math.sin((-xomi + xli) - g32)) +
(d4410 * Math.sin((x2omi + x2li) - g44)) +
(d4422 * Math.sin(x2li - g44)) +
(d5220 * Math.sin((xomi + xli) - g52)) +
(d5232 * Math.sin((-xomi + xli) - g52)) +
(d5421 * Math.sin((xomi + x2li) - g54)) +
(d5433 * Math.sin((-xomi + x2li) - g54));
xldot = xni + xfact;
xnddt = (d2201 * Math.cos((x2omi + xli) - g22)) +
(d2211 * Math.cos(xli - g22)) +
(d3210 * Math.cos((xomi + xli) - g32)) +
(d3222 * Math.cos((-xomi + xli) - g32)) +
(d5220 * Math.cos((xomi + xli) - g52)) +
(d5232 * Math.cos((-xomi + xli) - g52)) +
(2.0 * d4410 * Math.cos((x2omi + x2li) - g44)) +
(d4422 * Math.cos(x2li - g44)) +
(d5421 * Math.cos((xomi + x2li) - g54)) +
(d5433 * Math.cos((-xomi + x2li) - g54));
xnddt *= xldot;
}
if (abs(t - atime) >= stepp) {
iretn = 381;
} else {
ft = t - atime;
iretn = 0;
}
if (iretn == 381) {
xli += (xldot * delt) + (xndt * step2);
xni += (xndt * delt) + (xnddt * step2);
atime += delt;
}
}
nm = xni + (xndt * ft) + (xnddt * ft * ft * 0.5);
xl = xli + (xldot * ft) + (xndt * ft * ft * 0.5);
if (irez != 1) {
mm = (xl - (2.0 * nodem)) + (2.0 * theta);
dndt = nm - no;
} else {
mm = (xl - nodem - argpm) + theta;
dndt = nm - no;
}
nm = no + dndt;
}
return {
'atime': atime,
'em': em,
'argpm': argpm,
'inclm': inclm,
'xli': xli,
'mm': mm,
'xni': xni,
'nodem': nodem,
'dndt': dndt,
'nm': nm,
};
}