On Friday 03 June 2011 01:49:30 Gaurav Tendolkar wrote: > I am modelling an battery powered electric motor MAV. > In JSBsim the battery does not discharge. > > 00178 FGElectric::CalcFuelNeed(void)00179 {00180 return 0;00181 } > > now i want to write a code where fuel is the power supplied by battery. > by knowing the total stored energy we will calculate time to discharge. > > How do i make the changes to the code come to effect in flightgear ?
Consuming fuel requires a loss of mass. I'm sure you don't intend that, so I would recommend looking at other methods. Like Curt suggested, you could create your own system using JSBSim functions (recommend) or NASAL. You can use these properties to calculate the power consumed by the engine: propulsion/engine/power-hp propulsion/engine/propeller-rpm (These are JSBSim properties, in FlightGear they are preceded by /fdm/jsbsim/) This code snippet for the JSBSim <FCS> block will reduce the throttle by the normalized battery voltage. Setting the value of (/fdm/jsbsim/)propulsion/battery-volt-norm is left to you. <property value="1.0"> propulsion/battery-volt-norm</property> <channel name="battery"> <pure_gain name="throttle"> <input> fcs/throttle-cmd-norm </input> <gain> propulsion/battery-volt-norm </gain> <output> fcs/throttle-pos-norm </output> </pure_gain> </channel> Good luck, Ron ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Discover what all the cheering's about. Get your free trial download today. http://p.sf.net/sfu/quest-dev2dev2 _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel