////////////////////////////////////////////////////////////////
//
// PURPOSE: This contains SimulatorModule parameters for Tethys.
//
// NOTES:   All values (except "strings") must be followed by
//          a unit abbreviation (or one of the unit-like
//          abbreviations: n/a, bool, enum, count).
//
////////////////////////////////////////////////////////////////

   ExternalSim.loadAtStartup         = 0 bool;
   ExternalSim.SimDaemonServer       = "tellum.shore.mbari.org";
   // ExternalSim.SimDaemonServer    = "tethyscode.shore.mbari.org";

   ExternalSimIgnition.loadAtStartup = 1 bool;

   InternalSim.loadAtStartup         = 0 bool;

   NavigationSim.loadAtStartup       = 0 bool;

   InternalEnvSim.loadAtStartup   = 0 bool;
   InternalEnvSim.nc3File         = "";
   // Format of var# entires: "[standard variable name]:[LRAUV unit]"
   InternalEnvSim.var1         = "";
   InternalEnvSim.var2         = "";
   InternalEnvSim.var3         = "";
   InternalEnvSim.var4         = "";
   InternalEnvSim.var5         = "";
   InternalEnvSim.var6         = "";
   // Format of att# setting/override entires: "[global attribute name]:[double value]"
   InternalEnvSim.att1         = "";
   InternalEnvSim.att2         = "";
   InternalEnvSim.att3         = "";
   InternalEnvSim.att4         = "";
   InternalEnvSim.att5         = "";
   InternalEnvSim.att6         = "";
   // If timeAdjust is non-NaN, set first sim time to start of vehicle time plus this value
   InternalEnvSim.timeAdjust   = nan second;


   // Vehicle Initial Conditions:

   Simulator.initLat  =   36.8034 arcdeg; // Initial latitude
   Simulator.initLon  = -121.8222 arcdeg; // Initial longitude

   // Initial Position Vector
   Simulator.initPitch             = 000.0000 arcdeg;   // Pitch wrto LV
   Simulator.initRoll              = 000.0000 arcdeg;   // Roll wrto LV
   Simulator.initYaw               = 000.0000 arcdeg;   // Yaw wrto LV
   Simulator.initZ                 = 0.000000 m;        // Initial depth

   // Initial Rate Vector
   Simulator.initP                 = 000.0000 rad/s;    // Pitch rate wrto LV
   Simulator.initQ                 = 000.0000 rad/s;    // Roll rate wrto LV
   Simulator.initR                 = 000.0000 rad/s;    // Yaw rate wrto LV
   Simulator.initU                 = 0.000000 m/s;      // vel x wrto B
   Simulator.initV                 = 0.000000 m/s;      // vel y wrto B
   Simulator.initW                 = 0.000000 m/s;      // vel z wrto B

   // Initial Vehicle Configuration
   Simulator.initMassPosition      = 0.000000 cm;       // centered
   Simulator.initBuoyancyPosition  = 955.0000 cc;       // full inflated

// Mass Properties:
   Simulator.mass                  = 147.8671 kg;       //Flooded Vehicle mass ( x 9.80665 m/s2 = 1450.0 N)
   Simulator.volume                = 0.144260585365854 m3; //m3 (equals 1450 N buoyancy in 1025 kg/m3 water)
                                                           //excludes buoyancy bladder at default setting

// Stability Derivatives:
   Simulator.effDragCoef           = .21 n/a;           //veh drag in x; related to Xuu
   Simulator.Xuabu                 = -6.2282 kg/m;      //Force Derivative, > -6.98 kg/m because fin drag added separately

// Geometric Parameters (Used only by the simulation)
   Simulator.centerOfMassX         = 0.1181 m;
   Simulator.centerOfMassY         = -0.000236 m;
   Simulator.centerOfMassZ         = 0.006794 m;

   Simulator.centerOfBuoyX         = 0.1181 m;
   Simulator.centerOfBuoyY         = 0.0 m;
   Simulator.centerOfBuoyZ         = 0.0 m;

// Simple geometric model of vehicle (Used at the surface)
   Simulator.cylinderLength        = 2 m;
   Simulator.cylinderRadius        = 6 in;

   Simulator.lowerRudX             = -1.973 m;
   Simulator.lowerRudY             = 0.012 m;
   Simulator.lowerRudZ             = -0.152 m;

   Simulator.upperRudX             = -1.973 m;
   Simulator.upperRudY             = 0.012 m;
   Simulator.upperRudZ             = 0.152 m;

   Simulator.portElevX             = -1.973 m;
   Simulator.portElevY             = -0.152 m;
   Simulator.portElevZ             = 0.0 m;

   Simulator.stbdElevX             = -1.973 m;
   Simulator.stbdElevY             = 0.152 m;
   Simulator.stbdElevZ             = 0.0 m;

   // Thruster parameters
   Simulator.designOmega           = 300 rpm;           //Nominal prop rotation rate
   Simulator.designPropEff         = 0.86 n/a;          //Nominal prop efficiency
   Simulator.designSpeed           = 1.0 m/s;           //Nominal speed
   Simulator.designThrust          = 6.98 N;            //Thrust at nominal omega
   Simulator.designTorque          = 0.23 N-m;          //Thrust at nominal thrust

   // Dropweight1 parameters
   Simulator.dropWt1Mass           = 1.0 kg;            //Mass of the drop weight #1, kg
   Simulator.dropWt1Volume         = 0.0000881 m3;      //Volume of the drop weight #1, m3
   Simulator.dropWt1X              = 0.1655 m;          //X location of the drop weight #1, m
   Simulator.dropWt1Y              = 0.0 m;             //Y location of the drop weight #1, m
   Simulator.dropWt1Z              = -0.20 m;           //Z location of the drop weight #1, m

   // Mass shift control values
   Simulator.movableMass           = 26 kg;             // Kilograms of movable mass (~ 1/3 of vehicle mass )

   Simulator.centerOfMovableMassX = 0.1181 m;
   Simulator.centerOfMovableMassY = -0.000236 m;
   Simulator.centerOfMovableMassZ = 0.006794 m;

   // Mass Properties:

   Simulator.Ixx    =    3.000000 kg-m2;  // Ixx, kg-m^2.
   Simulator.Iyy    =   41.980233 kg-m2;  // Iyy, kg-m^2.
   Simulator.Izz    =   41.980233 kg-m2;  // Izz, kg-m^2.

   // Added Mass:

   Simulator.Kpdot  =    0.000000 kg-m2;  // Kpdot, kg-m^2.
   Simulator.Kvdot  =    0.000000 kg-m;   // Kvdot, kg-m.
   Simulator.Mqdot  =  -33.463086 kg-m2;  // Mqdot, kg-m^2.
   Simulator.Mwdot  =    7.117842 kg-m;   // Mwdot, kg-m.
   Simulator.Nrdot  =  -33.463086 kg-m2;  // Nrdot, kg-m^2.
   Simulator.Nvdot  =   -7.117842 kg-m;   // Nvdot, kg-m.
   Simulator.Xudot  =   -4.876161 kg;     // Xudot, kg.
   Simulator.Ypdot  =    0.000000 kg-m;   // Ypdot, kg-m.
   Simulator.Yrdot  =   -7.117842 kg-m;   // Yrdot, kg-m.
   Simulator.Yvdot  = -126.324739 kg;     // Yvdot, kg.
   Simulator.Zqdot  =    7.117842 kg-m;   // Zqdot, kg-m.
   Simulator.Zwdot  = -126.324739 kg;     // Zwdot, kg.

   // Stability Derivatives:

   Simulator.Kpabp =   -0.191601 kg-m2;  // Kp|p| , kg-m^2
   Simulator.Mpr   =   33.463086 kg-m2;  // Mpr   , kg-m^2
   Simulator.Mqabq = -632.698957 kg-m2;  // Mq|q| , kg-m^2
   Simulator.Muq   =  -61.182063 kg-m;   // Muq   , kg-m
   Simulator.Muw   =  105.660262 kg;     // Muw   , kg
   Simulator.Mwabw =  -58.113144 kg;     // Mw|w| , kg
   Simulator.Npq   =  -33.463086 kg-m2;  // Npq   , kg-m^2
   Simulator.Nrabr = -632.698957 kg-m2;  // Nr|r| , kg-m^2
   Simulator.Nur   =  -61.182063 kg-m;   // Nur   , kg-m
   Simulator.Nuv   = -105.660262 kg;     // Nuv   , kg
   Simulator.Nvabv =   58.113144 kg;     // Nv|v| , kg
   Simulator.Xqq   =    7.117842 kg-m;   // Xqq   , kg-m
   Simulator.Xrr   =    7.117842 kg-m;   // Xrr   , kg-m
   Simulator.Xvr   =  126.324739 kg;     // Xvr   , kg
   Simulator.Xvv   =  -54.370919 kg/m;   // Xvv   , kg/m
   Simulator.Xwq   = -126.324739 kg;     // Xwq   , kg
   Simulator.Xww   =  -54.370919 kg/m;   // Xww   , kg/m
   Simulator.Yrabr =    0.000000 n/a;    // Yr|r| , ?
   Simulator.Yur   =    8.719853 kg;     // Yur   , kg
   Simulator.Yuv   =  -23.954759 kg/m;   // Yuv   , kg/m
   Simulator.Yvabv = -601.274653 kg/m;   // Yv|v| , kg/m
   Simulator.Ywp   =  126.324739 kg-m;   // Ywp   , kg-m
   Simulator.Zqabq =    0.000000 n/a;    // Zq|q| , ?
   Simulator.Zuq   =   -8.719853 kg;     // Zuq   , kg
   Simulator.Zuw   =  -23.954759 kg/m;   // Zuw   , kg/m
   Simulator.Zvp   = -126.324739 kg;     // Zvp   , kg
   Simulator.Zwabw = -601.274653 kg/m;   // Zw|w| , kg/m

   Simulator.Kvt2  =    0.000000 n/a;    // ?     , ?

   // Actuator (Tailcone) Parameters:

   Simulator.stallAngle     =   30.000000 arcdeg;
   Simulator.wideHystRud    =    0.000000 arcdeg;
   Simulator.centerHystRud  =    0.000000 arcdeg;
   Simulator.speedRud       =    7.5      arcdeg/s
   Simulator.wideHystElev   =    0.000000 arcdeg;
   Simulator.centerHystElev =    0.000000 arcdeg;
   Simulator.speedElev      =    7.5      arcdeg/s
   Simulator.aspectRatio    =    6.500000 n/a;
   Simulator.finArea        =    0.012189 m2;
   Simulator.CDc            =    0.030000 n/a;     // Crossflow Coef. of Drag
   Simulator.dCL            =    4.130000 n/a;     // Coef. of Lift Slope


   // Environmental Conditions (nans revert to 4D model):

   Simulator.density               = nan kg/m3;  // i.e., 1025.0 kg/m3 - sea water density.
   Simulator.eastCurrent           = nan m/s;    // vel y wrto LV
   Simulator.magneticVariation     = nan arcdeg; // i.e., 14.0937 arcdeg - if not specified, calculated from lat & lon
   Simulator.mixedLayerDepth       = nan meter;  // i.e., 40 meter - depth of mixed layer
   Simulator.northCurrent          = nan m/s;    // vel x wrto LV
   Simulator.s300                  = nan ppt;    // i.e., 34.2 ppt - salinity at 300 meters.  Linear change from mixed layer depth
   Simulator.sMixed                = nan ppt;    // i.e., 33.5 ppt - salinity at mixed layer depth.  Linear change from surface
   Simulator.soundSpeed            = nan m/s;    // i.e., 1490 m/s - if not specified, calculated from density, pressure
   Simulator.sss                   = nan ppt;    // i.e., 33.2 ppt - sea surface salinity.  Extends to the mixed layer depth
   Simulator.sst                   = nan degC;   // i.e., 16.0 degC - sea surface temperature.  Extends to the mixed layer depth
   Simulator.t300                  = nan degC;   // i.e., 7.0 degC - temperature at 300 meters.  Linear change from mixed layer depth
   Simulator.tMixed                = nan degC;   // i.e., 10.0 degC - temperature at mixed layer depth.  Linear change from surface
   Simulator.vertCurrent           = nan m/s;    // vel z wrto LV (positive down)

   Simulator.oceanModelData        = "Resources/2003080103_mb_l3_las.nc";
   Simulator.defaultDensity        = 1025.0 kg/m3;       // Always specify: used outside of 4D model

   Simulator.centerHystMovableMass = 0.000000 mm;
   Simulator.speedMovableMass      = .70      mm/s
   Simulator.wideHystMovableMass   = 0.000000 mm;

   Simulator.centerHystBuoyancy    = 0.000000 cc;
   Simulator.speedBuoyancy         = 3.0     cc/s
   Simulator.wideHystBuoyancy      = 00.00000 cc;

   Simulator.buoyancyNeutralOffset = 0.00 cc;   // Value added to buoyancy in the ExternalSim to achieve "True" neutral
   Simulator.entrainedAir          = 0.00 cc;   // Amount of entrained air in vehicle
   Simulator.massPositionOffset    = 0.00 mm;   // Value added to mass position in the ExternalSim to achieve "True" zero pitch

   Simulator.bottomLockGone        = 100 meter; // Altitude greater than this value results in loss of bottom lock simulated

   Simulator.numberOfHomingTragets = 3 count;
   Simulator.homingSensorTat       = 0.3 s;     // Turn-around time of the DAT homing sonar.