1 /*******************************************************************************
3 Header: FGInitialCondition.cpp
7 ------------- Copyright (C) 1999 Anthony K. Peden (apeden@earthlink.net) -------------
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free Software
11 Foundation; either version 2 of the License, or (at your option) any later
14 This program is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 You should have received a copy of the GNU General Public License along with
20 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21 Place - Suite 330, Boston, MA 02111-1307, USA.
23 Further information about the GNU General Public License can also be found on
24 the world wide web at http://www.gnu.org.
28 --------------------------------------------------------------------------------
32 FUNCTIONAL DESCRIPTION
33 --------------------------------------------------------------------------------
35 The purpose of this class is to take a set of initial conditions and provide
36 a kinematically consistent set of body axis velocity components, euler
37 angles, and altitude. This class does not attempt to trim the model i.e.
38 the sim will most likely start in a very dynamic state (unless, of course,
39 you have chosen your IC's wisely) even after setting it up with this class.
41 ********************************************************************************
43 *******************************************************************************/
45 #include "FGInitialCondition.h"
46 #include "FGFDMExec.h"
48 #include "FGAtmosphere.h"
49 #include "FGAerodynamics.h"
51 #include "FGAircraft.h"
52 #include "FGTranslation.h"
53 #include "FGRotation.h"
54 #include "FGPosition.h"
55 #include "FGAuxiliary.h"
57 #include "FGConfigFile.h"
58 #include "FGPropertyManager.h"
60 static const char *IdSrc = "$Id$";
61 static const char *IdHdr = ID_INITIALCONDITION;
63 //******************************************************************************
65 FGInitialCondition::FGInitialCondition(FGFDMExec *FDMExec)
81 sea_level_radius = FDMExec->GetInertial()->RefRadius();
82 radius_to_vehicle = FDMExec->GetInertial()->RefRadius();
85 salpha=sbeta=stheta=sphi=spsi=sgamma=0;
86 calpha=cbeta=ctheta=cphi=cpsi=cgamma=1;
88 if(FDMExec != NULL ) {
90 fdmex->GetPosition()->Seth(altitude);
91 fdmex->GetAtmosphere()->Run();
92 PropertyManager=fdmex->GetPropertyManager();
95 cout << "FGInitialCondition: This class requires a pointer to a valid FGFDMExec object" << endl;
101 //******************************************************************************
103 FGInitialCondition::~FGInitialCondition()
109 //******************************************************************************
111 void FGInitialCondition::SetVcalibratedKtsIC(double tt) {
113 if(getMachFromVcas(&mach,tt*ktstofps)) {
114 //cout << "Mach: " << mach << endl;
117 vt=mach*fdmex->GetAtmosphere()->GetSoundSpeed();
118 ve=vt*sqrt(fdmex->GetAtmosphere()->GetDensityRatio());
119 //cout << "Vt: " << vt*fpstokts << " Vc: " << vc*fpstokts << endl;
122 cout << "Failed to get Mach number for given Vc and altitude, Vc unchanged." << endl;
123 cout << "Please mail the set of initial conditions used to apeden@earthlink.net" << endl;
127 //******************************************************************************
129 void FGInitialCondition::SetVequivalentKtsIC(double tt) {
132 vt=ve*1/sqrt(fdmex->GetAtmosphere()->GetDensityRatio());
133 mach=vt/fdmex->GetAtmosphere()->GetSoundSpeed();
137 //******************************************************************************
139 void FGInitialCondition::SetVgroundFpsIC(double tt) {
145 vnorth = vg*cos(psi); veast = vg*sin(psi); vdown = 0;
147 ua = u + uw; va = v + vw; wa = w + ww;
148 vt = sqrt( ua*ua + va*va + wa*wa );
150 vxz = sqrt( u*u + w*w );
151 if( w != 0 ) alpha = atan2( w, u );
152 if( vxz != 0 ) beta = atan2( v, vxz );
153 mach=vt/fdmex->GetAtmosphere()->GetSoundSpeed();
155 ve=vt*sqrt(fdmex->GetAtmosphere()->GetDensityRatio());
158 //******************************************************************************
160 void FGInitialCondition::SetVtrueFpsIC(double tt) {
163 mach=vt/fdmex->GetAtmosphere()->GetSoundSpeed();
165 ve=vt*sqrt(fdmex->GetAtmosphere()->GetDensityRatio());
168 //******************************************************************************
170 void FGInitialCondition::SetMachIC(double tt) {
172 lastSpeedSet=setmach;
173 vt=mach*fdmex->GetAtmosphere()->GetSoundSpeed();
175 ve=vt*sqrt(fdmex->GetAtmosphere()->GetDensityRatio());
176 //cout << "Vt: " << vt*fpstokts << " Vc: " << vc*fpstokts << endl;
179 //******************************************************************************
181 void FGInitialCondition::SetClimbRateFpmIC(double tt) {
182 SetClimbRateFpsIC(tt/60.0);
185 //******************************************************************************
187 void FGInitialCondition::SetClimbRateFpsIC(double tt) {
192 sgamma=sin(gamma); cgamma=cos(gamma);
196 //******************************************************************************
198 void FGInitialCondition::SetFlightPathAngleRadIC(double tt) {
200 sgamma=sin(gamma); cgamma=cos(gamma);
205 //******************************************************************************
207 void FGInitialCondition::SetAlphaRadIC(double tt) {
209 salpha=sin(alpha); calpha=cos(alpha);
213 //******************************************************************************
215 void FGInitialCondition::SetPitchAngleRadIC(double tt) {
217 stheta=sin(theta); ctheta=cos(theta);
221 //******************************************************************************
223 void FGInitialCondition::SetBetaRadIC(double tt) {
225 sbeta=sin(beta); cbeta=cos(beta);
230 //******************************************************************************
232 void FGInitialCondition::SetRollAngleRadIC(double tt) {
234 sphi=sin(phi); cphi=cos(phi);
238 //******************************************************************************
240 void FGInitialCondition::SetTrueHeadingRadIC(double tt) {
242 spsi=sin(psi); cpsi=cos(psi);
246 //******************************************************************************
248 void FGInitialCondition::SetUBodyFpsIC(double tt) {
250 vt=sqrt(u*u + v*v + w*w);
254 //******************************************************************************
256 void FGInitialCondition::SetVBodyFpsIC(double tt) {
258 vt=sqrt(u*u + v*v + w*w);
262 //******************************************************************************
264 void FGInitialCondition::SetWBodyFpsIC(double tt) {
266 vt=sqrt( u*u + v*v + w*w );
270 //******************************************************************************
272 double FGInitialCondition::GetUBodyFpsIC(void) {
273 if(lastSpeedSet == setvg )
276 return vt*calpha*cbeta - uw;
279 //******************************************************************************
281 double FGInitialCondition::GetVBodyFpsIC(void) {
282 if( lastSpeedSet == setvg )
285 return vt*sbeta - vw;
289 //******************************************************************************
291 double FGInitialCondition::GetWBodyFpsIC(void) {
292 if( lastSpeedSet == setvg )
295 return vt*salpha*cbeta -ww;
298 //******************************************************************************
300 void FGInitialCondition::SetWindNEDFpsIC(double wN, double wE, double wD ) {
301 wnorth = wN; weast = wE; wdown = wD;
302 lastWindSet = setwned;
304 if(lastSpeedSet == setvg)
308 //******************************************************************************
310 // positive from left
311 void FGInitialCondition::SetHeadWindKtsIC(double head){
315 if(lastSpeedSet == setvg)
320 //******************************************************************************
322 void FGInitialCondition::SetCrossWindKtsIC(double cross){
323 wcross=cross*ktstofps;
326 if(lastSpeedSet == setvg)
331 //******************************************************************************
333 void FGInitialCondition::SetWindDownKtsIC(double wD) {
336 if(lastSpeedSet == setvg)
340 //******************************************************************************
342 void FGInitialCondition::SetWindMagKtsIC(double mag) {
346 if(lastSpeedSet == setvg)
350 //******************************************************************************
352 void FGInitialCondition::SetWindDirDegIC(double dir) {
356 if(lastSpeedSet == setvg)
361 //******************************************************************************
363 void FGInitialCondition::calcWindUVW(void) {
365 switch(lastWindSet) {
367 wnorth=wmag*cos(wdir);
368 weast=wmag*sin(wdir);
371 wnorth=whead*cos(psi) + wcross*cos(psi+M_PI/2);
372 weast=whead*sin(psi) + wcross*sin(psi+M_PI/2);
377 uw=wnorth*ctheta*cpsi +
380 vw=wnorth*( sphi*stheta*cpsi - cphi*spsi ) +
381 weast*( sphi*stheta*spsi + cphi*cpsi ) +
383 ww=wnorth*(cphi*stheta*cpsi + sphi*spsi) +
384 weast*(cphi*stheta*spsi - sphi*cpsi) +
388 /* cout << "FGInitialCondition::calcWindUVW: wnorth, weast, wdown "
389 << wnorth << ", " << weast << ", " << wdown << endl;
390 cout << "FGInitialCondition::calcWindUVW: theta, phi, psi "
391 << theta << ", " << phi << ", " << psi << endl;
392 cout << "FGInitialCondition::calcWindUVW: uw, vw, ww "
393 << uw << ", " << vw << ", " << ww << endl; */
397 //******************************************************************************
399 void FGInitialCondition::SetAltitudeFtIC(double tt) {
401 fdmex->GetPosition()->Seth(altitude);
402 fdmex->GetAtmosphere()->Run();
403 //lets try to make sure the user gets what they intended
405 switch(lastSpeedSet) {
409 SetVtrueKtsIC(vt*fpstokts);
412 SetVcalibratedKtsIC(vc*fpstokts);
415 SetVequivalentKtsIC(ve*fpstokts);
426 //******************************************************************************
428 void FGInitialCondition::SetAltitudeAGLFtIC(double tt) {
429 fdmex->GetPosition()->SetDistanceAGL(tt);
430 altitude=fdmex->GetPosition()->Geth();
431 SetAltitudeFtIC(altitude);
434 //******************************************************************************
436 void FGInitialCondition::SetSeaLevelRadiusFtIC(double tt) {
437 sea_level_radius = tt;
440 //******************************************************************************
442 void FGInitialCondition::SetTerrainAltitudeFtIC(double tt) {
446 //******************************************************************************
448 void FGInitialCondition::calcUVWfromNED(void) {
449 u=vnorth*ctheta*cpsi +
452 v=vnorth*( sphi*stheta*cpsi - cphi*spsi ) +
453 veast*( sphi*stheta*spsi + cphi*cpsi ) +
455 w=vnorth*( cphi*stheta*cpsi + sphi*spsi ) +
456 veast*( cphi*stheta*spsi - sphi*cpsi ) +
460 //******************************************************************************
462 void FGInitialCondition::SetVnorthFpsIC(double tt) {
465 vt=sqrt(u*u + v*v + w*w);
469 //******************************************************************************
471 void FGInitialCondition::SetVeastFpsIC(double tt) {
474 vt=sqrt(u*u + v*v + w*w);
478 //******************************************************************************
480 void FGInitialCondition::SetVdownFpsIC(double tt) {
483 vt=sqrt(u*u + v*v + w*w);
484 SetClimbRateFpsIC(-1*vdown);
488 //******************************************************************************
490 bool FGInitialCondition::getMachFromVcas(double *Mach,double vcas) {
496 sfunc=&FGInitialCondition::calcVcas;
497 if(findInterval(vcas,guess)) {
498 if(solve(&mach,vcas))
504 //******************************************************************************
506 bool FGInitialCondition::getAlpha(void) {
508 double guess=theta-gamma;
510 if(vt < 0.01) return 0;
513 xmin=fdmex->GetAerodynamics()->GetAlphaCLMin();
514 xmax=fdmex->GetAerodynamics()->GetAlphaCLMax();
515 sfunc=&FGInitialCondition::GammaEqOfAlpha;
516 if(findInterval(0,guess)){
527 //******************************************************************************
529 bool FGInitialCondition::getTheta(void) {
531 double guess=alpha+gamma;
533 if(vt < 0.01) return 0;
537 sfunc=&FGInitialCondition::GammaEqOfTheta;
538 if(findInterval(0,guess)){
549 //******************************************************************************
551 double FGInitialCondition::GammaEqOfTheta(double Theta) {
553 double sTheta,cTheta;
555 //theta=Theta; stheta=sin(theta); ctheta=cos(theta);
556 sTheta=sin(Theta); cTheta=cos(Theta);
558 a=wdown + vt*calpha*cbeta + uw;
559 b=vt*sphi*sbeta + vw*sphi;
560 c=vt*cphi*salpha*cbeta + ww*cphi;
561 return vt*sgamma - ( a*sTheta - (b+c)*cTheta);
564 //******************************************************************************
566 double FGInitialCondition::GammaEqOfAlpha(double Alpha) {
568 double sAlpha,cAlpha;
569 sAlpha=sin(Alpha); cAlpha=cos(Alpha);
570 a=wdown + vt*cAlpha*cbeta + uw;
571 b=vt*sphi*sbeta + vw*sphi;
572 c=vt*cphi*sAlpha*cbeta + ww*cphi;
574 return vt*sgamma - ( a*stheta - (b+c)*ctheta );
577 //******************************************************************************
579 double FGInitialCondition::calcVcas(double Mach) {
581 double p=fdmex->GetAtmosphere()->GetPressure();
582 double psl=fdmex->GetAtmosphere()->GetPressureSL();
583 double rhosl=fdmex->GetAtmosphere()->GetDensitySL();
584 double pt,A,B,D,vcas;
586 if(Mach < 1) //calculate total pressure assuming isentropic flow
587 pt=p*pow((1 + 0.2*Mach*Mach),3.5);
589 // shock in front of pitot tube, we'll assume its normal and use
590 // the Rayleigh Pitot Tube Formula, i.e. the ratio of total
591 // pressure behind the shock to the static pressure in front
594 //the normal shock assumption should not be a bad one -- most supersonic
595 //aircraft place the pitot probe out front so that it is the forward
596 //most point on the aircraft. The real shock would, of course, take
597 //on something like the shape of a rounded-off cone but, here again,
598 //the assumption should be good since the opening of the pitot probe
599 //is very small and, therefore, the effects of the shock curvature
600 //should be small as well. AFAIK, this approach is fairly well accepted
601 //within the aerospace community
603 B = 5.76*Mach*Mach/(5.6*Mach*Mach - 0.8);
605 // The denominator above is zero for Mach ~ 0.38, for which
606 // we'll never be here, so we're safe
608 D = (2.8*Mach*Mach-0.4)*0.4167;
612 A = pow(((pt-p)/psl+1),0.28571);
613 vcas = sqrt(7*psl/rhosl*(A-1));
614 //cout << "calcVcas: vcas= " << vcas*fpstokts << " mach= " << Mach << " pressure: " << pt << endl;
618 //******************************************************************************
620 bool FGInitialCondition::findInterval(double x,double guess) {
621 //void find_interval(inter_params &ip,eqfunc f,double y,double constant, int &flag){
625 double flo,fhi,fguess;
628 fguess=(this->*sfunc)(guess)-x;
634 if(lo < xmin) lo=xmin;
635 if(hi > xmax) hi=xmax;
637 flo=(this->*sfunc)(lo)-x;
638 fhi=(this->*sfunc)(hi)-x;
639 if(flo*fhi <=0) { //found interval with root
641 if(flo*fguess <= 0) { //narrow interval down a bit
642 hi=lo+step; //to pass solver interval that is as
645 else if(fhi*fguess <= 0) {
649 //cout << "findInterval: i=" << i << " Lo= " << lo << " Hi= " << hi << endl;
651 while((found == 0) && (i <= 100));
657 //******************************************************************************
659 bool FGInitialCondition::solve(double *y,double x)
661 double x1,x2,x3,f1,f2,f3,d,d0;
663 double const relax =0.9;
671 f1=(this->*sfunc)(x1)-x;
672 f3=(this->*sfunc)(x3)-x;
677 while ((fabs(d) > eps) && (i < 100)) {
679 x2 = x1-d*d0*f1/(f3-f1);
681 f2=(this->*sfunc)(x2)-x;
682 //cout << "solve x1,x2,x3: " << x1 << "," << x2 << "," << x3 << endl;
683 //cout << " " << f1 << "," << f2 << "," << f3 << endl;
685 if(fabs(f2) <= 0.001) {
687 } else if(f1*f2 <= 0.0) {
691 } else if(f2*f3 <= 0) {
704 //cout << "Success= " << success << " Vcas: " << vcas*fpstokts << " Mach: " << x2 << endl;
708 //******************************************************************************
710 double FGInitialCondition::GetWindDirDegIC(void) {
712 return atan2(weast,wnorth)*radtodeg;
719 //******************************************************************************
721 bool FGInitialCondition::Load(string rstfile, bool useStoredPath)
733 if( useStoredPath ) {
734 string acpath = fdmex->GetAircraftPath() + sep + fdmex->GetModelName();
735 resetDef = acpath + sep + rstfile + ".xml";
740 FGConfigFile resetfile(resetDef);
741 if (!resetfile.IsOpen()) {
742 cerr << "Failed to open reset file: " << resetDef << endl;
746 resetfile.GetNextConfigLine();
747 token = resetfile.GetValue();
748 if (token != string("initialize")) {
749 cerr << "The reset file " << resetDef
750 << " does not appear to be a reset file" << endl;
754 resetfile.GetNextConfigLine();
756 while (token != string("/initialize") && token != string("EOF")) {
757 if (token == "UBODY" ) { resetfile >> temp; SetUBodyFpsIC(temp); }
758 if (token == "VBODY" ) { resetfile >> temp; SetVBodyFpsIC(temp); }
759 if (token == "WBODY" ) { resetfile >> temp; SetWBodyFpsIC(temp); }
760 if (token == "LATITUDE" ) { resetfile >> temp; SetLatitudeDegIC(temp); }
761 if (token == "LONGITUDE" ) { resetfile >> temp; SetLongitudeDegIC(temp); }
762 if (token == "PHI" ) { resetfile >> temp; SetRollAngleDegIC(temp); }
763 if (token == "THETA" ) { resetfile >> temp; SetPitchAngleDegIC(temp); }
764 if (token == "PSI" ) { resetfile >> temp; SetTrueHeadingDegIC(temp); }
765 if (token == "ALPHA" ) { resetfile >> temp; SetAlphaDegIC(temp); }
766 if (token == "BETA" ) { resetfile >> temp; SetBetaDegIC(temp); }
767 if (token == "GAMMA" ) { resetfile >> temp; SetFlightPathAngleDegIC(temp); }
768 if (token == "ROC" ) { resetfile >> temp; SetClimbRateFpmIC(temp); }
769 if (token == "ALTITUDE" ) { resetfile >> temp; SetAltitudeFtIC(temp); }
770 if (token == "WINDDIR" ) { resetfile >> temp; SetWindDirDegIC(temp); }
771 if (token == "VWIND" ) { resetfile >> temp; SetWindMagKtsIC(temp); }
772 if (token == "HWIND" ) { resetfile >> temp; SetHeadWindKtsIC(temp); }
773 if (token == "XWIND" ) { resetfile >> temp; SetCrossWindKtsIC(temp); }
774 if (token == "VC" ) { resetfile >> temp; SetVcalibratedKtsIC(temp); }
775 if (token == "MACH" ) { resetfile >> temp; SetMachIC(temp); }
776 if (token == "VGROUND" ) { resetfile >> temp; SetVgroundKtsIC(temp); }
785 //******************************************************************************
787 void FGInitialCondition::bind(void){
788 PropertyManager->Tie("ic/vc-kts", this,
789 &FGInitialCondition::GetVcalibratedKtsIC,
790 &FGInitialCondition::SetVcalibratedKtsIC,
792 PropertyManager->Tie("ic/ve-kts", this,
793 &FGInitialCondition::GetVequivalentKtsIC,
794 &FGInitialCondition::SetVequivalentKtsIC,
796 PropertyManager->Tie("ic/vg-kts", this,
797 &FGInitialCondition::GetVgroundKtsIC,
798 &FGInitialCondition::SetVgroundKtsIC,
800 PropertyManager->Tie("ic/vt-kts", this,
801 &FGInitialCondition::GetVtrueKtsIC,
802 &FGInitialCondition::SetVtrueKtsIC,
804 PropertyManager->Tie("ic/mach-norm", this,
805 &FGInitialCondition::GetMachIC,
806 &FGInitialCondition::SetMachIC,
808 PropertyManager->Tie("ic/roc-fpm", this,
809 &FGInitialCondition::GetClimbRateFpmIC,
810 &FGInitialCondition::SetClimbRateFpmIC,
812 PropertyManager->Tie("ic/gamma-deg", this,
813 &FGInitialCondition::GetFlightPathAngleDegIC,
814 &FGInitialCondition::SetFlightPathAngleDegIC,
816 PropertyManager->Tie("ic/alpha-deg", this,
817 &FGInitialCondition::GetAlphaDegIC,
818 &FGInitialCondition::SetAlphaDegIC,
820 PropertyManager->Tie("ic/beta-deg", this,
821 &FGInitialCondition::GetBetaDegIC,
822 &FGInitialCondition::SetBetaDegIC,
824 PropertyManager->Tie("ic/theta-deg", this,
825 &FGInitialCondition::GetPitchAngleDegIC,
826 &FGInitialCondition::SetPitchAngleDegIC,
828 PropertyManager->Tie("ic/phi-deg", this,
829 &FGInitialCondition::GetRollAngleDegIC,
830 &FGInitialCondition::SetRollAngleDegIC,
832 PropertyManager->Tie("ic/psi-true-deg", this,
833 &FGInitialCondition::GetHeadingDegIC );
834 PropertyManager->Tie("ic/lat-gc-deg", this,
835 &FGInitialCondition::GetLatitudeDegIC,
836 &FGInitialCondition::SetLatitudeDegIC,
838 PropertyManager->Tie("ic/long-gc-deg", this,
839 &FGInitialCondition::GetLongitudeDegIC,
840 &FGInitialCondition::SetLongitudeDegIC,
842 PropertyManager->Tie("ic/h-sl-ft", this,
843 &FGInitialCondition::GetAltitudeFtIC,
844 &FGInitialCondition::SetAltitudeFtIC,
846 PropertyManager->Tie("ic/h-agl-ft", this,
847 &FGInitialCondition::GetAltitudeAGLFtIC,
848 &FGInitialCondition::SetAltitudeAGLFtIC,
850 PropertyManager->Tie("ic/sea-level-radius-ft", this,
851 &FGInitialCondition::GetSeaLevelRadiusFtIC,
852 &FGInitialCondition::SetSeaLevelRadiusFtIC,
854 PropertyManager->Tie("ic/terrain-altitude-ft", this,
855 &FGInitialCondition::GetTerrainAltitudeFtIC,
856 &FGInitialCondition::SetTerrainAltitudeFtIC,
858 PropertyManager->Tie("ic/vg-fps", this,
859 &FGInitialCondition::GetVgroundFpsIC,
860 &FGInitialCondition::SetVgroundFpsIC,
862 PropertyManager->Tie("ic/vt-fps", this,
863 &FGInitialCondition::GetVtrueFpsIC,
864 &FGInitialCondition::SetVtrueFpsIC,
866 PropertyManager->Tie("ic/vw-bx-fps", this,
867 &FGInitialCondition::GetWindUFpsIC);
868 PropertyManager->Tie("ic/vw-by-fps", this,
869 &FGInitialCondition::GetWindVFpsIC);
870 PropertyManager->Tie("ic/vw-bz-fps", this,
871 &FGInitialCondition::GetWindWFpsIC);
872 PropertyManager->Tie("ic/vw-north-fps", this,
873 &FGInitialCondition::GetWindNFpsIC);
874 PropertyManager->Tie("ic/vw-east-fps", this,
875 &FGInitialCondition::GetWindEFpsIC);
876 PropertyManager->Tie("ic/vw-down-fps", this,
877 &FGInitialCondition::GetWindDFpsIC);
878 PropertyManager->Tie("ic/vw-mag-fps", this,
879 &FGInitialCondition::GetWindFpsIC);
880 /* PropertyManager->Tie("ic/vw-dir-deg", this,
881 &FGInitialCondition::GetWindDirDegIC,
882 &FGInitialCondition::SetWindDirDegIC,
885 PropertyManager->Tie("ic/roc-fps", this,
886 &FGInitialCondition::GetClimbRateFpsIC,
887 &FGInitialCondition::SetClimbRateFpsIC,
889 /* PropertyManager->Tie("ic/u-fps", this,
890 &FGInitialCondition::GetUBodyFpsIC,
891 &FGInitialCondition::SetUBodyFpsIC,
893 PropertyManager->Tie("ic/v-fps", this,
894 &FGInitialCondition::GetVBodyFpsIC,
895 &FGInitialCondition::SetVBodyFpsIC,
897 PropertyManager->Tie("ic/w-fps", this,
898 &FGInitialCondition::GetWBodyFpsIC,
899 &FGInitialCondition::SetWBodyFpsIC,
902 PropertyManager->Tie("ic/gamma-rad", this,
903 &FGInitialCondition::GetFlightPathAngleRadIC,
904 &FGInitialCondition::SetFlightPathAngleRadIC,
906 PropertyManager->Tie("ic/alpha-rad", this,
907 &FGInitialCondition::GetAlphaRadIC,
908 &FGInitialCondition::SetAlphaRadIC,
910 PropertyManager->Tie("ic/theta-rad", this,
911 &FGInitialCondition::GetPitchAngleRadIC,
912 &FGInitialCondition::SetPitchAngleRadIC,
914 PropertyManager->Tie("ic/beta-rad", this,
915 &FGInitialCondition::GetBetaRadIC,
916 &FGInitialCondition::SetBetaRadIC,
918 PropertyManager->Tie("ic/phi-rad", this,
919 &FGInitialCondition::GetRollAngleRadIC,
920 &FGInitialCondition::SetRollAngleRadIC,
922 PropertyManager->Tie("ic/psi-true-rad", this,
923 &FGInitialCondition::GetHeadingRadIC);
924 PropertyManager->Tie("ic/lat-gc-rad", this,
925 &FGInitialCondition::GetLatitudeRadIC,
926 &FGInitialCondition::SetLatitudeRadIC,
928 PropertyManager->Tie("ic/long-gc-rad", this,
929 &FGInitialCondition::GetLongitudeRadIC,
930 &FGInitialCondition::SetLongitudeRadIC,
934 //******************************************************************************
936 void FGInitialCondition::unbind(void){
937 PropertyManager->Untie("ic/vc-kts");
938 PropertyManager->Untie("ic/ve-kts");
939 PropertyManager->Untie("ic/vg-kts");
940 PropertyManager->Untie("ic/vt-kts");
941 PropertyManager->Untie("ic/mach-norm");
942 PropertyManager->Untie("ic/roc-fpm");
943 PropertyManager->Untie("ic/gamma-deg");
944 PropertyManager->Untie("ic/alpha-deg");
945 PropertyManager->Untie("ic/beta-deg");
946 PropertyManager->Untie("ic/theta-deg");
947 PropertyManager->Untie("ic/phi-deg");
948 PropertyManager->Untie("ic/psi-true-deg");
949 PropertyManager->Untie("ic/lat-gc-deg");
950 PropertyManager->Untie("ic/long-gc-deg");
951 PropertyManager->Untie("ic/h-sl-ft");
952 PropertyManager->Untie("ic/h-agl-ft");
953 PropertyManager->Untie("ic/sea-level-radius-ft");
954 PropertyManager->Untie("ic/terrain-altitude-ft");
955 PropertyManager->Untie("ic/vg-fps");
956 PropertyManager->Untie("ic/vt-fps");
957 PropertyManager->Untie("ic/vw-bx-fps");
958 PropertyManager->Untie("ic/vw-by-fps");
959 PropertyManager->Untie("ic/vw-bz-fps");
960 PropertyManager->Untie("ic/vw-north-fps");
961 PropertyManager->Untie("ic/vw-east-fps");
962 PropertyManager->Untie("ic/vw-down-fps");
963 PropertyManager->Untie("ic/vw-mag-fps");
964 /* PropertyManager->Untie("ic/vw-dir-deg"); */
966 PropertyManager->Untie("ic/roc-fps");
968 /* PropertyManager->Untie("ic/u-fps");
969 PropertyManager->Untie("ic/v-fps");
970 PropertyManager->Untie("ic/w-fps"); */
972 PropertyManager->Untie("ic/gamma-rad");
973 PropertyManager->Untie("ic/alpha-rad");
974 PropertyManager->Untie("ic/theta-rad");
975 PropertyManager->Untie("ic/beta-rad");
976 PropertyManager->Untie("ic/phi-rad");
977 PropertyManager->Untie("ic/psi-true-rad");
978 PropertyManager->Untie("ic/lat-gc-rad");
979 PropertyManager->Untie("ic/long-gc-rad");
982 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
983 // The bitmasked value choices are as follows:
984 // unset: In this case (the default) JSBSim would only print
985 // out the normally expected messages, essentially echoing
986 // the config files as they are read. If the environment
987 // variable is not set, debug_lvl is set to 1 internally
988 // 0: This requests JSBSim not to output any messages
990 // 1: This value explicity requests the normal JSBSim
992 // 2: This value asks for a message to be printed out when
993 // a class is instantiated
994 // 4: When this value is set, a message is displayed when a
995 // FGModel object executes its Run() method
996 // 8: When this value is set, various runtime state variables
997 // are printed out periodically
998 // 16: When set various parameters are sanity checked and
999 // a message is printed out when they go out of bounds
1001 void FGInitialCondition::Debug(int from)
1003 if (debug_lvl <= 0) return;
1005 if (debug_lvl & 1) { // Standard console startup message output
1007 if (debug_lvl & 2 ) { // Instantiation/Destruction notification
1008 if (from == 0) cout << "Instantiated: FGInitialCondition" << endl;
1009 if (from == 1) cout << "Destroyed: FGInitialCondition" << endl;
1011 if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
1013 if (debug_lvl & 8 ) { // Runtime state variables
1015 if (debug_lvl & 16) { // Sanity checking
1017 if (debug_lvl & 64) {
1018 if (from == 0) { // Constructor
1019 cout << IdSrc << endl;
1020 cout << IdHdr << endl;