<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.flightgear.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dany9a3</id>
	<title>FlightGear wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.flightgear.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dany9a3"/>
	<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/Special:Contributions/Dany9a3"/>
	<updated>2026-04-05T16:30:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Bendix/King_KAP140_Autopilot&amp;diff=135736</id>
		<title>Bendix/King KAP140 Autopilot</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Bendix/King_KAP140_Autopilot&amp;diff=135736"/>
		<updated>2022-10-20T14:25:51Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''''Bendix/King KAP 140''''' '''Two Axis/Altitude Preselect Autopilot System''' is the [[autopilot]] of the default [[Cessna 172]], controlling the [[elevator]] and [[aileron]]s.&lt;br /&gt;
&lt;br /&gt;
== Quick Guide ==&lt;br /&gt;
[[File:KAP140.jpg|KAP140 Two Axis with Preselect Altitude]]&lt;br /&gt;
&lt;br /&gt;
Normally the autopilot boots as soon as the electrical system has power&amp;lt;ref&amp;gt;newer models simulate preflight checks, so it's not immediately available after power-on.&amp;lt;/ref&amp;gt;. It is commonly wired to an electrical avionics bus and secured by a dedicated breaker; if it stays dark, check power, avionics bus switches and the breaker.&lt;br /&gt;
&lt;br /&gt;
# To activate the autopilot in wings level (ROL) and vertical speed (VS) modes press the AP button&amp;lt;ref&amp;gt;hold for 0.25 seconds on newer models&amp;lt;/ref&amp;gt;. The autopilot will try to keep the wings level by keeping the turn rate at zero. The autopilot will also try to maintain the vertical speed at activation. Use the UP and DN buttons to set the desired vertical speed.&lt;br /&gt;
# With the autopilot active you can use the HDG button to toggle between wings level (ROL) and heading select (HDG) modes. In heading select mode the autopilot will try to maintain the heading selected by the heading bug on the directional gyro.&lt;br /&gt;
# Use NAV button to toggle between navigation mode (NAV) and wings level (ROL) mode. NAV mode is flying to NAV1 or GPS. That is one of the Heading modes in KAP140 that direction when heading bug OBS operated. Please be careful.&lt;br /&gt;
# Toggle other mode and approach (APR) mode when APR button pushed and following marker beacon, VOR, GPS and [[ILS]] (localizer and glide slope) for automatic approach. This mode is recommended for instrument approach.&lt;br /&gt;
# The REV button enables the back course mode having the autopilot flying away from the runway. This mode is like APR mode except that the direction is away from the localizer (LOC) and that glide slope (GS) is not used.&lt;br /&gt;
# Use the ALT button to toggle between vertical speed (VS) and altitude hold (ALT) modes. In altitude hold mode the UP and DN buttons change the altitude by 20 feet per press.&lt;br /&gt;
# The ARM button enables altitude preselect by the rotary knob using procedure below, pushing it again disables altitude preselect.&lt;br /&gt;
## Input the current atmospheric pressure using the BARO button and rotary knob&lt;br /&gt;
## Check that the display is showing altitude and set your desired altitude, using the rotary knob. &lt;br /&gt;
## Set your desired vertical speed using UP and DN button.&lt;br /&gt;
## Press the ARM button that is enable ARM mode.&lt;br /&gt;
# The BARO button sets the atmospheric pressure. When the BARO button is pushed, enter desired atmospheric pressure using the rotary dial/knob. When pushed long, it switches the setting display to hPa (and back)&amp;lt;ref&amp;gt;only on newer simulated models&amp;lt;/ref&amp;gt; (hint: you can do InHG&amp;lt;&amp;gt;hPa conversion easily with this)&lt;br /&gt;
# Press the AP button to deactivate the autopilot. The horizontal and vertical modes can not be activated independently.&lt;br /&gt;
&lt;br /&gt;
Please read the Pilot's Guide for complete instructions on the use of the KAP140 Autopilot system.&lt;br /&gt;
&lt;br /&gt;
== Limits ==&lt;br /&gt;
* Not certified for use below 200ft [[AGL]], below 80 or above 160 knots [[IAS]] or when alternate static port is active&lt;br /&gt;
* Only activate when flaps are retracted.&lt;br /&gt;
* Do not override the autopilot with flight controls, instead deactivate it temporarily to make manual adjustmens&lt;br /&gt;
* Do not activate the autopilot near the ground (takeoff, landing) or at low speeds: it will mess up and may crash you into the ground.&lt;br /&gt;
* It also has no autoland capability, so it can't land you based on ILS signals.&lt;br /&gt;
* Don't activate it when in an unstable or mistrimmed flight attitude. Tough it will try(!) to stabilize the plane, this is unsafe.&lt;br /&gt;
* It will not rescue you out of a stall, so watch the airspeed regularly. If the plane slows down, the autopilot will increase pitch to maintain the VS/ALT mode ordered, putting you into a stall. Disengage the autopilot and manually stabilize your flight.&lt;br /&gt;
* Altitude catching only works if you are flying towards the desired setting. For example, if you are at 1500ft, entered 2000ft as target and then descend, it will not intercept but fly you into the ground. Similarly, if you enter an altitude below you and accidentally climb, you will eventually reach the planes service ceiling and stall. The &amp;quot;ALT ARM&amp;quot; mode does not mean &amp;quot;bring me to that altitude&amp;quot;.&lt;br /&gt;
* Like with altitude interception, intercepting a VOR radial or ILS will not work, if the heading bug was not aligned or if you try to intercept from a custom angle (ie. engaging NAV mode from ROL).&lt;br /&gt;
&lt;br /&gt;
== Altitude alert (beeping sound) ==&lt;br /&gt;
A nice feature for assisting manual flights is the altitude alert. This is the aural beeping alert when you get near the selected altitude preset:&lt;br /&gt;
* When getting near 1000ft of the selected altitude, it starts to beep five times and show a steady &amp;quot;ALERT&amp;quot; right below the altitude.&lt;br /&gt;
* When intercepting the altitude, the ALERT annunciator vanishes if you get 200ft near, and will shortly flash up when crossing the selected altitude to signal it &amp;quot;catched on&amp;quot;.&lt;br /&gt;
* When now exceeding the +-200ft band, it will alert by flashing and beeping.&lt;br /&gt;
&lt;br /&gt;
This feature just needs a calibrated baro setting and a selected altitude, thus it is also active when using the modes utilizing altitude preset described below.&lt;br /&gt;
&lt;br /&gt;
== Example workflow ==&lt;br /&gt;
This example tries to show you how to deal with the autopilot to achieve common tasks. There are more advanced techniques to achieve with the autopilot, but they are out of scope for this quick introduction. Please refer to the 'KAP 140 Pilot's Guide' which is linked below.&lt;br /&gt;
&lt;br /&gt;
For better familiarization it would be good to follow trough the following guide inside flightgear.&lt;br /&gt;
&lt;br /&gt;
{{note| Be aware of procedure differences when you have an [[HSI|Horizontal Situation Indicator (HSI)]] installed in the aircraft: In this case, the KAP 140 will not have an automatic 45°-Intercept for NAV/APR/REV modes when switching from HDG-mode and you need to select the desired intercept course manually by turning the heading bug to the desired intercept course. }}&lt;br /&gt;
&lt;br /&gt;
=== Before-takeoff preparations ===&lt;br /&gt;
* For the HDG/NAV mode it is important to calibrate the [[Avionics_and_instruments#Directional_Gyro|Directional Gyro (DG)]] to the magnetic compass (with running motor, so the DG has power): read the magnetic compass and rotate the DG so its upper bearing mark reflects that course (use the red heading bug if necessary, it makes it easier at the beginning). If your DG was not calibrated, this will not be the magnetic course and you probably will not get where you wanted to.&lt;br /&gt;
* For the ALT mode it is important to calibrate the barometric setting of the autopilot to the one of the altimeter: read the altimeters baro setting from the Kollsman window (the small window at the altimeter), press the &amp;quot;BARO&amp;quot; key at the autopilot and rotate the right &amp;quot;altitude-preselect knob&amp;quot; so the autopilot shows the same setting. If you miss to calibrate the baro setting, you will under-/overshoot altitude presets&lt;br /&gt;
* You should run through the HDG and VS modes on ground as preflight check to make sure the autopilot is operating the aileron, elevator and trim wheel&lt;br /&gt;
* If you intend to follow the runway heading after takeoff, now is a good time to adjust the heading bug.&lt;br /&gt;
* If you intend to climb to a specific altitude and let the autopilot intercept it, you should now rotate the altitude preselect knob of the autopilot to the desired altitude.&lt;br /&gt;
&lt;br /&gt;
=== After Takeoff: Hold heading, continue climbing ===&lt;br /&gt;
It is not advised to engage the autopilot immediately for takeoff as it will mess up with lower speeds. Establish a smooth climb rate and trimmed flight first.&lt;br /&gt;
&lt;br /&gt;
When you achieved a stable climb rate after takeoff, engage the autopilot by pressing &amp;quot;AP&amp;quot;. It will engage in ROL/VS mode: keeps the wings level and maintain climb at the current rate. The moment you engage the autopilot it will show &amp;quot;ROL&amp;quot;, &amp;quot;VS&amp;quot;, and at the right side the currently set climb rate for some seconds. Always visually confirm the autopilot shows the modes you expect!&lt;br /&gt;
&lt;br /&gt;
If not done yet, rotate the red heading bug at the DG to the desired heading before switching to HDG mode.&lt;br /&gt;
&lt;br /&gt;
Once you press the HGT button, the autopilot will switch from ROL to the HDG mode, and the plane now follows the desired course. When you change the heading bug, the plane will bank and follow the new heading (it will do this at standard turn rate).&lt;br /&gt;
&lt;br /&gt;
=== Climb to Altitude, then hold it (intercept altitude) ===&lt;br /&gt;
The autpilot now should be in HDG/VS mode. You should check the vertical speed the autopilot automatically set to the climb rate you had when engaging it. Using the buttons &amp;quot;UP&amp;quot; and &amp;quot;DN&amp;quot; you can adjust the vertical speed setting to the desired value.&lt;br /&gt;
&lt;br /&gt;
To let the autopilot intercept the desired altitude, you need to enter it using the knob on the right side. Turn in the desired altitude.&lt;br /&gt;
Doing this should automatically &amp;quot;arm&amp;quot; the autopilot (it shows &amp;quot;ALT ARM&amp;quot;), telling you that it waits to reach the entered altitude. If it was not arming automatically, you can arm it by manually pressing &amp;quot;ARM&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The plane will now climb to the altitude you requested. When you get at 1000ft near your setting, it will beep to let you know its close. Once you reach the altitude it will reduce the climb rate to zero, leveling out at the desired altitude: this is indicated by the &amp;quot;ALT ARM&amp;quot; vanishing.&lt;br /&gt;
If you are not at the altitude you entered, you probably forgot to calibrate the baro setting.&lt;br /&gt;
&lt;br /&gt;
=== Enroute climb / descend ===&lt;br /&gt;
In case you want to change the currently maintained altitude, you can do so by two means:&lt;br /&gt;
# ''Small adjustments'' can be made by pressing just the UP/DN buttons. Each press will adjust the set altitude for 20ft.&amp;lt;ref&amp;gt;In reality you can hold the button to trigger climb/descend at 500ft/m until you release the key. Recent KAP140 simulations implement this.&amp;lt;/ref&amp;gt; Note that we are in ALT mode, so we adjust absolute altiutde with UP/DN knobs, not climb rate! &lt;br /&gt;
# For ''larger adjustments'' you just rotate the altitude preselect knob to the new desired altitude. The autopilot will show &amp;quot;ALT ARM&amp;quot;. When you are ready to climb or descend, put the autopilot to VS mode by pressing the ALT button. Now push UP/DN buttons to climb or descend, and everything else will behave like already described above. You can adjust the desired climb rate anytime. When intercepting, the autopilot will automatically enter ALT mode again (which changes the behaviour of UP/DN buttons to absolute corrections too!).&lt;br /&gt;
# For other cases you can also use the manual ALT mode: Put the autopilot in VS mode by pressing &amp;quot;ALT&amp;quot;, adjust the climb rate to your liking and as soon as you feel the altitude is right, you can press &amp;quot;ALT&amp;quot; again. The AP will show &amp;quot;ALT&amp;quot; immediately, indicating it is holding this altitude. If your climb rate was a little higher, you probably overshoot the desired altitude, but the autopilot will soon return to it.&lt;br /&gt;
&lt;br /&gt;
Note that you can use these techniques with ROL, HDG and NAV modes.&lt;br /&gt;
&lt;br /&gt;
=== VOR interception (NAV mode) ===&lt;br /&gt;
For longer trips it is nice to let the autopilot track a [[VOR]] radial. The difference to the HDG mode is that the plane will compensate for wind drift as it seeks to keep the [https://en.wikipedia.org/wiki/Course_deviation_indicator CDI]-needle centered.&lt;br /&gt;
&lt;br /&gt;
To use the NAV mode you have to tune NAV1 to the VORs frequency and select the desired radial with the OBS knob of your [https://en.wikipedia.org/wiki/Course_deviation_indicator CDI1] (which links to NAV1).&lt;br /&gt;
Now you can intercept the radial, and you have two options to do that:&lt;br /&gt;
# ''From HDG mode'': select the radial also on your DG heading bug (the plane will try to follow that now). Then engage by pressing &amp;quot;NAV&amp;quot;. The autopilot will show &amp;quot;NAV ARM&amp;quot; and turn the plane to an 45° interception angle, but it will remain in HDG mode. Once you are close enough, the NAV-mode will kick in (&amp;quot;NAV ARM&amp;quot; vanishes and NAV shows) - the plane now follows the radial.&lt;br /&gt;
# ''From ROL mode'' (all angle intercept): It works like HDG mode, but once you push the NAV knob, the plane will intercept the radial at the angle you are currently flying. To initially bring the plane to the desired angle, use either HDG-mode with the heading bug, or fly manually, then engage ROL mode by pressing HDG.&lt;br /&gt;
Both modes will show a flashing &amp;quot;HDG&amp;quot; annunciator to remind you that you have to set the DG heading bug to the radial in both cases (the autopilot computes the needed course from that)!&lt;br /&gt;
&lt;br /&gt;
=== ILS assisted approach (APR mode) ===&lt;br /&gt;
The NAV and APR modes are really similar, but the APR mode does additionally follow also the glideslope signal from an [https://en.wikipedia.org/wiki/Instrument_landing_system ILS], and the ILS has a fixed radial (so it ignores the OBS knob setting of the CDI!).&lt;br /&gt;
&lt;br /&gt;
The interception works exactly as in the NAV mode described above. If you engage the APR mode knob the plane will start to intercept the signal, showing &amp;quot;APR ARM&amp;quot; and continue with the currently selected lateral mode (ROL or HDG with 45° intercept angle). Remember to set the DG heading bug to the desired approach course (&amp;quot;HDG&amp;quot; will flash to remember you of that).&lt;br /&gt;
&lt;br /&gt;
As soon as the plane intercepts the localizer (that drives the CDI needle left/right), it will behave like in NAV mode. &amp;quot;APR ARM&amp;quot; will vanish and switch to &amp;quot;APR&amp;quot;, showing you are in approach mode now.&lt;br /&gt;
&lt;br /&gt;
When the APR mode engages, the GS mode will try to intercept the vertical glideslope beam. As long as you stay below the beam, it will show &amp;quot;GS ARM&amp;quot;. When the vertical glideslope is intercepted, the plane will start to follow it downwards.&lt;br /&gt;
&lt;br /&gt;
'''Attention! This mode is dangerous''', because it will drive you into the ground if you don't disengage the autopilot. It is not meant to land you automatically, just to guide you close to the runway. As soon as you are near the runway you should disengage and land manually.&lt;br /&gt;
&lt;br /&gt;
=== Flying opposite direction of VOR or ILS (REV mode) ===&lt;br /&gt;
Using the REV mode allows you to fly away from an VOR or ILS localizer signal (note that glideslope is ignored).&lt;br /&gt;
It works the same as NAV or APR, just in the opposite compass direction. This is helpful if you want to fly straight away from the runway at start or to fly away from a VOR that you tuned the inbound course into the OBS.&lt;br /&gt;
&lt;br /&gt;
As APR and NAV, you can intercept the radial or localizer either from ROL or HDG mode.&lt;br /&gt;
In either case, dial in the Front Inbound course into the OBS and the DG heading bug, and not the direction you want to fly.&lt;br /&gt;
Course reversal is done from the autopilot automatically.&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
* [[Joystick Autopilot Bindings]]  Snippets for joystick.xml file that allow control of most of the autopilot functions using the joystick.&lt;br /&gt;
: {{icaution|These joystick bindings only work with the older KAP versions, not the new one with the preflight check simulated!}}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
*[https://bkx.bendixking.com/downloads/006-18034-0000_3.pdf Bendix/King KAP 140 Pilot's Guide download link] (PDF, 6.8 MB), Honywell, rev. 3, Nov 2005.&lt;br /&gt;
*[https://www.bendixking.com/content/dam/bendixking/en/documents/document-lists/downloads-and-manuals/006-18034-0000-KAP-140-Pilots-Guide.pdf Bendix/King KAP 140 Pilot's Guide], Honeywell, rev. 3, Nov 2005.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft instruments]]&lt;br /&gt;
&lt;br /&gt;
[[de:Autopilot Bendix/King KAP140]]&lt;br /&gt;
[[es:Piloto automático Bendix/King KAP140]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Bindings&amp;diff=121633</id>
		<title>Bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Bindings&amp;diff=121633"/>
		<updated>2020-02-25T15:46:09Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Bindings''' define what happens when a user:&lt;br /&gt;
* [[Howto: Make a clickable panel|Clicks an object]] in the [[scenery]] or in an [[aircraft]].&lt;br /&gt;
* Presses a key/button on the keyboard or [[joystick]].&lt;br /&gt;
* Clicks a [[menu]] item&lt;br /&gt;
* Interacts with a dialog (clicking a button, selecting list entries etc)&lt;br /&gt;
&lt;br /&gt;
In other words, '''bindings''' are simply the term for '''actions''' that are associated with certain '''events''' in FlightGear. &lt;br /&gt;
&lt;br /&gt;
There are different types of events supported by various subsystems, but the resulting action that can be triggered will typically involve either a hard-coded command (a so called fgcommand), or a block of scripted code (using [[Nasal]]). Bindings can be parameterized/customized using properties as arguments that are passed to each binding as a props.Node object.&lt;br /&gt;
And Nasal code can also be registered to become available as a dedicated fgcommand.&lt;br /&gt;
&lt;br /&gt;
You can assign multiple bindings to one object, button or key. Bindings may contain [[conditions]] to make them conditionally executed. Each binding must specify a command node with its particular type, see below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|Planes are free to override key bindings to fullfill their needs. The Space Shuttle for instance has no mixture control, so the m-key switches from translational to rotational hand controller.&lt;br /&gt;
The key only performs as mixture control if the plane has mixture settings and if the plane didn't re-assign the key - so dependent on what plane you try, it may or may not. Usually the aircraft-specific help spells it out.&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
  |url    =  https://forum.flightgear.org/viewtopic.php?p=298436#p298436 &lt;br /&gt;
  |title  =  &amp;lt;nowiki&amp;gt; Re: trouble with m-key &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
  |author =  &amp;lt;nowiki&amp;gt; Thorsten &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
  |date   =  Nov 9th, 2016 &lt;br /&gt;
  |added  =  Nov 9th, 2016 &lt;br /&gt;
  |script_version = 0.40 &lt;br /&gt;
  }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This article gives a small overview of frequently used bindings. Please refer to {{readme file|commands}} for additional information and refer to $FG_SRC/Main/commands.cxx for a complete list of available bindings.&lt;br /&gt;
&lt;br /&gt;
All given codes are examples, found on various places in the [[FlightGear]] package.&lt;br /&gt;
&lt;br /&gt;
== Commands ==&lt;br /&gt;
Below are some useful commands, some also with their equivalent Nasal call.  A more complete listing can be found in the readme file, {{readme file|commands}}.&lt;br /&gt;
&lt;br /&gt;
To learn more about adding your own custom fgcommands to the source code, see [[Howto:Add new fgcommands to FlightGear]].&lt;br /&gt;
&lt;br /&gt;
=== replay ===&lt;br /&gt;
Toggles replay.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;replay&amp;lt;/command&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
fgcommand(&amp;quot;replay&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== dialog-close ===&lt;br /&gt;
Closes the active dialog.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;dialog-close&amp;lt;/command&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
fgcommand(&amp;quot;dialog-close&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== dialog-show ===&lt;br /&gt;
Shows a dialog, which should be present in &amp;lt;tt&amp;gt;''[[$FG_ROOT]]/gui/dialogs''&amp;lt;/tt&amp;gt;. In addition, from FlightGear 2.8, dialog files located in &amp;lt;tt&amp;gt;''&amp;lt;aircraft directory&amp;gt;/gui/dialogs''&amp;lt;/tt&amp;gt; are also loaded. This should be used for dialogs specific to a certain aircraft.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;dialog-show&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;dialog-name&amp;gt;location-in-air&amp;lt;/dialog-name&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
fgcommand(&amp;quot;dialog-show&amp;quot;, props.Node.new({&amp;quot;dialog-name&amp;quot;: &amp;quot;location-in-air&amp;quot;}));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; dialog-name : The name of the dialog, as designated in its XML file.&lt;br /&gt;
&lt;br /&gt;
=== nasal ===&lt;br /&gt;
[[Nasal]] is frequently used for complicated systems, because it can execute virtually any function and allows running previously-defined Nasal functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt;b777.afds.input(0,1);&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; script : The Nasal script to execute.&lt;br /&gt;
: {{inote|Make sure that the script does not conflict with the {{wikipedia|List of XML and HTML character entity references#Predefined entities in XML|predefined XML entities}}. If it does, you can either put it in a {{wikipedia|CDATA|CDATA section}} or use a non-interpreted version (e.g., &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt; in place of &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;).}}&lt;br /&gt;
&lt;br /&gt;
The {{func link|cmdarg()}} function is often useful in these situations to extract offset values passed to the binding. It returns the specific &amp;lt;tt&amp;gt;&amp;amp;lt;binding&amp;amp;gt;&amp;lt;/tt&amp;gt; node, which contains a &amp;lt;tt&amp;gt;&amp;amp;lt;setting&amp;amp;gt;&amp;lt;/tt&amp;gt; node at runtime if used in a joystick axis that represents the value of that axis.&lt;br /&gt;
&lt;br /&gt;
In joysticks and keyboard keys, the script is run in a specific namespace; please see [[Howto:Understand Namespaces and Methods]] for more information on namespaces.&lt;br /&gt;
&lt;br /&gt;
=== property-adjust ===&lt;br /&gt;
Increases or decreases a property's value with a given step. Maximum and minimum values are optional.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-adjust&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/autopilot/settings/heading-bug-deg&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;step&amp;gt;1&amp;lt;/step&amp;gt;&lt;br /&gt;
  &amp;lt;min&amp;gt;0&amp;lt;/min&amp;gt;&lt;br /&gt;
  &amp;lt;max&amp;gt;360&amp;lt;/max&amp;gt;&lt;br /&gt;
  &amp;lt;wrap&amp;gt;true&amp;lt;/wrap&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; property : Property that will be changed.&lt;br /&gt;
; step     : Amount to increase or decrease the property's value. Defaults to 0.&lt;br /&gt;
; offset   : Offset from the property's current value. If '''step''' is not given, this is multiplied by '''factor'''.&lt;br /&gt;
; factor   : When '''step''' is not given, '''offset''' is multiplied by this. Defaults to 1.&lt;br /&gt;
; min      : The minimum allowed value. Defaults to &amp;quot;no minimum.&amp;quot;&lt;br /&gt;
; max      : The maximum allowed value. Defaults to &amp;quot;no maximum.&amp;quot;&lt;br /&gt;
; wrap     : If true, the value will be wrapped when it passes min or max; both min and max must be present for this to work. Defaults to false.&lt;br /&gt;
; mask     : This argument accepts three value: &amp;quot;integer,&amp;quot; &amp;quot;decimal&amp;quot; and &amp;quot;all&amp;quot; (default). &amp;quot;integer&amp;quot; means that '''step''' or '''offset * factor''' is applied to the part of the property's current value left of the decimal point first. &amp;quot;decimal&amp;quot; does the same, but applies it to the prt to the right of the decimal point. &amp;quot;all&amp;quot; simply applies it to the whole number. This parameter does not seem to affect the resulting new value of the property, and so is not needed.&lt;br /&gt;
&lt;br /&gt;
=== property-assign ===&lt;br /&gt;
One of the most important commands. It sets a property to a predefined value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-assign&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/autopilot/settings/target-speed-kt&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value&amp;gt;0&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-cycle ===&lt;br /&gt;
Cycles between a list of values and assigns one to a property. The value-list can vary in length. If the current value is &amp;quot;value1&amp;quot;, it will change to &amp;quot;value2&amp;quot;; if it is &amp;quot;value2&amp;quot;, it will change to &amp;quot;value3&amp;quot;, and so on, wrapping around the end.  If the current value is not in the list, it will jump to the first one.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-cycle&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/autopilot/autobrake/setting&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;string&amp;quot;&amp;gt;ARM&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;string&amp;quot;&amp;gt;DISARM&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;string&amp;quot;&amp;gt;OFF&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
As of May 2013, the command supports additional behaviours to simplify use with the new [[Knob_/_slider_animation|knob and slider animations]]. The wrapping behaviour can be disabled by setting &amp;lt;wrap&amp;gt;0&amp;lt;/wrap&amp;gt;, and the command uses the 'offset' argument to select a direction of movement. This means a property-cycle bound to a multi-position knob will function as expected for movement in both directions.&lt;br /&gt;
&lt;br /&gt;
=== property-interpolate ===&lt;br /&gt;
Interpolates to a value with a given rate of change (per second).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-interpolate&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron-trim&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;double&amp;quot;&amp;gt;0&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;rate&amp;gt;0.5&amp;lt;/rate&amp;gt;&amp;lt;!-- 2 seconds to 0 from 1 or -1 --&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instead of using &amp;lt;rate&amp;gt;, one could use &amp;lt;time&amp;gt;, to specify the time (in seconds) it takes to go to the new value, independent of the current value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-interpolate&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron-trim&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;double&amp;quot;&amp;gt;0&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;time&amp;gt;2&amp;lt;/time&amp;gt;&amp;lt;!-- 2 seconds to 0 from 1, 0.5, -1 etc. --&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also interpolate to a value given by a property.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-interpolate&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron-trim&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/default-aileron-trim&amp;lt;/property&amp;gt;&amp;lt;!-- the value to interpolate to, is 0 --&amp;gt;&lt;br /&gt;
  &amp;lt;rate&amp;gt;0.5&amp;lt;/rate&amp;gt;&amp;lt;!-- 2 seconds to 0 from 1 or -1 --&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-multiply ===&lt;br /&gt;
Multiply the value of a property by a given factor.&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-multiply&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;factor&amp;gt;0.5&amp;lt;/factor&amp;gt;&lt;br /&gt;
  &amp;lt;min&amp;gt;-1&amp;lt;/min&amp;gt;&lt;br /&gt;
  &amp;lt;max&amp;gt;1&amp;lt;/max&amp;gt;&lt;br /&gt;
  &amp;lt;mask&amp;gt;all&amp;lt;/mask&amp;gt;&lt;br /&gt;
  &amp;lt;wrap&amp;gt;true&amp;lt;/wrap&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''factor:''' the amount to multiply by.&lt;br /&gt;
*'''min:''' minimum value.&lt;br /&gt;
*'''max:''' maximum value.&lt;br /&gt;
*'''mask:'''&lt;br /&gt;
** '''integer:''' mutiply only left of the decimal point.&lt;br /&gt;
** '''decimal:''' multiply only the right of the decimal point.&lt;br /&gt;
** '''all:''' multiply the entire value.&lt;br /&gt;
*'''wrap:''' true if the value should be wrapped if it passes min/max. It is required to set both min and max in that case.&lt;br /&gt;
&lt;br /&gt;
=== property-randomize ===&lt;br /&gt;
Assigns a random value (between min and max) to a property.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-randomize&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/orientation/pitch-deg&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;min&amp;gt;0&amp;lt;/min&amp;gt;&lt;br /&gt;
  &amp;lt;max&amp;gt;360&amp;lt;/max&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-scale ===&lt;br /&gt;
Set the value of a property based on an axis, often used in [[joystick]] configuration files.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-scale&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;offset&amp;gt;0.001&amp;lt;/offset&amp;gt;&lt;br /&gt;
  &amp;lt;factor&amp;gt;-1&amp;lt;/factor&amp;gt;&lt;br /&gt;
  &amp;lt;power&amp;gt;3&amp;lt;/power&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''offset:''' the offset to shift by, before applying the factor.&lt;br /&gt;
* '''factor:''' the factor to multiply by (use negative to reverse).&lt;br /&gt;
* '''squared:''' if true will square the resulting value (same as power=2).&lt;br /&gt;
* '''power:''' the resulting value will be taken to the power of this integer value (overrides squared).&lt;br /&gt;
&lt;br /&gt;
Remember: &amp;lt;tt&amp;gt;(property^power + offset) * factor = result&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-swap ===&lt;br /&gt;
Swaps the values of two properties, useful for radio panels.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-swap&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/instrumentation/comm/frequencies/selected-mhz&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/instrumentation/comm/frequencies/standby-mhz&amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-toggle ===&lt;br /&gt;
Toggles the value of a property on each click, between true (1) and false (0).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-toggle&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/gear/gear-down&amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or - if defined - it toggles between two custom values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-toggle&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/gear/gear-down&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value&amp;gt;2&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;value&amp;gt;3&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===request-metar ===&lt;br /&gt;
{{cquote|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
fgcommand(&amp;quot;request-metar&amp;quot;, props.Node.new({&amp;quot;path&amp;quot;: &amp;quot;/foo/mymetar&amp;quot;, &amp;quot;station&amp;quot;: &amp;quot;LOWI&amp;quot;}));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you pass an existing path, the station ID will be updated, and if you pass the same station ID as before, no additional request is made. As usual for metar-properties, there's a time-to-live and valid flags you can check, and the metar refreshes automatically every 900 seconds. You can also write to the station ID directly to change station, update the time-to-live, and wait for the valid signal.&lt;br /&gt;
&lt;br /&gt;
There's also an unregister command ('clear-metar') to cancel the binding into the property tree.&amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg38372.html|title=&amp;lt;nowiki&amp;gt;[Flightgear-devel] Requesting arbitrary metar&amp;lt;/nowiki&amp;gt;|author=James Turner|date=Sun, 23 Sep 2012 08:56:48 -0700}}&amp;lt;/ref&amp;gt;|James Turner}}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
=== Wiki ===&lt;br /&gt;
* [[Howto:Make a clickable panel]]&lt;br /&gt;
* [[Howto:Reassign keyboard bindings]]&lt;br /&gt;
&lt;br /&gt;
=== Readme file ===&lt;br /&gt;
* {{readme file|commands}}&lt;br /&gt;
&lt;br /&gt;
=== Source ===&lt;br /&gt;
Note that many commands are defined elsewhere. The readme file has a more complete listing.&lt;br /&gt;
&lt;br /&gt;
* {{flightgear source|path=src/Main/fg_commands.hxx}}&lt;br /&gt;
* {{flightgear source|path=src/Main/fg_commands.cxx}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:XML]]&lt;br /&gt;
[[Category:FlightGear keyboard]]&lt;br /&gt;
[[Category:Joysticks and Yokes]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Writing_Joystick_Code:_Part_1&amp;diff=121632</id>
		<title>Writing Joystick Code: Part 1</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Writing_Joystick_Code:_Part_1&amp;diff=121632"/>
		<updated>2020-02-25T15:44:02Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: Aileron, elevator and rudder: 'power' is applied prior to offset and factor&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{JoystickScripting Navigation}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Before you start, read [[Input device]].&lt;br /&gt;
&lt;br /&gt;
All the examples below assume that you have obtained the correct axes and button numbers as described in the above article. You will have to substitute the correct axis and button numbers in these code examples.&lt;br /&gt;
&lt;br /&gt;
Note the indent in all examples. The indents have no effect on operation, they just make the code so much more readable.&lt;br /&gt;
&lt;br /&gt;
Here is some code to explain a few important basic concepts of xml files. (I have numbered the lines to aid the explanation below. In your xml file the line numbers will not be there.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line&amp;gt;&lt;br /&gt;
&amp;lt;button n=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;desc&amp;gt;Gear up&amp;lt;/desc&amp;gt;&lt;br /&gt;
  &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
  &amp;lt;binding&amp;gt;&lt;br /&gt;
    &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
    &amp;lt;script&amp;gt;controls.gearDown(-1)&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;controls.gearDown(0)&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ignoring the actual meaning of the code, let's got through it line by line.&lt;br /&gt;
&lt;br /&gt;
Line 1: &amp;lt;button&amp;gt; specifies that this is the code for a button, and the n=&amp;quot;4&amp;quot; means that this is the code for the button which ''your system'' reports as number 4.&lt;br /&gt;
&lt;br /&gt;
Line 2: &amp;lt;desc&amp;gt; A (short) description of what the button does.&lt;br /&gt;
&lt;br /&gt;
Line 3: &amp;lt;repeatable&amp;gt;true&amp;lt;/repeatable&amp;gt; means that ''as long as the button is held in'' the following action will be executed. If repeatable is false, the button action is one-shot, and won't execute again until the button is released and pressed again.&lt;br /&gt;
&lt;br /&gt;
Notice the &amp;lt;/repeatable&amp;gt; after the value true. Each tag (&amp;lt;word&amp;gt; must have a closing tag &amp;lt;/word&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Line 4: &amp;lt;binding&amp;gt; This is the start of the code which defines what happens when the button is pressed. Notice that there can be a few lines before the &amp;lt;/binding&amp;gt; tag. &lt;br /&gt;
&lt;br /&gt;
Line 5: &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt; means that the following line(s) is(are) written in the programming language nasal. That is all you need to know!!&lt;br /&gt;
&lt;br /&gt;
Line 6: &amp;lt;script&amp;gt;controls.gearDown&amp;lt;/script&amp;gt;. The text between &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; are the nasal commands to be performed. Here there is only one command, but there can be many.&lt;br /&gt;
&lt;br /&gt;
Line 7: &amp;lt;/binding&amp;gt; The end of what happens when the button is pressed.&lt;br /&gt;
&lt;br /&gt;
Line 8: &amp;lt;mod-up&amp;gt; (Modification up.) This is the start of the section to handle what happens when the button is released. The up part co9mes from the idea of pushing a button down, and it moves up when you take your finger off it. Not all button actions need a &amp;lt;mod-up&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
Lines 9 to 13: Same as above, except that it refers to what happens when the button is released.&lt;br /&gt;
&lt;br /&gt;
Line 14: &amp;lt;/button&amp;gt; The end of the button section. Not necessary to specify the button number again, as you can't use &amp;lt;button&amp;gt; &amp;lt;/button&amp;gt; inside another &amp;lt;button&amp;gt; &amp;lt;/button&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
== Axes ==&lt;br /&gt;
Axes are the controls on a joystick which con be moved over a whole arc of operation.&lt;br /&gt;
&lt;br /&gt;
Even though the hat hat-switch is classed as an axis, for the purpose of writing code for it, it is a set of buttons. It is, in fact, just a set of buttons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Aileron, elevator and rudder ===&lt;br /&gt;
The code for these looks like this. The lines in italics are optional. The other lines are compulsory.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;axis n=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;Elevator&amp;lt;/desc&amp;gt;&lt;br /&gt;
    ''&amp;lt;dead-band type=&amp;quot;double&amp;quot;&amp;gt;0.0&amp;lt;/dead-band&amp;gt;''&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;property-scale&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;property&amp;gt;/controls/flight/elevator&amp;lt;/property&amp;gt;&lt;br /&gt;
      ''&amp;lt;offset type=&amp;quot;double&amp;quot;&amp;gt;0.0&amp;lt;/offset&amp;gt;''&lt;br /&gt;
      ''&amp;lt;factor type=&amp;quot;double&amp;quot;&amp;gt;-1.0&amp;lt;/factor&amp;gt;''&lt;br /&gt;
      ''&amp;lt;power type=&amp;quot;int&amp;quot;&amp;gt;3&amp;lt;/power&amp;gt;''&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;/axis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;desc&amp;gt;Elevator&amp;lt;/desc&amp;gt; let's us know that this axis controls the elevator. For human purposes only. All the other lines are for the benefit of FG.&lt;br /&gt;
&lt;br /&gt;
The optional lines need quite a bit of explanation. For a start, all three these axes have a center-zero action. At this point, they have a value of 0. As you move them to their extreme positions, their value gradually increases (decreases) to +1.0 or -1.0, depending on the direction of movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dead-band ..... : You may want a small movement around the center of the axis not to do anything. Or your joystick might be getting old, and it jitters around zero. Jittering is small, continuous value changes in the value. You can then supply a value for dead-band that will eliminate this. And it will be small. A dead-band of 1.0 means that the axis does nothing, a dead-band of 0.25 means that the axis does nothing for the first 25% of its movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;offset ..... : If you find that in its center position the axes outputs a non-zero value, you can put that same value here, with opposite + or - sign, to counter-act this. The HUD will show you if you have an offset problem, and can be used to see if you have solved it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;factor ...... : If you find that moving an axis results in the aileron, elevator or rudder moving in the wrong direction, change the -1.0 to 1.0 or the 1.0 to -1.0. This will make it work the other way round.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;power ...... : Sometimes the axes are too sensitive - a slight touch on aileron makes the plane barrel-roll. You can reduce this sensitivity by making the value of power more than 1. (It is a decimal number, so you can make small adjustments, but small adjustments are usually not enough to be noticible.) Never mind the maths, but the larger the value of power the less sensitive the aircraft will be to axis movement.&lt;br /&gt;
&lt;br /&gt;
Remember: (property^power + offset) * factor = result. See [http://wiki.flightgear.org/Bindings#property-scale Bindings, property-scale].&lt;br /&gt;
&lt;br /&gt;
{{Note|In some joystick binding files, you'll find:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;squared type=&amp;quot;bool&amp;quot;&amp;amp;gt;true&amp;amp;lt;/squared&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is equivalent to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;power type=&amp;quot;int&amp;quot;&amp;amp;gt;2&amp;amp;lt;/power&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and not faster in any way, therefore I prefer using ''power'' since it's then easier to change the value if needed.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For aileron and rudder you replace ''&amp;gt;/controls/flight/elevator'' with ''/controls/flight/aileron'' and ''/controls/flight/rudder''. Don't forget to change the the name between &amp;lt;desc&amp;gt; and &amp;lt;/desc&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Other axes ===&lt;br /&gt;
Throttle, propeller-pitch, mixture and carburetor-heat. &lt;br /&gt;
&lt;br /&gt;
These do not have optional settings, after all you want a smooth linear response. This is the code for the throttle control, for the others, just replace throttleAxis with propellerAxis, mixtureAxis or carbHeatAxis.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;axis n=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;Throttle&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;controls.throttleAxis()&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/binding&amp;gt;&lt;br /&gt;
 &amp;lt;/axis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the &amp;quot;instructions&amp;quot; we give are in the Nasal language, so we have &lt;br /&gt;
  &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt; to let the interpreter know.&lt;br /&gt;
&lt;br /&gt;
The actual &amp;quot;instruction&amp;quot; is between the &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; tags.&lt;br /&gt;
  &amp;lt;script&amp;gt;controls.throttleAxis()&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Buttons ==&lt;br /&gt;
&lt;br /&gt;
There is almost no end to what we can do with buttons, limited usually by the number of buttons on the joystick, what we need, and what we can remember of the allocation of button actions.&lt;br /&gt;
&lt;br /&gt;
=== Repeatable/Non-repeatable ===&lt;br /&gt;
&lt;br /&gt;
There are two categories of buttons, repeatable and non-repeatable. With non-repeatable buttons, when we push it, a single action is carried out, and nothing else happens. An example of its use would be a button to lower the landing-gear. We press the button, the gear goes down. With repeatable buttons, when we hold the button in, the same action is carried out over and over, until we release the button. An example is zoom-in. We press the button, and the view keeps zooming in. When we have the view we want, we release the button, and zooming stops.&lt;br /&gt;
An important point to remeber is that if a button is repeatable, even if you just give it the briefest of touches, the instruction will be carried out a few times, thanks to the repeat-rate of the system.&lt;br /&gt;
Setting a button to repeatable or non-repeatable is part of the basic definition of the button (like its number), it cannot be changed willy-nilly. So when you decide on the use for joystick buttons, you decide ''which will be repeatable and which not''.&lt;br /&gt;
&lt;br /&gt;
The shell of a button definition looks lke this&lt;br /&gt;
  &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''What the button does''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Your code goes here''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Code for what happens when the button is released goes here''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a non-repeatable button&lt;br /&gt;
  &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make a  button repeatable, replace false with true.&lt;br /&gt;
&lt;br /&gt;
You can use this shell for all your buttons. Just use the correct button number, give the correct &amp;lt;desc&amp;gt;, decide repeatable or non-repeatable, and then type the correct code in place of ''Your code goes here'' and ''Code for what happens when the button is released goes here''. Not all actions need a &amp;lt;mod-up&amp;gt; section, but you will soon get the hang of what does and what doesn't.&lt;br /&gt;
&lt;br /&gt;
If your code has more than one command, then do this&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
    ''Command number 1'';&lt;br /&gt;
    ''Command number 2'';&lt;br /&gt;
    ''Command number 3''&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that all lines except the last have a ; at the end. This lets the interpreter know that you haven't finished yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== A note on &amp;lt;mod-up&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
I have been having a good look at the controls.nas file that comes with FG. With most of them, where you would use &lt;br /&gt;
  controls.someAction(1)&lt;br /&gt;
to do something, you are allowed to use&lt;br /&gt;
  controls.someAction(0)&lt;br /&gt;
in &amp;lt;mod-up&amp;gt;, but it does nothing. Xml files are full of such code, which is totally, unnecessary. It does no harm, just wastes time, albeit very little time. In fact, the only time a &amp;lt;mod-up&amp;gt; is needed is when a non-repeatable button starts an ongoing process, and we want to stop that process when we release the button. In Part2 and Part 3 you will see almost no &amp;lt;mod-up&amp;gt; code at all.&lt;br /&gt;
&lt;br /&gt;
One advantage  of leaving out unnecessary &amp;lt;mod-up&amp;gt; code is that it makes the code easier to read. (And saves a couple of trees when the files are printed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Giving buttons multiple choices ===&lt;br /&gt;
&lt;br /&gt;
There is a limit to the number of buttons on the joystick and lots of things we'd like to do with them. Fortunately, FG makes it easy for us. It lets us know if any or more than one of the Shift, Alt and Ctrl buttons are pressed. We can thus modify the action of a button with the &amp;lt;mod-shift&amp;gt;, &amp;lt;mod-ctrl&amp;gt; and &amp;lt;mod-alt&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
Here is an example of what you need to modify the action of a button when the Shift key is held in when you press the button. I have deliberately included &amp;lt;mod-up&amp;gt; tags so that you can see where they must go, should they be necessary.&lt;br /&gt;
  &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''Normal action/Shift action''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Normal: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Normal: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;mod-shift&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Shift: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;mod-up&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Shift: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-shift&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quite easy.&lt;br /&gt;
&lt;br /&gt;
Notice that the &amp;lt;repeatable&amp;gt; tag is right at the top. ''You cannot make the normale action repeatable and the modified action non-repeatable''.&lt;br /&gt;
&lt;br /&gt;
Now let's go crazy. We want:&lt;br /&gt;
  1. Normal action.&lt;br /&gt;
  2. Action when Ctrl is pressed.&lt;br /&gt;
  3. Action when Ctrl and Alt are pressed.&lt;br /&gt;
&lt;br /&gt;
Looks like this.&lt;br /&gt;
    &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''Normal action/Ctrl action/Ctrl-Alt action''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    # *****  Normal *****&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Normal: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Normal: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    # ***** Ctrl  *****&lt;br /&gt;
    &amp;lt;mod-ctrl&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Ctrl: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;mod-up&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Ctrl: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      # ***** Ctrl-Alt *****&lt;br /&gt;
      &amp;lt;mod-alt&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Ctrl &amp;amp; Alt: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
        &amp;lt;mod-up&amp;gt;&lt;br /&gt;
          &amp;lt;binding&amp;gt;&lt;br /&gt;
            &amp;lt;script&amp;gt;''Ctrl &amp;amp; Alt: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
          &amp;lt;/binding&amp;gt;&lt;br /&gt;
        &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-alt&amp;gt; &lt;br /&gt;
   &amp;lt;/mod-ctrl&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice four things:&lt;br /&gt;
   1. The &amp;lt;mod-alt&amp;gt; selection is between the &amp;lt;mod-ctrl&amp;gt; and &amp;lt;/mod-ctrl&amp;gt; tags. This means that the code is for Ctrl and Alt, not just Alt.&lt;br /&gt;
   2. I have spaced the sections with empty lines for readability.&lt;br /&gt;
   3. I have used comments # ***** Comment ***** to make it even more readable.&lt;br /&gt;
   4. By using comments and open lines, the block of code is a lot less daunting. In fact, once you have grasped the basics, it is quite easy to read.&lt;br /&gt;
&lt;br /&gt;
Anything that starts with # is ignored by the interpreter, even if it comes after some code. Such as&lt;br /&gt;
  &amp;lt;script&amp;gt;controls.throttleAxis&amp;lt;/script&amp;gt; # Controls the throttle axis&lt;br /&gt;
&lt;br /&gt;
The code will work and we humans have an explanation of the code.&lt;br /&gt;
&lt;br /&gt;
To write long comments you can do this&lt;br /&gt;
  &amp;amp;lt;!--  &lt;br /&gt;
     Lots and lots&lt;br /&gt;
     and even more&lt;br /&gt;
     lots of lines of comments.&lt;br /&gt;
  --&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use the function keys as modifiers: &amp;lt;mod-F1&amp;gt;, &amp;lt;mod-F2&amp;gt;, etc., but remember that with all the combinations of Shift, Ctrl and Alt you get 7 options, and that is a lot of options to remember for each button.&lt;br /&gt;
&lt;br /&gt;
In a later section I will show how to use buttons on the joystick as modifiers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== CDATA ==&lt;br /&gt;
If your code (or even comments) contains &amp;lt;, &amp;gt;, &amp;amp; or --, it can cause havoc with your xml file. Any area that contains any of these must be enclosed between&lt;br /&gt;
  &amp;lt;![CDATA[      and     ]]&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Any complaints/suggestions/questions/kudos can be posted [http://forum.flightgear.org/viewtopic.php?f=24&amp;amp;t=17892 here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Bindings&amp;diff=121631</id>
		<title>Bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Bindings&amp;diff=121631"/>
		<updated>2020-02-25T15:26:55Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Bindings''' define what happens when a user:&lt;br /&gt;
* [[Howto: Make a clickable panel|Clicks an object]] in the [[scenery]] or in an [[aircraft]].&lt;br /&gt;
* Presses a key/button on the keyboard or [[joystick]].&lt;br /&gt;
* Clicks a [[menu]] item&lt;br /&gt;
* Interacts with a dialog (clicking a button, selecting list entries etc)&lt;br /&gt;
&lt;br /&gt;
In other words, '''bindings''' are simply the term for '''actions''' that are associated with certain '''events''' in FlightGear. &lt;br /&gt;
&lt;br /&gt;
There are different types of events supported by various subsystems, but the resulting action that can be triggered will typically involve either a hard-coded command (a so called fgcommand), or a block of scripted code (using [[Nasal]]). Bindings can be parameterized/customized using properties as arguments that are passed to each binding as a props.Node object.&lt;br /&gt;
And Nasal code can also be registered to become available as a dedicated fgcommand.&lt;br /&gt;
&lt;br /&gt;
You can assign multiple bindings to one object, button or key. Bindings may contain [[conditions]] to make them conditionally executed. Each binding must specify a command node with its particular type, see below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|Planes are free to override key bindings to fullfill their needs. The Space Shuttle for instance has no mixture control, so the m-key switches from translational to rotational hand controller.&lt;br /&gt;
The key only performs as mixture control if the plane has mixture settings and if the plane didn't re-assign the key - so dependent on what plane you try, it may or may not. Usually the aircraft-specific help spells it out.&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
  |url    =  https://forum.flightgear.org/viewtopic.php?p=298436#p298436 &lt;br /&gt;
  |title  =  &amp;lt;nowiki&amp;gt; Re: trouble with m-key &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
  |author =  &amp;lt;nowiki&amp;gt; Thorsten &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
  |date   =  Nov 9th, 2016 &lt;br /&gt;
  |added  =  Nov 9th, 2016 &lt;br /&gt;
  |script_version = 0.40 &lt;br /&gt;
  }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This article gives a small overview of frequently used bindings. Please refer to {{readme file|commands}} for additional information and refer to $FG_SRC/Main/commands.cxx for a complete list of available bindings.&lt;br /&gt;
&lt;br /&gt;
All given codes are examples, found on various places in the [[FlightGear]] package.&lt;br /&gt;
&lt;br /&gt;
== Commands ==&lt;br /&gt;
Below are some useful commands, some also with their equivalent Nasal call.  A more complete listing can be found in the readme file, {{readme file|commands}}.&lt;br /&gt;
&lt;br /&gt;
To learn more about adding your own custom fgcommands to the source code, see [[Howto:Add new fgcommands to FlightGear]].&lt;br /&gt;
&lt;br /&gt;
=== replay ===&lt;br /&gt;
Toggles replay.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;replay&amp;lt;/command&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
fgcommand(&amp;quot;replay&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== dialog-close ===&lt;br /&gt;
Closes the active dialog.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;dialog-close&amp;lt;/command&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
fgcommand(&amp;quot;dialog-close&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== dialog-show ===&lt;br /&gt;
Shows a dialog, which should be present in &amp;lt;tt&amp;gt;''[[$FG_ROOT]]/gui/dialogs''&amp;lt;/tt&amp;gt;. In addition, from FlightGear 2.8, dialog files located in &amp;lt;tt&amp;gt;''&amp;lt;aircraft directory&amp;gt;/gui/dialogs''&amp;lt;/tt&amp;gt; are also loaded. This should be used for dialogs specific to a certain aircraft.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;dialog-show&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;dialog-name&amp;gt;location-in-air&amp;lt;/dialog-name&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
fgcommand(&amp;quot;dialog-show&amp;quot;, props.Node.new({&amp;quot;dialog-name&amp;quot;: &amp;quot;location-in-air&amp;quot;}));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; dialog-name : The name of the dialog, as designated in its XML file.&lt;br /&gt;
&lt;br /&gt;
=== nasal ===&lt;br /&gt;
[[Nasal]] is frequently used for complicated systems, because it can execute virtually any function and allows running previously-defined Nasal functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt;b777.afds.input(0,1);&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; script : The Nasal script to execute.&lt;br /&gt;
: {{inote|Make sure that the script does not conflict with the {{wikipedia|List of XML and HTML character entity references#Predefined entities in XML|predefined XML entities}}. If it does, you can either put it in a {{wikipedia|CDATA|CDATA section}} or use a non-interpreted version (e.g., &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt; in place of &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;).}}&lt;br /&gt;
&lt;br /&gt;
The {{func link|cmdarg()}} function is often useful in these situations to extract offset values passed to the binding. It returns the specific &amp;lt;tt&amp;gt;&amp;amp;lt;binding&amp;amp;gt;&amp;lt;/tt&amp;gt; node, which contains a &amp;lt;tt&amp;gt;&amp;amp;lt;setting&amp;amp;gt;&amp;lt;/tt&amp;gt; node at runtime if used in a joystick axis that represents the value of that axis.&lt;br /&gt;
&lt;br /&gt;
In joysticks and keyboard keys, the script is run in a specific namespace; please see [[Howto:Understand Namespaces and Methods]] for more information on namespaces.&lt;br /&gt;
&lt;br /&gt;
=== property-adjust ===&lt;br /&gt;
Increases or decreases a property's value with a given step. Maximum and minimum values are optional.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-adjust&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/autopilot/settings/heading-bug-deg&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;step&amp;gt;1&amp;lt;/step&amp;gt;&lt;br /&gt;
  &amp;lt;min&amp;gt;0&amp;lt;/min&amp;gt;&lt;br /&gt;
  &amp;lt;max&amp;gt;360&amp;lt;/max&amp;gt;&lt;br /&gt;
  &amp;lt;wrap&amp;gt;true&amp;lt;/wrap&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; property : Property that will be changed.&lt;br /&gt;
; step     : Amount to increase or decrease the property's value. Defaults to 0.&lt;br /&gt;
; offset   : Offset from the property's current value. If '''step''' is not given, this is multiplied by '''factor'''.&lt;br /&gt;
; factor   : When '''step''' is not given, '''offset''' is multiplied by this. Defaults to 1.&lt;br /&gt;
; min      : The minimum allowed value. Defaults to &amp;quot;no minimum.&amp;quot;&lt;br /&gt;
; max      : The maximum allowed value. Defaults to &amp;quot;no maximum.&amp;quot;&lt;br /&gt;
; wrap     : If true, the value will be wrapped when it passes min or max; both min and max must be present for this to work. Defaults to false.&lt;br /&gt;
; mask     : This argument accepts three value: &amp;quot;integer,&amp;quot; &amp;quot;decimal&amp;quot; and &amp;quot;all&amp;quot; (default). &amp;quot;integer&amp;quot; means that '''step''' or '''offset * factor''' is applied to the part of the property's current value left of the decimal point first. &amp;quot;decimal&amp;quot; does the same, but applies it to the prt to the right of the decimal point. &amp;quot;all&amp;quot; simply applies it to the whole number. This parameter does not seem to affect the resulting new value of the property, and so is not needed.&lt;br /&gt;
&lt;br /&gt;
=== property-assign ===&lt;br /&gt;
One of the most important commands. It sets a property to a predefined value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-assign&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/autopilot/settings/target-speed-kt&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value&amp;gt;0&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-cycle ===&lt;br /&gt;
Cycles between a list of values and assigns one to a property. The value-list can vary in length. If the current value is &amp;quot;value1&amp;quot;, it will change to &amp;quot;value2&amp;quot;; if it is &amp;quot;value2&amp;quot;, it will change to &amp;quot;value3&amp;quot;, and so on, wrapping around the end.  If the current value is not in the list, it will jump to the first one.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-cycle&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/autopilot/autobrake/setting&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;string&amp;quot;&amp;gt;ARM&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;string&amp;quot;&amp;gt;DISARM&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;string&amp;quot;&amp;gt;OFF&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
As of May 2013, the command supports additional behaviours to simplify use with the new [[Knob_/_slider_animation|knob and slider animations]]. The wrapping behaviour can be disabled by setting &amp;lt;wrap&amp;gt;0&amp;lt;/wrap&amp;gt;, and the command uses the 'offset' argument to select a direction of movement. This means a property-cycle bound to a multi-position knob will function as expected for movement in both directions.&lt;br /&gt;
&lt;br /&gt;
=== property-interpolate ===&lt;br /&gt;
Interpolates to a value with a given rate of change (per second).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-interpolate&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron-trim&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;double&amp;quot;&amp;gt;0&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;rate&amp;gt;0.5&amp;lt;/rate&amp;gt;&amp;lt;!-- 2 seconds to 0 from 1 or -1 --&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instead of using &amp;lt;rate&amp;gt;, one could use &amp;lt;time&amp;gt;, to specify the time (in seconds) it takes to go to the new value, independent of the current value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-interpolate&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron-trim&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;double&amp;quot;&amp;gt;0&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;time&amp;gt;2&amp;lt;/time&amp;gt;&amp;lt;!-- 2 seconds to 0 from 1, 0.5, -1 etc. --&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also interpolate to a value given by a property.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-interpolate&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron-trim&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/default-aileron-trim&amp;lt;/property&amp;gt;&amp;lt;!-- the value to interpolate to, is 0 --&amp;gt;&lt;br /&gt;
  &amp;lt;rate&amp;gt;0.5&amp;lt;/rate&amp;gt;&amp;lt;!-- 2 seconds to 0 from 1 or -1 --&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-multiply ===&lt;br /&gt;
Multiply the value of a property by a given factor.&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-multiply&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;factor&amp;gt;0.5&amp;lt;/factor&amp;gt;&lt;br /&gt;
  &amp;lt;min&amp;gt;-1&amp;lt;/min&amp;gt;&lt;br /&gt;
  &amp;lt;max&amp;gt;1&amp;lt;/max&amp;gt;&lt;br /&gt;
  &amp;lt;mask&amp;gt;all&amp;lt;/mask&amp;gt;&lt;br /&gt;
  &amp;lt;wrap&amp;gt;true&amp;lt;/wrap&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''factor:''' the amount to multiply by.&lt;br /&gt;
*'''min:''' minimum value.&lt;br /&gt;
*'''max:''' maximum value.&lt;br /&gt;
*'''mask:'''&lt;br /&gt;
** '''integer:''' mutiply only left of the decimal point.&lt;br /&gt;
** '''decimal:''' multiply only the right of the decimal point.&lt;br /&gt;
** '''all:''' multiply the entire value.&lt;br /&gt;
*'''wrap:''' true if the value should be wrapped if it passes min/max. It is required to set both min and max in that case.&lt;br /&gt;
&lt;br /&gt;
=== property-randomize ===&lt;br /&gt;
Assigns a random value (between min and max) to a property.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-randomize&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/orientation/pitch-deg&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;min&amp;gt;0&amp;lt;/min&amp;gt;&lt;br /&gt;
  &amp;lt;max&amp;gt;360&amp;lt;/max&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-scale ===&lt;br /&gt;
Set the value of a property based on an axis, often used in [[joystick]] configuration files.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-scale&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;offset&amp;gt;0.001&amp;lt;/offset&amp;gt;&lt;br /&gt;
  &amp;lt;factor&amp;gt;-1&amp;lt;/factor&amp;gt;&lt;br /&gt;
  &amp;lt;power&amp;gt;3&amp;lt;/power&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''offset:''' the offset to shift by, before applying the factor.&lt;br /&gt;
* '''factor:''' the factor to multiply by (use negative to reverse).&lt;br /&gt;
* '''squared:''' if true will square the resulting value (same as power=2).&lt;br /&gt;
* '''power:''' the resulting value will be taken to the power of this integer value (overrides squared).&lt;br /&gt;
&lt;br /&gt;
Remember: &amp;lt;tt&amp;gt;((property^power + offset) * factor) = result&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-swap ===&lt;br /&gt;
Swaps the values of two properties, useful for radio panels.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-swap&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/instrumentation/comm/frequencies/selected-mhz&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/instrumentation/comm/frequencies/standby-mhz&amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-toggle ===&lt;br /&gt;
Toggles the value of a property on each click, between true (1) and false (0).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-toggle&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/gear/gear-down&amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or - if defined - it toggles between two custom values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-toggle&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/gear/gear-down&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value&amp;gt;2&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;value&amp;gt;3&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===request-metar ===&lt;br /&gt;
{{cquote|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
fgcommand(&amp;quot;request-metar&amp;quot;, props.Node.new({&amp;quot;path&amp;quot;: &amp;quot;/foo/mymetar&amp;quot;, &amp;quot;station&amp;quot;: &amp;quot;LOWI&amp;quot;}));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you pass an existing path, the station ID will be updated, and if you pass the same station ID as before, no additional request is made. As usual for metar-properties, there's a time-to-live and valid flags you can check, and the metar refreshes automatically every 900 seconds. You can also write to the station ID directly to change station, update the time-to-live, and wait for the valid signal.&lt;br /&gt;
&lt;br /&gt;
There's also an unregister command ('clear-metar') to cancel the binding into the property tree.&amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg38372.html|title=&amp;lt;nowiki&amp;gt;[Flightgear-devel] Requesting arbitrary metar&amp;lt;/nowiki&amp;gt;|author=James Turner|date=Sun, 23 Sep 2012 08:56:48 -0700}}&amp;lt;/ref&amp;gt;|James Turner}}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
=== Wiki ===&lt;br /&gt;
* [[Howto:Make a clickable panel]]&lt;br /&gt;
* [[Howto:Reassign keyboard bindings]]&lt;br /&gt;
&lt;br /&gt;
=== Readme file ===&lt;br /&gt;
* {{readme file|commands}}&lt;br /&gt;
&lt;br /&gt;
=== Source ===&lt;br /&gt;
Note that many commands are defined elsewhere. The readme file has a more complete listing.&lt;br /&gt;
&lt;br /&gt;
* {{flightgear source|path=src/Main/fg_commands.hxx}}&lt;br /&gt;
* {{flightgear source|path=src/Main/fg_commands.cxx}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:XML]]&lt;br /&gt;
[[Category:FlightGear keyboard]]&lt;br /&gt;
[[Category:Joysticks and Yokes]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Bindings&amp;diff=121630</id>
		<title>Bindings</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Bindings&amp;diff=121630"/>
		<updated>2020-02-25T15:12:10Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: Property-scale: 'power' is applied to property prior to offset and factor&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Bindings''' define what happens when a user:&lt;br /&gt;
* [[Howto: Make a clickable panel|Clicks an object]] in the [[scenery]] or in an [[aircraft]].&lt;br /&gt;
* Presses a key/button on the keyboard or [[joystick]].&lt;br /&gt;
* Clicks a [[menu]] item&lt;br /&gt;
* Interacts with a dialog (clicking a button, selecting list entries etc)&lt;br /&gt;
&lt;br /&gt;
In other words, '''bindings''' are simply the term for '''actions''' that are associated with certain '''events''' in FlightGear. &lt;br /&gt;
&lt;br /&gt;
There are different types of events supported by various subsystems, but the resulting action that can be triggered will typically involve either a hard-coded command (a so called fgcommand), or a block of scripted code (using [[Nasal]]). Bindings can be parameterized/customized using properties as arguments that are passed to each binding as a props.Node object.&lt;br /&gt;
And Nasal code can also be registered to become available as a dedicated fgcommand.&lt;br /&gt;
&lt;br /&gt;
You can assign multiple bindings to one object, button or key. Bindings may contain [[conditions]] to make them conditionally executed. Each binding must specify a command node with its particular type, see below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|Planes are free to override key bindings to fullfill their needs. The Space Shuttle for instance has no mixture control, so the m-key switches from translational to rotational hand controller.&lt;br /&gt;
The key only performs as mixture control if the plane has mixture settings and if the plane didn't re-assign the key - so dependent on what plane you try, it may or may not. Usually the aircraft-specific help spells it out.&amp;lt;ref&amp;gt;{{cite web&lt;br /&gt;
  |url    =  https://forum.flightgear.org/viewtopic.php?p=298436#p298436 &lt;br /&gt;
  |title  =  &amp;lt;nowiki&amp;gt; Re: trouble with m-key &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
  |author =  &amp;lt;nowiki&amp;gt; Thorsten &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
  |date   =  Nov 9th, 2016 &lt;br /&gt;
  |added  =  Nov 9th, 2016 &lt;br /&gt;
  |script_version = 0.40 &lt;br /&gt;
  }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This article gives a small overview of frequently used bindings. Please refer to {{readme file|commands}} for additional information and refer to $FG_SRC/Main/commands.cxx for a complete list of available bindings.&lt;br /&gt;
&lt;br /&gt;
All given codes are examples, found on various places in the [[FlightGear]] package.&lt;br /&gt;
&lt;br /&gt;
== Commands ==&lt;br /&gt;
Below are some useful commands, some also with their equivalent Nasal call.  A more complete listing can be found in the readme file, {{readme file|commands}}.&lt;br /&gt;
&lt;br /&gt;
To learn more about adding your own custom fgcommands to the source code, see [[Howto:Add new fgcommands to FlightGear]].&lt;br /&gt;
&lt;br /&gt;
=== replay ===&lt;br /&gt;
Toggles replay.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;replay&amp;lt;/command&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
fgcommand(&amp;quot;replay&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== dialog-close ===&lt;br /&gt;
Closes the active dialog.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;dialog-close&amp;lt;/command&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
fgcommand(&amp;quot;dialog-close&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== dialog-show ===&lt;br /&gt;
Shows a dialog, which should be present in &amp;lt;tt&amp;gt;''[[$FG_ROOT]]/gui/dialogs''&amp;lt;/tt&amp;gt;. In addition, from FlightGear 2.8, dialog files located in &amp;lt;tt&amp;gt;''&amp;lt;aircraft directory&amp;gt;/gui/dialogs''&amp;lt;/tt&amp;gt; are also loaded. This should be used for dialogs specific to a certain aircraft.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;dialog-show&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;dialog-name&amp;gt;location-in-air&amp;lt;/dialog-name&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
fgcommand(&amp;quot;dialog-show&amp;quot;, props.Node.new({&amp;quot;dialog-name&amp;quot;: &amp;quot;location-in-air&amp;quot;}));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; dialog-name : The name of the dialog, as designated in its XML file.&lt;br /&gt;
&lt;br /&gt;
=== nasal ===&lt;br /&gt;
[[Nasal]] is frequently used for complicated systems, because it can execute virtually any function and allows running previously-defined Nasal functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt;b777.afds.input(0,1);&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; script : The Nasal script to execute.&lt;br /&gt;
: {{inote|Make sure that the script does not conflict with the {{wikipedia|List of XML and HTML character entity references#Predefined entities in XML|predefined XML entities}}. If it does, you can either put it in a {{wikipedia|CDATA|CDATA section}} or use a non-interpreted version (e.g., &amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt; in place of &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;).}}&lt;br /&gt;
&lt;br /&gt;
The {{func link|cmdarg()}} function is often useful in these situations to extract offset values passed to the binding. It returns the specific &amp;lt;tt&amp;gt;&amp;amp;lt;binding&amp;amp;gt;&amp;lt;/tt&amp;gt; node, which contains a &amp;lt;tt&amp;gt;&amp;amp;lt;setting&amp;amp;gt;&amp;lt;/tt&amp;gt; node at runtime if used in a joystick axis that represents the value of that axis.&lt;br /&gt;
&lt;br /&gt;
In joysticks and keyboard keys, the script is run in a specific namespace; please see [[Howto:Understand Namespaces and Methods]] for more information on namespaces.&lt;br /&gt;
&lt;br /&gt;
=== property-adjust ===&lt;br /&gt;
Increases or decreases a property's value with a given step. Maximum and minimum values are optional.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-adjust&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/autopilot/settings/heading-bug-deg&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;step&amp;gt;1&amp;lt;/step&amp;gt;&lt;br /&gt;
  &amp;lt;min&amp;gt;0&amp;lt;/min&amp;gt;&lt;br /&gt;
  &amp;lt;max&amp;gt;360&amp;lt;/max&amp;gt;&lt;br /&gt;
  &amp;lt;wrap&amp;gt;true&amp;lt;/wrap&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; property : Property that will be changed.&lt;br /&gt;
; step     : Amount to increase or decrease the property's value. Defaults to 0.&lt;br /&gt;
; offset   : Offset from the property's current value. If '''step''' is not given, this is multiplied by '''factor'''.&lt;br /&gt;
; factor   : When '''step''' is not given, '''offset''' is multiplied by this. Defaults to 1.&lt;br /&gt;
; min      : The minimum allowed value. Defaults to &amp;quot;no minimum.&amp;quot;&lt;br /&gt;
; max      : The maximum allowed value. Defaults to &amp;quot;no maximum.&amp;quot;&lt;br /&gt;
; wrap     : If true, the value will be wrapped when it passes min or max; both min and max must be present for this to work. Defaults to false.&lt;br /&gt;
; mask     : This argument accepts three value: &amp;quot;integer,&amp;quot; &amp;quot;decimal&amp;quot; and &amp;quot;all&amp;quot; (default). &amp;quot;integer&amp;quot; means that '''step''' or '''offset * factor''' is applied to the part of the property's current value left of the decimal point first. &amp;quot;decimal&amp;quot; does the same, but applies it to the prt to the right of the decimal point. &amp;quot;all&amp;quot; simply applies it to the whole number. This parameter does not seem to affect the resulting new value of the property, and so is not needed.&lt;br /&gt;
&lt;br /&gt;
=== property-assign ===&lt;br /&gt;
One of the most important commands. It sets a property to a predefined value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-assign&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/autopilot/settings/target-speed-kt&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value&amp;gt;0&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-cycle ===&lt;br /&gt;
Cycles between a list of values and assigns one to a property. The value-list can vary in length. If the current value is &amp;quot;value1&amp;quot;, it will change to &amp;quot;value2&amp;quot;; if it is &amp;quot;value2&amp;quot;, it will change to &amp;quot;value3&amp;quot;, and so on, wrapping around the end.  If the current value is not in the list, it will jump to the first one.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-cycle&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/autopilot/autobrake/setting&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;string&amp;quot;&amp;gt;ARM&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;string&amp;quot;&amp;gt;DISARM&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;string&amp;quot;&amp;gt;OFF&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
As of May 2013, the command supports additional behaviours to simplify use with the new [[Knob_/_slider_animation|knob and slider animations]]. The wrapping behaviour can be disabled by setting &amp;lt;wrap&amp;gt;0&amp;lt;/wrap&amp;gt;, and the command uses the 'offset' argument to select a direction of movement. This means a property-cycle bound to a multi-position knob will function as expected for movement in both directions.&lt;br /&gt;
&lt;br /&gt;
=== property-interpolate ===&lt;br /&gt;
Interpolates to a value with a given rate of change (per second).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-interpolate&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron-trim&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;double&amp;quot;&amp;gt;0&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;rate&amp;gt;0.5&amp;lt;/rate&amp;gt;&amp;lt;!-- 2 seconds to 0 from 1 or -1 --&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instead of using &amp;lt;rate&amp;gt;, one could use &amp;lt;time&amp;gt;, to specify the time (in seconds) it takes to go to the new value, independent of the current value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-interpolate&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron-trim&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value type=&amp;quot;double&amp;quot;&amp;gt;0&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;time&amp;gt;2&amp;lt;/time&amp;gt;&amp;lt;!-- 2 seconds to 0 from 1, 0.5, -1 etc. --&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also interpolate to a value given by a property.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-interpolate&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron-trim&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/default-aileron-trim&amp;lt;/property&amp;gt;&amp;lt;!-- the value to interpolate to, is 0 --&amp;gt;&lt;br /&gt;
  &amp;lt;rate&amp;gt;0.5&amp;lt;/rate&amp;gt;&amp;lt;!-- 2 seconds to 0 from 1 or -1 --&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-multiply ===&lt;br /&gt;
Multiply the value of a property by a given factor.&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-multiply&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;factor&amp;gt;0.5&amp;lt;/factor&amp;gt;&lt;br /&gt;
  &amp;lt;min&amp;gt;-1&amp;lt;/min&amp;gt;&lt;br /&gt;
  &amp;lt;max&amp;gt;1&amp;lt;/max&amp;gt;&lt;br /&gt;
  &amp;lt;mask&amp;gt;all&amp;lt;/mask&amp;gt;&lt;br /&gt;
  &amp;lt;wrap&amp;gt;true&amp;lt;/wrap&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''factor:''' the amount to multiply by.&lt;br /&gt;
*'''min:''' minimum value.&lt;br /&gt;
*'''max:''' maximum value.&lt;br /&gt;
*'''mask:'''&lt;br /&gt;
** '''integer:''' mutiply only left of the decimal point.&lt;br /&gt;
** '''decimal:''' multiply only the right of the decimal point.&lt;br /&gt;
** '''all:''' multiply the entire value.&lt;br /&gt;
*'''wrap:''' true if the value should be wrapped if it passes min/max. It is required to set both min and max in that case.&lt;br /&gt;
&lt;br /&gt;
=== property-randomize ===&lt;br /&gt;
Assigns a random value (between min and max) to a property.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-randomize&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/orientation/pitch-deg&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;min&amp;gt;0&amp;lt;/min&amp;gt;&lt;br /&gt;
  &amp;lt;max&amp;gt;360&amp;lt;/max&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-scale ===&lt;br /&gt;
Set the value of a property based on an axis, often used in [[joystick]] configuration files.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-scale&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/flight/aileron&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;offset&amp;gt;0.001&amp;lt;/offset&amp;gt;&lt;br /&gt;
  &amp;lt;factor&amp;gt;-1&amp;lt;/factor&amp;gt;&lt;br /&gt;
  &amp;lt;power&amp;gt;3&amp;lt;/power&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''offset:''' the offset to shift by, before applying the factor.&lt;br /&gt;
* '''factor:''' the factor to multiply by (use negative to reverse).&lt;br /&gt;
* '''squared:''' if true will square the resulting value (same as power=2).&lt;br /&gt;
* '''power:''' the resulting value will be taken to the power of this integer value (overrides squared).&lt;br /&gt;
&lt;br /&gt;
Remember: &amp;lt;tt&amp;gt;((property^power + offset)*factor)=result&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-swap ===&lt;br /&gt;
Swaps the values of two properties, useful for radio panels.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-swap&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/instrumentation/comm/frequencies/selected-mhz&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/instrumentation/comm/frequencies/standby-mhz&amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== property-toggle ===&lt;br /&gt;
Toggles the value of a property on each click, between true (1) and false (0).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-toggle&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/gear/gear-down&amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or - if defined - it toggles between two custom values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;binding&amp;gt;&lt;br /&gt;
  &amp;lt;command&amp;gt;property-toggle&amp;lt;/command&amp;gt;&lt;br /&gt;
  &amp;lt;property&amp;gt;/controls/gear/gear-down&amp;lt;/property&amp;gt;&lt;br /&gt;
  &amp;lt;value&amp;gt;2&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;value&amp;gt;3&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;lt;/binding&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===request-metar ===&lt;br /&gt;
{{cquote|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
fgcommand(&amp;quot;request-metar&amp;quot;, props.Node.new({&amp;quot;path&amp;quot;: &amp;quot;/foo/mymetar&amp;quot;, &amp;quot;station&amp;quot;: &amp;quot;LOWI&amp;quot;}));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you pass an existing path, the station ID will be updated, and if you pass the same station ID as before, no additional request is made. As usual for metar-properties, there's a time-to-live and valid flags you can check, and the metar refreshes automatically every 900 seconds. You can also write to the station ID directly to change station, update the time-to-live, and wait for the valid signal.&lt;br /&gt;
&lt;br /&gt;
There's also an unregister command ('clear-metar') to cancel the binding into the property tree.&amp;lt;ref&amp;gt;{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg38372.html|title=&amp;lt;nowiki&amp;gt;[Flightgear-devel] Requesting arbitrary metar&amp;lt;/nowiki&amp;gt;|author=James Turner|date=Sun, 23 Sep 2012 08:56:48 -0700}}&amp;lt;/ref&amp;gt;|James Turner}}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
=== Wiki ===&lt;br /&gt;
* [[Howto:Make a clickable panel]]&lt;br /&gt;
* [[Howto:Reassign keyboard bindings]]&lt;br /&gt;
&lt;br /&gt;
=== Readme file ===&lt;br /&gt;
* {{readme file|commands}}&lt;br /&gt;
&lt;br /&gt;
=== Source ===&lt;br /&gt;
Note that many commands are defined elsewhere. The readme file has a more complete listing.&lt;br /&gt;
&lt;br /&gt;
* {{flightgear source|path=src/Main/fg_commands.hxx}}&lt;br /&gt;
* {{flightgear source|path=src/Main/fg_commands.cxx}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:XML]]&lt;br /&gt;
[[Category:FlightGear keyboard]]&lt;br /&gt;
[[Category:Joysticks and Yokes]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=JSBSim_Aerodynamics&amp;diff=120016</id>
		<title>JSBSim Aerodynamics</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=JSBSim_Aerodynamics&amp;diff=120016"/>
		<updated>2019-08-22T13:20:52Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: Forces, Lift: CL, minor additions (QBarUW)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[JSBSim]] provides a framework for aerodynamics. This page will attempt to explain how to translate traditional aerodynamics concepts into the [[JSBSim]] framework, and how to create [[FDM]]s that are sane for any flight value.&lt;br /&gt;
&lt;br /&gt;
This page uses the term &amp;quot;coefficient&amp;quot; both the traditional sense of a constant multiplicative factor or in the [[JSBSim]] sense of the output of a function derived from a coefficient.&lt;br /&gt;
&lt;br /&gt;
JSBSim provides three [[#Forces|Forces]] and three [[#Moments|Moments]] (a moment is a twisting or turning force), therefore it is a 'six degree of freedom' simulation.&lt;br /&gt;
&lt;br /&gt;
== Frames ==&lt;br /&gt;
JSBSim incorporates several frame of reference. The body frame and wind frame are the most important to the aerodynamic model.&lt;br /&gt;
* '''Body XYZ''' The body frame uses the X axis for forward and aft, with + to the front. The Y axis is side to side with + to the right. The Z axis is up and down, with + being down. The origin of this frame is the Center of Gravity (CG), about which the aircraft forces and moments are summed and the resulting accelerations are integrated to get velocities. &lt;br /&gt;
&lt;br /&gt;
* '''Wind XYZ''' The wind frame X-axis points directly into the relative wind. The Z-axis is perpendicular to the X-axis, and remains within the aircraft body axis XZ plane (also called the reference plane). The Y-axis completes a right hand coordinate system. The origin of this frame is the AeroRP.&lt;br /&gt;
&lt;br /&gt;
* '''Wind UVW''' This isn't really a frame, but it is the components of the wind velocity vector. The relative wind is imposed on the body frame using variables U,V, and W. U to represent the velocity of the wind flowing past the aircraft. U represents the wind blowing down the X or longitudinal axis of the aircraft. V represents the wind blowing down the body frame Y axis, that is, wind in your ear. W represents wind blowing down the body frame Z axis, or wind from above.&lt;br /&gt;
&lt;br /&gt;
== Angles ==&lt;br /&gt;
These two angles define the direction the relative wind is blowing in regard to the body frame.&lt;br /&gt;
* '''Alpha''' Alpha is the angle between the X body axis and the X wind axis measured on the UV plane. In standard aerodynamics Alpha is often referenced to the main wing chord line, this is not the case in [[JSBSim]].&lt;br /&gt;
* '''Beta''' Beta is the angle between the X body axis and the X wind axis measured in the UW plane.&lt;br /&gt;
&lt;br /&gt;
== QBar ==&lt;br /&gt;
QBar, or dynamic pressure, is the product of velocity^2*(air density)/2&lt;br /&gt;
* '''QBarUW''' Use this value for formula involving Alpha. It is the value of QBar restricted to the vertical plane airspeed components contribution.&lt;br /&gt;
* '''QBarUV''' Use this value for formula involving Beta. It is the value of QBar restricted to the horizontal plane airspeed components contribution.&lt;br /&gt;
* It is possible to calculate other dynamic pressures for special purposes, such as QBarU for control surfaces.&lt;br /&gt;
&lt;br /&gt;
The Greek letter rho or &amp;quot;ρ&amp;quot; is commonly used for air density. Normally, Qbar is based on the total free stream velocity, V[∞], so:&lt;br /&gt;
&lt;br /&gt;
'''qbar = 1/2*ρ*(V[∞])^2'''&lt;br /&gt;
&lt;br /&gt;
V[∞] is a vector and can be broken down into components commonly called U, V, W. By definition, U, V, and W are all at right angle to each other, so we use Pythagoras to say:&lt;br /&gt;
&lt;br /&gt;
'''(V[∞])^2 = U^2 + V^2 + W^2'''&lt;br /&gt;
&lt;br /&gt;
and rewrite&lt;br /&gt;
&lt;br /&gt;
'''qbar = 1/2*ρ*(U^2 + V^2 + W^2)'''&lt;br /&gt;
&lt;br /&gt;
QbarUV drops the vertical component, W, and just uses:&lt;br /&gt;
&lt;br /&gt;
'''qbarUV = 1/2*ρ*(U^2 + V^2)'''&lt;br /&gt;
&lt;br /&gt;
QbarUW drops the horizontal component and just uses:&lt;br /&gt;
&lt;br /&gt;
'''qbarUW = 1/2*ρ*(U^2 + W^2)'''&lt;br /&gt;
&lt;br /&gt;
And for the special case of qbarU, only use the axial component.&lt;br /&gt;
&lt;br /&gt;
'''qbarU = 1/2*rho*(U^2)'''&lt;br /&gt;
&lt;br /&gt;
Since its one dimensional, preserving the sign to show direction is valid:&lt;br /&gt;
&lt;br /&gt;
'''qbarU = 1/2*ρ*(U*abs(U))'''&lt;br /&gt;
&lt;br /&gt;
Qbar, qbarUV and qbarUW, can not have signs because they are multidimensional, use the reported alpha or beta angles to decide where the pressure is coming from.&lt;br /&gt;
&lt;br /&gt;
== Metrics ==&lt;br /&gt;
The metrics section provides a standard place to record common aircraft dimensions. [[Aeromatic]] built [[FDM]]s only use four of the defined properties.&lt;br /&gt;
* Wing Area - metrics/Sw-sqft&lt;br /&gt;
* Wing Span - metrics/bw-ft&lt;br /&gt;
* Wing Chord - metrics/cbarw-ft&lt;br /&gt;
* AeroRP - the location where the aerodynamic forces are applied to the model. If this location is not exactly equal to the center of gravity (CoG) then moments, or twisting forces, will be created. Conventional aircraft need AeroRP to be aft of the CoG for stability.&lt;br /&gt;
&lt;br /&gt;
Other dimensions [[Aeromatic]] creates but does not use are: (tail arms are used by the JSBSim Turbulence code)&lt;br /&gt;
* Horizontal Tail Area - Sh-sqft&lt;br /&gt;
* Horizontal Tail Arm - lh-ft &lt;br /&gt;
* Vertical Tail Area - Sv-sqft&lt;br /&gt;
* Vertical Tail Arm - lv-ft&lt;br /&gt;
&lt;br /&gt;
Other elements in metrics:&lt;br /&gt;
* EYEPOINT - where G-forces are computed for the pilot&lt;br /&gt;
* VRP - the world position reported by JSBSim to FlightGear is for this location in the structural frame. Hence, the VRP location should match the origin of the coordinate system(s) used to position views, sounds and the 3d model in the FlightGear XML files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metrics&amp;gt;&lt;br /&gt;
    &amp;lt;wingarea unit=&amp;quot;{FT2 | M2}&amp;quot;&amp;gt; {number} &amp;lt;/wingarea&amp;gt;&lt;br /&gt;
    &amp;lt;wingspan unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/wingspan&amp;gt;&lt;br /&gt;
    &amp;lt;chord unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/chord&amp;gt;&lt;br /&gt;
    &amp;lt;htailarea unit=&amp;quot;{FT2 | M2}&amp;quot;&amp;gt; {number} &amp;lt;/htailarea&amp;gt;&lt;br /&gt;
    &amp;lt;htailarm unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/htailarm&amp;gt;&lt;br /&gt;
    &amp;lt;vtailarea unit=&amp;quot;{FT2 | M}&amp;quot;&amp;gt; {number} &amp;lt;/vtailarea&amp;gt;&lt;br /&gt;
    &amp;lt;vtailarm unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/vtailarm&amp;gt;&lt;br /&gt;
    &amp;lt;wing_incidence unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt; {number} &amp;lt;/wing_incidence&amp;gt;&lt;br /&gt;
    &amp;lt;pitot_angle unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt; {number} &amp;lt;/pitot_angle&amp;gt;&lt;br /&gt;
    &amp;lt;location name=&amp;quot;{AERORP | EYEPOINT | VRP}&amp;quot; unit=&amp;quot;{IN | M}&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;x&amp;gt; {number} &amp;lt;/x&amp;gt;&lt;br /&gt;
         &amp;lt;y&amp;gt; {number} &amp;lt;/y&amp;gt;&lt;br /&gt;
         &amp;lt;z&amp;gt; {number} &amp;lt;/z&amp;gt;&lt;br /&gt;
    &amp;lt;/location&amp;gt;&lt;br /&gt;
    {other location blocks}&lt;br /&gt;
&amp;lt;/metrics&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Forces ==&lt;br /&gt;
&lt;br /&gt;
For purposes of the Aerodynamics section the entire aircraft creates a single, unified aerodynamic force. This force is split into three component vectors. The most common way of splitting this force into vectors is the Lift Drag Side method. Another, potential better way from the perspective of generating a full 360 degree capable [[FDM]], is the Normal, Axial, Side method.&lt;br /&gt;
* '''Lift: CL''' Lift is the portion of the aerodynamic force that is at a right angle to the relative wind '''and''' lies within the x-z-axis plane (usually the aircraft's symmetry plane) '''and''' is oriented towards the aircraft's upside. (During inverted flight, it points to the ground).&lt;br /&gt;
** Lift is a function of QBar * Wing Area * Cl&amp;lt;sub&amp;gt;lift&amp;lt;/sub&amp;gt;. Cl&amp;lt;sub&amp;gt;lift&amp;lt;/sub&amp;gt; is generally derived from a 2D table as a function of AoA. In the real world it is also a function of the Reynolds and Mach Numbers. At least for unswept wings, using '''QBarUW''' is more appropriate for CL than the generic QBar. Otherwise, your aircraft will likely be prone to the issue [https://github.com/JSBSim-Team/jsbsim/issues/89 Pitch oscillations at rest, Brakes ON, with pure crosswind]. Swept wings might need a different treatment that we have not investigated further. ''However this has only been tested for the particular case of the c172, these are not universal laws but rather guidance or at the very least trouble shooting.''&lt;br /&gt;
* '''Drag: CD''' Drag is the portion of the aerodynamic force that is parallel to the relative wind.&lt;br /&gt;
** It is important to ensure all coefficient functions in the drag section remain positive. When drag coefficient functions are negative, drag is effectively acting as thrust opposite the relative wind.&lt;br /&gt;
* '''Side: CY''' Side is the portion of the aerodynamic force that is at a right angle to both the Lift and the Drag vector. It usually points to the aircraft's right side.&lt;br /&gt;
&lt;br /&gt;
This system was developed by and for people using wind tunnels. Lift is to the top of the wind tunnel, drag is out the back and side is to the side. As a real aircraft in free space yanks and banks it may become ambiguous which direction the forces are applied. If an aircraft's body-x-axis is oriented exactly perpendicular to the relative wind, the definitions given above cannot be applied.&lt;br /&gt;
&lt;br /&gt;
Enter the Axial, Normal, Side system.&lt;br /&gt;
* '''Axial: CA''' Axial force is the portion of the aerodynamic force that is parallel to the aircraft's longitudinal (X) axis. For very small angles of attack it is analogous to Drag.&lt;br /&gt;
* '''Normal: CN''' Normal force is the portion of the aerodynamic force that is parallel to the aircraft's vertical (Z) axis.  For very small angles of attack it is analogous to Lift.&lt;br /&gt;
* '''Side: CY''' Side is the portion of the aerodynamic force that is parallel to the aircraft's lateral (Y) axis.&lt;br /&gt;
&lt;br /&gt;
Which ever system is used, the forces are applied at the Aerodynamic Reference Point (AeroRP). If the AeroRP is not coincident to the model's center of gravity (CG), yaw, pitch and roll moments are created that do not appear in the moments sections.&lt;br /&gt;
&lt;br /&gt;
== Moments ==&lt;br /&gt;
* '''Roll: Cl''' Aerodynamic rolling moment comes from multiple sources:&lt;br /&gt;
** One is the lift generated by the vertical tail. On most aircraft the center of pressure for the vertical tail is not on the X body axis. This sets up a moment arm creating a moment of (moment arm length)*(vertical tail lift force).&lt;br /&gt;
** Another roll moment source is main wing dihedral angle. If a dihedral wing encounters a sidewind component, let's say from the right, then the effective angle of attack will slightly increase for the right wing and decrease for the left wing. This is because - from the wing's perspective - the side wind component approaches the right wing from below (leading to an increase in AOA and more lift) and the left wing from above (leading to a decrease in AOA and less lift). Rolling the aircraft to one side will induce a side motion which leads to a resulting difference in lift, creating a roll moment counteracting the initial roll angle and providing roll stability.&lt;br /&gt;
&lt;br /&gt;
* '''Pitch: Cm''' The primary contributor to the pitching moment is the lift generated by the horizontal tail. The pitching moment of the main wing airfoil is a secondary contributor. Because of this fact it makes sense that the value for Cm will resemble the CL curve for the horizontal tail airfoil. The standard CL curve does not take into account the changes in tail Angle of Attack (AoA) and QBar due to main wing down-wash and rotational velocity around the Y axis. At least for unswept wings, using '''QBarUW''' is more appropriate for Cm than the generic QBar. Otherwise, your aircraft will likely be prone to the issue [https://github.com/JSBSim-Team/jsbsim/issues/89 Pitch oscillations at rest, Brakes ON, with pure crosswind]. Swept wings might need a different treatment that we have not investigated further. ''However this has only been tested for the particular case of the c172, these are not universal laws but rather guidance or at the very least trouble shooting.''&lt;br /&gt;
* '''Yaw: Cn''' The primary contributor to the yawing moment is the lift generated by the vertical tail. The wind force on the fuselage is a secondary contributor. Because of this fact it makes sense that the value for Cn will resemble the CL curve for the vertical tail airfoil. Changes in QBar due to the vertical tail moving into the 'shadow' of a stalled main wing may need to be accounted for, as well. The source for vertical tail Angle of Attack (AoA) should be Beta and QBarUV is more appropriate for Cn than the generic QBar.&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
* '''Stall''' - A 'stall' is generally regarded as a loss of lift due to flow separation over the top of a wing, however, examination of lift polar for an airfoil over a full 360 degrees shows that significant amounts of lift are NOT lost as the stall occurs. The biggest aerodynamic effect of a stall is a large and rapid increase in drag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;hysteresis_limits unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;min&amp;gt; {number} &amp;lt;/min&amp;gt;&lt;br /&gt;
    &amp;lt;max&amp;gt; {number} &amp;lt;/max&amp;gt;&lt;br /&gt;
&amp;lt;/hysteresis_limits&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Spin''' - Spins are caused loss of stability in the Yaw Moment axis. A stock [[Aeromatic]] [[FDM]] yaw section does not take alpha into account when calculating the yaw moment.&lt;br /&gt;
* '''Aerodynamic Reference Point''' - JSBSim provides a way to shift the aerodynamic reference point (AeroRP) forward (negative values) and aft (positive) in response to mach, pitch or other influences. Use the tag &amp;amp;lt;aero_ref_pt_shift_x&amp;amp;gt; in the &amp;amp;lt;aerodynamics&amp;amp;gt; section.  The value this tag function returns is internally multiplied by the chord entered in the &amp;amp;lt;metrics&amp;amp;gt; section to get the final shift. You could use this by setting the AeroRP to the leading edge of the wing and use a 1D table indexed by mach starting at .25 chord and getting bigger as the mach number increases to simulate mach tuck. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;aero_ref_pt_shift_x&amp;gt;  &lt;br /&gt;
    &amp;lt;function&amp;gt;&lt;br /&gt;
        {function contents}&lt;br /&gt;
    &amp;lt;/function&amp;gt; &lt;br /&gt;
&amp;lt;/aero_ref_pt_shift_x&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Lift Due To Elevator''' - There are two interrelated effects from elevator deflection, the Force change and the Moment. These have two different coefficients in two different sections of the FDM but should be considered together. The formula is:&lt;br /&gt;
&lt;br /&gt;
CLde * lh-ft = Cmde * cbarw-ft&lt;br /&gt;
&lt;br /&gt;
That is, the force (lift) created by the elevator times its length from the CG is equal to the moment. For some reason standard aerodynamics uses the chord as the reference length.&lt;br /&gt;
&lt;br /&gt;
A similar formula:&lt;br /&gt;
&lt;br /&gt;
CYdr * lv-ft = Cndr * bw-ft &lt;br /&gt;
&lt;br /&gt;
Is applicable the rudder's side force and yawing moment. The force (side) created by the rudder times its length from the CG is equal to the moment. For some reason standard aerodynamics uses the wing span as the reference length.&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
[[Aero input and outputs]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=JSBSim_Aerodynamics&amp;diff=120015</id>
		<title>JSBSim Aerodynamics</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=JSBSim_Aerodynamics&amp;diff=120015"/>
		<updated>2019-08-22T13:05:23Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: Moments, Pitch: Cm additions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[JSBSim]] provides a framework for aerodynamics. This page will attempt to explain how to translate traditional aerodynamics concepts into the [[JSBSim]] framework, and how to create [[FDM]]s that are sane for any flight value.&lt;br /&gt;
&lt;br /&gt;
This page uses the term &amp;quot;coefficient&amp;quot; both the traditional sense of a constant multiplicative factor or in the [[JSBSim]] sense of the output of a function derived from a coefficient.&lt;br /&gt;
&lt;br /&gt;
JSBSim provides three [[#Forces|Forces]] and three [[#Moments|Moments]] (a moment is a twisting or turning force), therefore it is a 'six degree of freedom' simulation.&lt;br /&gt;
&lt;br /&gt;
== Frames ==&lt;br /&gt;
JSBSim incorporates several frame of reference. The body frame and wind frame are the most important to the aerodynamic model.&lt;br /&gt;
* '''Body XYZ''' The body frame uses the X axis for forward and aft, with + to the front. The Y axis is side to side with + to the right. The Z axis is up and down, with + being down. The origin of this frame is the Center of Gravity (CG), about which the aircraft forces and moments are summed and the resulting accelerations are integrated to get velocities. &lt;br /&gt;
&lt;br /&gt;
* '''Wind XYZ''' The wind frame X-axis points directly into the relative wind. The Z-axis is perpendicular to the X-axis, and remains within the aircraft body axis XZ plane (also called the reference plane). The Y-axis completes a right hand coordinate system. The origin of this frame is the AeroRP.&lt;br /&gt;
&lt;br /&gt;
* '''Wind UVW''' This isn't really a frame, but it is the components of the wind velocity vector. The relative wind is imposed on the body frame using variables U,V, and W. U to represent the velocity of the wind flowing past the aircraft. U represents the wind blowing down the X or longitudinal axis of the aircraft. V represents the wind blowing down the body frame Y axis, that is, wind in your ear. W represents wind blowing down the body frame Z axis, or wind from above.&lt;br /&gt;
&lt;br /&gt;
== Angles ==&lt;br /&gt;
These two angles define the direction the relative wind is blowing in regard to the body frame.&lt;br /&gt;
* '''Alpha''' Alpha is the angle between the X body axis and the X wind axis measured on the UV plane. In standard aerodynamics Alpha is often referenced to the main wing chord line, this is not the case in [[JSBSim]].&lt;br /&gt;
* '''Beta''' Beta is the angle between the X body axis and the X wind axis measured in the UW plane.&lt;br /&gt;
&lt;br /&gt;
== QBar ==&lt;br /&gt;
QBar, or dynamic pressure, is the product of velocity^2*(air density)/2&lt;br /&gt;
* '''QBarUW''' Use this value for formula involving Alpha. It is the value of QBar restricted to the vertical plane airspeed components contribution.&lt;br /&gt;
* '''QBarUV''' Use this value for formula involving Beta. It is the value of QBar restricted to the horizontal plane airspeed components contribution.&lt;br /&gt;
* It is possible to calculate other dynamic pressures for special purposes, such as QBarU for control surfaces.&lt;br /&gt;
&lt;br /&gt;
The Greek letter rho or &amp;quot;ρ&amp;quot; is commonly used for air density. Normally, Qbar is based on the total free stream velocity, V[∞], so:&lt;br /&gt;
&lt;br /&gt;
'''qbar = 1/2*ρ*(V[∞])^2'''&lt;br /&gt;
&lt;br /&gt;
V[∞] is a vector and can be broken down into components commonly called U, V, W. By definition, U, V, and W are all at right angle to each other, so we use Pythagoras to say:&lt;br /&gt;
&lt;br /&gt;
'''(V[∞])^2 = U^2 + V^2 + W^2'''&lt;br /&gt;
&lt;br /&gt;
and rewrite&lt;br /&gt;
&lt;br /&gt;
'''qbar = 1/2*ρ*(U^2 + V^2 + W^2)'''&lt;br /&gt;
&lt;br /&gt;
QbarUV drops the vertical component, W, and just uses:&lt;br /&gt;
&lt;br /&gt;
'''qbarUV = 1/2*ρ*(U^2 + V^2)'''&lt;br /&gt;
&lt;br /&gt;
QbarUW drops the horizontal component and just uses:&lt;br /&gt;
&lt;br /&gt;
'''qbarUW = 1/2*ρ*(U^2 + W^2)'''&lt;br /&gt;
&lt;br /&gt;
And for the special case of qbarU, only use the axial component.&lt;br /&gt;
&lt;br /&gt;
'''qbarU = 1/2*rho*(U^2)'''&lt;br /&gt;
&lt;br /&gt;
Since its one dimensional, preserving the sign to show direction is valid:&lt;br /&gt;
&lt;br /&gt;
'''qbarU = 1/2*ρ*(U*abs(U))'''&lt;br /&gt;
&lt;br /&gt;
Qbar, qbarUV and qbarUW, can not have signs because they are multidimensional, use the reported alpha or beta angles to decide where the pressure is coming from.&lt;br /&gt;
&lt;br /&gt;
== Metrics ==&lt;br /&gt;
The metrics section provides a standard place to record common aircraft dimensions. [[Aeromatic]] built [[FDM]]s only use four of the defined properties.&lt;br /&gt;
* Wing Area - metrics/Sw-sqft&lt;br /&gt;
* Wing Span - metrics/bw-ft&lt;br /&gt;
* Wing Chord - metrics/cbarw-ft&lt;br /&gt;
* AeroRP - the location where the aerodynamic forces are applied to the model. If this location is not exactly equal to the center of gravity (CoG) then moments, or twisting forces, will be created. Conventional aircraft need AeroRP to be aft of the CoG for stability.&lt;br /&gt;
&lt;br /&gt;
Other dimensions [[Aeromatic]] creates but does not use are: (tail arms are used by the JSBSim Turbulence code)&lt;br /&gt;
* Horizontal Tail Area - Sh-sqft&lt;br /&gt;
* Horizontal Tail Arm - lh-ft &lt;br /&gt;
* Vertical Tail Area - Sv-sqft&lt;br /&gt;
* Vertical Tail Arm - lv-ft&lt;br /&gt;
&lt;br /&gt;
Other elements in metrics:&lt;br /&gt;
* EYEPOINT - where G-forces are computed for the pilot&lt;br /&gt;
* VRP - the world position reported by JSBSim to FlightGear is for this location in the structural frame. Hence, the VRP location should match the origin of the coordinate system(s) used to position views, sounds and the 3d model in the FlightGear XML files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metrics&amp;gt;&lt;br /&gt;
    &amp;lt;wingarea unit=&amp;quot;{FT2 | M2}&amp;quot;&amp;gt; {number} &amp;lt;/wingarea&amp;gt;&lt;br /&gt;
    &amp;lt;wingspan unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/wingspan&amp;gt;&lt;br /&gt;
    &amp;lt;chord unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/chord&amp;gt;&lt;br /&gt;
    &amp;lt;htailarea unit=&amp;quot;{FT2 | M2}&amp;quot;&amp;gt; {number} &amp;lt;/htailarea&amp;gt;&lt;br /&gt;
    &amp;lt;htailarm unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/htailarm&amp;gt;&lt;br /&gt;
    &amp;lt;vtailarea unit=&amp;quot;{FT2 | M}&amp;quot;&amp;gt; {number} &amp;lt;/vtailarea&amp;gt;&lt;br /&gt;
    &amp;lt;vtailarm unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/vtailarm&amp;gt;&lt;br /&gt;
    &amp;lt;wing_incidence unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt; {number} &amp;lt;/wing_incidence&amp;gt;&lt;br /&gt;
    &amp;lt;pitot_angle unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt; {number} &amp;lt;/pitot_angle&amp;gt;&lt;br /&gt;
    &amp;lt;location name=&amp;quot;{AERORP | EYEPOINT | VRP}&amp;quot; unit=&amp;quot;{IN | M}&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;x&amp;gt; {number} &amp;lt;/x&amp;gt;&lt;br /&gt;
         &amp;lt;y&amp;gt; {number} &amp;lt;/y&amp;gt;&lt;br /&gt;
         &amp;lt;z&amp;gt; {number} &amp;lt;/z&amp;gt;&lt;br /&gt;
    &amp;lt;/location&amp;gt;&lt;br /&gt;
    {other location blocks}&lt;br /&gt;
&amp;lt;/metrics&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Forces ==&lt;br /&gt;
&lt;br /&gt;
For purposes of the Aerodynamics section the entire aircraft creates a single, unified aerodynamic force. This force is split into three component vectors. The most common way of splitting this force into vectors is the Lift Drag Side method. Another, potential better way from the perspective of generating a full 360 degree capable [[FDM]], is the Normal, Axial, Side method.&lt;br /&gt;
* '''Lift: CL''' Lift is the portion of the aerodynamic force that is at a right angle to the relative wind '''and''' lies within the x-z-axis plane (usually the aircraft's symmetry plane) '''and''' is oriented towards the aircraft's upside. (During inverted flight, it points to the ground).&lt;br /&gt;
** Lift is a function of QBar * Wing Area * Cl&amp;lt;sub&amp;gt;lift&amp;lt;/sub&amp;gt;. Cl&amp;lt;sub&amp;gt;lift&amp;lt;/sub&amp;gt; is generally derived from a 2D table as a function of AoA. In the real world it is also a function of the Reynolds and Mach Numbers. Using QBarUW is more appropriate for CL than the generic QBar.&lt;br /&gt;
* '''Drag: CD''' Drag is the portion of the aerodynamic force that is parallel to the relative wind.&lt;br /&gt;
** It is important to ensure all coefficient functions in the drag section remain positive. When drag coefficient functions are negative, drag is effectively acting as thrust opposite the relative wind.&lt;br /&gt;
* '''Side: CY''' Side is the portion of the aerodynamic force that is at a right angle to both the Lift and the Drag vector. It usually points to the aircraft's right side.&lt;br /&gt;
&lt;br /&gt;
This system was developed by and for people using wind tunnels. Lift is to the top of the wind tunnel, drag is out the back and side is to the side. As a real aircraft in free space yanks and banks it may become ambiguous which direction the forces are applied. If an aircraft's body-x-axis is oriented exactly perpendicular to the relative wind, the definitions given above cannot be applied.&lt;br /&gt;
&lt;br /&gt;
Enter the Axial, Normal, Side system.&lt;br /&gt;
* '''Axial: CA''' Axial force is the portion of the aerodynamic force that is parallel to the aircraft's longitudinal (X) axis. For very small angles of attack it is analogous to Drag.&lt;br /&gt;
* '''Normal: CN''' Normal force is the portion of the aerodynamic force that is parallel to the aircraft's vertical (Z) axis.  For very small angles of attack it is analogous to Lift.&lt;br /&gt;
* '''Side: CY''' Side is the portion of the aerodynamic force that is parallel to the aircraft's lateral (Y) axis.&lt;br /&gt;
&lt;br /&gt;
Which ever system is used, the forces are applied at the Aerodynamic Reference Point (AeroRP). If the AeroRP is not coincident to the model's center of gravity (CG), yaw, pitch and roll moments are created that do not appear in the moments sections.&lt;br /&gt;
&lt;br /&gt;
== Moments ==&lt;br /&gt;
* '''Roll: Cl''' Aerodynamic rolling moment comes from multiple sources:&lt;br /&gt;
** One is the lift generated by the vertical tail. On most aircraft the center of pressure for the vertical tail is not on the X body axis. This sets up a moment arm creating a moment of (moment arm length)*(vertical tail lift force).&lt;br /&gt;
** Another roll moment source is main wing dihedral angle. If a dihedral wing encounters a sidewind component, let's say from the right, then the effective angle of attack will slightly increase for the right wing and decrease for the left wing. This is because - from the wing's perspective - the side wind component approaches the right wing from below (leading to an increase in AOA and more lift) and the left wing from above (leading to a decrease in AOA and less lift). Rolling the aircraft to one side will induce a side motion which leads to a resulting difference in lift, creating a roll moment counteracting the initial roll angle and providing roll stability.&lt;br /&gt;
&lt;br /&gt;
* '''Pitch: Cm''' The primary contributor to the pitching moment is the lift generated by the horizontal tail. The pitching moment of the main wing airfoil is a secondary contributor. Because of this fact it makes sense that the value for Cm will resemble the CL curve for the horizontal tail airfoil. The standard CL curve does not take into account the changes in tail Angle of Attack (AoA) and QBar due to main wing down-wash and rotational velocity around the Y axis. At least for unswept wings, using '''QBarUW''' is more appropriate for Cm than the generic QBar. Otherwise, your aircraft will likely be prone to the issue [https://github.com/JSBSim-Team/jsbsim/issues/89 Pitch oscillations at rest, Brakes ON, with pure crosswind]. Swept wings might need a different treatment that we have not investigated further. ''However this has only been tested for the particular case of the c172, these are not universal laws but rather guidance or at the very least trouble shooting.''&lt;br /&gt;
* '''Yaw: Cn''' The primary contributor to the yawing moment is the lift generated by the vertical tail. The wind force on the fuselage is a secondary contributor. Because of this fact it makes sense that the value for Cn will resemble the CL curve for the vertical tail airfoil. Changes in QBar due to the vertical tail moving into the 'shadow' of a stalled main wing may need to be accounted for, as well. The source for vertical tail Angle of Attack (AoA) should be Beta and QBarUV is more appropriate for Cn than the generic QBar.&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
* '''Stall''' - A 'stall' is generally regarded as a loss of lift due to flow separation over the top of a wing, however, examination of lift polar for an airfoil over a full 360 degrees shows that significant amounts of lift are NOT lost as the stall occurs. The biggest aerodynamic effect of a stall is a large and rapid increase in drag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;hysteresis_limits unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;min&amp;gt; {number} &amp;lt;/min&amp;gt;&lt;br /&gt;
    &amp;lt;max&amp;gt; {number} &amp;lt;/max&amp;gt;&lt;br /&gt;
&amp;lt;/hysteresis_limits&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Spin''' - Spins are caused loss of stability in the Yaw Moment axis. A stock [[Aeromatic]] [[FDM]] yaw section does not take alpha into account when calculating the yaw moment.&lt;br /&gt;
* '''Aerodynamic Reference Point''' - JSBSim provides a way to shift the aerodynamic reference point (AeroRP) forward (negative values) and aft (positive) in response to mach, pitch or other influences. Use the tag &amp;amp;lt;aero_ref_pt_shift_x&amp;amp;gt; in the &amp;amp;lt;aerodynamics&amp;amp;gt; section.  The value this tag function returns is internally multiplied by the chord entered in the &amp;amp;lt;metrics&amp;amp;gt; section to get the final shift. You could use this by setting the AeroRP to the leading edge of the wing and use a 1D table indexed by mach starting at .25 chord and getting bigger as the mach number increases to simulate mach tuck. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;aero_ref_pt_shift_x&amp;gt;  &lt;br /&gt;
    &amp;lt;function&amp;gt;&lt;br /&gt;
        {function contents}&lt;br /&gt;
    &amp;lt;/function&amp;gt; &lt;br /&gt;
&amp;lt;/aero_ref_pt_shift_x&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Lift Due To Elevator''' - There are two interrelated effects from elevator deflection, the Force change and the Moment. These have two different coefficients in two different sections of the FDM but should be considered together. The formula is:&lt;br /&gt;
&lt;br /&gt;
CLde * lh-ft = Cmde * cbarw-ft&lt;br /&gt;
&lt;br /&gt;
That is, the force (lift) created by the elevator times its length from the CG is equal to the moment. For some reason standard aerodynamics uses the chord as the reference length.&lt;br /&gt;
&lt;br /&gt;
A similar formula:&lt;br /&gt;
&lt;br /&gt;
CYdr * lv-ft = Cndr * bw-ft &lt;br /&gt;
&lt;br /&gt;
Is applicable the rudder's side force and yawing moment. The force (side) created by the rudder times its length from the CG is equal to the moment. For some reason standard aerodynamics uses the wing span as the reference length.&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
[[Aero input and outputs]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=JSBSim_Aerodynamics&amp;diff=119808</id>
		<title>JSBSim Aerodynamics</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=JSBSim_Aerodynamics&amp;diff=119808"/>
		<updated>2019-08-18T16:54:36Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* QBar */minor additions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[JSBSim]] provides a framework for aerodynamics. This page will attempt to explain how to translate traditional aerodynamics concepts into the [[JSBSim]] framework, and how to create [[FDM]]s that are sane for any flight value.&lt;br /&gt;
&lt;br /&gt;
This page uses the term &amp;quot;coefficient&amp;quot; both the traditional sense of a constant multiplicative factor or in the [[JSBSim]] sense of the output of a function derived from a coefficient.&lt;br /&gt;
&lt;br /&gt;
JSBSim provides three [[#Forces|Forces]] and three [[#Moments|Moments]] (a moment is a twisting or turning force), therefore it is a 'six degree of freedom' simulation.&lt;br /&gt;
&lt;br /&gt;
== Frames ==&lt;br /&gt;
JSBSim incorporates several frame of reference. The body frame and wind frame are the most important to the aerodynamic model.&lt;br /&gt;
* '''Body XYZ''' The body frame uses the X axis for forward and aft, with + to the front. The Y axis is side to side with + to the right. The Z axis is up and down, with + being down. The origin of this frame is the Center of Gravity (CG), about which the aircraft forces and moments are summed and the resulting accelerations are integrated to get velocities. &lt;br /&gt;
&lt;br /&gt;
* '''Wind XYZ''' The wind frame X-axis points directly into the relative wind. The Z-axis is perpendicular to the X-axis, and remains within the aircraft body axis XZ plane (also called the reference plane). The Y-axis completes a right hand coordinate system. The origin of this frame is the AeroRP.&lt;br /&gt;
&lt;br /&gt;
* '''Wind UVW''' This isn't really a frame, but it is the components of the wind velocity vector. The relative wind is imposed on the body frame using variables U,V, and W. U to represent the velocity of the wind flowing past the aircraft. U represents the wind blowing down the X or longitudinal axis of the aircraft. V represents the wind blowing down the body frame Y axis, that is, wind in your ear. W represents wind blowing down the body frame Z axis, or wind from above.&lt;br /&gt;
&lt;br /&gt;
== Angles ==&lt;br /&gt;
These two angles define the direction the relative wind is blowing in regard to the body frame.&lt;br /&gt;
* '''Alpha''' Alpha is the angle between the X body axis and the X wind axis measured on the UV plane. In standard aerodynamics Alpha is often referenced to the main wing chord line, this is not the case in [[JSBSim]].&lt;br /&gt;
* '''Beta''' Beta is the angle between the X body axis and the X wind axis measured in the UW plane.&lt;br /&gt;
&lt;br /&gt;
== QBar ==&lt;br /&gt;
QBar, or dynamic pressure, is the product of velocity^2*(air density)/2&lt;br /&gt;
* '''QBarUW''' Use this value for formula involving Alpha. It is the value of QBar restricted to the vertical plane airspeed components contribution.&lt;br /&gt;
* '''QBarUV''' Use this value for formula involving Beta. It is the value of QBar restricted to the horizontal plane airspeed components contribution.&lt;br /&gt;
* It is possible to calculate other dynamic pressures for special purposes, such as QBarU for control surfaces.&lt;br /&gt;
&lt;br /&gt;
The Greek letter rho or &amp;quot;ρ&amp;quot; is commonly used for air density. Normally, Qbar is based on the total free stream velocity, V[∞], so:&lt;br /&gt;
&lt;br /&gt;
'''qbar = 1/2*ρ*(V[∞])^2'''&lt;br /&gt;
&lt;br /&gt;
V[∞] is a vector and can be broken down into components commonly called U, V, W. By definition, U, V, and W are all at right angle to each other, so we use Pythagoras to say:&lt;br /&gt;
&lt;br /&gt;
'''(V[∞])^2 = U^2 + V^2 + W^2'''&lt;br /&gt;
&lt;br /&gt;
and rewrite&lt;br /&gt;
&lt;br /&gt;
'''qbar = 1/2*ρ*(U^2 + V^2 + W^2)'''&lt;br /&gt;
&lt;br /&gt;
QbarUV drops the vertical component, W, and just uses:&lt;br /&gt;
&lt;br /&gt;
'''qbarUV = 1/2*ρ*(U^2 + V^2)'''&lt;br /&gt;
&lt;br /&gt;
QbarUW drops the horizontal component and just uses:&lt;br /&gt;
&lt;br /&gt;
'''qbarUW = 1/2*ρ*(U^2 + W^2)'''&lt;br /&gt;
&lt;br /&gt;
And for the special case of qbarU, only use the axial component.&lt;br /&gt;
&lt;br /&gt;
'''qbarU = 1/2*rho*(U^2)'''&lt;br /&gt;
&lt;br /&gt;
Since its one dimensional, preserving the sign to show direction is valid:&lt;br /&gt;
&lt;br /&gt;
'''qbarU = 1/2*ρ*(U*abs(U))'''&lt;br /&gt;
&lt;br /&gt;
Qbar, qbarUV and qbarUW, can not have signs because they are multidimensional, use the reported alpha or beta angles to decide where the pressure is coming from.&lt;br /&gt;
&lt;br /&gt;
== Metrics ==&lt;br /&gt;
The metrics section provides a standard place to record common aircraft dimensions. [[Aeromatic]] built [[FDM]]s only use four of the defined properties.&lt;br /&gt;
* Wing Area - metrics/Sw-sqft&lt;br /&gt;
* Wing Span - metrics/bw-ft&lt;br /&gt;
* Wing Chord - metrics/cbarw-ft&lt;br /&gt;
* AeroRP - the location where the aerodynamic forces are applied to the model. If this location is not exactly equal to the center of gravity (CoG) then moments, or twisting forces, will be created. Conventional aircraft need AeroRP to be aft of the CoG for stability.&lt;br /&gt;
&lt;br /&gt;
Other dimensions [[Aeromatic]] creates but does not use are: (tail arms are used by the JSBSim Turbulence code)&lt;br /&gt;
* Horizontal Tail Area - Sh-sqft&lt;br /&gt;
* Horizontal Tail Arm - lh-ft &lt;br /&gt;
* Vertical Tail Area - Sv-sqft&lt;br /&gt;
* Vertical Tail Arm - lv-ft&lt;br /&gt;
&lt;br /&gt;
Other elements in metrics:&lt;br /&gt;
* EYEPOINT - where G-forces are computed for the pilot&lt;br /&gt;
* VRP - the world position reported by JSBSim to FlightGear is for this location in the structural frame. Hence, the VRP location should match the origin of the coordinate system(s) used to position views, sounds and the 3d model in the FlightGear XML files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metrics&amp;gt;&lt;br /&gt;
    &amp;lt;wingarea unit=&amp;quot;{FT2 | M2}&amp;quot;&amp;gt; {number} &amp;lt;/wingarea&amp;gt;&lt;br /&gt;
    &amp;lt;wingspan unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/wingspan&amp;gt;&lt;br /&gt;
    &amp;lt;chord unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/chord&amp;gt;&lt;br /&gt;
    &amp;lt;htailarea unit=&amp;quot;{FT2 | M2}&amp;quot;&amp;gt; {number} &amp;lt;/htailarea&amp;gt;&lt;br /&gt;
    &amp;lt;htailarm unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/htailarm&amp;gt;&lt;br /&gt;
    &amp;lt;vtailarea unit=&amp;quot;{FT2 | M}&amp;quot;&amp;gt; {number} &amp;lt;/vtailarea&amp;gt;&lt;br /&gt;
    &amp;lt;vtailarm unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/vtailarm&amp;gt;&lt;br /&gt;
    &amp;lt;wing_incidence unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt; {number} &amp;lt;/wing_incidence&amp;gt;&lt;br /&gt;
    &amp;lt;pitot_angle unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt; {number} &amp;lt;/pitot_angle&amp;gt;&lt;br /&gt;
    &amp;lt;location name=&amp;quot;{AERORP | EYEPOINT | VRP}&amp;quot; unit=&amp;quot;{IN | M}&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;x&amp;gt; {number} &amp;lt;/x&amp;gt;&lt;br /&gt;
         &amp;lt;y&amp;gt; {number} &amp;lt;/y&amp;gt;&lt;br /&gt;
         &amp;lt;z&amp;gt; {number} &amp;lt;/z&amp;gt;&lt;br /&gt;
    &amp;lt;/location&amp;gt;&lt;br /&gt;
    {other location blocks}&lt;br /&gt;
&amp;lt;/metrics&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Forces ==&lt;br /&gt;
&lt;br /&gt;
For purposes of the Aerodynamics section the entire aircraft creates a single, unified aerodynamic force. This force is split into three component vectors. The most common way of splitting this force into vectors is the Lift Drag Side method. Another, potential better way from the perspective of generating a full 360 degree capable [[FDM]], is the Normal, Axial, Side method.&lt;br /&gt;
* '''Lift: CL''' Lift is the portion of the aerodynamic force that is at a right angle to the relative wind '''and''' lies within the x-z-axis plane (usually the aircraft's symmetry plane) '''and''' is oriented towards the aircraft's upside. (During inverted flight, it points to the ground).&lt;br /&gt;
** Lift is a function of QBar * Wing Area * Cl&amp;lt;sub&amp;gt;lift&amp;lt;/sub&amp;gt;. Cl&amp;lt;sub&amp;gt;lift&amp;lt;/sub&amp;gt; is generally derived from a 2D table as a function of AoA. In the real world it is also a function of the Reynolds and Mach Numbers. Using QBarUW is more appropriate for CL than the generic QBar.&lt;br /&gt;
* '''Drag: CD''' Drag is the portion of the aerodynamic force that is parallel to the relative wind.&lt;br /&gt;
** It is important to ensure all coefficient functions in the drag section remain positive. When drag coefficient functions are negative, drag is effectively acting as thrust opposite the relative wind.&lt;br /&gt;
* '''Side: CY''' Side is the portion of the aerodynamic force that is at a right angle to both the Lift and the Drag vector. It usually points to the aircraft's right side.&lt;br /&gt;
&lt;br /&gt;
This system was developed by and for people using wind tunnels. Lift is to the top of the wind tunnel, drag is out the back and side is to the side. As a real aircraft in free space yanks and banks it may become ambiguous which direction the forces are applied. If an aircraft's body-x-axis is oriented exactly perpendicular to the relative wind, the definitions given above cannot be applied.&lt;br /&gt;
&lt;br /&gt;
Enter the Axial, Normal, Side system.&lt;br /&gt;
* '''Axial: CA''' Axial force is the portion of the aerodynamic force that is parallel to the aircraft's longitudinal (X) axis. For very small angles of attack it is analogous to Drag.&lt;br /&gt;
* '''Normal: CN''' Normal force is the portion of the aerodynamic force that is parallel to the aircraft's vertical (Z) axis.  For very small angles of attack it is analogous to Lift.&lt;br /&gt;
* '''Side: CY''' Side is the portion of the aerodynamic force that is parallel to the aircraft's lateral (Y) axis.&lt;br /&gt;
&lt;br /&gt;
Which ever system is used, the forces are applied at the Aerodynamic Reference Point (AeroRP). If the AeroRP is not coincident to the model's center of gravity (CG), yaw, pitch and roll moments are created that do not appear in the moments sections.&lt;br /&gt;
&lt;br /&gt;
== Moments ==&lt;br /&gt;
* '''Roll: Cl''' Aerodynamic rolling moment comes from multiple sources:&lt;br /&gt;
** One is the lift generated by the vertical tail. On most aircraft the center of pressure for the vertical tail is not on the X body axis. This sets up a moment arm creating a moment of (moment arm length)*(vertical tail lift force).&lt;br /&gt;
** Another roll moment source is main wing dihedral angle. If a dihedral wing encounters a sidewind component, let's say from the right, then the effective angle of attack will slightly increase for the right wing and decrease for the left wing. This is because - from the wing's perspective - the side wind component approaches the right wing from below (leading to an increase in AOA and more lift) and the left wing from above (leading to a decrease in AOA and less lift). Rolling the aircraft to one side will induce a side motion which leads to a resulting difference in lift, creating a roll moment counteracting the initial roll angle and providing roll stability.&lt;br /&gt;
&lt;br /&gt;
* '''Pitch: Cm''' The primary contributor to the pitching moment is the lift generated by the horizontal tail. The pitching moment of the main wing airfoil is a secondary contributor. Because of this fact it makes sense that the value for Cm will resemble the CL curve for the horizontal tail airfoil. The standard CL curve does not take into account the changes in tail Angle of Attack (AoA) and QBar due to main wing down-wash and rotational velocity around the Y axis. Using QBarUW is more appropriate for Cm than the generic QBar.&lt;br /&gt;
* '''Yaw: Cn''' The primary contributor to the yawing moment is the lift generated by the vertical tail. The wind force on the fuselage is a secondary contributor. Because of this fact it makes sense that the value for Cn will resemble the CL curve for the vertical tail airfoil. Changes in QBar due to the vertical tail moving into the 'shadow' of a stalled main wing may need to be accounted for, as well. The source for vertical tail Angle of Attack (AoA) should be Beta and QBarUV is more appropriate for Cn than the generic QBar.&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
* '''Stall''' - A 'stall' is generally regarded as a loss of lift due to flow separation over the top of a wing, however, examination of lift polar for an airfoil over a full 360 degrees shows that significant amounts of lift are NOT lost as the stall occurs. The biggest aerodynamic effect of a stall is a large and rapid increase in drag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;hysteresis_limits unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;min&amp;gt; {number} &amp;lt;/min&amp;gt;&lt;br /&gt;
    &amp;lt;max&amp;gt; {number} &amp;lt;/max&amp;gt;&lt;br /&gt;
&amp;lt;/hysteresis_limits&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Spin''' - Spins are caused loss of stability in the Yaw Moment axis. A stock [[Aeromatic]] [[FDM]] yaw section does not take alpha into account when calculating the yaw moment.&lt;br /&gt;
* '''Aerodynamic Reference Point''' - JSBSim provides a way to shift the aerodynamic reference point (AeroRP) forward (negative values) and aft (positive) in response to mach, pitch or other influences. Use the tag &amp;amp;lt;aero_ref_pt_shift_x&amp;amp;gt; in the &amp;amp;lt;aerodynamics&amp;amp;gt; section.  The value this tag function returns is internally multiplied by the chord entered in the &amp;amp;lt;metrics&amp;amp;gt; section to get the final shift. You could use this by setting the AeroRP to the leading edge of the wing and use a 1D table indexed by mach starting at .25 chord and getting bigger as the mach number increases to simulate mach tuck. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;aero_ref_pt_shift_x&amp;gt;  &lt;br /&gt;
    &amp;lt;function&amp;gt;&lt;br /&gt;
        {function contents}&lt;br /&gt;
    &amp;lt;/function&amp;gt; &lt;br /&gt;
&amp;lt;/aero_ref_pt_shift_x&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Lift Due To Elevator''' - There are two interrelated effects from elevator deflection, the Force change and the Moment. These have two different coefficients in two different sections of the FDM but should be considered together. The formula is:&lt;br /&gt;
&lt;br /&gt;
CLde * lh-ft = Cmde * cbarw-ft&lt;br /&gt;
&lt;br /&gt;
That is, the force (lift) created by the elevator times its length from the CG is equal to the moment. For some reason standard aerodynamics uses the chord as the reference length.&lt;br /&gt;
&lt;br /&gt;
A similar formula:&lt;br /&gt;
&lt;br /&gt;
CYdr * lv-ft = Cndr * bw-ft &lt;br /&gt;
&lt;br /&gt;
Is applicable the rudder's side force and yawing moment. The force (side) created by the rudder times its length from the CG is equal to the moment. For some reason standard aerodynamics uses the wing span as the reference length.&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
[[Aero input and outputs]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=JSBSim_Aerodynamics&amp;diff=119807</id>
		<title>JSBSim Aerodynamics</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=JSBSim_Aerodynamics&amp;diff=119807"/>
		<updated>2019-08-18T16:10:43Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Forces */Minor addition&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[JSBSim]] provides a framework for aerodynamics. This page will attempt to explain how to translate traditional aerodynamics concepts into the [[JSBSim]] framework, and how to create [[FDM]]s that are sane for any flight value.&lt;br /&gt;
&lt;br /&gt;
This page uses the term &amp;quot;coefficient&amp;quot; both the traditional sense of a constant multiplicative factor or in the [[JSBSim]] sense of the output of a function derived from a coefficient.&lt;br /&gt;
&lt;br /&gt;
JSBSim provides three [[#Forces|Forces]] and three [[#Moments|Moments]] (a moment is a twisting or turning force), therefore it is a 'six degree of freedom' simulation.&lt;br /&gt;
&lt;br /&gt;
== Frames ==&lt;br /&gt;
JSBSim incorporates several frame of reference. The body frame and wind frame are the most important to the aerodynamic model.&lt;br /&gt;
* '''Body XYZ''' The body frame uses the X axis for forward and aft, with + to the front. The Y axis is side to side with + to the right. The Z axis is up and down, with + being down. The origin of this frame is the Center of Gravity (CG), about which the aircraft forces and moments are summed and the resulting accelerations are integrated to get velocities. &lt;br /&gt;
&lt;br /&gt;
* '''Wind XYZ''' The wind frame X-axis points directly into the relative wind. The Z-axis is perpendicular to the X-axis, and remains within the aircraft body axis XZ plane (also called the reference plane). The Y-axis completes a right hand coordinate system. The origin of this frame is the AeroRP.&lt;br /&gt;
&lt;br /&gt;
* '''Wind UVW''' This isn't really a frame, but it is the components of the wind velocity vector. The relative wind is imposed on the body frame using variables U,V, and W. U to represent the velocity of the wind flowing past the aircraft. U represents the wind blowing down the X or longitudinal axis of the aircraft. V represents the wind blowing down the body frame Y axis, that is, wind in your ear. W represents wind blowing down the body frame Z axis, or wind from above.&lt;br /&gt;
&lt;br /&gt;
== Angles ==&lt;br /&gt;
These two angles define the direction the relative wind is blowing in regard to the body frame.&lt;br /&gt;
* '''Alpha''' Alpha is the angle between the X body axis and the X wind axis measured on the UV plane. In standard aerodynamics Alpha is often referenced to the main wing chord line, this is not the case in [[JSBSim]].&lt;br /&gt;
* '''Beta''' Beta is the angle between the X body axis and the X wind axis measured in the UW plane.&lt;br /&gt;
&lt;br /&gt;
== QBar ==&lt;br /&gt;
QBar, or dynamic pressure, is the product of velocity^2*(air density)/2&lt;br /&gt;
* '''QBarUW''' Use this value for formula involving Alpha. It is the value of QBar restricted to the vertical plane airspeed components.&lt;br /&gt;
* '''QBarUV''' Use this value for formula involving Beta. It is the value of QBar restricted to the horizontal plane airspeed components.&lt;br /&gt;
* It is possible to calculate other dynamic pressures for special purposes, such as QBarU for control surfaces.&lt;br /&gt;
&lt;br /&gt;
The Greek letter rho or &amp;quot;ρ&amp;quot; is commonly used for air density. Normally, Qbar is based on the total free stream velocity, V[∞], so:&lt;br /&gt;
&lt;br /&gt;
'''qbar = 1/2*ρ*(V[∞])^2'''&lt;br /&gt;
&lt;br /&gt;
V[∞] is a vector and can be broken down into components commonly called U, V, W. By definition, U, V, and W are all at right angle to each other, so we use Pythagoras to say:&lt;br /&gt;
&lt;br /&gt;
'''(V[∞])^2 = U^2 + V^2 + W^2'''&lt;br /&gt;
&lt;br /&gt;
and rewrite&lt;br /&gt;
&lt;br /&gt;
'''qbar = 1/2*ρ*(U^2 + V^2 + W^2)'''&lt;br /&gt;
&lt;br /&gt;
QbarUV drops the vertical component, W, and just uses:&lt;br /&gt;
&lt;br /&gt;
'''qbarUV = 1/2*ρ*(U^2 + V^2)'''&lt;br /&gt;
&lt;br /&gt;
QbarUW drops the horizontal component and just uses:&lt;br /&gt;
&lt;br /&gt;
'''qbarUW = 1/2*ρ*(U^2 + W^2)'''&lt;br /&gt;
&lt;br /&gt;
And for the special case of qbarU, only use the axial component.&lt;br /&gt;
&lt;br /&gt;
'''qbarU = 1/2*rho*(U^2)'''&lt;br /&gt;
&lt;br /&gt;
Since its one dimensional, preserving the sign to show direction is valid:&lt;br /&gt;
&lt;br /&gt;
'''qbarU = 1/2*ρ*(U*abs(U))'''&lt;br /&gt;
&lt;br /&gt;
Qbar, qbarUV and qbarUW, can not have signs because they are multidimensional, use the reported alpha or beta angles to decide where the pressure is coming from.&lt;br /&gt;
&lt;br /&gt;
== Metrics ==&lt;br /&gt;
The metrics section provides a standard place to record common aircraft dimensions. [[Aeromatic]] built [[FDM]]s only use four of the defined properties.&lt;br /&gt;
* Wing Area - metrics/Sw-sqft&lt;br /&gt;
* Wing Span - metrics/bw-ft&lt;br /&gt;
* Wing Chord - metrics/cbarw-ft&lt;br /&gt;
* AeroRP - the location where the aerodynamic forces are applied to the model. If this location is not exactly equal to the center of gravity (CoG) then moments, or twisting forces, will be created. Conventional aircraft need AeroRP to be aft of the CoG for stability.&lt;br /&gt;
&lt;br /&gt;
Other dimensions [[Aeromatic]] creates but does not use are: (tail arms are used by the JSBSim Turbulence code)&lt;br /&gt;
* Horizontal Tail Area - Sh-sqft&lt;br /&gt;
* Horizontal Tail Arm - lh-ft &lt;br /&gt;
* Vertical Tail Area - Sv-sqft&lt;br /&gt;
* Vertical Tail Arm - lv-ft&lt;br /&gt;
&lt;br /&gt;
Other elements in metrics:&lt;br /&gt;
* EYEPOINT - where G-forces are computed for the pilot&lt;br /&gt;
* VRP - the world position reported by JSBSim to FlightGear is for this location in the structural frame. Hence, the VRP location should match the origin of the coordinate system(s) used to position views, sounds and the 3d model in the FlightGear XML files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metrics&amp;gt;&lt;br /&gt;
    &amp;lt;wingarea unit=&amp;quot;{FT2 | M2}&amp;quot;&amp;gt; {number} &amp;lt;/wingarea&amp;gt;&lt;br /&gt;
    &amp;lt;wingspan unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/wingspan&amp;gt;&lt;br /&gt;
    &amp;lt;chord unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/chord&amp;gt;&lt;br /&gt;
    &amp;lt;htailarea unit=&amp;quot;{FT2 | M2}&amp;quot;&amp;gt; {number} &amp;lt;/htailarea&amp;gt;&lt;br /&gt;
    &amp;lt;htailarm unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/htailarm&amp;gt;&lt;br /&gt;
    &amp;lt;vtailarea unit=&amp;quot;{FT2 | M}&amp;quot;&amp;gt; {number} &amp;lt;/vtailarea&amp;gt;&lt;br /&gt;
    &amp;lt;vtailarm unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/vtailarm&amp;gt;&lt;br /&gt;
    &amp;lt;wing_incidence unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt; {number} &amp;lt;/wing_incidence&amp;gt;&lt;br /&gt;
    &amp;lt;pitot_angle unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt; {number} &amp;lt;/pitot_angle&amp;gt;&lt;br /&gt;
    &amp;lt;location name=&amp;quot;{AERORP | EYEPOINT | VRP}&amp;quot; unit=&amp;quot;{IN | M}&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;x&amp;gt; {number} &amp;lt;/x&amp;gt;&lt;br /&gt;
         &amp;lt;y&amp;gt; {number} &amp;lt;/y&amp;gt;&lt;br /&gt;
         &amp;lt;z&amp;gt; {number} &amp;lt;/z&amp;gt;&lt;br /&gt;
    &amp;lt;/location&amp;gt;&lt;br /&gt;
    {other location blocks}&lt;br /&gt;
&amp;lt;/metrics&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Forces ==&lt;br /&gt;
&lt;br /&gt;
For purposes of the Aerodynamics section the entire aircraft creates a single, unified aerodynamic force. This force is split into three component vectors. The most common way of splitting this force into vectors is the Lift Drag Side method. Another, potential better way from the perspective of generating a full 360 degree capable [[FDM]], is the Normal, Axial, Side method.&lt;br /&gt;
* '''Lift: CL''' Lift is the portion of the aerodynamic force that is at a right angle to the relative wind '''and''' lies within the x-z-axis plane (usually the aircraft's symmetry plane) '''and''' is oriented towards the aircraft's upside. (During inverted flight, it points to the ground).&lt;br /&gt;
** Lift is a function of QBar * Wing Area * Cl&amp;lt;sub&amp;gt;lift&amp;lt;/sub&amp;gt;. Cl&amp;lt;sub&amp;gt;lift&amp;lt;/sub&amp;gt; is generally derived from a 2D table as a function of AoA. In the real world it is also a function of the Reynolds and Mach Numbers. Using QBarUW is more appropriate for CL than the generic QBar.&lt;br /&gt;
* '''Drag: CD''' Drag is the portion of the aerodynamic force that is parallel to the relative wind.&lt;br /&gt;
** It is important to ensure all coefficient functions in the drag section remain positive. When drag coefficient functions are negative, drag is effectively acting as thrust opposite the relative wind.&lt;br /&gt;
* '''Side: CY''' Side is the portion of the aerodynamic force that is at a right angle to both the Lift and the Drag vector. It usually points to the aircraft's right side.&lt;br /&gt;
&lt;br /&gt;
This system was developed by and for people using wind tunnels. Lift is to the top of the wind tunnel, drag is out the back and side is to the side. As a real aircraft in free space yanks and banks it may become ambiguous which direction the forces are applied. If an aircraft's body-x-axis is oriented exactly perpendicular to the relative wind, the definitions given above cannot be applied.&lt;br /&gt;
&lt;br /&gt;
Enter the Axial, Normal, Side system.&lt;br /&gt;
* '''Axial: CA''' Axial force is the portion of the aerodynamic force that is parallel to the aircraft's longitudinal (X) axis. For very small angles of attack it is analogous to Drag.&lt;br /&gt;
* '''Normal: CN''' Normal force is the portion of the aerodynamic force that is parallel to the aircraft's vertical (Z) axis.  For very small angles of attack it is analogous to Lift.&lt;br /&gt;
* '''Side: CY''' Side is the portion of the aerodynamic force that is parallel to the aircraft's lateral (Y) axis.&lt;br /&gt;
&lt;br /&gt;
Which ever system is used, the forces are applied at the Aerodynamic Reference Point (AeroRP). If the AeroRP is not coincident to the model's center of gravity (CG), yaw, pitch and roll moments are created that do not appear in the moments sections.&lt;br /&gt;
&lt;br /&gt;
== Moments ==&lt;br /&gt;
* '''Roll: Cl''' Aerodynamic rolling moment comes from multiple sources:&lt;br /&gt;
** One is the lift generated by the vertical tail. On most aircraft the center of pressure for the vertical tail is not on the X body axis. This sets up a moment arm creating a moment of (moment arm length)*(vertical tail lift force).&lt;br /&gt;
** Another roll moment source is main wing dihedral angle. If a dihedral wing encounters a sidewind component, let's say from the right, then the effective angle of attack will slightly increase for the right wing and decrease for the left wing. This is because - from the wing's perspective - the side wind component approaches the right wing from below (leading to an increase in AOA and more lift) and the left wing from above (leading to a decrease in AOA and less lift). Rolling the aircraft to one side will induce a side motion which leads to a resulting difference in lift, creating a roll moment counteracting the initial roll angle and providing roll stability.&lt;br /&gt;
&lt;br /&gt;
* '''Pitch: Cm''' The primary contributor to the pitching moment is the lift generated by the horizontal tail. The pitching moment of the main wing airfoil is a secondary contributor. Because of this fact it makes sense that the value for Cm will resemble the CL curve for the horizontal tail airfoil. The standard CL curve does not take into account the changes in tail Angle of Attack (AoA) and QBar due to main wing down-wash and rotational velocity around the Y axis. Using QBarUW is more appropriate for Cm than the generic QBar.&lt;br /&gt;
* '''Yaw: Cn''' The primary contributor to the yawing moment is the lift generated by the vertical tail. The wind force on the fuselage is a secondary contributor. Because of this fact it makes sense that the value for Cn will resemble the CL curve for the vertical tail airfoil. Changes in QBar due to the vertical tail moving into the 'shadow' of a stalled main wing may need to be accounted for, as well. The source for vertical tail Angle of Attack (AoA) should be Beta and QBarUV is more appropriate for Cn than the generic QBar.&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
* '''Stall''' - A 'stall' is generally regarded as a loss of lift due to flow separation over the top of a wing, however, examination of lift polar for an airfoil over a full 360 degrees shows that significant amounts of lift are NOT lost as the stall occurs. The biggest aerodynamic effect of a stall is a large and rapid increase in drag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;hysteresis_limits unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;min&amp;gt; {number} &amp;lt;/min&amp;gt;&lt;br /&gt;
    &amp;lt;max&amp;gt; {number} &amp;lt;/max&amp;gt;&lt;br /&gt;
&amp;lt;/hysteresis_limits&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Spin''' - Spins are caused loss of stability in the Yaw Moment axis. A stock [[Aeromatic]] [[FDM]] yaw section does not take alpha into account when calculating the yaw moment.&lt;br /&gt;
* '''Aerodynamic Reference Point''' - JSBSim provides a way to shift the aerodynamic reference point (AeroRP) forward (negative values) and aft (positive) in response to mach, pitch or other influences. Use the tag &amp;amp;lt;aero_ref_pt_shift_x&amp;amp;gt; in the &amp;amp;lt;aerodynamics&amp;amp;gt; section.  The value this tag function returns is internally multiplied by the chord entered in the &amp;amp;lt;metrics&amp;amp;gt; section to get the final shift. You could use this by setting the AeroRP to the leading edge of the wing and use a 1D table indexed by mach starting at .25 chord and getting bigger as the mach number increases to simulate mach tuck. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;aero_ref_pt_shift_x&amp;gt;  &lt;br /&gt;
    &amp;lt;function&amp;gt;&lt;br /&gt;
        {function contents}&lt;br /&gt;
    &amp;lt;/function&amp;gt; &lt;br /&gt;
&amp;lt;/aero_ref_pt_shift_x&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Lift Due To Elevator''' - There are two interrelated effects from elevator deflection, the Force change and the Moment. These have two different coefficients in two different sections of the FDM but should be considered together. The formula is:&lt;br /&gt;
&lt;br /&gt;
CLde * lh-ft = Cmde * cbarw-ft&lt;br /&gt;
&lt;br /&gt;
That is, the force (lift) created by the elevator times its length from the CG is equal to the moment. For some reason standard aerodynamics uses the chord as the reference length.&lt;br /&gt;
&lt;br /&gt;
A similar formula:&lt;br /&gt;
&lt;br /&gt;
CYdr * lv-ft = Cndr * bw-ft &lt;br /&gt;
&lt;br /&gt;
Is applicable the rudder's side force and yawing moment. The force (side) created by the rudder times its length from the CG is equal to the moment. For some reason standard aerodynamics uses the wing span as the reference length.&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
[[Aero input and outputs]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=JSBSim_Aerodynamics&amp;diff=119806</id>
		<title>JSBSim Aerodynamics</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=JSBSim_Aerodynamics&amp;diff=119806"/>
		<updated>2019-08-18T16:06:22Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Moments */minor corrections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[JSBSim]] provides a framework for aerodynamics. This page will attempt to explain how to translate traditional aerodynamics concepts into the [[JSBSim]] framework, and how to create [[FDM]]s that are sane for any flight value.&lt;br /&gt;
&lt;br /&gt;
This page uses the term &amp;quot;coefficient&amp;quot; both the traditional sense of a constant multiplicative factor or in the [[JSBSim]] sense of the output of a function derived from a coefficient.&lt;br /&gt;
&lt;br /&gt;
JSBSim provides three [[#Forces|Forces]] and three [[#Moments|Moments]] (a moment is a twisting or turning force), therefore it is a 'six degree of freedom' simulation.&lt;br /&gt;
&lt;br /&gt;
== Frames ==&lt;br /&gt;
JSBSim incorporates several frame of reference. The body frame and wind frame are the most important to the aerodynamic model.&lt;br /&gt;
* '''Body XYZ''' The body frame uses the X axis for forward and aft, with + to the front. The Y axis is side to side with + to the right. The Z axis is up and down, with + being down. The origin of this frame is the Center of Gravity (CG), about which the aircraft forces and moments are summed and the resulting accelerations are integrated to get velocities. &lt;br /&gt;
&lt;br /&gt;
* '''Wind XYZ''' The wind frame X-axis points directly into the relative wind. The Z-axis is perpendicular to the X-axis, and remains within the aircraft body axis XZ plane (also called the reference plane). The Y-axis completes a right hand coordinate system. The origin of this frame is the AeroRP.&lt;br /&gt;
&lt;br /&gt;
* '''Wind UVW''' This isn't really a frame, but it is the components of the wind velocity vector. The relative wind is imposed on the body frame using variables U,V, and W. U to represent the velocity of the wind flowing past the aircraft. U represents the wind blowing down the X or longitudinal axis of the aircraft. V represents the wind blowing down the body frame Y axis, that is, wind in your ear. W represents wind blowing down the body frame Z axis, or wind from above.&lt;br /&gt;
&lt;br /&gt;
== Angles ==&lt;br /&gt;
These two angles define the direction the relative wind is blowing in regard to the body frame.&lt;br /&gt;
* '''Alpha''' Alpha is the angle between the X body axis and the X wind axis measured on the UV plane. In standard aerodynamics Alpha is often referenced to the main wing chord line, this is not the case in [[JSBSim]].&lt;br /&gt;
* '''Beta''' Beta is the angle between the X body axis and the X wind axis measured in the UW plane.&lt;br /&gt;
&lt;br /&gt;
== QBar ==&lt;br /&gt;
QBar, or dynamic pressure, is the product of velocity^2*(air density)/2&lt;br /&gt;
* '''QBarUW''' Use this value for formula involving Alpha. It is the value of QBar restricted to the vertical plane airspeed components.&lt;br /&gt;
* '''QBarUV''' Use this value for formula involving Beta. It is the value of QBar restricted to the horizontal plane airspeed components.&lt;br /&gt;
* It is possible to calculate other dynamic pressures for special purposes, such as QBarU for control surfaces.&lt;br /&gt;
&lt;br /&gt;
The Greek letter rho or &amp;quot;ρ&amp;quot; is commonly used for air density. Normally, Qbar is based on the total free stream velocity, V[∞], so:&lt;br /&gt;
&lt;br /&gt;
'''qbar = 1/2*ρ*(V[∞])^2'''&lt;br /&gt;
&lt;br /&gt;
V[∞] is a vector and can be broken down into components commonly called U, V, W. By definition, U, V, and W are all at right angle to each other, so we use Pythagoras to say:&lt;br /&gt;
&lt;br /&gt;
'''(V[∞])^2 = U^2 + V^2 + W^2'''&lt;br /&gt;
&lt;br /&gt;
and rewrite&lt;br /&gt;
&lt;br /&gt;
'''qbar = 1/2*ρ*(U^2 + V^2 + W^2)'''&lt;br /&gt;
&lt;br /&gt;
QbarUV drops the vertical component, W, and just uses:&lt;br /&gt;
&lt;br /&gt;
'''qbarUV = 1/2*ρ*(U^2 + V^2)'''&lt;br /&gt;
&lt;br /&gt;
QbarUW drops the horizontal component and just uses:&lt;br /&gt;
&lt;br /&gt;
'''qbarUW = 1/2*ρ*(U^2 + W^2)'''&lt;br /&gt;
&lt;br /&gt;
And for the special case of qbarU, only use the axial component.&lt;br /&gt;
&lt;br /&gt;
'''qbarU = 1/2*rho*(U^2)'''&lt;br /&gt;
&lt;br /&gt;
Since its one dimensional, preserving the sign to show direction is valid:&lt;br /&gt;
&lt;br /&gt;
'''qbarU = 1/2*ρ*(U*abs(U))'''&lt;br /&gt;
&lt;br /&gt;
Qbar, qbarUV and qbarUW, can not have signs because they are multidimensional, use the reported alpha or beta angles to decide where the pressure is coming from.&lt;br /&gt;
&lt;br /&gt;
== Metrics ==&lt;br /&gt;
The metrics section provides a standard place to record common aircraft dimensions. [[Aeromatic]] built [[FDM]]s only use four of the defined properties.&lt;br /&gt;
* Wing Area - metrics/Sw-sqft&lt;br /&gt;
* Wing Span - metrics/bw-ft&lt;br /&gt;
* Wing Chord - metrics/cbarw-ft&lt;br /&gt;
* AeroRP - the location where the aerodynamic forces are applied to the model. If this location is not exactly equal to the center of gravity (CoG) then moments, or twisting forces, will be created. Conventional aircraft need AeroRP to be aft of the CoG for stability.&lt;br /&gt;
&lt;br /&gt;
Other dimensions [[Aeromatic]] creates but does not use are: (tail arms are used by the JSBSim Turbulence code)&lt;br /&gt;
* Horizontal Tail Area - Sh-sqft&lt;br /&gt;
* Horizontal Tail Arm - lh-ft &lt;br /&gt;
* Vertical Tail Area - Sv-sqft&lt;br /&gt;
* Vertical Tail Arm - lv-ft&lt;br /&gt;
&lt;br /&gt;
Other elements in metrics:&lt;br /&gt;
* EYEPOINT - where G-forces are computed for the pilot&lt;br /&gt;
* VRP - the world position reported by JSBSim to FlightGear is for this location in the structural frame. Hence, the VRP location should match the origin of the coordinate system(s) used to position views, sounds and the 3d model in the FlightGear XML files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metrics&amp;gt;&lt;br /&gt;
    &amp;lt;wingarea unit=&amp;quot;{FT2 | M2}&amp;quot;&amp;gt; {number} &amp;lt;/wingarea&amp;gt;&lt;br /&gt;
    &amp;lt;wingspan unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/wingspan&amp;gt;&lt;br /&gt;
    &amp;lt;chord unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/chord&amp;gt;&lt;br /&gt;
    &amp;lt;htailarea unit=&amp;quot;{FT2 | M2}&amp;quot;&amp;gt; {number} &amp;lt;/htailarea&amp;gt;&lt;br /&gt;
    &amp;lt;htailarm unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/htailarm&amp;gt;&lt;br /&gt;
    &amp;lt;vtailarea unit=&amp;quot;{FT2 | M}&amp;quot;&amp;gt; {number} &amp;lt;/vtailarea&amp;gt;&lt;br /&gt;
    &amp;lt;vtailarm unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/vtailarm&amp;gt;&lt;br /&gt;
    &amp;lt;wing_incidence unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt; {number} &amp;lt;/wing_incidence&amp;gt;&lt;br /&gt;
    &amp;lt;pitot_angle unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt; {number} &amp;lt;/pitot_angle&amp;gt;&lt;br /&gt;
    &amp;lt;location name=&amp;quot;{AERORP | EYEPOINT | VRP}&amp;quot; unit=&amp;quot;{IN | M}&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;x&amp;gt; {number} &amp;lt;/x&amp;gt;&lt;br /&gt;
         &amp;lt;y&amp;gt; {number} &amp;lt;/y&amp;gt;&lt;br /&gt;
         &amp;lt;z&amp;gt; {number} &amp;lt;/z&amp;gt;&lt;br /&gt;
    &amp;lt;/location&amp;gt;&lt;br /&gt;
    {other location blocks}&lt;br /&gt;
&amp;lt;/metrics&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Forces ==&lt;br /&gt;
&lt;br /&gt;
For purposes of the Aerodynamics section the entire aircraft creates a single, unified aerodynamic force. This force is split into three component vectors. The most common way of splitting this force into vectors is the Lift Drag Side method. Another, potential better way from the perspective of generating a full 360 degree capable [[FDM]], is the Normal, Axial, Side method.&lt;br /&gt;
* '''Lift: CL''' Lift is the portion of the aerodynamic force that is at a right angle to the relative wind '''and''' lies within the x-z-axis plane (usually the aircraft's symmetry plane) '''and''' is oriented towards the aircraft's upside. (During inverted flight, it points to the ground).&lt;br /&gt;
** Lift is a function of QBar * Wing Area * Cl&amp;lt;sub&amp;gt;lift&amp;lt;/sub&amp;gt;. Cl&amp;lt;sub&amp;gt;lift&amp;lt;/sub&amp;gt; is generally derived from a 2D table as a function of AoA. In the real world it is also a function of the Reynolds and Mach Numbers.&lt;br /&gt;
* '''Drag: CD''' Drag is the portion of the aerodynamic force that is parallel to the relative wind.&lt;br /&gt;
** It is important to ensure all coefficient functions in the drag section remain positive. When drag coefficient functions are negative, drag is effectively acting as thrust opposite the relative wind.&lt;br /&gt;
* '''Side: CY''' Side is the portion of the aerodynamic force that is at a right angle to both the Lift and the Drag vector. It usually points to the aircraft's right side.&lt;br /&gt;
&lt;br /&gt;
This system was developed by and for people using wind tunnels. Lift is to the top of the wind tunnel, drag is out the back and side is to the side. As a real aircraft in free space yanks and banks it may become ambiguous which direction the forces are applied. If an aircraft's body-x-axis is oriented exactly perpendicular to the relative wind, the definitions given above cannot be applied.&lt;br /&gt;
&lt;br /&gt;
Enter the Axial, Normal, Side system.&lt;br /&gt;
* '''Axial: CA''' Axial force is the portion of the aerodynamic force that is parallel to the aircraft's longitudinal (X) axis. For very small angles of attack it is analogous to Drag.&lt;br /&gt;
* '''Normal: CN''' Normal force is the portion of the aerodynamic force that is parallel to the aircraft's vertical (Z) axis.  For very small angles of attack it is analogous to Lift.&lt;br /&gt;
* '''Side: CY''' Side is the portion of the aerodynamic force that is parallel to the aircraft's lateral (Y) axis.&lt;br /&gt;
&lt;br /&gt;
Which ever system is used, the forces are applied at the Aerodynamic Reference Point (AeroRP). If the AeroRP is not coincident to the model's center of gravity (CG), yaw, pitch and roll moments are created that do not appear in the moments sections.&lt;br /&gt;
&lt;br /&gt;
== Moments ==&lt;br /&gt;
* '''Roll: Cl''' Aerodynamic rolling moment comes from multiple sources:&lt;br /&gt;
** One is the lift generated by the vertical tail. On most aircraft the center of pressure for the vertical tail is not on the X body axis. This sets up a moment arm creating a moment of (moment arm length)*(vertical tail lift force).&lt;br /&gt;
** Another roll moment source is main wing dihedral angle. If a dihedral wing encounters a sidewind component, let's say from the right, then the effective angle of attack will slightly increase for the right wing and decrease for the left wing. This is because - from the wing's perspective - the side wind component approaches the right wing from below (leading to an increase in AOA and more lift) and the left wing from above (leading to a decrease in AOA and less lift). Rolling the aircraft to one side will induce a side motion which leads to a resulting difference in lift, creating a roll moment counteracting the initial roll angle and providing roll stability.&lt;br /&gt;
&lt;br /&gt;
* '''Pitch: Cm''' The primary contributor to the pitching moment is the lift generated by the horizontal tail. The pitching moment of the main wing airfoil is a secondary contributor. Because of this fact it makes sense that the value for Cm will resemble the CL curve for the horizontal tail airfoil. The standard CL curve does not take into account the changes in tail Angle of Attack (AoA) and QBar due to main wing down-wash and rotational velocity around the Y axis. Using QBarUW is more appropriate for Cm than the generic QBar.&lt;br /&gt;
* '''Yaw: Cn''' The primary contributor to the yawing moment is the lift generated by the vertical tail. The wind force on the fuselage is a secondary contributor. Because of this fact it makes sense that the value for Cn will resemble the CL curve for the vertical tail airfoil. Changes in QBar due to the vertical tail moving into the 'shadow' of a stalled main wing may need to be accounted for, as well. The source for vertical tail Angle of Attack (AoA) should be Beta and QBarUV is more appropriate for Cn than the generic QBar.&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
* '''Stall''' - A 'stall' is generally regarded as a loss of lift due to flow separation over the top of a wing, however, examination of lift polar for an airfoil over a full 360 degrees shows that significant amounts of lift are NOT lost as the stall occurs. The biggest aerodynamic effect of a stall is a large and rapid increase in drag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;hysteresis_limits unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;min&amp;gt; {number} &amp;lt;/min&amp;gt;&lt;br /&gt;
    &amp;lt;max&amp;gt; {number} &amp;lt;/max&amp;gt;&lt;br /&gt;
&amp;lt;/hysteresis_limits&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Spin''' - Spins are caused loss of stability in the Yaw Moment axis. A stock [[Aeromatic]] [[FDM]] yaw section does not take alpha into account when calculating the yaw moment.&lt;br /&gt;
* '''Aerodynamic Reference Point''' - JSBSim provides a way to shift the aerodynamic reference point (AeroRP) forward (negative values) and aft (positive) in response to mach, pitch or other influences. Use the tag &amp;amp;lt;aero_ref_pt_shift_x&amp;amp;gt; in the &amp;amp;lt;aerodynamics&amp;amp;gt; section.  The value this tag function returns is internally multiplied by the chord entered in the &amp;amp;lt;metrics&amp;amp;gt; section to get the final shift. You could use this by setting the AeroRP to the leading edge of the wing and use a 1D table indexed by mach starting at .25 chord and getting bigger as the mach number increases to simulate mach tuck. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;aero_ref_pt_shift_x&amp;gt;  &lt;br /&gt;
    &amp;lt;function&amp;gt;&lt;br /&gt;
        {function contents}&lt;br /&gt;
    &amp;lt;/function&amp;gt; &lt;br /&gt;
&amp;lt;/aero_ref_pt_shift_x&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Lift Due To Elevator''' - There are two interrelated effects from elevator deflection, the Force change and the Moment. These have two different coefficients in two different sections of the FDM but should be considered together. The formula is:&lt;br /&gt;
&lt;br /&gt;
CLde * lh-ft = Cmde * cbarw-ft&lt;br /&gt;
&lt;br /&gt;
That is, the force (lift) created by the elevator times its length from the CG is equal to the moment. For some reason standard aerodynamics uses the chord as the reference length.&lt;br /&gt;
&lt;br /&gt;
A similar formula:&lt;br /&gt;
&lt;br /&gt;
CYdr * lv-ft = Cndr * bw-ft &lt;br /&gt;
&lt;br /&gt;
Is applicable the rudder's side force and yawing moment. The force (side) created by the rudder times its length from the CG is equal to the moment. For some reason standard aerodynamics uses the wing span as the reference length.&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
[[Aero input and outputs]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=JSBSim_Aerodynamics&amp;diff=119805</id>
		<title>JSBSim Aerodynamics</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=JSBSim_Aerodynamics&amp;diff=119805"/>
		<updated>2019-08-18T16:01:30Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* QBar */minor additions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[JSBSim]] provides a framework for aerodynamics. This page will attempt to explain how to translate traditional aerodynamics concepts into the [[JSBSim]] framework, and how to create [[FDM]]s that are sane for any flight value.&lt;br /&gt;
&lt;br /&gt;
This page uses the term &amp;quot;coefficient&amp;quot; both the traditional sense of a constant multiplicative factor or in the [[JSBSim]] sense of the output of a function derived from a coefficient.&lt;br /&gt;
&lt;br /&gt;
JSBSim provides three [[#Forces|Forces]] and three [[#Moments|Moments]] (a moment is a twisting or turning force), therefore it is a 'six degree of freedom' simulation.&lt;br /&gt;
&lt;br /&gt;
== Frames ==&lt;br /&gt;
JSBSim incorporates several frame of reference. The body frame and wind frame are the most important to the aerodynamic model.&lt;br /&gt;
* '''Body XYZ''' The body frame uses the X axis for forward and aft, with + to the front. The Y axis is side to side with + to the right. The Z axis is up and down, with + being down. The origin of this frame is the Center of Gravity (CG), about which the aircraft forces and moments are summed and the resulting accelerations are integrated to get velocities. &lt;br /&gt;
&lt;br /&gt;
* '''Wind XYZ''' The wind frame X-axis points directly into the relative wind. The Z-axis is perpendicular to the X-axis, and remains within the aircraft body axis XZ plane (also called the reference plane). The Y-axis completes a right hand coordinate system. The origin of this frame is the AeroRP.&lt;br /&gt;
&lt;br /&gt;
* '''Wind UVW''' This isn't really a frame, but it is the components of the wind velocity vector. The relative wind is imposed on the body frame using variables U,V, and W. U to represent the velocity of the wind flowing past the aircraft. U represents the wind blowing down the X or longitudinal axis of the aircraft. V represents the wind blowing down the body frame Y axis, that is, wind in your ear. W represents wind blowing down the body frame Z axis, or wind from above.&lt;br /&gt;
&lt;br /&gt;
== Angles ==&lt;br /&gt;
These two angles define the direction the relative wind is blowing in regard to the body frame.&lt;br /&gt;
* '''Alpha''' Alpha is the angle between the X body axis and the X wind axis measured on the UV plane. In standard aerodynamics Alpha is often referenced to the main wing chord line, this is not the case in [[JSBSim]].&lt;br /&gt;
* '''Beta''' Beta is the angle between the X body axis and the X wind axis measured in the UW plane.&lt;br /&gt;
&lt;br /&gt;
== QBar ==&lt;br /&gt;
QBar, or dynamic pressure, is the product of velocity^2*(air density)/2&lt;br /&gt;
* '''QBarUW''' Use this value for formula involving Alpha. It is the value of QBar restricted to the vertical plane airspeed components.&lt;br /&gt;
* '''QBarUV''' Use this value for formula involving Beta. It is the value of QBar restricted to the horizontal plane airspeed components.&lt;br /&gt;
* It is possible to calculate other dynamic pressures for special purposes, such as QBarU for control surfaces.&lt;br /&gt;
&lt;br /&gt;
The Greek letter rho or &amp;quot;ρ&amp;quot; is commonly used for air density. Normally, Qbar is based on the total free stream velocity, V[∞], so:&lt;br /&gt;
&lt;br /&gt;
'''qbar = 1/2*ρ*(V[∞])^2'''&lt;br /&gt;
&lt;br /&gt;
V[∞] is a vector and can be broken down into components commonly called U, V, W. By definition, U, V, and W are all at right angle to each other, so we use Pythagoras to say:&lt;br /&gt;
&lt;br /&gt;
'''(V[∞])^2 = U^2 + V^2 + W^2'''&lt;br /&gt;
&lt;br /&gt;
and rewrite&lt;br /&gt;
&lt;br /&gt;
'''qbar = 1/2*ρ*(U^2 + V^2 + W^2)'''&lt;br /&gt;
&lt;br /&gt;
QbarUV drops the vertical component, W, and just uses:&lt;br /&gt;
&lt;br /&gt;
'''qbarUV = 1/2*ρ*(U^2 + V^2)'''&lt;br /&gt;
&lt;br /&gt;
QbarUW drops the horizontal component and just uses:&lt;br /&gt;
&lt;br /&gt;
'''qbarUW = 1/2*ρ*(U^2 + W^2)'''&lt;br /&gt;
&lt;br /&gt;
And for the special case of qbarU, only use the axial component.&lt;br /&gt;
&lt;br /&gt;
'''qbarU = 1/2*rho*(U^2)'''&lt;br /&gt;
&lt;br /&gt;
Since its one dimensional, preserving the sign to show direction is valid:&lt;br /&gt;
&lt;br /&gt;
'''qbarU = 1/2*ρ*(U*abs(U))'''&lt;br /&gt;
&lt;br /&gt;
Qbar, qbarUV and qbarUW, can not have signs because they are multidimensional, use the reported alpha or beta angles to decide where the pressure is coming from.&lt;br /&gt;
&lt;br /&gt;
== Metrics ==&lt;br /&gt;
The metrics section provides a standard place to record common aircraft dimensions. [[Aeromatic]] built [[FDM]]s only use four of the defined properties.&lt;br /&gt;
* Wing Area - metrics/Sw-sqft&lt;br /&gt;
* Wing Span - metrics/bw-ft&lt;br /&gt;
* Wing Chord - metrics/cbarw-ft&lt;br /&gt;
* AeroRP - the location where the aerodynamic forces are applied to the model. If this location is not exactly equal to the center of gravity (CoG) then moments, or twisting forces, will be created. Conventional aircraft need AeroRP to be aft of the CoG for stability.&lt;br /&gt;
&lt;br /&gt;
Other dimensions [[Aeromatic]] creates but does not use are: (tail arms are used by the JSBSim Turbulence code)&lt;br /&gt;
* Horizontal Tail Area - Sh-sqft&lt;br /&gt;
* Horizontal Tail Arm - lh-ft &lt;br /&gt;
* Vertical Tail Area - Sv-sqft&lt;br /&gt;
* Vertical Tail Arm - lv-ft&lt;br /&gt;
&lt;br /&gt;
Other elements in metrics:&lt;br /&gt;
* EYEPOINT - where G-forces are computed for the pilot&lt;br /&gt;
* VRP - the world position reported by JSBSim to FlightGear is for this location in the structural frame. Hence, the VRP location should match the origin of the coordinate system(s) used to position views, sounds and the 3d model in the FlightGear XML files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;metrics&amp;gt;&lt;br /&gt;
    &amp;lt;wingarea unit=&amp;quot;{FT2 | M2}&amp;quot;&amp;gt; {number} &amp;lt;/wingarea&amp;gt;&lt;br /&gt;
    &amp;lt;wingspan unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/wingspan&amp;gt;&lt;br /&gt;
    &amp;lt;chord unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/chord&amp;gt;&lt;br /&gt;
    &amp;lt;htailarea unit=&amp;quot;{FT2 | M2}&amp;quot;&amp;gt; {number} &amp;lt;/htailarea&amp;gt;&lt;br /&gt;
    &amp;lt;htailarm unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/htailarm&amp;gt;&lt;br /&gt;
    &amp;lt;vtailarea unit=&amp;quot;{FT2 | M}&amp;quot;&amp;gt; {number} &amp;lt;/vtailarea&amp;gt;&lt;br /&gt;
    &amp;lt;vtailarm unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/vtailarm&amp;gt;&lt;br /&gt;
    &amp;lt;wing_incidence unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt; {number} &amp;lt;/wing_incidence&amp;gt;&lt;br /&gt;
    &amp;lt;pitot_angle unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt; {number} &amp;lt;/pitot_angle&amp;gt;&lt;br /&gt;
    &amp;lt;location name=&amp;quot;{AERORP | EYEPOINT | VRP}&amp;quot; unit=&amp;quot;{IN | M}&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;x&amp;gt; {number} &amp;lt;/x&amp;gt;&lt;br /&gt;
         &amp;lt;y&amp;gt; {number} &amp;lt;/y&amp;gt;&lt;br /&gt;
         &amp;lt;z&amp;gt; {number} &amp;lt;/z&amp;gt;&lt;br /&gt;
    &amp;lt;/location&amp;gt;&lt;br /&gt;
    {other location blocks}&lt;br /&gt;
&amp;lt;/metrics&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Forces ==&lt;br /&gt;
&lt;br /&gt;
For purposes of the Aerodynamics section the entire aircraft creates a single, unified aerodynamic force. This force is split into three component vectors. The most common way of splitting this force into vectors is the Lift Drag Side method. Another, potential better way from the perspective of generating a full 360 degree capable [[FDM]], is the Normal, Axial, Side method.&lt;br /&gt;
* '''Lift: CL''' Lift is the portion of the aerodynamic force that is at a right angle to the relative wind '''and''' lies within the x-z-axis plane (usually the aircraft's symmetry plane) '''and''' is oriented towards the aircraft's upside. (During inverted flight, it points to the ground).&lt;br /&gt;
** Lift is a function of QBar * Wing Area * Cl&amp;lt;sub&amp;gt;lift&amp;lt;/sub&amp;gt;. Cl&amp;lt;sub&amp;gt;lift&amp;lt;/sub&amp;gt; is generally derived from a 2D table as a function of AoA. In the real world it is also a function of the Reynolds and Mach Numbers.&lt;br /&gt;
* '''Drag: CD''' Drag is the portion of the aerodynamic force that is parallel to the relative wind.&lt;br /&gt;
** It is important to ensure all coefficient functions in the drag section remain positive. When drag coefficient functions are negative, drag is effectively acting as thrust opposite the relative wind.&lt;br /&gt;
* '''Side: CY''' Side is the portion of the aerodynamic force that is at a right angle to both the Lift and the Drag vector. It usually points to the aircraft's right side.&lt;br /&gt;
&lt;br /&gt;
This system was developed by and for people using wind tunnels. Lift is to the top of the wind tunnel, drag is out the back and side is to the side. As a real aircraft in free space yanks and banks it may become ambiguous which direction the forces are applied. If an aircraft's body-x-axis is oriented exactly perpendicular to the relative wind, the definitions given above cannot be applied.&lt;br /&gt;
&lt;br /&gt;
Enter the Axial, Normal, Side system.&lt;br /&gt;
* '''Axial: CA''' Axial force is the portion of the aerodynamic force that is parallel to the aircraft's longitudinal (X) axis. For very small angles of attack it is analogous to Drag.&lt;br /&gt;
* '''Normal: CN''' Normal force is the portion of the aerodynamic force that is parallel to the aircraft's vertical (Z) axis.  For very small angles of attack it is analogous to Lift.&lt;br /&gt;
* '''Side: CY''' Side is the portion of the aerodynamic force that is parallel to the aircraft's lateral (Y) axis.&lt;br /&gt;
&lt;br /&gt;
Which ever system is used, the forces are applied at the Aerodynamic Reference Point (AeroRP). If the AeroRP is not coincident to the model's center of gravity (CG), yaw, pitch and roll moments are created that do not appear in the moments sections.&lt;br /&gt;
&lt;br /&gt;
== Moments ==&lt;br /&gt;
* '''Roll: Cl''' Aerodynamic rolling moment comes from multiple sources:&lt;br /&gt;
** One is the lift generated by the vertical tail. On most aircraft the center of pressure for the vertical tail is not on the X body axis. This sets up a moment arm creating a moment of (moment arm length)*(vertical tail lift force).&lt;br /&gt;
** Another roll moment source is main wing dihedral angle. If a dihedral wing encounters a sidewind component, let's say from the right, then the effective angle of attack will slightly increase for the right wing and decrease for the left wing. This is because - from the wing's perspective - the side wind component approaches the right wing from below (leading to an increase in AOA and more lift) and the left wing from above (leading to a decrease in AOA and less lift). Rolling the aircraft to one side will induce a side motion which leads to a resulting difference in lift, creating a roll moment counteracting the initial roll angle and providing roll stability.&lt;br /&gt;
&lt;br /&gt;
* '''Pitch: Cm''' The primary contributor to the pitching moment is the lift generated by the horizontal tail. The pitching moment of the main wing airfoil is a secondary contributor. Because of this fact it makes sense that the value for Cm will resemble the CL curve for the horizontal tail airfoil. The standard CL curve does not take into account the changes in tail Angle of Attack (AoA) and QBar due to main wing down-wash and rotational velocity around the Y axis. Using QBarUV is more appropriate for Cm than the generic QBar.&lt;br /&gt;
* '''Yaw: Cn''' The primary contributor to the yawing moment is the lift generated by the vertical tail. The wind force on the fuselage is a secondary contributor. Because of this fact it makes sense that the value for Cn will resemble the CL curve for the vertical tail airfoil. Changes in QBar due to the vertical tail moving into the 'shadow' of a stalled main wing may need to be accounted for, as well. The source for vertical tail Angle of Attack (AoA) should be Beta and QBarUW is more appropriate for Cn than the generic QBar.&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
* '''Stall''' - A 'stall' is generally regarded as a loss of lift due to flow separation over the top of a wing, however, examination of lift polar for an airfoil over a full 360 degrees shows that significant amounts of lift are NOT lost as the stall occurs. The biggest aerodynamic effect of a stall is a large and rapid increase in drag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;hysteresis_limits unit=&amp;quot;{RAD | DEG}&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;min&amp;gt; {number} &amp;lt;/min&amp;gt;&lt;br /&gt;
    &amp;lt;max&amp;gt; {number} &amp;lt;/max&amp;gt;&lt;br /&gt;
&amp;lt;/hysteresis_limits&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Spin''' - Spins are caused loss of stability in the Yaw Moment axis. A stock [[Aeromatic]] [[FDM]] yaw section does not take alpha into account when calculating the yaw moment.&lt;br /&gt;
* '''Aerodynamic Reference Point''' - JSBSim provides a way to shift the aerodynamic reference point (AeroRP) forward (negative values) and aft (positive) in response to mach, pitch or other influences. Use the tag &amp;amp;lt;aero_ref_pt_shift_x&amp;amp;gt; in the &amp;amp;lt;aerodynamics&amp;amp;gt; section.  The value this tag function returns is internally multiplied by the chord entered in the &amp;amp;lt;metrics&amp;amp;gt; section to get the final shift. You could use this by setting the AeroRP to the leading edge of the wing and use a 1D table indexed by mach starting at .25 chord and getting bigger as the mach number increases to simulate mach tuck. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;aero_ref_pt_shift_x&amp;gt;  &lt;br /&gt;
    &amp;lt;function&amp;gt;&lt;br /&gt;
        {function contents}&lt;br /&gt;
    &amp;lt;/function&amp;gt; &lt;br /&gt;
&amp;lt;/aero_ref_pt_shift_x&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Lift Due To Elevator''' - There are two interrelated effects from elevator deflection, the Force change and the Moment. These have two different coefficients in two different sections of the FDM but should be considered together. The formula is:&lt;br /&gt;
&lt;br /&gt;
CLde * lh-ft = Cmde * cbarw-ft&lt;br /&gt;
&lt;br /&gt;
That is, the force (lift) created by the elevator times its length from the CG is equal to the moment. For some reason standard aerodynamics uses the chord as the reference length.&lt;br /&gt;
&lt;br /&gt;
A similar formula:&lt;br /&gt;
&lt;br /&gt;
CYdr * lv-ft = Cndr * bw-ft &lt;br /&gt;
&lt;br /&gt;
Is applicable the rudder's side force and yawing moment. The force (side) created by the rudder times its length from the CG is equal to the moment. For some reason standard aerodynamics uses the wing span as the reference length.&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
[[Aero input and outputs]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Cessna_172P&amp;diff=116760</id>
		<title>Cessna 172P</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Cessna_172P&amp;diff=116760"/>
		<updated>2018-12-05T10:53:06Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: Stall speeds in CAS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:{{PAGENAME}}/info}}&lt;br /&gt;
The '''Cessna 172P ''Skyhawk''''' is a four-seat, single-engine, high-wing fixed-wing [[aircraft]]. First flown in 1955 and still in production, more Cessna 172s have been built than any other aircraft.&lt;br /&gt;
&lt;br /&gt;
The Cessna 172 has been the default aircraft in [[FlightGear]] since 2000, when it replaced the [[Navion]]. It has had a long development and includes a wide variety of simulation features. In 2015, it went through a complete refresh, including engine options, various tire sizes and floats, as well as a complete cockpit texture makeover. This new detailed version of the plane has become the default aircraft since [[Changelog_3.6|FlightGear 3.6]].&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The new C172p has a much better 3D model and is now fully textured (including the interior). All the switches in the cockpit are clickable. It also has an improved FDM, more complex procedures and new realistic checklists, new sound effects, and damage modelling. The aircraft can get damaged if mishandled (e.g. gear collapse after a hard landing).&lt;br /&gt;
&lt;br /&gt;
[[File:c172p-preview5.jpg|center|700px]]&lt;br /&gt;
&lt;br /&gt;
The aircraft currently has five variants, all available from the aircraft menu:&lt;br /&gt;
* regular wheels&lt;br /&gt;
* 26&amp;quot; bush tires&lt;br /&gt;
* 36&amp;quot; bush tires&lt;br /&gt;
* pontoons&lt;br /&gt;
* amphibious&lt;br /&gt;
* snow skis&lt;br /&gt;
&lt;br /&gt;
Also, from the same menu, the user can select two different engines:&lt;br /&gt;
* 160 HP&lt;br /&gt;
* 180 HP (recommended when using pontoons, amphibian and skis variants)&lt;br /&gt;
&lt;br /&gt;
The aircraft now can get damaged from collisions, crashes, hard landings or overload while in-flight, and the modelling includes wheel collapse, wings breaking, etc. The damage can be turned off in the aircraft menu, which also contains an option for repairing the aircraft.&lt;br /&gt;
&lt;br /&gt;
The windows now can get foggy or frosty, depending on the combination of interior and exterior temperatures. The pilot must then use the Cabin Heat and Cabin Air levers (on the right of the flaps) to control it. Alternatively, it's possible to disable the effect in the &amp;quot;Aircraft Options&amp;quot; in the &amp;quot;Cessna 172P&amp;quot; menu. This effect depends on the new ALS effects found in 3.5 and above, and will also have the side effect of producing grey windows in versions prior to 3.5.&lt;br /&gt;
&lt;br /&gt;
The FDM has also been modified. The aircraft may enter into a spin in case of an asymmetric stall (a particularly dangerous situation when turning to final, in which case the aircraft is at low speed and low height). The FDM has also been tweaked to include hydrodynamics effects while taking off or landing on water, as well as adding a new 180 HP engine.&lt;br /&gt;
&lt;br /&gt;
There are several liveries available, some of which have higher resolution than others, which are marked as HD in the liveries menu. Each of the HD liveries also has unique cockpit and interior textures.&lt;br /&gt;
&lt;br /&gt;
The aircraft has a simulation of the [[Bendix/King KAP140 Autopilot]].&lt;br /&gt;
&lt;br /&gt;
Also, if the user has enabled ALS (Atmospheric light scattering) in the Rendering Options, then it's possible to activate the flashlight by clicking on the &amp;quot;Cessna 172P&amp;quot; menu and selecting &amp;quot;Flashlight&amp;quot;. Select it once for the white flashlight, select it again for a red one and select it one more time to turn it off.&lt;br /&gt;
&lt;br /&gt;
The aircraft can now go through a pre-flight: wheel chocks, tie-downs and the pitot tube cover can now be added or removed, oil management and fuel contamination by water have been implemented (both of which are not activated by default, but are available in the Aircraft Options dialogue).&lt;br /&gt;
&lt;br /&gt;
Carburettor icing is also modelled. Accumulating carburettor ice will result in loss of power. Applying carb heat will help to melt it. If the engine starts to cough when carb heat is applied, it means that ice has indeed been accumulated in the carburettor and now is being melted. To reduce a cough during the melting process, one can lean the mixture. &lt;br /&gt;
&lt;br /&gt;
As of version 2016.3, static objects can be toggled in the Ground Equipment dialogue. These include cones under the wings, a fuel truck, a ground power unit and ladders. The ground power can be used to recharge the battery and the fuel truck can be used to refuelling the tanks. The walker can climb the ladder by walking towards it, which makes it easy to access the fuel tank cap in order to refill it.&lt;br /&gt;
&lt;br /&gt;
[[File:c172p-panel-lighting.jpg|700px|center|Cessna 172P cockpit at night]]&lt;br /&gt;
&lt;br /&gt;
== Handling The Aircraft ==&lt;br /&gt;
&lt;br /&gt;
=== Pre-Flight Inspection ===&lt;br /&gt;
[[File:c172p-ground-objects.jpg|300px||thumb|Cessna 172P secured at Aosta Airport]]&lt;br /&gt;
It's recommended to use any exterior view or activate the walker for these procedures.&lt;br /&gt;
* Fuel quantity: add by clicking on the fuel tank caps above each wing (you can add a ladder in the Ground Equipment dialog and climb it with the walker as well)&lt;br /&gt;
* Left wing: remove tie-down&lt;br /&gt;
* Left wing: remove pitot tube cover&lt;br /&gt;
* Left wing: check for fuel contamination by clicking under the wing and take a fuel sample. If the sample is light blue, the fuel is not contaminated and can be returned to the tank. If the sample is transparent or partially transparent, you must discard it and take new samples until they are completely light blue&lt;br /&gt;
* Tail: remove tie-down&lt;br /&gt;
* Right wing: remove tie-down&lt;br /&gt;
* Right wing: check for fuel contamination&lt;br /&gt;
* Nose: check for oil quantity by clicking on the oil door in the nose. Critical oil level for either engine is 5.0 quarts.&lt;br /&gt;
* Nose: remove wheel chocks&lt;br /&gt;
&lt;br /&gt;
=== Engine Start (manual and complex startup) ===&lt;br /&gt;
[[File:c172p-panel-closeup.jpg|300px||thumb|Cessna 172P before starting the engine]]&lt;br /&gt;
* Priming: prime the engine at least 3 times&lt;br /&gt;
* Mixture: Rich (red lever all the way in)&lt;br /&gt;
* Throttle: Open 1/8 (black lever at 20%)&lt;br /&gt;
* Parking Brake: Applied ({{Key press|Shift|B}})&lt;br /&gt;
* Prop Area: Clear&lt;br /&gt;
* Master switch: ON (both)&lt;br /&gt;
* Magnetos: Both (Press {{Key press|&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;}} three times)&lt;br /&gt;
* Ignition: Start ({{Key press|S}})&lt;br /&gt;
&lt;br /&gt;
=== Engine Start (automatically with Autostart) ===&lt;br /&gt;
* Click on the menu &amp;quot;Cessna C172P&amp;quot; and select &amp;quot;Autostart&amp;quot; in order to start the plane. Please note that the Autostart attempts to start the engine with the mixture full rich, so if you are taking off from a very high altitude airport you may need to manually start the plane.&lt;br /&gt;
&lt;br /&gt;
=== Takeoff ===&lt;br /&gt;
[[File:c172p-preview0.jpg|300px||thumb|Cessna 172P ready for take off]]&lt;br /&gt;
* no flaps&lt;br /&gt;
* full throttle&lt;br /&gt;
* rotate at 55 KIAS&lt;br /&gt;
&lt;br /&gt;
=== Climbout ===&lt;br /&gt;
* no flaps&lt;br /&gt;
* full throttle&lt;br /&gt;
* 75 KIAS&lt;br /&gt;
&lt;br /&gt;
=== Cruise ===&lt;br /&gt;
* throttle 65%&lt;br /&gt;
* mixture rich of peak&lt;br /&gt;
* speed around 100 knots&lt;br /&gt;
&lt;br /&gt;
=== Landing ===&lt;br /&gt;
[[File:c172p-preview4.jpg|300px||thumb|Cessna 172P about to touch down]]&lt;br /&gt;
* full flaps&lt;br /&gt;
* 60 KIAS&lt;br /&gt;
&lt;br /&gt;
=== Airspeeds ===&lt;br /&gt;
: ''See also [[Aircraft speed#V speeds]]''&lt;br /&gt;
&lt;br /&gt;
The information in this section is based on external resources.&amp;lt;ref&amp;gt;[http://www.triangleaviation.com/1982_172r.html Triangle Aviation]{{dead link|2015-10}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://www.otisair.com/c172info.html OtisAir's Airborne Observations]{{dead link|2015-10}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite web |url=http://www.airweb.faa.gov/Regulatory_and_Guidance_Library/rgMakeModel.nsf/0/724e90061c5bf3b1862576260063e599/$FILE/3A12.pdf |title=Type Certificate No. 3A12, Revision 79 |date=27 August 2009 |work= |publisher=FAA |format=pdf |accessdate=9 October 2015}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Airspeed !! CAS&lt;br /&gt;
|-&lt;br /&gt;
| Stall speed, landing configuration, V&amp;lt;sub&amp;gt;S&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;/sub&amp;gt; || 46 - 48 kt&lt;br /&gt;
|-&lt;br /&gt;
| Stall speed, clean, V&amp;lt;sub&amp;gt;S&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/sub&amp;gt; || 51 - 53 kt&lt;br /&gt;
|-&lt;br /&gt;
| Rotation speed, V&amp;lt;sub&amp;gt;R&amp;lt;/sub&amp;gt; || 55 kt&lt;br /&gt;
|-&lt;br /&gt;
| Best angle of climb speed, V&amp;lt;sub&amp;gt;X&amp;lt;/sub&amp;gt; || 59 kt&lt;br /&gt;
|-&lt;br /&gt;
| Best rate of climb speed, V&amp;lt;sub&amp;gt;Y&amp;lt;/sub&amp;gt; || 76 kt&lt;br /&gt;
|-&lt;br /&gt;
| Maximum flap extended speed, V&amp;lt;sub&amp;gt;FE&amp;lt;/sub&amp;gt; || 85 kt&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; valign=&amp;quot;top&amp;quot; | Maneuvering speed, V&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; || 96 kt (floatplane)&lt;br /&gt;
|-&lt;br /&gt;
| 99 kt (landplane)&lt;br /&gt;
|-&lt;br /&gt;
| Maximum structural cruising speed, V&amp;lt;sub&amp;gt;NO&amp;lt;/sub&amp;gt; || 127 kt&lt;br /&gt;
|-&lt;br /&gt;
| Never exceed speed, V&amp;lt;sub&amp;gt;NE&amp;lt;/sub&amp;gt; || 158 kt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&lt;br /&gt;
Here are some of the frequently asked questions about this aircraft:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' I am experiencing grey windows, what is happening?&lt;br /&gt;
&lt;br /&gt;
'''A:''' If you are experiencing grey windows, you do not have the minimum FlightGear version to run this aircraft. Consider upgrading your Flight Gear version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' Why does the aircraft keep turning left?&lt;br /&gt;
&lt;br /&gt;
'''A:''' Please see [[understanding Propeller Torque and P-Factor]]. If using the amphibian model on a solid runway, note that at the taxiing is done by differential braking (the rudder becomes more and more effective as the plane gains speed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' Why will the engine not start?&lt;br /&gt;
&lt;br /&gt;
'''A:''' You can start the engine automatically by clicking on the menu &amp;quot;Cessna C172P&amp;quot; and selecting &amp;quot;Autostart&amp;quot;. For a manual start, please follow the checklists available by clicking on the menu &amp;quot;Help&amp;quot; followed by &amp;quot;Aircraft Checklists&amp;quot;. As seen above, the engine must by &amp;quot;primed&amp;quot; before starting. If oil management is activated, you must have enough oil for the engine to work (more than 5.0 quarts). If fuel contamination is activated, the fuel must be light blue in order for the engine to properly work. You must also make sure that the battery is charged enough (you can check and recharge it in the Aircraft Options dialog).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' Why does the Autostart fail to start the engine?&lt;br /&gt;
&lt;br /&gt;
'''A:''' That's probably because you are attempting to take off from a very high altitude airport. Autostart always tries to start the engine with the mixture full rich, and if it fails to do that properly then you must manually start the engine after properly leaning the mixture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' Why does the engine die immediately after startup?&lt;br /&gt;
&lt;br /&gt;
'''A:''' Probably because the throttle is being incremented too fast after startup as the engine needs a few seconds to stabilize itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' Why can't I start the sim with the engine running?&lt;br /&gt;
&lt;br /&gt;
'''A:''' You can! Go to the menu &amp;quot;Cessna C172P&amp;quot;, select &amp;quot;Aircraft Options&amp;quot; and tick the option &amp;quot;Start with engine running&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' Why I keep running out of battery?&lt;br /&gt;
&lt;br /&gt;
'''A:''' Just like in the real airplane, it's always a bad idea to keep the battery switch on for a long time while the engine is not running, as the battery will run out of charge. When the engine is running, the alternator will make sure that the battery is always recharging. If you run out of battery charge, go to the Aircraft Options dialog and recharge it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' Why doesn't the aircraft move?&lt;br /&gt;
&lt;br /&gt;
'''A:''' The aircraft won't move if you have the parking brakes set, or if either of the wing tie-downs, the tail tie-down or wheel chocks are in place (if the option &amp;quot;allow securing aircraft&amp;quot; is enabled in the aircraft menu).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' Why the airspeed indicator doesn't work?&lt;br /&gt;
&lt;br /&gt;
'''A:''' If the option &amp;quot;allow securing aircraft&amp;quot; is enabled in the aircraft menu, then very likely you forgot to remove the pitot tube cover.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' How can I switch to the bush tires/pontoons/amphibian?&lt;br /&gt;
&lt;br /&gt;
'''A:''' By clicking in menu &amp;quot;Cessna 172P&amp;quot;, selecting &amp;quot;Aircraft Options&amp;quot; and then selecting the other landing gear options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' How can I switch to the 180 HP engine?&lt;br /&gt;
&lt;br /&gt;
'''A:''' This is also done by clicking in menu &amp;quot;Cessna 172P&amp;quot;, selecting &amp;quot;Aircraft Options&amp;quot; and then selecting the engine power option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' Why can't I take off from the water without crashing the plane?&lt;br /&gt;
&lt;br /&gt;
'''A:''' Taking off and landing on water can be quite tricky. Try applying a little bit of back pressure on the yoke while accelerating to 55 KIAS. It's also recommended to use the 180 HP engine instead of the default 160 HP, as the extra weight of the pontoons make it really hard to climb with the default engine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' Why is the simulator lagging so much?&lt;br /&gt;
&lt;br /&gt;
'''A:''' As with any complex 3D model, this new version of the c172p is a bit more demanding on the computers than the older one. If you are having troubles with performance, try using non-HD liveries which use textures with lower resolutions, as well as other solutions that can improve performance (disabling certain graphical options in the Rendering Options, lowering the resolution of FlightGear, etc.).&lt;br /&gt;
&lt;br /&gt;
Some tricks that help to increase fps is by disabling all GUI windows, including the menu bar and the orange fps counters at the bottom of the screen. You can display an alternative fps counter in the top left corner via the &amp;quot;Debug&amp;quot; menu and then selecting &amp;quot;Cycle On-Screen Statistics&amp;quot;. Make sure to hide the menu bar by pressing F10 to see the counter.&lt;br /&gt;
&lt;br /&gt;
A second trick is to simply disable the rendering of all clouds if you don't mind. Start FlightGear with &amp;quot;--prop:/sim/rendering/draw-mask/clouds=0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you notice heavy slowdowns when flying over certain scenery and you see FlightGear generating many &amp;quot;Warning:: Picked up error in TriangleIntersect&amp;quot; messages in the terminal or log file, you can disable this by starting FlightGear with &amp;quot;--prop:/sim/rendering/osg-notify-level=fatal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' Why are the windows getting foggy/frosty?&lt;br /&gt;
&lt;br /&gt;
'''A:''' If the dew point of the cabin air temperature is higher than the surface temperature of the windshield, the windows will get either foggy or frosty. Use the Cabin Heat and Cabin Air levers (on the right of the flaps) to control it. The dew point rises with the temperature in the cabin, and it rises faster than the windshield temperature can adjust, resulting in temporary fog. If the air is very humid, the dew point is going to be very close to the cabin temperature, which makes it likely that it will be higher than the windshield temperature. Extra passengers will create a more humid atmosphere in the cabin. Try to increase air flow using the Cabin Air lever or overhead air vents in order to decrease the humidity or temperature. Alternatively, disable the effect by going to the menu &amp;quot;Cessna 172P&amp;quot;, selecting &amp;quot;Aircraft Options&amp;quot; and disable the option &amp;quot;Enable frost and fog&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' How do I increase the cabin air temperature?&lt;br /&gt;
&lt;br /&gt;
'''A:''' Increase the cabin air temperature by opening the Cabin Heat lever. In order to actually get a heated air flow, you need a medium or high EGT (Exhaust Gas Temperature -- the instrument between the yoke and the ADF instrument), and airspeed and/or sufficient propeller RPM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' How can I click on a switch which is being covered by the yoke?&lt;br /&gt;
&lt;br /&gt;
'''A:''' You can hide the yokes by clicking on them or by going to the menu &amp;quot;Cessna 172P&amp;quot;, selecting &amp;quot;Hide/Show Yokes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Q:''' Why my engine seems to be losing power?&lt;br /&gt;
&lt;br /&gt;
'''A:''' Assuming that you have the mixture correctly leaned according to your altitude and atmospheric pressure, then another possibility is that you are accumulating carburettor ice which results in loss of power. Apply carb heat and the ice should slowly melt. Notice that if the engine starts to cough when you apply carb heat, it means that ice is being melt and is a sign that icing was indeed your problem. To reduce the cough during the melting process, lean the mixture.&lt;br /&gt;
&lt;br /&gt;
== Development status/Issues/TODO ==&lt;br /&gt;
&lt;br /&gt;
This aircraft is undergoing a constant development, which can be followed on its [https://github.com/Juanvvc/c172p-detailed repository], where a [https://github.com/Juanvvc/c172p-detailed/issues list of issues and future enhancements] can also be found.&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot;&amp;gt;&lt;br /&gt;
c172p-preview5.jpg|Cessna 172P high over Italy&lt;br /&gt;
c172p-preview7.jpg|PT-IAO on a soft dirt runway &lt;br /&gt;
c172p-preview0.jpg|Panel view, about to take off&lt;br /&gt;
c172p-preview2.jpg|Parked and secured &lt;br /&gt;
c172p-preview13.jpg|Night lighting effects&lt;br /&gt;
c172p-preview1.jpg|Float variant taking off&lt;br /&gt;
c172p-preview3.jpg|Ski variant over Freiburg&lt;br /&gt;
c172p-preview4.jpg|About to land at Aosta Airport&lt;br /&gt;
c172p-panel-closeup.jpg|Panel close-up&lt;br /&gt;
c172p-preview6.jpg|Hazy day over Naples&lt;br /&gt;
c172p-preview8.jpg|Sightseeing at Chapada Diamantina&lt;br /&gt;
c172p-preview9.jpg|Bush take off&lt;br /&gt;
c172p-preview12.jpg|Night flight with dimmed post lights&lt;br /&gt;
c172p-panel-lighting.jpg|Full post lighting&lt;br /&gt;
c172p-preview10.jpg|Amphibian variant at Hawaii&lt;br /&gt;
c172p-preview11.jpg|Bush variant&lt;br /&gt;
c172p-panel-landing.jpg|About to land&lt;br /&gt;
c172p-ground-objects.jpg|PT-IAO with ground objects&lt;br /&gt;
c172p-particles.jpg|Taking off on water, showing the particle system&lt;br /&gt;
c172p-parked.jpg|N35799 livery parked at Camden Airport (YSCN)&lt;br /&gt;
c172p-damage.jpg|Gear collapse due to heavy landing&lt;br /&gt;
c172p-frost.jpg|If the conditions are just right, frost or fog will appear in the windows&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* {{Wikipedia|Cessna 172|lang=en}}&lt;br /&gt;
* [http://www.aerodynamicaviation.com/wp-content/uploads/2016/03/C172P-checklist.pdf Cessna 172 checklist at aerodynamicaviation.com]&lt;br /&gt;
&lt;br /&gt;
{{Appendix}}&lt;br /&gt;
&lt;br /&gt;
{{Cessna}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft with a cockpit-only autopilot]]&lt;br /&gt;
&lt;br /&gt;
[[ar:Cessna 172P]]&lt;br /&gt;
[[ca:Cessna 172P]]&lt;br /&gt;
[[de:Cessna 172P]]&lt;br /&gt;
[[es:Cessna 172P]]&lt;br /&gt;
[[fr:Cessna 172P]]&lt;br /&gt;
[[nl:Cessna 172P]]&lt;br /&gt;
[[ru:Cessna 172P]]&lt;br /&gt;
[[zh:Cessna 172P]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Property_browser&amp;diff=115568</id>
		<title>Property browser</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Property_browser&amp;diff=115568"/>
		<updated>2018-07-08T15:04:03Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: Displaying On-Screen property values through nasal&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Property_Browser.jpg|thumb|270px|The property browser window]]&lt;br /&gt;
{{PropertyTree}}&lt;br /&gt;
&lt;br /&gt;
The [[FlightGear]] '''property browser''' is a dialog used to browse, in-simulator, through all properties. Properties are internal, runtime state variables in FlightGear. The property browser cannot only be used to inspect all sorts of internal variables at runtime, but it can also be used to change the values of most properties easily (some being conceputally read-only, i.e. because they're exclusively written-to by a certain subsystem such as the FDM).&lt;br /&gt;
&lt;br /&gt;
== Opening the property browser ==&lt;br /&gt;
The property browser can be opened while FlightGear is running either:&lt;br /&gt;
* By pressing the {{key press|/}} key (forward slash)&lt;br /&gt;
* Through the main [[menubar|menu]]: &amp;lt;tt&amp;gt;Debug &amp;gt; Browse Internal Properties&amp;lt;/tt&amp;gt; (in older version: &amp;lt;tt&amp;gt;File &amp;gt; Browse Internal Properties&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Browse around to see the different data fields that are available. Just about everything interesting/useful is published in the property system. The browser allows you to inspect and even change values in the live running copy of FG.&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you have enabled the corresponding &amp;quot;development extension&amp;quot; (see the menu item in the Debug menu), after typing {{key press|/}} you can type in a path (e.g. &amp;lt;tt&amp;gt;/fdm/jsbsim&amp;lt;/tt&amp;gt;) and type {{key press|:}} to open the property browser at that path or {{key press|!}} to display it in the list of properties. This method also features tab-completion similar to bash: it will cycle through a list of existing properties that match what has been typed already. See {{fg root file|path=Nasal/prop_key_handler.nas}} for more information.&lt;br /&gt;
&lt;br /&gt;
== Tied properties ==&lt;br /&gt;
Some properties are so called ''tied'' properties which are directly mapped to internal C++ variables and they cannot be modified using the property browser, we are currently trying to get rid of tied properties, see [[Howto:Use_Property_Tree_Objects]] for details.&lt;br /&gt;
&lt;br /&gt;
In addition, even some non-tied properties cannot be modified because they are by default constantly written/modified by another subsystem (in C++/Nasal space), possibly updating properties at frame rate, this applies for example to the frame rate counter, which is constantly updated by C++ code - so trying to set it from Nasal would be kind of pointless.&lt;br /&gt;
&lt;br /&gt;
Also certain properties are only read/applied during initialization/re-initialization (startup/reset) of the sim, while others require the corresponding subsystems to be reinitialized.&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
Apart from setting a property by clicking it and using the text field and Set button, there is many things that can be done through the property browser:&lt;br /&gt;
&lt;br /&gt;
* To ''toggle boolean values'' (like true/false), ctrl-click a boolean property.&lt;br /&gt;
* To ''display a property'' in the top left corner of the screen, shift-click the property in the property bowser. To ''remove the property'' ctrl-shift-click another property.&lt;br /&gt;
* To ''clone the property browser window'' click the square in the ''left'' top of the window. The ''right'' square closes the current browser.&lt;br /&gt;
* To ''go to the root'' ctrl-click an &amp;quot;&amp;lt;tt&amp;gt;..&amp;lt;/tt&amp;gt;&amp;quot; entry.&lt;br /&gt;
* To toggle ''verbose/developer mode'' ctrl-click an &amp;quot;&amp;lt;tt&amp;gt;.&amp;lt;/tt&amp;gt;&amp;quot; entry.&lt;br /&gt;
&lt;br /&gt;
== Verbose mode ==&lt;br /&gt;
In verbose mode, toggled by ctrl-clicking an &amp;quot;&amp;lt;tt&amp;gt;.&amp;lt;/tt&amp;gt;&amp;quot; entry or toggling &amp;lt;code&amp;gt;/sim/gui/dialogs/property-browser/show-flags&amp;lt;/code&amp;gt;, some additional information is shown as flags like this&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;foo = '123.456' (double; AT)&amp;lt;/code&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
! Flag&lt;br /&gt;
! Meaning&lt;br /&gt;
! Comment&lt;br /&gt;
|-&lt;br /&gt;
| r || Read protected || Showing that a property can not be read.&lt;br /&gt;
|-&lt;br /&gt;
| w || Write protected || Showing that a property can not be written to.&lt;br /&gt;
|-&lt;br /&gt;
| R || Trace read operations || rowspan=&amp;quot;2&amp;quot; | In &amp;lt;code&amp;gt;--log-level=info&amp;lt;/code&amp;gt; create log line with TRACE prefix on write/read operation; set with &amp;lt;code&amp;gt;&amp;lt;foo trace-write=&amp;quot;y&amp;quot;&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| W || Trace write operations&lt;br /&gt;
|-&lt;br /&gt;
| A || Archive bit set || Makes writeProperties() also save this property in restricted mode (&amp;quot;save flight&amp;quot;), while all others are only saved in full mode.&lt;br /&gt;
|-&lt;br /&gt;
| U || User archive bit set || Saved into ~/.fgfs/autosave.xml, and restored next time. &amp;lt;!-- When FlightGear starts? --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| T || Tied property || Only the C/C++ code that owns a tied property can write to it. Also, listeners will not be triggered.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
|1= &amp;lt;pre&amp;gt;props.globals.getNode(&amp;quot;/sim/aircraft&amp;quot;).getAttribute(&amp;quot;references&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
does now return the reference counter -- the number of co-owners&lt;br /&gt;
of the shared pointer. This is really only useful for debugging.&lt;br /&gt;
And here's again a summary of all the attribute names:&lt;br /&gt;
&lt;br /&gt;
 children    ... returns number of children (faster than size(n.getChildren()!)&lt;br /&gt;
 listeners   ... return number of attached listeners&lt;br /&gt;
 references  ... returns number of co-owners (+ 2 for own consumption)&lt;br /&gt;
 tied        ... returns whether a node is &amp;quot;tied&amp;quot; (in which case listeners&lt;br /&gt;
                 might not get triggered)&lt;br /&gt;
 alias       ... whether the node is an alias to another node&lt;br /&gt;
 read        ... whether the node is read-protected&lt;br /&gt;
 write       ... whether the node is write-protected&lt;br /&gt;
 archive     ... whether the &amp;quot;archive&amp;quot; flag is set, which makes the&lt;br /&gt;
                 node saved with &amp;quot;Save Flight&amp;quot; in the menu&lt;br /&gt;
 trace-read  ... whether the node is being traced for read operations&lt;br /&gt;
 trace-write ... whether the node is being traced for write operations&lt;br /&gt;
 userarchive ... whether the node will be saved to ~/.fgfs/autosave.xml&lt;br /&gt;
                 on exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|2= {{cite web&lt;br /&gt;
  | url    = http://sourceforge.net/p/flightgear/mailman/message/15645291/&lt;br /&gt;
  | title  = &amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] FlightGear/Plib periodic stutter notes&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  | author = &amp;lt;nowiki&amp;gt;Melchior FRANZ&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  | date   = Oct 21st, 2007&lt;br /&gt;
  | added   = Oct 21st, 2007&lt;br /&gt;
  | script_version = 0.25&lt;br /&gt;
  }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Other ways to open the property browser ==&lt;br /&gt;
=== Forcing open the browser on startup ===&lt;br /&gt;
You can force the browser to open on startup, through the following command:&lt;br /&gt;
 --prop:browser=/sim/path/that/you/want/to/show&lt;br /&gt;
&lt;br /&gt;
More than one property browser can be opened like this.&lt;br /&gt;
 --prop:browser=position --prop:browser[1]=orientation&lt;br /&gt;
&lt;br /&gt;
=== Opening the property browser through nasal ===&lt;br /&gt;
Calling &amp;lt;code&amp;gt;gui.property_browser(&amp;lt;path&amp;gt;)&amp;lt;/code&amp;gt; opens a property browser for &amp;lt;path&amp;gt;.  While it can be called more than once, though all the dialogues will be drawn on top of each other in the centre of the screen. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
settimer(func {&lt;br /&gt;
    gui.property_browser(&amp;quot;/position&amp;quot;);&lt;br /&gt;
    gui.property_browser(&amp;quot;/orientation&amp;quot;);&lt;br /&gt;
}, 0);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Displaying On-Screen property values through nasal ===&lt;br /&gt;
Create a file (let's call it display-props.nas) with instructions such below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
# On-screen displays&lt;br /&gt;
var enableOSD = func {&lt;br /&gt;
    var left  = screen.display.new(20, 10);&lt;br /&gt;
    var right = screen.display.new(-300, 10);&lt;br /&gt;
    &lt;br /&gt;
    left.add(&amp;quot;/orientation/heading-deg&amp;quot;);&lt;br /&gt;
    left.add(&amp;quot;/environment/wind-from-heading-deg&amp;quot;);&lt;br /&gt;
    left.add(&amp;quot;/environment/wind-speed-kt&amp;quot;);&lt;br /&gt;
    right.add(&amp;quot;/controls/flight/rudder&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
enableOSD();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the path/to/display-props.nas in your aircraft -set.xml,&lt;br /&gt;
&lt;br /&gt;
or in your $FG_HOME/ inside a Nasal/ folder.&lt;br /&gt;
&lt;br /&gt;
[[Category:Menubar]]&lt;br /&gt;
[[Category:Property Tree]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=JSBSim_Thrusters&amp;diff=115486</id>
		<title>JSBSim Thrusters</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=JSBSim_Thrusters&amp;diff=115486"/>
		<updated>2018-06-19T09:14:29Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''[[JSBSim]]''' uses '''thruster''' models to convert engine power into aerodynamic forces. The following table shows which engine-thruster combinations work.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;border: none; background: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; rowspan=&amp;quot;2&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot; | &lt;br /&gt;
! colspan=4 | Thrusters&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width:60px;&amp;quot; | [[JSBSim Thrusters#FGDirect|Direct]] &lt;br /&gt;
| style=&amp;quot;width:60px;&amp;quot; | [[JSBSim Thrusters#FGNozzle|Nozzle]]&lt;br /&gt;
| style=&amp;quot;width:60px;&amp;quot; | [[JSBSim Thrusters#FGPropeller|Propeller]]&lt;br /&gt;
| style=&amp;quot;width:60px;&amp;quot; | [[JSBSim Thrusters#FGRotor|Rotor]] &lt;br /&gt;
|-&lt;br /&gt;
! rowspan=5 | Engines&lt;br /&gt;
|[[JSBSim Engines#FGElectric|Electric]]&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|[[JSBSim Engines#FGPiston|Piston]]&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|[[JSBSim Engines#FGRocket|Rocket]]&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |    &lt;br /&gt;
|-&lt;br /&gt;
|[[JSBSim Engines#FGTurbine|Turbine]]&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|[[JSBSim Engines#FGTurboProp|TurboProp]]&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FGDirect ==&lt;br /&gt;
Thrust is computed directly by the engine, the direct thruster file is a stub. Currently FGTurbine engines use this thruster and it can also be used with FGElectric.&lt;br /&gt;
&lt;br /&gt;
=== Configuration file format ===&lt;br /&gt;
This is the complete configuration file. Copy and paste into your 'direct.xml' file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;direct name=&amp;quot;Direct&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/direct&amp;gt; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
* The direct thruster creates a property called propulsion/engine[#]/reverser-angle-rad&lt;br /&gt;
* &amp;quot;Reverser angle&amp;quot; as used here is a way to manipulate the thrust vector, along the thrust axis ONLY, during run time.  This should not be confused with a thrust vectoring nozzle. The angle is defined in radians, and is used thus:  Final_thrust = cosine( reverser_angle ) * unmodified_thrust. Therefore a reverser angle of 0 results in no change, and a reverser angle of 3.14 (pi) results in a completely reversed thrust vector.  An angle of 1.57 (pi/2) results in no thrust at all&lt;br /&gt;
&lt;br /&gt;
== FGNozzle ==&lt;br /&gt;
FGNozzle is for the FGRocket engine.&lt;br /&gt;
&lt;br /&gt;
=== Configuration file format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;nozzle name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;area unit=&amp;quot;{FT2 | M2 | IN2}&amp;quot;&amp;gt; {number}  &amp;lt;/area&amp;gt;&lt;br /&gt;
&amp;lt;/nozzle&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|area&lt;br /&gt;
|Nozzle area at the exit plane.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
* All parameters MUST be specified.&lt;br /&gt;
* The area specified times the sea level pressure (2117 lbf/ft^2) is the amount thrust is reduced at sea level&lt;br /&gt;
&lt;br /&gt;
== FGPropeller ==&lt;br /&gt;
FGPropeller models a propeller given the tabular data for Ct and Cp, indexed by the advance ratio &amp;quot;J&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Configuration file format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- Sense and P factor go in the parent tag of the propeller, i.e. in the &amp;lt;thruster&amp;gt; element --&amp;gt;&lt;br /&gt;
&amp;lt;sense&amp;gt; {1 | -1} &amp;lt;/sense&amp;gt; &lt;br /&gt;
&amp;lt;p_factor&amp;gt; {number} &amp;lt;/p_factor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;propeller name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ixx&amp;gt; {number} &amp;lt;/ixx&amp;gt;&lt;br /&gt;
  &amp;lt;diameter unit=&amp;quot;IN&amp;quot;&amp;gt; {number} &amp;lt;/diameter&amp;gt;&lt;br /&gt;
  &amp;lt;numblades&amp;gt; {number} &amp;lt;/numblades&amp;gt;&lt;br /&gt;
  &amp;lt;gearratio&amp;gt; {number} &amp;lt;/gearratio&amp;gt;&lt;br /&gt;
  &amp;lt;minpitch&amp;gt; {number} &amp;lt;/minpitch&amp;gt;&lt;br /&gt;
  &amp;lt;maxpitch&amp;gt; {number} &amp;lt;/maxpitch&amp;gt;&lt;br /&gt;
  &amp;lt;minrpm&amp;gt; {number} &amp;lt;/minrpm&amp;gt;&lt;br /&gt;
  &amp;lt;maxrpm&amp;gt; {number} &amp;lt;/maxrpm&amp;gt;&lt;br /&gt;
  &amp;lt;constspeed&amp;gt; {number} &amp;lt;/constspeed&amp;gt;&lt;br /&gt;
  &amp;lt;reversepitch&amp;gt; {number} &amp;lt;/reversepitch&amp;gt;&lt;br /&gt;
  &amp;lt;ct_factor&amp;gt; {number} &amp;lt;/ct_factor&amp;gt;&lt;br /&gt;
  &amp;lt;cp_factor&amp;gt; {number} &amp;lt;/cp_factor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;C_THRUST&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {numbers}&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;C_POWER&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {numbers}&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;CT_MACH&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {numbers}&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;CP_MACH&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {numbers}&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/propeller&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | ixx&lt;br /&gt;
|Propeller rotational inertia. This can be english units, slug &amp;amp; feet^2:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ixx unit=&amp;quot;SLUG*FT2&amp;quot;&amp;gt;       8.95 &amp;lt;/ixx&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or in metric units, kg * meters^2:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ixx unit=&amp;quot;KG*M2&amp;quot;&amp;gt;         12.14 &amp;lt;/ixx&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a thin rod of mass m (kg) and diameter D (meters) spinning about its center, the formula is m*D^2/12. See the [http://en.wikipedia.org/wiki/List_of_moments_of_inertia Moments of inertia reference page] and [http://www.engineeringtoolbox.com/moment-inertia-torque-d_913.html list of conversion factors for different units for moment of inertia].)&lt;br /&gt;
|-&lt;br /&gt;
|diameter&lt;br /&gt;
|Propeller disk diameter.&lt;br /&gt;
|-&lt;br /&gt;
|numblades&lt;br /&gt;
|Number of blades.&lt;br /&gt;
|-&lt;br /&gt;
|gearratio&lt;br /&gt;
|Ratio of (engine rpm) / (prop rpm).&lt;br /&gt;
|-&lt;br /&gt;
|minpitch&lt;br /&gt;
|Minimum blade pitch angle.&lt;br /&gt;
|-&lt;br /&gt;
|maxpitch&lt;br /&gt;
|Maximum blade pitch angle.&lt;br /&gt;
|-&lt;br /&gt;
|minrpm&lt;br /&gt;
|Minimum rpm target for constant speed propeller.&lt;br /&gt;
|-&lt;br /&gt;
|maxrpm&lt;br /&gt;
|Maximum rpm target for constant speed propeller.&lt;br /&gt;
|-&lt;br /&gt;
|constspeed&lt;br /&gt;
|1 = constant speed mode, 0 = manual pitch mode. &lt;br /&gt;
|-&lt;br /&gt;
|reversepitch&lt;br /&gt;
|Blade pitch angle for reverse.&lt;br /&gt;
|-&lt;br /&gt;
|sense&lt;br /&gt;
|Direction of rotation (1= clockwise as viewed from rear, -1=counter-clockwise as viewed from rear). Sense is specified in the parent tag of the propeller. ''See [[JSBSim_Thrusters#Sense_bug_affecting_gyroscopic_moment|important note below]] regarding a JSBSim bug affecting sense and the direction of the resulting gyroscopic moment.''&lt;br /&gt;
|-&lt;br /&gt;
|p_factor&lt;br /&gt;
|P factor. It is specified in the parent tag of the propeller.&lt;br /&gt;
|-&lt;br /&gt;
|ct_factor&lt;br /&gt;
|A multiplier for the coefficients of thrust (multiplies the dependent variable in the C_THRUST table by this factor).&lt;br /&gt;
|-&lt;br /&gt;
|cp_factor&lt;br /&gt;
|A multiplier for the coefficients of power (multiplies the dependent variable in the C_POWER table by this factor).&lt;br /&gt;
|}&lt;br /&gt;
The parameters &amp;lt;sense&amp;gt; and &amp;lt;p_factor&amp;gt; must be specified at the parent level i.e. in the &amp;lt;thruster&amp;gt; element. This allows to specify different sense and P factor values for each propeller of the model while using the same definition file for all the propellers.&lt;br /&gt;
&lt;br /&gt;
=== C_THRUST and C_POWER tables ===&lt;br /&gt;
The C_THRUST and C_POWER tables are required. &lt;br /&gt;
&lt;br /&gt;
The independent variable for both tables is [http://en.wikipedia.org/wiki/Advance_ratio Advance Ratio] (J). The dependent variable is the coefficient of thrust (Ct) for the C_THRUST and the coefficient of power (Cp) for C_POWER. &lt;br /&gt;
&lt;br /&gt;
For variable pitch propellers, it is possible to give a two-dimensional table, showing Ct and Cp for different J and different pitch angles of the propeller.  See example below.&lt;br /&gt;
&lt;br /&gt;
[http://www.mh-aerotools.de/airfoils/pylonprops_1.htm Propellors for F3D Models explains the theory] and has [http://www.mh-aerotools.de/airfoils/pylonprops_2.htm formulas] and [http://www.mh-aerotools.de/airfoils/pylonprops_3.htm many graphs] showing the relationship between J, Ct, and Cp.&lt;br /&gt;
&lt;br /&gt;
Relevant formulas relating the variables in the tables (and metric system units):&lt;br /&gt;
&lt;br /&gt;
* Thrust: T = Ct * rho * n^2 * D^4&lt;br /&gt;
* Power: P = Cp * rho * n^3 * D^5)&lt;br /&gt;
* Advance Ratio: J = v/(n*D)&lt;br /&gt;
* Efficiency: eta = Ct/Cp * v/(n*D) (or equivalently, eta = Ct/Cp * J )&lt;br /&gt;
&lt;br /&gt;
In the formulas&lt;br /&gt;
* Ct = coefficient of thrust&lt;br /&gt;
* Cp = coefficient of power&lt;br /&gt;
* v = true velocity of aircraft (m/s)&lt;br /&gt;
* D = diameter of propeller disk (m)&lt;br /&gt;
* n = rotations per second (1/s) (note RPS, not RPM)&lt;br /&gt;
* rho = density of air (kg/m^3)&lt;br /&gt;
* P = power (W)&lt;br /&gt;
* T = thrust (N)&lt;br /&gt;
&lt;br /&gt;
For a typical propeller, both Cp and Ct are downward sloping curves that reach 0 when J is somewhere in the range 0-4 (depending on blade angle and other factors). Cp and Ct can be negative; this indicates the drag induced by the prop when the airspeed is relatively fast compared with prop RPM. At higher pitch angles Ct may have a positive slope or be flat in the lower J range.&lt;br /&gt;
&lt;br /&gt;
Ct/Cp gives the efficiency (eta), and propeller shape and general design give each propeller a distinctive [http://www.mh-aerotools.de/airfoils/pylonprops_3.htm efficiency curve]. For fixed-pitch propellers, the propeller is generally designed to reach peak efficiency either at climb velocity &amp;amp; RPM, cruise velocity and RPM, or some compromise between the two.  [http://en.wikipedia.org/wiki/Controllable_pitch_propeller Variable pitch propellers] and [http://en.wikipedia.org/wiki/Constant_speed_propeller constant speed propellers] bring different factors into play.&lt;br /&gt;
&lt;br /&gt;
Note that several of the values mentioned above can be viewed while FG is running, in the property tree under /fdm/jsbsim/propulsion/engine.  This is useful for seeing how the settings and tables play out under various conditions and fine-tuning the settings.&lt;br /&gt;
&lt;br /&gt;
==== Sample C_THRUST and C_POWER tables ====&lt;br /&gt;
These example tables are from FlightGear's C172P aircraft:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;table name=&amp;quot;C_THRUST&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;tableData&amp;gt;&lt;br /&gt;
        0.0    0.068&lt;br /&gt;
        0.1    0.068&lt;br /&gt;
        0.2    0.067&lt;br /&gt;
        0.3    0.066&lt;br /&gt;
        0.4    0.064&lt;br /&gt;
        0.5    0.062&lt;br /&gt;
        0.6    0.059&lt;br /&gt;
        0.7    0.054&lt;br /&gt;
        0.8    0.043&lt;br /&gt;
        0.9    0.031&lt;br /&gt;
        1.0    0.019&lt;br /&gt;
        1.1    0.008&lt;br /&gt;
        1.2   -0.001&lt;br /&gt;
        1.3   -0.008&lt;br /&gt;
        1.4   -0.019&lt;br /&gt;
        1.5   -0.029&lt;br /&gt;
        1.6   -0.040&lt;br /&gt;
        1.7   -0.050&lt;br /&gt;
        1.8   -0.057&lt;br /&gt;
        1.9   -0.061&lt;br /&gt;
        2.0   -0.064&lt;br /&gt;
        2.1   -0.066&lt;br /&gt;
        2.2   -0.067&lt;br /&gt;
        2.3   -0.068&lt;br /&gt;
        5.0   -0.068&lt;br /&gt;
      &amp;lt;/tableData&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;table name=&amp;quot;C_POWER&amp;quot; type = &amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;tableData&amp;gt;&lt;br /&gt;
        0.0   0.0580&lt;br /&gt;
        0.1   0.0620&lt;br /&gt;
        0.2   0.0600&lt;br /&gt;
        0.3   0.0580&lt;br /&gt;
        0.4   0.0520&lt;br /&gt;
        0.5   0.0457&lt;br /&gt;
        0.6   0.0436&lt;br /&gt;
        0.7   0.0420&lt;br /&gt;
        0.8   0.0372&lt;br /&gt;
        0.9   0.0299&lt;br /&gt;
        1.0   0.0202&lt;br /&gt;
        1.1   0.0111&lt;br /&gt;
        1.2   0.0075&lt;br /&gt;
        1.3   0.0111&lt;br /&gt;
        1.4   0.0202&lt;br /&gt;
        1.5   0.0280&lt;br /&gt;
        1.6   0.0346&lt;br /&gt;
        1.7   0.0389&lt;br /&gt;
        1.8   0.0421&lt;br /&gt;
        1.9   0.0436&lt;br /&gt;
        2.0   0.0445&lt;br /&gt;
        2.1   0.0445&lt;br /&gt;
        2.2   0.0442&lt;br /&gt;
        2.3   0.0431&lt;br /&gt;
        2.4   0.0424&lt;br /&gt;
        5.0   0.0413&lt;br /&gt;
      &amp;lt;/tableData&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of table for variable pitch propeller ([http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg32187.html source]):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;!-- thrust coefficient as a function of advance ratio and blade angle --&amp;gt;&lt;br /&gt;
    &amp;lt;table name=&amp;quot;C_THRUST&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;tableData&amp;gt;&lt;br /&gt;
                  -10        0         15        25        35        45        55        65       90&lt;br /&gt;
        -0.2      -0.0734    0.0413    0.1503    0.1842    0.2030    0.2142    0.1974    0.1691   0.0000&lt;br /&gt;
         0.0      -0.1090    0.0000    0.1503    0.1842    0.2030    0.2162    0.2021    0.1691   0.0000&lt;br /&gt;
         0.2      -0.1222   -0.0376    0.1297    0.1804    0.2001    0.2162    0.2021    0.1691   0.0000&lt;br /&gt;
         0.4      -0.1222   -0.0873    0.0977    0.1786    0.1963    0.2142    0.2021    0.1691   0.0000&lt;br /&gt;
         0.6      -0.1222   -0.1222    0.0517    0.1607    0.1879    0.2087    0.1992    0.1691   0.0000&lt;br /&gt;
         0.8      -0.1222   -0.1222    0.0029    0.1203    0.1824    0.2012    0.1992    0.1691   0.0000&lt;br /&gt;
         1.0      -0.1222   -0.1222   -0.0489    0.0734    0.1748    0.1908    0.1974    0.1691   0.0000&lt;br /&gt;
         1.2      -0.1222   -0.1222   -0.1006    0.0226    0.1437    0.1842    0.1974    0.1691   0.0000&lt;br /&gt;
         1.4      -0.1222   -0.1222   -0.1222   -0.0329    0.1034    0.1813    0.1936    0.1691   0.0000&lt;br /&gt;
         1.6      -0.1222   -0.1222   -0.1222   -0.0836    0.0564    0.1748    0.1899    0.1691   0.0000&lt;br /&gt;
         1.8      -0.1222   -0.1222   -0.1222   -0.1222    0.0095    0.1503    0.1842    0.1691   0.0000&lt;br /&gt;
         2.0      -0.1222   -0.1222   -0.1222   -0.1222   -0.0376    0.1174    0.1834    0.1691   0.0000&lt;br /&gt;
         2.2      -0.1222   -0.1222   -0.1222   -0.1222   -0.0846    0.0846    0.1804    0.1691   0.0000&lt;br /&gt;
         2.4      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222    0.0451    0.1473    0.1691   0.0000&lt;br /&gt;
         2.6      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222    0.0057    0.0932    0.1503   0.0000&lt;br /&gt;
         2.8      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.0338    0.0610    0.1222   0.0000&lt;br /&gt;
         3.0      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.0734    0.0320    0.0940   0.0000&lt;br /&gt;
         3.2      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1128    0.0029    0.0658   0.0000&lt;br /&gt;
         3.4      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.0263    0.0376   0.0000&lt;br /&gt;
         3.6      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.0555    0.0095   0.0000&lt;br /&gt;
         3.8      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.0846   -0.0188   0.0000&lt;br /&gt;
         4.0      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1137   -0.0471   0.0000&lt;br /&gt;
         6.0      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   0.0000&lt;br /&gt;
        &amp;lt;/tableData&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;!-- power coefficient as a function of advance ratio and blade angle --&amp;gt;&lt;br /&gt;
    &amp;lt;table name=&amp;quot;C_POWER&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;tableData&amp;gt;&lt;br /&gt;
                 -10        0        15        25        35        45        55        65       90&lt;br /&gt;
        -0.2      0.0108   0.0215    0.0753    0.1710    0.2949    0.4194    0.4839    0.5355   0.5355&lt;br /&gt;
         0.0      0.0430   0.0108    0.0645    0.1594    0.2820    0.4194    0.4859    0.5355   0.5355&lt;br /&gt;
         0.2      0.0613   0.0172    0.0624    0.1484    0.2697    0.4194    0.4859    0.5355   0.5355&lt;br /&gt;
         0.4      0.0826   0.0376    0.0537    0.1368    0.2562    0.4194    0.4859    0.5355   0.5355&lt;br /&gt;
         0.6      0.1013   0.0570    0.0355    0.1271    0.2400    0.4110    0.4839    0.5355   0.5355&lt;br /&gt;
         0.8      0.1194   0.0763    0.0108    0.1078    0.2258    0.3923    0.4839    0.5355   0.5355&lt;br /&gt;
         1.0      0.1374   0.0948    0.0108    0.0755    0.2129    0.3723    0.4820    0.5355   0.5355&lt;br /&gt;
         1.2      0.1561   0.0758   -0.0355    0.0290    0.1884    0.3568    0.4788    0.5355   0.5355&lt;br /&gt;
         1.4      0.1742   0.1310   -0.0536   -0.0215    0.1452    0.3516    0.4729    0.5355   0.5355&lt;br /&gt;
         1.6      0.1923   0.1497   -0.0626   -0.0645    0.0916    0.3420    0.4626    0.5162   0.5355&lt;br /&gt;
         1.8      0.2110   0.1678   -0.0645   -0.1078    0.0269    0.3033    0.4484    0.5052   0.5355&lt;br /&gt;
         2.0      0.2291   0.1858   -0.0826   -0.1503   -0.0323    0.2581    0.4271    0.4949   0.5355&lt;br /&gt;
         2.2      0.2471   0.2045   -0.1013   -0.1936   -0.0968    0.2097    0.4142    0.4729   0.5355&lt;br /&gt;
         2.4      0.2658   0.2226   -0.1194   -0.2368   -0.1613    0.1497    0.4020    0.4626   0.5355&lt;br /&gt;
         2.6      0.2839   0.2407   -0.1374   -0.2794   -0.2045    0.0626    0.3923    0.4465   0.5355&lt;br /&gt;
         2.8      0.3020   0.2594   -0.1561   -0.3226   -0.2452   -0.0213    0.3839    0.4407   0.5355&lt;br /&gt;
         3.0      0.3207   0.2774   -0.1742   -0.3658   -0.2903   -0.0968    0.3710    0.4407   0.5355&lt;br /&gt;
         3.2      0.3387   0.2955   -0.1923   -0.4084   -0.3336   -0.1723    0.3471    0.4304   0.5355&lt;br /&gt;
         3.4      0.3568   0.3142   -0.2110   -0.4517   -0.3762   -0.2471    0.2691    0.4194   0.5355&lt;br /&gt;
         3.6      0.3755   0.3323   -0.2291   -0.4949   -0.4194   -0.3226    0.1890    0.4084   0.5355&lt;br /&gt;
         3.8      0.3936   0.3504   -0.2471   -0.5355   -0.4626   -0.3981    0.1052    0.3955   0.5355&lt;br /&gt;
         4.0      0.4117   0.3691   -0.2658   -0.5355   -0.5355   -0.4729    0.0213    0.3658   0.5355&lt;br /&gt;
         6.0      0.5355   0.5355   -0.5355   -0.5355   -0.5355   -0.5355   -0.5355   -0.3226   0.5355&lt;br /&gt;
       &amp;lt;/tableData&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- thrust effects of helical tip Mach --&amp;gt;&lt;br /&gt;
  &amp;lt;table name=&amp;quot;CT_MACH&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      0.85   1.0&lt;br /&gt;
      1.05   0.8&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- power-required effects of helical tip Mach --&amp;gt;&lt;br /&gt;
  &amp;lt;table name=&amp;quot;CP_MACH&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      0.85   1.0&lt;br /&gt;
      1.05   1.8&lt;br /&gt;
      2.00   1.4&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CT_MACH and CP_MACH ===&lt;br /&gt;
The CT_MACH and CP_MACH tables are optional. They apply a factor to Ct and Cp based on the helical tip Mach. The CP_MACH table models the [http://en.wikipedia.org/wiki/Drag_divergence_Mach_number Drag Divergence Mach Number] for the propeller airfoil. The CT_MACH table models the thrust reduction.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- thrust effects of helical tip Mach --&amp;gt;&lt;br /&gt;
  &amp;lt;table name=&amp;quot;CT_MACH&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      0.85   1.0&lt;br /&gt;
      1.05   0.8&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- power-required effects of helical tip Mach --&amp;gt;&lt;br /&gt;
  &amp;lt;table name=&amp;quot;CP_MACH&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      0.85   1.0&lt;br /&gt;
      1.05   1.8&lt;br /&gt;
      2.00   1.4&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sense ===&lt;br /&gt;
Sense is the direction of rotation. 1=clockwise (typically as seen from rear of aircraft or the cockpit of a typical front-propeller aircraft, but this may vary depending on how you have set up the coordinate system for your aircraft) and -1 is counter-clockwise.&lt;br /&gt;
&lt;br /&gt;
The sense tag goes in the parent tag of the thruster, ie, in the &amp;lt;propulsion&amp;gt;&amp;lt;thruster&amp;gt; section which is typically in the main JSBSim XML file.  Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;propulsion&amp;gt;&lt;br /&gt;
        &amp;lt;engine file=&amp;quot;Clerget9B&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;location unit=&amp;quot;IN&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;x&amp;gt; 12 &amp;lt;/x&amp;gt;&lt;br /&gt;
                &amp;lt;y&amp;gt; 0 &amp;lt;/y&amp;gt;&lt;br /&gt;
                &amp;lt;z&amp;gt; 0 &amp;lt;/z&amp;gt;&lt;br /&gt;
            &amp;lt;/location&amp;gt;&lt;br /&gt;
            &amp;lt;orient unit=&amp;quot;DEG&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;roll&amp;gt; 0 &amp;lt;/roll&amp;gt;&lt;br /&gt;
                &amp;lt;pitch&amp;gt; 0 &amp;lt;/pitch&amp;gt;&lt;br /&gt;
                &amp;lt;yaw&amp;gt; 0 &amp;lt;/yaw&amp;gt;&lt;br /&gt;
            &amp;lt;/orient&amp;gt;&lt;br /&gt;
            &amp;lt;feed&amp;gt;0&amp;lt;/feed&amp;gt;&lt;br /&gt;
            &amp;lt;thruster file=&amp;quot;CamelProp&amp;quot;&amp;gt;&lt;br /&gt;
                '''&amp;lt;sense&amp;gt;1&amp;lt;/sense&amp;gt;'''&lt;br /&gt;
                &amp;lt;location unit=&amp;quot;IN&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;x&amp;gt; 0 &amp;lt;/x&amp;gt;&lt;br /&gt;
                    &amp;lt;y&amp;gt; 0 &amp;lt;/y&amp;gt;&lt;br /&gt;
                    &amp;lt;z&amp;gt; 0 &amp;lt;/z&amp;gt;&lt;br /&gt;
                &amp;lt;/location&amp;gt;&lt;br /&gt;
                &amp;lt;orient unit=&amp;quot;DEG&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;roll&amp;gt; 0 &amp;lt;/roll&amp;gt;&lt;br /&gt;
                    &amp;lt;pitch&amp;gt; 0 &amp;lt;/pitch&amp;gt;&lt;br /&gt;
                    &amp;lt;yaw&amp;gt; 0 &amp;lt;/yaw&amp;gt;&lt;br /&gt;
                &amp;lt;/orient&amp;gt;&lt;br /&gt;
            &amp;lt;/thruster&amp;gt;&lt;br /&gt;
        &amp;lt;/engine&amp;gt;&lt;br /&gt;
        &amp;lt;tank type=&amp;quot;FUEL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;location unit=&amp;quot;IN&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;x&amp;gt; 60 &amp;lt;/x&amp;gt;&lt;br /&gt;
                &amp;lt;y&amp;gt; 0 &amp;lt;/y&amp;gt;&lt;br /&gt;
                &amp;lt;z&amp;gt; -5.62 &amp;lt;/z&amp;gt;&lt;br /&gt;
            &amp;lt;/location&amp;gt;&lt;br /&gt;
            &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt;133.6&amp;lt;/capacity&amp;gt;&lt;br /&gt;
            &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt;133.6&amp;lt;/contents&amp;gt;&lt;br /&gt;
        &amp;lt;/tank&amp;gt;&lt;br /&gt;
    &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sense bug affecting gyroscopic moment====&lt;br /&gt;
Prior to about 2015--and continuing in current JSBSim and FlightGear versions unless you take the corrective steps outlined below--a JSBSim bug cause the gyroscopic moment of the propeller to be reversed.&lt;br /&gt;
&lt;br /&gt;
To fix this bug and get the correct sign for your gyroscopic effect, you must add version=&amp;quot;1.1&amp;quot; (or higher--any version greater than 1.0 should work) to your propeller definition, as shown in this example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;propeller name=&amp;quot;prop&amp;quot; version=&amp;quot;1.1&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- propeller definition --&amp;gt;&lt;br /&gt;
&amp;lt;/propeller&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bug with the sign of gyroscopic effect and the fix are outlined under [https://sourceforge.net/p/jsbsim/bugs/110/ JSBSim Bug #110].&lt;br /&gt;
&lt;br /&gt;
For most aircraft and engine/propeller systems the gyroscopic effect is fairly subtle and thus the bug is difficult to detect. But for some aircraft, such as small, light, rotary-engined WWI-era aircraft, the gyroscopic effect is very noticeable, and the reverse in direction of the effect created by the bug is very noticeable as well.&lt;br /&gt;
&lt;br /&gt;
=== Starter speed (for piston engines) ===&lt;br /&gt;
There is a somewhat complex relationship among the power coefficient, the maxhp, and idlerpm.  Both maxhp and idlerpm are set in the engine xml file.&lt;br /&gt;
&lt;br /&gt;
The power of the starter motor is equal to 0.4*sqrt(maxhp).  The minimum RPM needed to start the engine is 80% of the idlerpm.  The greater the power coefficient (for J near 0), the more power the propeller will require to spin when starting the engine with the aircraft at rest.&lt;br /&gt;
&lt;br /&gt;
If your propeller will not spin fast enough to start, you can try some combination of:&lt;br /&gt;
&lt;br /&gt;
* Open the throttle. Pulling a partial vacuum in the intake manifold takes some power.&lt;br /&gt;
* Increase maxhp (increases the power of the starter motor)&lt;br /&gt;
* Decrease idlerpm (decreases the minimum RPM needed to start the engine)&lt;br /&gt;
* Decrease the power coefficient in the C_POWER table, for values of J close to (or equal to) 0.  This will reduce the amount of power it takes for the propeller to spin at a given RPM where J is close to 0 (which is the typical situation when starting the engine and the aircraft is at a dead stop).&lt;br /&gt;
&lt;br /&gt;
You can open the property tree and watch the value of J (/fdm/jsbsim/propulsion/engines/advance-ratio) to get an idea of which values you need to change in the C_POWER table.&lt;br /&gt;
&lt;br /&gt;
''' Code is in FG 2.8 to independently control the power of the piston starter motor, to include battery effects. '''&lt;br /&gt;
starter-torque (fgfs 2.8) is a value specifying the zero RPM torque in lb*ft the starter motor provides. Current default value is 40% of the maximum horsepower value.&lt;br /&gt;
starter-rpm (fgfs 2.8) is a value specifying the maximum RPM the unloaded starter motor can achieve. Loads placed on the engine by the propeller and throttle will further limit RPM achieved in practice. Peak starter power is achieved at 1/2 starter-rpm. At 1/2 starter-rpm torque is 1/2 starter-torque. Peak power can be calculated by the standard formula HP=(Torque*RPM)/5252&lt;br /&gt;
&lt;br /&gt;
=== Development tips ===&lt;br /&gt;
* If you open the property tree browser within FG to /fdm/jsbsim/propulsion/engines you can see a number of helpful variables in action, including RPM, horsepower, advance ratio, thrust coefficient, and others.&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* Barnes W. McCormick, &amp;quot;Aerodynamics, Aeronautics, and Flight Mechanics&amp;quot;, Wiley &amp;amp; Sons, 1979 ISBN 0-471-03032-5&lt;br /&gt;
* Edwin Hartman, David Biermann, &amp;quot;The Aerodynamic Characteristics of Full Scale Propellers Having 2, 3, and 4 Blades of Clark Y and R.A.F. 6 Airfoil Sections&amp;quot;, NACA Report TN-640, 1938 (?)&lt;br /&gt;
* Various NACA Technical Notes and Reports&lt;br /&gt;
&lt;br /&gt;
== FGRotor ==&lt;br /&gt;
FGRotor models a helicopter rotor.&lt;br /&gt;
&lt;br /&gt;
=== Configuration file format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- Sense goes in the parent tag --&amp;gt;&lt;br /&gt;
&amp;lt;sense&amp;gt; {1 | 0 | -1} &amp;lt;/sense&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;rotor name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;diameter unit=&amp;quot;{LENGTH}&amp;quot;&amp;gt; {number} &amp;lt;/diameter&amp;gt;&lt;br /&gt;
  &amp;lt;numblades&amp;gt; {number} &amp;lt;/numblades&amp;gt;&lt;br /&gt;
  &amp;lt;gearratio&amp;gt; {number} &amp;lt;/gearratio&amp;gt;&lt;br /&gt;
  &amp;lt;nominalrpm&amp;gt; {number} &amp;lt;/nominalrpm&amp;gt;&lt;br /&gt;
  &amp;lt;minrpm&amp;gt; {number} &amp;lt;/minrpm&amp;gt;&lt;br /&gt;
  &amp;lt;maxrpm&amp;gt; {number} &amp;lt;/maxrpm&amp;gt; &lt;br /&gt;
  &amp;lt;chord unit=&amp;quot;{LENGTH}&amp;quot;&amp;gt; {number} &amp;lt;/chord&amp;gt;&lt;br /&gt;
  &amp;lt;liftcurveslope Xunit=&amp;quot;1/RAD&amp;quot;&amp;gt; {number} &amp;lt;/liftcurveslope&amp;gt;&lt;br /&gt;
  &amp;lt;twist unit=&amp;quot;{ANGLE}&amp;quot;&amp;gt; {number} &amp;lt;/twist&amp;gt;&lt;br /&gt;
  &amp;lt;hingeoffset unit=&amp;quot;{LENGTH}&amp;quot;&amp;gt; {number} &amp;lt;/hingeoffset&amp;gt;&lt;br /&gt;
  &amp;lt;flappingmoment unit=&amp;quot;{MOMENT}&amp;quot;&amp;gt; {number} &amp;lt;/flappingmoment&amp;gt;&lt;br /&gt;
  &amp;lt;massmoment Xunit=&amp;quot;SLUG*FT&amp;quot;&amp;gt; {number} &amp;lt;/massmoment&amp;gt;&lt;br /&gt;
  &amp;lt;polarmoment unit=&amp;quot;{MOMENT}&amp;quot;&amp;gt; {number} &amp;lt;/polarmoment&amp;gt;&lt;br /&gt;
  &amp;lt;inflowlag&amp;gt; {number} &amp;lt;/inflowlag&amp;gt;&lt;br /&gt;
  &amp;lt;tiplossfactor&amp;gt; {number} &amp;lt;/tiplossfactor&amp;gt;&lt;br /&gt;
  &amp;lt;maxbrakepower unit=&amp;quot;{POWER}&amp;quot;&amp;gt; {number} &amp;lt;/maxbrakepower&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;controlmap&amp;gt; {MAIN|TAIL|TANDEM} &amp;lt;/controlmap&amp;gt;&lt;br /&gt;
  &amp;lt;ExternalRPM&amp;gt; {number} &amp;lt;/ExternalRPM&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;groundeffectexp&amp;gt; {number} &amp;lt;/groundeffectexp&amp;gt;&lt;br /&gt;
  &amp;lt;groundeffectshift unit=&amp;quot;{LENGTH}&amp;quot;&amp;gt; {number} &amp;lt;/groundeffectshift&amp;gt;&lt;br /&gt;
&amp;lt;/rotor&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* LENGTH means any of the supported units, same for ANGLE and MOMENT.X unit-attributes are a hint for currently unsupported units, so values must be provided accordingly.&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|diameter&lt;br /&gt;
|Rotor disk diameter (2x R).&lt;br /&gt;
|-&lt;br /&gt;
|numblades&lt;br /&gt;
|Number of blades (b).&lt;br /&gt;
|-&lt;br /&gt;
|gearratio&lt;br /&gt;
|Ratio of (engine rpm) / (rotor rpm), usually &amp;gt; 1.&lt;br /&gt;
|-&lt;br /&gt;
|nominalrpm&lt;br /&gt;
|RPM at which the rotor usally operates. &lt;br /&gt;
|-&lt;br /&gt;
|minrpm&lt;br /&gt;
|Lowest RPM used in the model, optional and defaults to 1.&lt;br /&gt;
|-&lt;br /&gt;
|maxrpm&lt;br /&gt;
|Largest RPM used in the model, optional and defaults to 2 x nominalrpm. &lt;br /&gt;
|-&lt;br /&gt;
|chord&lt;br /&gt;
|Blade chord, (c).&lt;br /&gt;
|-&lt;br /&gt;
|liftcurveslope&lt;br /&gt;
|Slope of curve of section lift against section angle of attack, per rad (a).&lt;br /&gt;
|-&lt;br /&gt;
|twist&lt;br /&gt;
|Blade twist from root to tip, (theta_1).&lt;br /&gt;
|-&lt;br /&gt;
|hingeoffset&lt;br /&gt;
|Rotor flapping-hinge offset (e).&lt;br /&gt;
|-&lt;br /&gt;
|flappingmoment&lt;br /&gt;
|Flapping moment of inertia (I_b).&lt;br /&gt;
|-&lt;br /&gt;
|massmoment&lt;br /&gt;
|Blade mass moment. Mass of a single blade times the blade's cg-distance from the hub, optional.&lt;br /&gt;
|-&lt;br /&gt;
|polarmoment&lt;br /&gt;
|Moment of inertia for the whole rotor disk, optional.&lt;br /&gt;
|-&lt;br /&gt;
|inflowlag&lt;br /&gt;
|Rotor inflow time constant, sec. Smaller values yield to quicker responses (typical values for main rotor: 0.1 - 0.2 s).&lt;br /&gt;
|-&lt;br /&gt;
|tiplossfactor&lt;br /&gt;
|Tip-loss factor. The Blade fraction that produces lift. Value usually ranges between 0.95 - 1.0, optional (B).&lt;br /&gt;
|-&lt;br /&gt;
|maxbrakepower&lt;br /&gt;
|Rotor brake, 20-30 hp should work for a mid size helicopter.&lt;br /&gt;
|-&lt;br /&gt;
|controlmap&lt;br /&gt;
|Defines the control inputs used (see notes).&lt;br /&gt;
|-&lt;br /&gt;
|ExternalRPM&lt;br /&gt;
|Links the rotor to another rotor, or an user controllable property.&lt;br /&gt;
&lt;br /&gt;
Experimental properties&lt;br /&gt;
|-&lt;br /&gt;
|groundeffectexp&lt;br /&gt;
|Exponent for ground effect approximation. Values usually range from 0.04 for large rotors to 0.1 for smaller ones. As a rule of thumb the effect vanishes at a height 2-3 times the rotor diameter. formula used: exp ( - groundeffectexp * (height+groundeffectshift) ) Omitting or setting to 0.0 disables the effect calculation.&lt;br /&gt;
|-&lt;br /&gt;
|groundeffectshift&lt;br /&gt;
|Further adjustment of ground effect, approx. hub height or slightly above. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The behavior of the rotor is controlled/influenced by following inputs.&lt;br /&gt;
* The power provided by the engine. This is handled by the regular engine controls.&lt;br /&gt;
* The collective control input. This is read from the &amp;lt;tt&amp;gt;fdm&amp;lt;/tt&amp;gt; property &amp;lt;tt&amp;gt;propulsion/engine[x]/collective-ctrl-rad&amp;lt;/tt&amp;gt;. See below for tail rotor&lt;br /&gt;
* The lateral cyclic input. Read from &amp;lt;tt&amp;gt;propulsion/engine[x]/lateral-ctrl-rad&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* The longitudinal cyclic input. Read from &amp;lt;tt&amp;gt;propulsion/engine[x]/longitudinal-ctrl-rad&amp;lt;/tt&amp;gt;.&lt;br /&gt;
** The tail collective (aka antitorque, aka pedal) control input. Read from &amp;lt;tt&amp;gt;propulsion/engine[x]/antitorque-ctrl-rad&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;propulsion/engine[x]/tail-collective-ctrl-rad&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== Tail/tandem rotor ====&lt;br /&gt;
Providing '''&amp;amp;lt;ExternalRPM&amp;amp;gt; 0 &amp;amp;lt;/ExternalRPM&amp;amp;gt;''' the tail rotor's RPM is linked to to the main (=first, =0) rotor, and specifying '''&amp;amp;lt;controlmap&amp;amp;gt; TAIL &amp;amp;lt;/controlmap&amp;amp;gt;''' tells this rotor to read the collective input from '''propulsion/engine[1]/antitorque-ctrl-rad''' (The TAIL-map ignores lateral and longitudinal input). The rotor needs to be attached to a dummy engine, e.g. an 1HP electrical engine. A tandem rotor is setup analogous.&lt;br /&gt;
&lt;br /&gt;
==== Sense ====&lt;br /&gt;
The 'sense' parameter from the thruster is interpreted as follows, sense=1 means counter clockwise rotation of the main rotor, as viewed from above. This is as a far as I know more popular than clockwise rotation, which is defined by setting sense to -1. Concerning coaxial designs - by setting 'sense' to zero, a Kamov-style rotor is modeled (i.e. the rotor produces no torque).&lt;br /&gt;
&lt;br /&gt;
==== Engine issues ====&lt;br /&gt;
In order to keep the rotor speed constant, use of a RPM-Governor system is encouraged (see examples).&lt;br /&gt;
&lt;br /&gt;
==== Development hints ====&lt;br /&gt;
Setting '''&amp;amp;lt;ExternalRPM&amp;amp;gt; -1 &amp;amp;lt;/ExternalRPM&amp;amp;gt;''' the rotor's RPM is controlled by the '''propulsion/engine[x]/x-rpm-dict''' property. This feature can be useful when developing a FDM.&lt;br /&gt;
&lt;br /&gt;
==== Properties ====&lt;br /&gt;
The rotor model creates the following properties:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/rotor-rpm&lt;br /&gt;
|RPMs of the rotor&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/engine-rpm&lt;br /&gt;
|RPMs of the Engine, as seen from this rotor.&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/a0-rad&lt;br /&gt;
|Rotor's coning angle in radians&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/a1-rad&lt;br /&gt;
|Longitudinal flapping angle with respect to the rotor shaft in radians&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/b1-rad&lt;br /&gt;
|Lateral flapping angle with respect to the rotor shaft in radians&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/inflow-ratio&lt;br /&gt;
| Lambda or λ&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/advance-ratio&lt;br /&gt;
|the tip-speed (aka advance) ratio Mu or μ&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/induced-inflow-ratio&lt;br /&gt;
| Nu or ν&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/vi-fps&lt;br /&gt;
|Induced Velocity in feet per second&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/thrust-coefficient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/torque-lbsft&lt;br /&gt;
| Rotor torque in pound * feet&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/theta-downwash-rad&lt;br /&gt;
|Down wash θ angle - positive values point forward (given a horizontal spinning rotor) in radians&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/phi-downwash-rad&lt;br /&gt;
|Down wash Φ angle - positive values point leftward (given a horizontal spinning rotor) in radians&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/groundeffect-scale-norm&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Control Inputs)&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/antitorque-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/tail-collective-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/lateral-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/longitudinal-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/collective-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/lateral-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/longitudinal-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|SH79&lt;br /&gt;
|Shaugnessy, J. D., Deaux, Thomas N., and Yenni, Kenneth R., &amp;quot;Development and Validation of a Piloted Simulation of a  Helicopter and External Sling Load&amp;quot;,  NASA TP-1285, 1979.&lt;br /&gt;
|-&lt;br /&gt;
|BA41&lt;br /&gt;
|Bailey,F.J.,Jr., &amp;quot;A Simplified Theoretical Method of Determining the Characteristics of a Lifting Rotor in Forward Flight&amp;quot;, NACA Rep.716, 1941&lt;br /&gt;
|-&lt;br /&gt;
|AM50&lt;br /&gt;
|Amer, Kenneth B.,&amp;quot;Theory of Helicopter Damping in Pitch or Roll and a Comparison With Flight Measurements&amp;quot;, NACA TN-2136, 1950.&lt;br /&gt;
|-&lt;br /&gt;
|TA77&lt;br /&gt;
|Talbot, Peter D., Corliss, Lloyd D., &amp;quot;A Mathematical Force and Moment Model of a UH-1H Helicopter for Flight Dynamics Simulations&amp;quot;, NASA TM-73,254, 1977.&lt;br /&gt;
|-&lt;br /&gt;
|GE49&lt;br /&gt;
|Gessow, Alfred, Amer, Kenneth B. &amp;quot;An Introduction to the Physical Aspects of Helicopter Stability&amp;quot;, NACA TN-1982, 1949.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=JSBSim_Thrusters&amp;diff=115485</id>
		<title>JSBSim Thrusters</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=JSBSim_Thrusters&amp;diff=115485"/>
		<updated>2018-06-19T08:58:59Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: P factor must be specified in the parent tag of the propeller.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''[[JSBSim]]''' uses '''thruster''' models to convert engine power into aerodynamic forces. The following table shows which engine-thruster combinations work.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;border: none; background: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; rowspan=&amp;quot;2&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot; | &lt;br /&gt;
! colspan=4 | Thrusters&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width:60px;&amp;quot; | [[JSBSim Thrusters#FGDirect|Direct]] &lt;br /&gt;
| style=&amp;quot;width:60px;&amp;quot; | [[JSBSim Thrusters#FGNozzle|Nozzle]]&lt;br /&gt;
| style=&amp;quot;width:60px;&amp;quot; | [[JSBSim Thrusters#FGPropeller|Propeller]]&lt;br /&gt;
| style=&amp;quot;width:60px;&amp;quot; | [[JSBSim Thrusters#FGRotor|Rotor]] &lt;br /&gt;
|-&lt;br /&gt;
! rowspan=5 | Engines&lt;br /&gt;
|[[JSBSim Engines#FGElectric|Electric]]&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|[[JSBSim Engines#FGPiston|Piston]]&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|[[JSBSim Engines#FGRocket|Rocket]]&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |    &lt;br /&gt;
|-&lt;br /&gt;
|[[JSBSim Engines#FGTurbine|Turbine]]&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|[[JSBSim Engines#FGTurboProp|TurboProp]]&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #FF3333;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background-color: #33FF33;&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FGDirect ==&lt;br /&gt;
Thrust is computed directly by the engine, the direct thruster file is a stub. Currently FGTurbine engines use this thruster and it can also be used with FGElectric.&lt;br /&gt;
&lt;br /&gt;
=== Configuration file format ===&lt;br /&gt;
This is the complete configuration file. Copy and paste into your 'direct.xml' file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;direct name=&amp;quot;Direct&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/direct&amp;gt; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
* The direct thruster creates a property called propulsion/engine[#]/reverser-angle-rad&lt;br /&gt;
* &amp;quot;Reverser angle&amp;quot; as used here is a way to manipulate the thrust vector, along the thrust axis ONLY, during run time.  This should not be confused with a thrust vectoring nozzle. The angle is defined in radians, and is used thus:  Final_thrust = cosine( reverser_angle ) * unmodified_thrust. Therefore a reverser angle of 0 results in no change, and a reverser angle of 3.14 (pi) results in a completely reversed thrust vector.  An angle of 1.57 (pi/2) results in no thrust at all&lt;br /&gt;
&lt;br /&gt;
== FGNozzle ==&lt;br /&gt;
FGNozzle is for the FGRocket engine.&lt;br /&gt;
&lt;br /&gt;
=== Configuration file format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;nozzle name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;area unit=&amp;quot;{FT2 | M2 | IN2}&amp;quot;&amp;gt; {number}  &amp;lt;/area&amp;gt;&lt;br /&gt;
&amp;lt;/nozzle&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|area&lt;br /&gt;
|Nozzle area at the exit plane.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
* All parameters MUST be specified.&lt;br /&gt;
* The area specified times the sea level pressure (2117 lbf/ft^2) is the amount thrust is reduced at sea level&lt;br /&gt;
&lt;br /&gt;
== FGPropeller ==&lt;br /&gt;
FGPropeller models a propeller given the tabular data for Ct and Cp, indexed by the advance ratio &amp;quot;J&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Configuration file format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- Sense and P factor go in the parent tag of the propeller, i.e. in the &amp;lt;thruster&amp;gt; element --&amp;gt;&lt;br /&gt;
&amp;lt;sense&amp;gt; {1 | -1} &amp;lt;/sense&amp;gt; &lt;br /&gt;
&amp;lt;p_factor&amp;gt; {number} &amp;lt;/p_factor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;propeller name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ixx&amp;gt; {number} &amp;lt;/ixx&amp;gt;&lt;br /&gt;
  &amp;lt;diameter unit=&amp;quot;IN&amp;quot;&amp;gt; {number} &amp;lt;/diameter&amp;gt;&lt;br /&gt;
  &amp;lt;numblades&amp;gt; {number} &amp;lt;/numblades&amp;gt;&lt;br /&gt;
  &amp;lt;gearratio&amp;gt; {number} &amp;lt;/gearratio&amp;gt;&lt;br /&gt;
  &amp;lt;minpitch&amp;gt; {number} &amp;lt;/minpitch&amp;gt;&lt;br /&gt;
  &amp;lt;maxpitch&amp;gt; {number} &amp;lt;/maxpitch&amp;gt;&lt;br /&gt;
  &amp;lt;minrpm&amp;gt; {number} &amp;lt;/minrpm&amp;gt;&lt;br /&gt;
  &amp;lt;maxrpm&amp;gt; {number} &amp;lt;/maxrpm&amp;gt;&lt;br /&gt;
  &amp;lt;constspeed&amp;gt; {number} &amp;lt;/constspeed&amp;gt;&lt;br /&gt;
  &amp;lt;reversepitch&amp;gt; {number} &amp;lt;/reversepitch&amp;gt;&lt;br /&gt;
  &amp;lt;ct_factor&amp;gt; {number} &amp;lt;/ct_factor&amp;gt;&lt;br /&gt;
  &amp;lt;cp_factor&amp;gt; {number} &amp;lt;/cp_factor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;C_THRUST&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {numbers}&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;C_POWER&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {numbers}&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;CT_MACH&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {numbers}&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;CP_MACH&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {numbers}&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/propeller&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | ixx&lt;br /&gt;
|Propeller rotational inertia. This can be english units, slug &amp;amp; feet^2:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ixx unit=&amp;quot;SLUG*FT2&amp;quot;&amp;gt;       8.95 &amp;lt;/ixx&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or in metric units, kg * meters^2:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ixx unit=&amp;quot;KG*M2&amp;quot;&amp;gt;         12.14 &amp;lt;/ixx&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a thin rod of mass m (kg) and diameter D (meters) spinning about its center, the formula is m*D^2/12. See the [http://en.wikipedia.org/wiki/List_of_moments_of_inertia Moments of inertia reference page] and [http://www.engineeringtoolbox.com/moment-inertia-torque-d_913.html list of conversion factors for different units for moment of inertia].)&lt;br /&gt;
|-&lt;br /&gt;
|diameter&lt;br /&gt;
|Propeller disk diameter.&lt;br /&gt;
|-&lt;br /&gt;
|numblades&lt;br /&gt;
|Number of blades.&lt;br /&gt;
|-&lt;br /&gt;
|gearratio&lt;br /&gt;
|Ratio of (engine rpm) / (prop rpm).&lt;br /&gt;
|-&lt;br /&gt;
|minpitch&lt;br /&gt;
|Minimum blade pitch angle.&lt;br /&gt;
|-&lt;br /&gt;
|maxpitch&lt;br /&gt;
|Maximum blade pitch angle.&lt;br /&gt;
|-&lt;br /&gt;
|minrpm&lt;br /&gt;
|Minimum rpm target for constant speed propeller.&lt;br /&gt;
|-&lt;br /&gt;
|maxrpm&lt;br /&gt;
|Maximum rpm target for constant speed propeller.&lt;br /&gt;
|-&lt;br /&gt;
|constspeed&lt;br /&gt;
|1 = constant speed mode, 0 = manual pitch mode. &lt;br /&gt;
|-&lt;br /&gt;
|reversepitch&lt;br /&gt;
|Blade pitch angle for reverse.&lt;br /&gt;
|-&lt;br /&gt;
|sense&lt;br /&gt;
|Direction of rotation (1= clockwise as viewed from rear, -1=counter-clockwise as viewed from rear). Sense is specified in the parent tag of the propeller. ''See [[JSBSim_Thrusters#Sense_bug_affecting_gyroscopic_moment|important note below]] regarding a JSBSim bug affecting sense and the direction of the resulting gyroscopic moment.''&lt;br /&gt;
|-&lt;br /&gt;
|p_factor&lt;br /&gt;
|P factor is specified in the parent tag of the propeller.&lt;br /&gt;
|-&lt;br /&gt;
|ct_factor&lt;br /&gt;
|A multiplier for the coefficients of thrust (multiplies the dependent variable in the C_THRUST table by this factor).&lt;br /&gt;
|-&lt;br /&gt;
|cp_factor&lt;br /&gt;
|A multiplier for the coefficients of power (multiplies the dependent variable in the C_POWER table by this factor).&lt;br /&gt;
|}&lt;br /&gt;
The parameters &amp;lt;sense&amp;gt; and &amp;lt;p_factor&amp;gt; must be specified at the parent level i.e. in the &amp;lt;thruster&amp;gt; element. This allows to specify different sense and P factor values for each propeller of the model while using the same definition file for all the propellers.&lt;br /&gt;
&lt;br /&gt;
=== C_THRUST and C_POWER tables ===&lt;br /&gt;
The C_THRUST and C_POWER tables are required. &lt;br /&gt;
&lt;br /&gt;
The independent variable for both tables is [http://en.wikipedia.org/wiki/Advance_ratio Advance Ratio] (J). The dependent variable is the coefficient of thrust (Ct) for the C_THRUST and the coefficient of power (Cp) for C_POWER. &lt;br /&gt;
&lt;br /&gt;
For variable pitch propellers, it is possible to give a two-dimensional table, showing Ct and Cp for different J and different pitch angles of the propeller.  See example below.&lt;br /&gt;
&lt;br /&gt;
[http://www.mh-aerotools.de/airfoils/pylonprops_1.htm Propellors for F3D Models explains the theory] and has [http://www.mh-aerotools.de/airfoils/pylonprops_2.htm formulas] and [http://www.mh-aerotools.de/airfoils/pylonprops_3.htm many graphs] showing the relationship between J, Ct, and Cp.&lt;br /&gt;
&lt;br /&gt;
Relevant formulas relating the variables in the tables (and metric system units):&lt;br /&gt;
&lt;br /&gt;
* Thrust: T = Ct * rho * n^2 * D^4&lt;br /&gt;
* Power: P = Cp * rho * n^3 * D^5)&lt;br /&gt;
* Advance Ratio: J = v/(n*D)&lt;br /&gt;
* Efficiency: eta = Ct/Cp * v/(n*D) (or equivalently, eta = Ct/Cp * J )&lt;br /&gt;
&lt;br /&gt;
In the formulas&lt;br /&gt;
* Ct = coefficient of thrust&lt;br /&gt;
* Cp = coefficient of power&lt;br /&gt;
* v = true velocity of aircraft (m/s)&lt;br /&gt;
* D = diameter of propeller disk (m)&lt;br /&gt;
* n = rotations per second (1/s) (note RPS, not RPM)&lt;br /&gt;
* rho = density of air (kg/m^3)&lt;br /&gt;
* P = power (W)&lt;br /&gt;
* T = thrust (N)&lt;br /&gt;
&lt;br /&gt;
For a typical propeller, both Cp and Ct are downward sloping curves that reach 0 when J is somewhere in the range 0-4 (depending on blade angle and other factors). Cp and Ct can be negative; this indicates the drag induced by the prop when the airspeed is relatively fast compared with prop RPM. At higher pitch angles Ct may have a positive slope or be flat in the lower J range.&lt;br /&gt;
&lt;br /&gt;
Ct/Cp gives the efficiency (eta), and propeller shape and general design give each propeller a distinctive [http://www.mh-aerotools.de/airfoils/pylonprops_3.htm efficiency curve]. For fixed-pitch propellers, the propeller is generally designed to reach peak efficiency either at climb velocity &amp;amp; RPM, cruise velocity and RPM, or some compromise between the two.  [http://en.wikipedia.org/wiki/Controllable_pitch_propeller Variable pitch propellers] and [http://en.wikipedia.org/wiki/Constant_speed_propeller constant speed propellers] bring different factors into play.&lt;br /&gt;
&lt;br /&gt;
Note that several of the values mentioned above can be viewed while FG is running, in the property tree under /fdm/jsbsim/propulsion/engine.  This is useful for seeing how the settings and tables play out under various conditions and fine-tuning the settings.&lt;br /&gt;
&lt;br /&gt;
==== Sample C_THRUST and C_POWER tables ====&lt;br /&gt;
These example tables are from FlightGear's C172P aircraft:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;table name=&amp;quot;C_THRUST&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;tableData&amp;gt;&lt;br /&gt;
        0.0    0.068&lt;br /&gt;
        0.1    0.068&lt;br /&gt;
        0.2    0.067&lt;br /&gt;
        0.3    0.066&lt;br /&gt;
        0.4    0.064&lt;br /&gt;
        0.5    0.062&lt;br /&gt;
        0.6    0.059&lt;br /&gt;
        0.7    0.054&lt;br /&gt;
        0.8    0.043&lt;br /&gt;
        0.9    0.031&lt;br /&gt;
        1.0    0.019&lt;br /&gt;
        1.1    0.008&lt;br /&gt;
        1.2   -0.001&lt;br /&gt;
        1.3   -0.008&lt;br /&gt;
        1.4   -0.019&lt;br /&gt;
        1.5   -0.029&lt;br /&gt;
        1.6   -0.040&lt;br /&gt;
        1.7   -0.050&lt;br /&gt;
        1.8   -0.057&lt;br /&gt;
        1.9   -0.061&lt;br /&gt;
        2.0   -0.064&lt;br /&gt;
        2.1   -0.066&lt;br /&gt;
        2.2   -0.067&lt;br /&gt;
        2.3   -0.068&lt;br /&gt;
        5.0   -0.068&lt;br /&gt;
      &amp;lt;/tableData&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;table name=&amp;quot;C_POWER&amp;quot; type = &amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;tableData&amp;gt;&lt;br /&gt;
        0.0   0.0580&lt;br /&gt;
        0.1   0.0620&lt;br /&gt;
        0.2   0.0600&lt;br /&gt;
        0.3   0.0580&lt;br /&gt;
        0.4   0.0520&lt;br /&gt;
        0.5   0.0457&lt;br /&gt;
        0.6   0.0436&lt;br /&gt;
        0.7   0.0420&lt;br /&gt;
        0.8   0.0372&lt;br /&gt;
        0.9   0.0299&lt;br /&gt;
        1.0   0.0202&lt;br /&gt;
        1.1   0.0111&lt;br /&gt;
        1.2   0.0075&lt;br /&gt;
        1.3   0.0111&lt;br /&gt;
        1.4   0.0202&lt;br /&gt;
        1.5   0.0280&lt;br /&gt;
        1.6   0.0346&lt;br /&gt;
        1.7   0.0389&lt;br /&gt;
        1.8   0.0421&lt;br /&gt;
        1.9   0.0436&lt;br /&gt;
        2.0   0.0445&lt;br /&gt;
        2.1   0.0445&lt;br /&gt;
        2.2   0.0442&lt;br /&gt;
        2.3   0.0431&lt;br /&gt;
        2.4   0.0424&lt;br /&gt;
        5.0   0.0413&lt;br /&gt;
      &amp;lt;/tableData&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of table for variable pitch propeller ([http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg32187.html source]):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;!-- thrust coefficient as a function of advance ratio and blade angle --&amp;gt;&lt;br /&gt;
    &amp;lt;table name=&amp;quot;C_THRUST&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;tableData&amp;gt;&lt;br /&gt;
                  -10        0         15        25        35        45        55        65       90&lt;br /&gt;
        -0.2      -0.0734    0.0413    0.1503    0.1842    0.2030    0.2142    0.1974    0.1691   0.0000&lt;br /&gt;
         0.0      -0.1090    0.0000    0.1503    0.1842    0.2030    0.2162    0.2021    0.1691   0.0000&lt;br /&gt;
         0.2      -0.1222   -0.0376    0.1297    0.1804    0.2001    0.2162    0.2021    0.1691   0.0000&lt;br /&gt;
         0.4      -0.1222   -0.0873    0.0977    0.1786    0.1963    0.2142    0.2021    0.1691   0.0000&lt;br /&gt;
         0.6      -0.1222   -0.1222    0.0517    0.1607    0.1879    0.2087    0.1992    0.1691   0.0000&lt;br /&gt;
         0.8      -0.1222   -0.1222    0.0029    0.1203    0.1824    0.2012    0.1992    0.1691   0.0000&lt;br /&gt;
         1.0      -0.1222   -0.1222   -0.0489    0.0734    0.1748    0.1908    0.1974    0.1691   0.0000&lt;br /&gt;
         1.2      -0.1222   -0.1222   -0.1006    0.0226    0.1437    0.1842    0.1974    0.1691   0.0000&lt;br /&gt;
         1.4      -0.1222   -0.1222   -0.1222   -0.0329    0.1034    0.1813    0.1936    0.1691   0.0000&lt;br /&gt;
         1.6      -0.1222   -0.1222   -0.1222   -0.0836    0.0564    0.1748    0.1899    0.1691   0.0000&lt;br /&gt;
         1.8      -0.1222   -0.1222   -0.1222   -0.1222    0.0095    0.1503    0.1842    0.1691   0.0000&lt;br /&gt;
         2.0      -0.1222   -0.1222   -0.1222   -0.1222   -0.0376    0.1174    0.1834    0.1691   0.0000&lt;br /&gt;
         2.2      -0.1222   -0.1222   -0.1222   -0.1222   -0.0846    0.0846    0.1804    0.1691   0.0000&lt;br /&gt;
         2.4      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222    0.0451    0.1473    0.1691   0.0000&lt;br /&gt;
         2.6      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222    0.0057    0.0932    0.1503   0.0000&lt;br /&gt;
         2.8      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.0338    0.0610    0.1222   0.0000&lt;br /&gt;
         3.0      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.0734    0.0320    0.0940   0.0000&lt;br /&gt;
         3.2      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1128    0.0029    0.0658   0.0000&lt;br /&gt;
         3.4      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.0263    0.0376   0.0000&lt;br /&gt;
         3.6      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.0555    0.0095   0.0000&lt;br /&gt;
         3.8      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.0846   -0.0188   0.0000&lt;br /&gt;
         4.0      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1137   -0.0471   0.0000&lt;br /&gt;
         6.0      -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   -0.1222   0.0000&lt;br /&gt;
        &amp;lt;/tableData&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;!-- power coefficient as a function of advance ratio and blade angle --&amp;gt;&lt;br /&gt;
    &amp;lt;table name=&amp;quot;C_POWER&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;tableData&amp;gt;&lt;br /&gt;
                 -10        0        15        25        35        45        55        65       90&lt;br /&gt;
        -0.2      0.0108   0.0215    0.0753    0.1710    0.2949    0.4194    0.4839    0.5355   0.5355&lt;br /&gt;
         0.0      0.0430   0.0108    0.0645    0.1594    0.2820    0.4194    0.4859    0.5355   0.5355&lt;br /&gt;
         0.2      0.0613   0.0172    0.0624    0.1484    0.2697    0.4194    0.4859    0.5355   0.5355&lt;br /&gt;
         0.4      0.0826   0.0376    0.0537    0.1368    0.2562    0.4194    0.4859    0.5355   0.5355&lt;br /&gt;
         0.6      0.1013   0.0570    0.0355    0.1271    0.2400    0.4110    0.4839    0.5355   0.5355&lt;br /&gt;
         0.8      0.1194   0.0763    0.0108    0.1078    0.2258    0.3923    0.4839    0.5355   0.5355&lt;br /&gt;
         1.0      0.1374   0.0948    0.0108    0.0755    0.2129    0.3723    0.4820    0.5355   0.5355&lt;br /&gt;
         1.2      0.1561   0.0758   -0.0355    0.0290    0.1884    0.3568    0.4788    0.5355   0.5355&lt;br /&gt;
         1.4      0.1742   0.1310   -0.0536   -0.0215    0.1452    0.3516    0.4729    0.5355   0.5355&lt;br /&gt;
         1.6      0.1923   0.1497   -0.0626   -0.0645    0.0916    0.3420    0.4626    0.5162   0.5355&lt;br /&gt;
         1.8      0.2110   0.1678   -0.0645   -0.1078    0.0269    0.3033    0.4484    0.5052   0.5355&lt;br /&gt;
         2.0      0.2291   0.1858   -0.0826   -0.1503   -0.0323    0.2581    0.4271    0.4949   0.5355&lt;br /&gt;
         2.2      0.2471   0.2045   -0.1013   -0.1936   -0.0968    0.2097    0.4142    0.4729   0.5355&lt;br /&gt;
         2.4      0.2658   0.2226   -0.1194   -0.2368   -0.1613    0.1497    0.4020    0.4626   0.5355&lt;br /&gt;
         2.6      0.2839   0.2407   -0.1374   -0.2794   -0.2045    0.0626    0.3923    0.4465   0.5355&lt;br /&gt;
         2.8      0.3020   0.2594   -0.1561   -0.3226   -0.2452   -0.0213    0.3839    0.4407   0.5355&lt;br /&gt;
         3.0      0.3207   0.2774   -0.1742   -0.3658   -0.2903   -0.0968    0.3710    0.4407   0.5355&lt;br /&gt;
         3.2      0.3387   0.2955   -0.1923   -0.4084   -0.3336   -0.1723    0.3471    0.4304   0.5355&lt;br /&gt;
         3.4      0.3568   0.3142   -0.2110   -0.4517   -0.3762   -0.2471    0.2691    0.4194   0.5355&lt;br /&gt;
         3.6      0.3755   0.3323   -0.2291   -0.4949   -0.4194   -0.3226    0.1890    0.4084   0.5355&lt;br /&gt;
         3.8      0.3936   0.3504   -0.2471   -0.5355   -0.4626   -0.3981    0.1052    0.3955   0.5355&lt;br /&gt;
         4.0      0.4117   0.3691   -0.2658   -0.5355   -0.5355   -0.4729    0.0213    0.3658   0.5355&lt;br /&gt;
         6.0      0.5355   0.5355   -0.5355   -0.5355   -0.5355   -0.5355   -0.5355   -0.3226   0.5355&lt;br /&gt;
       &amp;lt;/tableData&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- thrust effects of helical tip Mach --&amp;gt;&lt;br /&gt;
  &amp;lt;table name=&amp;quot;CT_MACH&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      0.85   1.0&lt;br /&gt;
      1.05   0.8&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- power-required effects of helical tip Mach --&amp;gt;&lt;br /&gt;
  &amp;lt;table name=&amp;quot;CP_MACH&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      0.85   1.0&lt;br /&gt;
      1.05   1.8&lt;br /&gt;
      2.00   1.4&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CT_MACH and CP_MACH ===&lt;br /&gt;
The CT_MACH and CP_MACH tables are optional. They apply a factor to Ct and Cp based on the helical tip Mach. The CP_MACH table models the [http://en.wikipedia.org/wiki/Drag_divergence_Mach_number Drag Divergence Mach Number] for the propeller airfoil. The CT_MACH table models the thrust reduction.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- thrust effects of helical tip Mach --&amp;gt;&lt;br /&gt;
  &amp;lt;table name=&amp;quot;CT_MACH&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      0.85   1.0&lt;br /&gt;
      1.05   0.8&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- power-required effects of helical tip Mach --&amp;gt;&lt;br /&gt;
  &amp;lt;table name=&amp;quot;CP_MACH&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      0.85   1.0&lt;br /&gt;
      1.05   1.8&lt;br /&gt;
      2.00   1.4&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sense ===&lt;br /&gt;
Sense is the direction of rotation. 1=clockwise (typically as seen from rear of aircraft or the cockpit of a typical front-propeller aircraft, but this may vary depending on how you have set up the coordinate system for your aircraft) and -1 is counter-clockwise.&lt;br /&gt;
&lt;br /&gt;
The sense tag goes in the parent tag of the thruster, ie, in the &amp;lt;propulsion&amp;gt;&amp;lt;thruster&amp;gt; section which is typically in the main JSBSim XML file.  Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;propulsion&amp;gt;&lt;br /&gt;
        &amp;lt;engine file=&amp;quot;Clerget9B&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;location unit=&amp;quot;IN&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;x&amp;gt; 12 &amp;lt;/x&amp;gt;&lt;br /&gt;
                &amp;lt;y&amp;gt; 0 &amp;lt;/y&amp;gt;&lt;br /&gt;
                &amp;lt;z&amp;gt; 0 &amp;lt;/z&amp;gt;&lt;br /&gt;
            &amp;lt;/location&amp;gt;&lt;br /&gt;
            &amp;lt;orient unit=&amp;quot;DEG&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;roll&amp;gt; 0 &amp;lt;/roll&amp;gt;&lt;br /&gt;
                &amp;lt;pitch&amp;gt; 0 &amp;lt;/pitch&amp;gt;&lt;br /&gt;
                &amp;lt;yaw&amp;gt; 0 &amp;lt;/yaw&amp;gt;&lt;br /&gt;
            &amp;lt;/orient&amp;gt;&lt;br /&gt;
            &amp;lt;feed&amp;gt;0&amp;lt;/feed&amp;gt;&lt;br /&gt;
            &amp;lt;thruster file=&amp;quot;CamelProp&amp;quot;&amp;gt;&lt;br /&gt;
                '''&amp;lt;sense&amp;gt;1&amp;lt;/sense&amp;gt;'''&lt;br /&gt;
                &amp;lt;location unit=&amp;quot;IN&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;x&amp;gt; 0 &amp;lt;/x&amp;gt;&lt;br /&gt;
                    &amp;lt;y&amp;gt; 0 &amp;lt;/y&amp;gt;&lt;br /&gt;
                    &amp;lt;z&amp;gt; 0 &amp;lt;/z&amp;gt;&lt;br /&gt;
                &amp;lt;/location&amp;gt;&lt;br /&gt;
                &amp;lt;orient unit=&amp;quot;DEG&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;roll&amp;gt; 0 &amp;lt;/roll&amp;gt;&lt;br /&gt;
                    &amp;lt;pitch&amp;gt; 0 &amp;lt;/pitch&amp;gt;&lt;br /&gt;
                    &amp;lt;yaw&amp;gt; 0 &amp;lt;/yaw&amp;gt;&lt;br /&gt;
                &amp;lt;/orient&amp;gt;&lt;br /&gt;
            &amp;lt;/thruster&amp;gt;&lt;br /&gt;
        &amp;lt;/engine&amp;gt;&lt;br /&gt;
        &amp;lt;tank type=&amp;quot;FUEL&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;location unit=&amp;quot;IN&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;x&amp;gt; 60 &amp;lt;/x&amp;gt;&lt;br /&gt;
                &amp;lt;y&amp;gt; 0 &amp;lt;/y&amp;gt;&lt;br /&gt;
                &amp;lt;z&amp;gt; -5.62 &amp;lt;/z&amp;gt;&lt;br /&gt;
            &amp;lt;/location&amp;gt;&lt;br /&gt;
            &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt;133.6&amp;lt;/capacity&amp;gt;&lt;br /&gt;
            &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt;133.6&amp;lt;/contents&amp;gt;&lt;br /&gt;
        &amp;lt;/tank&amp;gt;&lt;br /&gt;
    &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sense bug affecting gyroscopic moment====&lt;br /&gt;
Prior to about 2015--and continuing in current JSBSim and FlightGear versions unless you take the corrective steps outlined below--a JSBSim bug cause the gyroscopic moment of the propeller to be reversed.&lt;br /&gt;
&lt;br /&gt;
To fix this bug and get the correct sign for your gyroscopic effect, you must add version=&amp;quot;1.1&amp;quot; (or higher--any version greater than 1.0 should work) to your propeller definition, as shown in this example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;propeller name=&amp;quot;prop&amp;quot; version=&amp;quot;1.1&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- propeller definition --&amp;gt;&lt;br /&gt;
&amp;lt;/propeller&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bug with the sign of gyroscopic effect and the fix are outlined under [https://sourceforge.net/p/jsbsim/bugs/110/ JSBSim Bug #110].&lt;br /&gt;
&lt;br /&gt;
For most aircraft and engine/propeller systems the gyroscopic effect is fairly subtle and thus the bug is difficult to detect. But for some aircraft, such as small, light, rotary-engined WWI-era aircraft, the gyroscopic effect is very noticeable, and the reverse in direction of the effect created by the bug is very noticeable as well.&lt;br /&gt;
&lt;br /&gt;
=== Starter speed (for piston engines) ===&lt;br /&gt;
There is a somewhat complex relationship among the power coefficient, the maxhp, and idlerpm.  Both maxhp and idlerpm are set in the engine xml file.&lt;br /&gt;
&lt;br /&gt;
The power of the starter motor is equal to 0.4*sqrt(maxhp).  The minimum RPM needed to start the engine is 80% of the idlerpm.  The greater the power coefficient (for J near 0), the more power the propeller will require to spin when starting the engine with the aircraft at rest.&lt;br /&gt;
&lt;br /&gt;
If your propeller will not spin fast enough to start, you can try some combination of:&lt;br /&gt;
&lt;br /&gt;
* Open the throttle. Pulling a partial vacuum in the intake manifold takes some power.&lt;br /&gt;
* Increase maxhp (increases the power of the starter motor)&lt;br /&gt;
* Decrease idlerpm (decreases the minimum RPM needed to start the engine)&lt;br /&gt;
* Decrease the power coefficient in the C_POWER table, for values of J close to (or equal to) 0.  This will reduce the amount of power it takes for the propeller to spin at a given RPM where J is close to 0 (which is the typical situation when starting the engine and the aircraft is at a dead stop).&lt;br /&gt;
&lt;br /&gt;
You can open the property tree and watch the value of J (/fdm/jsbsim/propulsion/engines/advance-ratio) to get an idea of which values you need to change in the C_POWER table.&lt;br /&gt;
&lt;br /&gt;
''' Code is in FG 2.8 to independently control the power of the piston starter motor, to include battery effects. '''&lt;br /&gt;
starter-torque (fgfs 2.8) is a value specifying the zero RPM torque in lb*ft the starter motor provides. Current default value is 40% of the maximum horsepower value.&lt;br /&gt;
starter-rpm (fgfs 2.8) is a value specifying the maximum RPM the unloaded starter motor can achieve. Loads placed on the engine by the propeller and throttle will further limit RPM achieved in practice. Peak starter power is achieved at 1/2 starter-rpm. At 1/2 starter-rpm torque is 1/2 starter-torque. Peak power can be calculated by the standard formula HP=(Torque*RPM)/5252&lt;br /&gt;
&lt;br /&gt;
=== Development tips ===&lt;br /&gt;
* If you open the property tree browser within FG to /fdm/jsbsim/propulsion/engines you can see a number of helpful variables in action, including RPM, horsepower, advance ratio, thrust coefficient, and others.&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* Barnes W. McCormick, &amp;quot;Aerodynamics, Aeronautics, and Flight Mechanics&amp;quot;, Wiley &amp;amp; Sons, 1979 ISBN 0-471-03032-5&lt;br /&gt;
* Edwin Hartman, David Biermann, &amp;quot;The Aerodynamic Characteristics of Full Scale Propellers Having 2, 3, and 4 Blades of Clark Y and R.A.F. 6 Airfoil Sections&amp;quot;, NACA Report TN-640, 1938 (?)&lt;br /&gt;
* Various NACA Technical Notes and Reports&lt;br /&gt;
&lt;br /&gt;
== FGRotor ==&lt;br /&gt;
FGRotor models a helicopter rotor.&lt;br /&gt;
&lt;br /&gt;
=== Configuration file format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- Sense goes in the parent tag --&amp;gt;&lt;br /&gt;
&amp;lt;sense&amp;gt; {1 | 0 | -1} &amp;lt;/sense&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;rotor name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;diameter unit=&amp;quot;{LENGTH}&amp;quot;&amp;gt; {number} &amp;lt;/diameter&amp;gt;&lt;br /&gt;
  &amp;lt;numblades&amp;gt; {number} &amp;lt;/numblades&amp;gt;&lt;br /&gt;
  &amp;lt;gearratio&amp;gt; {number} &amp;lt;/gearratio&amp;gt;&lt;br /&gt;
  &amp;lt;nominalrpm&amp;gt; {number} &amp;lt;/nominalrpm&amp;gt;&lt;br /&gt;
  &amp;lt;minrpm&amp;gt; {number} &amp;lt;/minrpm&amp;gt;&lt;br /&gt;
  &amp;lt;maxrpm&amp;gt; {number} &amp;lt;/maxrpm&amp;gt; &lt;br /&gt;
  &amp;lt;chord unit=&amp;quot;{LENGTH}&amp;quot;&amp;gt; {number} &amp;lt;/chord&amp;gt;&lt;br /&gt;
  &amp;lt;liftcurveslope Xunit=&amp;quot;1/RAD&amp;quot;&amp;gt; {number} &amp;lt;/liftcurveslope&amp;gt;&lt;br /&gt;
  &amp;lt;twist unit=&amp;quot;{ANGLE}&amp;quot;&amp;gt; {number} &amp;lt;/twist&amp;gt;&lt;br /&gt;
  &amp;lt;hingeoffset unit=&amp;quot;{LENGTH}&amp;quot;&amp;gt; {number} &amp;lt;/hingeoffset&amp;gt;&lt;br /&gt;
  &amp;lt;flappingmoment unit=&amp;quot;{MOMENT}&amp;quot;&amp;gt; {number} &amp;lt;/flappingmoment&amp;gt;&lt;br /&gt;
  &amp;lt;massmoment Xunit=&amp;quot;SLUG*FT&amp;quot;&amp;gt; {number} &amp;lt;/massmoment&amp;gt;&lt;br /&gt;
  &amp;lt;polarmoment unit=&amp;quot;{MOMENT}&amp;quot;&amp;gt; {number} &amp;lt;/polarmoment&amp;gt;&lt;br /&gt;
  &amp;lt;inflowlag&amp;gt; {number} &amp;lt;/inflowlag&amp;gt;&lt;br /&gt;
  &amp;lt;tiplossfactor&amp;gt; {number} &amp;lt;/tiplossfactor&amp;gt;&lt;br /&gt;
  &amp;lt;maxbrakepower unit=&amp;quot;{POWER}&amp;quot;&amp;gt; {number} &amp;lt;/maxbrakepower&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;controlmap&amp;gt; {MAIN|TAIL|TANDEM} &amp;lt;/controlmap&amp;gt;&lt;br /&gt;
  &amp;lt;ExternalRPM&amp;gt; {number} &amp;lt;/ExternalRPM&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;groundeffectexp&amp;gt; {number} &amp;lt;/groundeffectexp&amp;gt;&lt;br /&gt;
  &amp;lt;groundeffectshift unit=&amp;quot;{LENGTH}&amp;quot;&amp;gt; {number} &amp;lt;/groundeffectshift&amp;gt;&lt;br /&gt;
&amp;lt;/rotor&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* LENGTH means any of the supported units, same for ANGLE and MOMENT.X unit-attributes are a hint for currently unsupported units, so values must be provided accordingly.&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|diameter&lt;br /&gt;
|Rotor disk diameter (2x R).&lt;br /&gt;
|-&lt;br /&gt;
|numblades&lt;br /&gt;
|Number of blades (b).&lt;br /&gt;
|-&lt;br /&gt;
|gearratio&lt;br /&gt;
|Ratio of (engine rpm) / (rotor rpm), usually &amp;gt; 1.&lt;br /&gt;
|-&lt;br /&gt;
|nominalrpm&lt;br /&gt;
|RPM at which the rotor usally operates. &lt;br /&gt;
|-&lt;br /&gt;
|minrpm&lt;br /&gt;
|Lowest RPM used in the model, optional and defaults to 1.&lt;br /&gt;
|-&lt;br /&gt;
|maxrpm&lt;br /&gt;
|Largest RPM used in the model, optional and defaults to 2 x nominalrpm. &lt;br /&gt;
|-&lt;br /&gt;
|chord&lt;br /&gt;
|Blade chord, (c).&lt;br /&gt;
|-&lt;br /&gt;
|liftcurveslope&lt;br /&gt;
|Slope of curve of section lift against section angle of attack, per rad (a).&lt;br /&gt;
|-&lt;br /&gt;
|twist&lt;br /&gt;
|Blade twist from root to tip, (theta_1).&lt;br /&gt;
|-&lt;br /&gt;
|hingeoffset&lt;br /&gt;
|Rotor flapping-hinge offset (e).&lt;br /&gt;
|-&lt;br /&gt;
|flappingmoment&lt;br /&gt;
|Flapping moment of inertia (I_b).&lt;br /&gt;
|-&lt;br /&gt;
|massmoment&lt;br /&gt;
|Blade mass moment. Mass of a single blade times the blade's cg-distance from the hub, optional.&lt;br /&gt;
|-&lt;br /&gt;
|polarmoment&lt;br /&gt;
|Moment of inertia for the whole rotor disk, optional.&lt;br /&gt;
|-&lt;br /&gt;
|inflowlag&lt;br /&gt;
|Rotor inflow time constant, sec. Smaller values yield to quicker responses (typical values for main rotor: 0.1 - 0.2 s).&lt;br /&gt;
|-&lt;br /&gt;
|tiplossfactor&lt;br /&gt;
|Tip-loss factor. The Blade fraction that produces lift. Value usually ranges between 0.95 - 1.0, optional (B).&lt;br /&gt;
|-&lt;br /&gt;
|maxbrakepower&lt;br /&gt;
|Rotor brake, 20-30 hp should work for a mid size helicopter.&lt;br /&gt;
|-&lt;br /&gt;
|controlmap&lt;br /&gt;
|Defines the control inputs used (see notes).&lt;br /&gt;
|-&lt;br /&gt;
|ExternalRPM&lt;br /&gt;
|Links the rotor to another rotor, or an user controllable property.&lt;br /&gt;
&lt;br /&gt;
Experimental properties&lt;br /&gt;
|-&lt;br /&gt;
|groundeffectexp&lt;br /&gt;
|Exponent for ground effect approximation. Values usually range from 0.04 for large rotors to 0.1 for smaller ones. As a rule of thumb the effect vanishes at a height 2-3 times the rotor diameter. formula used: exp ( - groundeffectexp * (height+groundeffectshift) ) Omitting or setting to 0.0 disables the effect calculation.&lt;br /&gt;
|-&lt;br /&gt;
|groundeffectshift&lt;br /&gt;
|Further adjustment of ground effect, approx. hub height or slightly above. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
==== Controls ====&lt;br /&gt;
The behavior of the rotor is controlled/influenced by following inputs.&lt;br /&gt;
* The power provided by the engine. This is handled by the regular engine controls.&lt;br /&gt;
* The collective control input. This is read from the &amp;lt;tt&amp;gt;fdm&amp;lt;/tt&amp;gt; property &amp;lt;tt&amp;gt;propulsion/engine[x]/collective-ctrl-rad&amp;lt;/tt&amp;gt;. See below for tail rotor&lt;br /&gt;
* The lateral cyclic input. Read from &amp;lt;tt&amp;gt;propulsion/engine[x]/lateral-ctrl-rad&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* The longitudinal cyclic input. Read from &amp;lt;tt&amp;gt;propulsion/engine[x]/longitudinal-ctrl-rad&amp;lt;/tt&amp;gt;.&lt;br /&gt;
** The tail collective (aka antitorque, aka pedal) control input. Read from &amp;lt;tt&amp;gt;propulsion/engine[x]/antitorque-ctrl-rad&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;propulsion/engine[x]/tail-collective-ctrl-rad&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== Tail/tandem rotor ====&lt;br /&gt;
Providing '''&amp;amp;lt;ExternalRPM&amp;amp;gt; 0 &amp;amp;lt;/ExternalRPM&amp;amp;gt;''' the tail rotor's RPM is linked to to the main (=first, =0) rotor, and specifying '''&amp;amp;lt;controlmap&amp;amp;gt; TAIL &amp;amp;lt;/controlmap&amp;amp;gt;''' tells this rotor to read the collective input from '''propulsion/engine[1]/antitorque-ctrl-rad''' (The TAIL-map ignores lateral and longitudinal input). The rotor needs to be attached to a dummy engine, e.g. an 1HP electrical engine. A tandem rotor is setup analogous.&lt;br /&gt;
&lt;br /&gt;
==== Sense ====&lt;br /&gt;
The 'sense' parameter from the thruster is interpreted as follows, sense=1 means counter clockwise rotation of the main rotor, as viewed from above. This is as a far as I know more popular than clockwise rotation, which is defined by setting sense to -1. Concerning coaxial designs - by setting 'sense' to zero, a Kamov-style rotor is modeled (i.e. the rotor produces no torque).&lt;br /&gt;
&lt;br /&gt;
==== Engine issues ====&lt;br /&gt;
In order to keep the rotor speed constant, use of a RPM-Governor system is encouraged (see examples).&lt;br /&gt;
&lt;br /&gt;
==== Development hints ====&lt;br /&gt;
Setting '''&amp;amp;lt;ExternalRPM&amp;amp;gt; -1 &amp;amp;lt;/ExternalRPM&amp;amp;gt;''' the rotor's RPM is controlled by the '''propulsion/engine[x]/x-rpm-dict''' property. This feature can be useful when developing a FDM.&lt;br /&gt;
&lt;br /&gt;
==== Properties ====&lt;br /&gt;
The rotor model creates the following properties:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/rotor-rpm&lt;br /&gt;
|RPMs of the rotor&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/engine-rpm&lt;br /&gt;
|RPMs of the Engine, as seen from this rotor.&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/a0-rad&lt;br /&gt;
|Rotor's coning angle in radians&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/a1-rad&lt;br /&gt;
|Longitudinal flapping angle with respect to the rotor shaft in radians&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/b1-rad&lt;br /&gt;
|Lateral flapping angle with respect to the rotor shaft in radians&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/inflow-ratio&lt;br /&gt;
| Lambda or λ&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/advance-ratio&lt;br /&gt;
|the tip-speed (aka advance) ratio Mu or μ&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/induced-inflow-ratio&lt;br /&gt;
| Nu or ν&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/vi-fps&lt;br /&gt;
|Induced Velocity in feet per second&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/thrust-coefficient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/torque-lbsft&lt;br /&gt;
| Rotor torque in pound * feet&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/theta-downwash-rad&lt;br /&gt;
|Down wash θ angle - positive values point forward (given a horizontal spinning rotor) in radians&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/phi-downwash-rad&lt;br /&gt;
|Down wash Φ angle - positive values point leftward (given a horizontal spinning rotor) in radians&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/groundeffect-scale-norm&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Control Inputs)&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/antitorque-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/tail-collective-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/lateral-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/longitudinal-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/collective-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/lateral-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|propulsion/engine[#]/longitudinal-ctrl-rad&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|SH79&lt;br /&gt;
|Shaugnessy, J. D., Deaux, Thomas N., and Yenni, Kenneth R., &amp;quot;Development and Validation of a Piloted Simulation of a  Helicopter and External Sling Load&amp;quot;,  NASA TP-1285, 1979.&lt;br /&gt;
|-&lt;br /&gt;
|BA41&lt;br /&gt;
|Bailey,F.J.,Jr., &amp;quot;A Simplified Theoretical Method of Determining the Characteristics of a Lifting Rotor in Forward Flight&amp;quot;, NACA Rep.716, 1941&lt;br /&gt;
|-&lt;br /&gt;
|AM50&lt;br /&gt;
|Amer, Kenneth B.,&amp;quot;Theory of Helicopter Damping in Pitch or Roll and a Comparison With Flight Measurements&amp;quot;, NACA TN-2136, 1950.&lt;br /&gt;
|-&lt;br /&gt;
|TA77&lt;br /&gt;
|Talbot, Peter D., Corliss, Lloyd D., &amp;quot;A Mathematical Force and Moment Model of a UH-1H Helicopter for Flight Dynamics Simulations&amp;quot;, NASA TM-73,254, 1977.&lt;br /&gt;
|-&lt;br /&gt;
|GE49&lt;br /&gt;
|Gessow, Alfred, Amer, Kenneth B. &amp;quot;An Introduction to the Physical Aspects of Helicopter Stability&amp;quot;, NACA TN-1982, 1949.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Writing_Joystick_Code:_Part_1&amp;diff=114712</id>
		<title>Writing Joystick Code: Part 1</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Writing_Joystick_Code:_Part_1&amp;diff=114712"/>
		<updated>2018-03-12T11:09:45Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Aileron, elevator and rudder */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{JoystickScripting Navigation}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Before you start, read [[Input device]].&lt;br /&gt;
&lt;br /&gt;
All the examples below assume that you have obtained the correct axes and button numbers as described in the above article. You will have to substitute the correct axis and button numbers in these code examples.&lt;br /&gt;
&lt;br /&gt;
Note the indent in all examples. The indents have no effect on operation, they just make the code so much more readable.&lt;br /&gt;
&lt;br /&gt;
Here is some code to explain a few important basic concepts of xml files. (I have numbered the lines to aid the explanation below. In your xml file the line numbers will not be there.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line&amp;gt;&lt;br /&gt;
&amp;lt;button n=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;desc&amp;gt;Gear up&amp;lt;/desc&amp;gt;&lt;br /&gt;
  &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
  &amp;lt;binding&amp;gt;&lt;br /&gt;
    &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
    &amp;lt;script&amp;gt;controls.gearDown(-1)&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;controls.gearDown(0)&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ignoring the actual meaning of the code, let's got through it line by line.&lt;br /&gt;
&lt;br /&gt;
Line 1: &amp;lt;button&amp;gt; specifies that this is the code for a button, and the n=&amp;quot;4&amp;quot; means that this is the code for the button which ''your system'' reports as number 4.&lt;br /&gt;
&lt;br /&gt;
Line 2: &amp;lt;desc&amp;gt; A (short) description of what the button does.&lt;br /&gt;
&lt;br /&gt;
Line 3: &amp;lt;repeatable&amp;gt;true&amp;lt;/repeatable&amp;gt; means that ''as long as the button is held in'' the following action will be executed. If repeatable is false, the button action is one-shot, and won't execute again until the button is released and pressed again.&lt;br /&gt;
&lt;br /&gt;
Notice the &amp;lt;/repeatable&amp;gt; after the value true. Each tag (&amp;lt;word&amp;gt; must have a closing tag &amp;lt;/word&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Line 4: &amp;lt;binding&amp;gt; This is the start of the code which defines what happens when the button is pressed. Notice that there can be a few lines before the &amp;lt;/binding&amp;gt; tag. &lt;br /&gt;
&lt;br /&gt;
Line 5: &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt; means that the following line(s) is(are) written in the programming language nasal. That is all you need to know!!&lt;br /&gt;
&lt;br /&gt;
Line 6: &amp;lt;script&amp;gt;controls.gearDown&amp;lt;/script&amp;gt;. The text between &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; are the nasal commands to be performed. Here there is only one command, but there can be many.&lt;br /&gt;
&lt;br /&gt;
Line 7: &amp;lt;/binding&amp;gt; The end of what happens when the button is pressed.&lt;br /&gt;
&lt;br /&gt;
Line 8: &amp;lt;mod-up&amp;gt; (Modification up.) This is the start of the section to handle what happens when the button is released. The up part co9mes from the idea of pushing a button down, and it moves up when you take your finger off it. Not all button actions need a &amp;lt;mod-up&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
Lines 9 to 13: Same as above, except that it refers to what happens when the button is released.&lt;br /&gt;
&lt;br /&gt;
Line 14: &amp;lt;/button&amp;gt; The end of the button section. Not necessary to specify the button number again, as you can't use &amp;lt;button&amp;gt; &amp;lt;/button&amp;gt; inside another &amp;lt;button&amp;gt; &amp;lt;/button&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
== Axes ==&lt;br /&gt;
Axes are the controls on a joystick which con be moved over a whole arc of operation.&lt;br /&gt;
&lt;br /&gt;
Even though the hat hat-switch is classed as an axis, for the purpose of writing code for it, it is a set of buttons. It is, in fact, just a set of buttons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Aileron, elevator and rudder ===&lt;br /&gt;
The code for these looks like this. The lines in italics are optional. The other lines are compulsory.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;axis n=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;Elevator&amp;lt;/desc&amp;gt;&lt;br /&gt;
    ''&amp;lt;dead-band type=&amp;quot;double&amp;quot;&amp;gt;0.0&amp;lt;/dead-band&amp;gt;''&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;property-scale&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;property&amp;gt;/controls/flight/elevator&amp;lt;/property&amp;gt;&lt;br /&gt;
      ''&amp;lt;offset type=&amp;quot;double&amp;quot;&amp;gt;0.0&amp;lt;/offset&amp;gt;''&lt;br /&gt;
      ''&amp;lt;factor type=&amp;quot;double&amp;quot;&amp;gt;-1.0&amp;lt;/factor&amp;gt;''&lt;br /&gt;
      ''&amp;lt;power type=&amp;quot;int&amp;quot;&amp;gt;3&amp;lt;/power&amp;gt;''&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;/axis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;desc&amp;gt;Elevator&amp;lt;/desc&amp;gt; let's us know that this axis controls the elevator. For human purposes only. All the other lines are for the benefit of FG.&lt;br /&gt;
&lt;br /&gt;
The optional lines need quite a bit of explanation. For a start, all three these axes have a center-zero action. At this point, they have a value of 0. As you move them to their extreme positions, their value gradually increases (decreases) to +1.0 or -1.0, depending on the direction of movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dead-band ..... : You may want a small movement around the center of the axis not to do anything. Or your joystick might be getting old, and it jitters around zero. Jittering is small, continuous value changes in the value. You can then supply a value for dead-band that will eliminate this. And it will be small. A dead-band of 1.0 means that the axis does nothing, a dead-band of 0.25 means that the axis does nothing for the first 25% of its movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;offset ..... : If you find that in its center position the axes outputs a non-zero value, you can put that same value here, with opposite + or - sign, to counter-act this. The HUD will show you if you have an offset problem, and can be used to see if you have solved it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;factor ...... : If you find that moving an axis results in the aileron, elevator or rudder moving in the wrong direction, change the -1.0 to 1.0 or the 1.0 to -1.0. This will make it work the other way round.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;power ...... : Sometimes the axes are too sensitive - a slight touch on aileron makes the plane barrel-roll. You can reduce this sensitivity by making the value of power more than 1. (It is a decimal number, so you can make small adjustments, but small adjustments are usually not enough to be noticible.) Never mind the maths, but the larger the value of power the less sensitive the aircraft will be to axis movement.&lt;br /&gt;
&lt;br /&gt;
Remember: ((property+offset)*factor)^power=result. See [http://wiki.flightgear.org/Bindings#property-scale Bindings, property-scale].&lt;br /&gt;
&lt;br /&gt;
{{Note|In some joystick binding files, you'll find:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;squared type=&amp;quot;bool&amp;quot;&amp;amp;gt;true&amp;amp;lt;/squared&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is equivalent to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;power type=&amp;quot;int&amp;quot;&amp;amp;gt;2&amp;amp;lt;/power&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and not faster in any way, therefore I prefer using ''power'' since it's then easier to change the value if needed.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For aileron and rudder you replace ''&amp;gt;/controls/flight/elevator'' with ''/controls/flight/aileron'' and ''/controls/flight/rudder''. Don't forget to change the the name between &amp;lt;desc&amp;gt; and &amp;lt;/desc&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Other axes ===&lt;br /&gt;
Throttle, propeller-pitch, mixture and carburetor-heat. &lt;br /&gt;
&lt;br /&gt;
These do not have optional settings, after all you want a smooth linear response. This is the code for the throttle control, for the others, just replace throttleAxis with propellerAxis, mixtureAxis or carbHeatAxis.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;axis n=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;Throttle&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;controls.throttleAxis()&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/binding&amp;gt;&lt;br /&gt;
 &amp;lt;/axis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the &amp;quot;instructions&amp;quot; we give are in the Nasal language, so we have &lt;br /&gt;
  &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt; to let the interpreter know.&lt;br /&gt;
&lt;br /&gt;
The actual &amp;quot;instruction&amp;quot; is between the &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; tags.&lt;br /&gt;
  &amp;lt;script&amp;gt;controls.throttleAxis()&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Buttons ==&lt;br /&gt;
&lt;br /&gt;
There is almost no end to what we can do with buttons, limited usually by the number of buttons on the joystick, what we need, and what we can remember of the allocation of button actions.&lt;br /&gt;
&lt;br /&gt;
=== Repeatable/Non-repeatable ===&lt;br /&gt;
&lt;br /&gt;
There are two categories of buttons, repeatable and non-repeatable. With non-repeatable buttons, when we push it, a single action is carried out, and nothing else happens. An example of its use would be a button to lower the landing-gear. We press the button, the gear goes down. With repeatable buttons, when we hold the button in, the same action is carried out over and over, until we release the button. An example is zoom-in. We press the button, and the view keeps zooming in. When we have the view we want, we release the button, and zooming stops.&lt;br /&gt;
An important point to remeber is that if a button is repeatable, even if you just give it the briefest of touches, the instruction will be carried out a few times, thanks to the repeat-rate of the system.&lt;br /&gt;
Setting a button to repeatable or non-repeatable is part of the basic definition of the button (like its number), it cannot be changed willy-nilly. So when you decide on the use for joystick buttons, you decide ''which will be repeatable and which not''.&lt;br /&gt;
&lt;br /&gt;
The shell of a button definition looks lke this&lt;br /&gt;
  &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''What the button does''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Your code goes here''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Code for what happens when the button is released goes here''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a non-repeatable button&lt;br /&gt;
  &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make a  button repeatable, replace false with true.&lt;br /&gt;
&lt;br /&gt;
You can use this shell for all your buttons. Just use the correct button number, give the correct &amp;lt;desc&amp;gt;, decide repeatable or non-repeatable, and then type the correct code in place of ''Your code goes here'' and ''Code for what happens when the button is released goes here''. Not all actions need a &amp;lt;mod-up&amp;gt; section, but you will soon get the hang of what does and what doesn't.&lt;br /&gt;
&lt;br /&gt;
If your code has more than one command, then do this&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
    ''Command number 1'';&lt;br /&gt;
    ''Command number 2'';&lt;br /&gt;
    ''Command number 3''&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that all lines except the last have a ; at the end. This lets the interpreter know that you haven't finished yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== A note on &amp;lt;mod-up&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
I have been having a good look at the controls.nas file that comes with FG. With most of them, where you would use &lt;br /&gt;
  controls.someAction(1)&lt;br /&gt;
to do something, you are allowed to use&lt;br /&gt;
  controls.someAction(0)&lt;br /&gt;
in &amp;lt;mod-up&amp;gt;, but it does nothing. Xml files are full of such code, which is totally, unnecessary. It does no harm, just wastes time, albeit very little time. In fact, the only time a &amp;lt;mod-up&amp;gt; is needed is when a non-repeatable button starts an ongoing process, and we want to stop that process when we release the button. In Part2 and Part 3 you will see almost no &amp;lt;mod-up&amp;gt; code at all.&lt;br /&gt;
&lt;br /&gt;
One advantage  of leaving out unnecessary &amp;lt;mod-up&amp;gt; code is that it makes the code easier to read. (And saves a couple of trees when the files are printed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Giving buttons multiple choices ===&lt;br /&gt;
&lt;br /&gt;
There is a limit to the number of buttons on the joystick and lots of things we'd like to do with them. Fortunately, FG makes it easy for us. It lets us know if any or more than one of the Shift, Alt and Ctrl buttons are pressed. We can thus modify the action of a button with the &amp;lt;mod-shift&amp;gt;, &amp;lt;mod-ctrl&amp;gt; and &amp;lt;mod-alt&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
Here is an example of what you need to modify the action of a button when the Shift key is held in when you press the button. I have deliberately included &amp;lt;mod-up&amp;gt; tags so that you can see where they must go, should they be necessary.&lt;br /&gt;
  &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''Normal action/Shift action''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Normal: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Normal: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;mod-shift&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Shift: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;mod-up&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Shift: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-shift&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quite easy.&lt;br /&gt;
&lt;br /&gt;
Notice that the &amp;lt;repeatable&amp;gt; tag is right at the top. ''You cannot make the normale action repeatable and the modified action non-repeatable''.&lt;br /&gt;
&lt;br /&gt;
Now let's go crazy. We want:&lt;br /&gt;
  1. Normal action.&lt;br /&gt;
  2. Action when Ctrl is pressed.&lt;br /&gt;
  3. Action when Ctrl and Alt are pressed.&lt;br /&gt;
&lt;br /&gt;
Looks like this.&lt;br /&gt;
    &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''Normal action/Ctrl action/Ctrl-Alt action''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    # *****  Normal *****&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Normal: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Normal: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    # ***** Ctrl  *****&lt;br /&gt;
    &amp;lt;mod-ctrl&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Ctrl: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;mod-up&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Ctrl: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      # ***** Ctrl-Alt *****&lt;br /&gt;
      &amp;lt;mod-alt&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Ctrl &amp;amp; Alt: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
        &amp;lt;mod-up&amp;gt;&lt;br /&gt;
          &amp;lt;binding&amp;gt;&lt;br /&gt;
            &amp;lt;script&amp;gt;''Ctrl &amp;amp; Alt: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
          &amp;lt;/binding&amp;gt;&lt;br /&gt;
        &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-alt&amp;gt; &lt;br /&gt;
   &amp;lt;/mod-ctrl&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice four things:&lt;br /&gt;
   1. The &amp;lt;mod-alt&amp;gt; selection is between the &amp;lt;mod-ctrl&amp;gt; and &amp;lt;/mod-ctrl&amp;gt; tags. This means that the code is for Ctrl and Alt, not just Alt.&lt;br /&gt;
   2. I have spaced the sections with empty lines for readability.&lt;br /&gt;
   3. I have used comments # ***** Comment ***** to make it even more readable.&lt;br /&gt;
   4. By using comments and open lines, the block of code is a lot less daunting. In fact, once you have grasped the basics, it is quite easy to read.&lt;br /&gt;
&lt;br /&gt;
Anything that starts with # is ignored by the interpreter, even if it comes after some code. Such as&lt;br /&gt;
  &amp;lt;script&amp;gt;controls.throttleAxis&amp;lt;/script&amp;gt; # Controls the throttle axis&lt;br /&gt;
&lt;br /&gt;
The code will work and we humans have an explanation of the code.&lt;br /&gt;
&lt;br /&gt;
To write long comments you can do this&lt;br /&gt;
  &amp;amp;lt;!--  &lt;br /&gt;
     Lots and lots&lt;br /&gt;
     and even more&lt;br /&gt;
     lots of lines of comments.&lt;br /&gt;
  --&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use the function keys as modifiers: &amp;lt;mod-F1&amp;gt;, &amp;lt;mod-F2&amp;gt;, etc., but remember that with all the combinations of Shift, Ctrl and Alt you get 7 options, and that is a lot of options to remember for each button.&lt;br /&gt;
&lt;br /&gt;
In a later section I will show how to use buttons on the joystick as modifiers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== CDATA ==&lt;br /&gt;
If your code (or even comments) contains &amp;lt;, &amp;gt;, &amp;amp; or --, it can cause havoc with your xml file. Any area that contains any of these must be enclosed between&lt;br /&gt;
  &amp;lt;![CDATA[      and     ]]&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Any complaints/suggestions/questions/kudos can be posted [http://forum.flightgear.org/viewtopic.php?f=24&amp;amp;t=17892 here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=114679</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=114679"/>
		<updated>2018-03-11T11:03:49Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: DC3: replaced a broken link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. The collector tank in the example has the capacity 130 lbs so making the check against collector tank level greater or equal to 129 instead of against 130 is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 1 lb margin creates a buffer for this difference as the value oscillates around 129 lbs as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://2.bp.blogspot.com/-t6PpgjQXPGw/Ul60qTdgJDI/AAAAAAAAAmU/iefht14OnzQ/s1600/DC-3+fuel+system.jpg in this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (= 'OFF'), 0, 1, 2, 3, respectively for 'no tank selected', tank[0], [1], [2], [3].&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
* if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
* else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
* else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed or not, i.e. if it is connected to a tank, if this tank is not empty, with a running pump (or not).&lt;br /&gt;
&lt;br /&gt;
(This function above could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
'''For the fuel system presented here''', two small collector tanks [4] and [5] (each collector tank feeding one engine) have been added. In JSBSim, for this multi-engine aircraft (differently from a single-engine one), these collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (through rotary switches for left and right engines) and have their level kept constant. This functioning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ([4] and [5]), which themselves will be fed by the selected 'true' tanks ([0] to [3]).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 0 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 1 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is shown below (can be named fuel.xml, see at the top of this document for how to link the FDM to it).&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] have their level kept constant (at 0.25 lb content) by a step-controlled input flow rate (0 or 0.5 pps here). The &amp;quot;ON&amp;quot; value of this step flow rate must be a bit higher than the maximum&amp;quot; fuel-flow-rate-pps&amp;quot; needed by each engine at full power.&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] content is a compromise. A large content is secure but it gives an excessive delay between the moment when the 'true' tank runs out of fuel and the engine effectively stops running. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D with YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://equipe-flightgear.forumactif.com&lt;br /&gt;
 &lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- Tank 4 level maintenance --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
      &amp;lt;!-- from selected 'utility' tank to Collector Tank 4 Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0               &lt;br /&gt;
            propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1&lt;br /&gt;
            propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2               &lt;br /&gt;
            propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3&lt;br /&gt;
            propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt; &amp;lt;!-- Tank 4 filling --&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- for Tanks 0, 1, 2, 3 consumption --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank0-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank1-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank2-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank3-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- Tank 5 level maintenance --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
      &amp;lt;!-- from selected 'utility' tank to Collector Tank 5 Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0               &lt;br /&gt;
            propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1&lt;br /&gt;
            propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2               &lt;br /&gt;
            propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3&lt;br /&gt;
            propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt; &amp;lt;!-- Tank 5 filling --&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- for Tanks 0, 1, 2, 3 consumption --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank0-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank1-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank2-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank3-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank0-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank0-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank1-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank1-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank2-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank2-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank3-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank3-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Writing_Joystick_Code:_Part_1&amp;diff=114662</id>
		<title>Writing Joystick Code: Part 1</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Writing_Joystick_Code:_Part_1&amp;diff=114662"/>
		<updated>2018-03-10T11:20:47Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Aileron, elevator and rudder */Add a FG Wiki link to Bindings&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{JoystickScripting Navigation}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Before you start, read [[Input device]].&lt;br /&gt;
&lt;br /&gt;
All the examples below assume that you have obtained the correct axes and button numbers as described in the above article. You will have to substitute the correct axis and button numbers in these code examples.&lt;br /&gt;
&lt;br /&gt;
Note the indent in all examples. The indents have no effect on operation, they just make the code so much more readable.&lt;br /&gt;
&lt;br /&gt;
Here is some code to explain a few important basic concepts of xml files. (I have numbered the lines to aid the explanation below. In your xml file the line numbers will not be there.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line&amp;gt;&lt;br /&gt;
&amp;lt;button n=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;desc&amp;gt;Gear up&amp;lt;/desc&amp;gt;&lt;br /&gt;
  &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
  &amp;lt;binding&amp;gt;&lt;br /&gt;
    &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
    &amp;lt;script&amp;gt;controls.gearDown(-1)&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;controls.gearDown(0)&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ignoring the actual meaning of the code, let's got through it line by line.&lt;br /&gt;
&lt;br /&gt;
Line 1: &amp;lt;button&amp;gt; specifies that this is the code for a button, and the n=&amp;quot;4&amp;quot; means that this is the code for the button which ''your system'' reports as number 4.&lt;br /&gt;
&lt;br /&gt;
Line 2: &amp;lt;desc&amp;gt; A (short) description of what the button does.&lt;br /&gt;
&lt;br /&gt;
Line 3: &amp;lt;repeatable&amp;gt;true&amp;lt;/repeatable&amp;gt; means that ''as long as the button is held in'' the following action will be executed. If repeatable is false, the button action is one-shot, and won't execute again until the button is released and pressed again.&lt;br /&gt;
&lt;br /&gt;
Notice the &amp;lt;/repeatable&amp;gt; after the value true. Each tag (&amp;lt;word&amp;gt; must have a closing tag &amp;lt;/word&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Line 4: &amp;lt;binding&amp;gt; This is the start of the code which defines what happens when the button is pressed. Notice that there can be a few lines before the &amp;lt;/binding&amp;gt; tag. &lt;br /&gt;
&lt;br /&gt;
Line 5: &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt; means that the following line(s) is(are) written in the programming language nasal. That is all you need to know!!&lt;br /&gt;
&lt;br /&gt;
Line 6: &amp;lt;script&amp;gt;controls.gearDown&amp;lt;/script&amp;gt;. The text between &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; are the nasal commands to be performed. Here there is only one command, but there can be many.&lt;br /&gt;
&lt;br /&gt;
Line 7: &amp;lt;/binding&amp;gt; The end of what happens when the button is pressed.&lt;br /&gt;
&lt;br /&gt;
Line 8: &amp;lt;mod-up&amp;gt; (Modification up.) This is the start of the section to handle what happens when the button is released. The up part co9mes from the idea of pushing a button down, and it moves up when you take your finger off it. Not all button actions need a &amp;lt;mod-up&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
Lines 9 to 13: Same as above, except that it refers to what happens when the button is released.&lt;br /&gt;
&lt;br /&gt;
Line 14: &amp;lt;/button&amp;gt; The end of the button section. Not necessary to specify the button number again, as you can't use &amp;lt;button&amp;gt; &amp;lt;/button&amp;gt; inside another &amp;lt;button&amp;gt; &amp;lt;/button&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
== Axes ==&lt;br /&gt;
Axes are the controls on a joystick which con be moved over a whole arc of operation.&lt;br /&gt;
&lt;br /&gt;
Even though the hat hat-switch is classed as an axis, for the purpose of writing code for it, it is a set of buttons. It is, in fact, just a set of buttons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Aileron, elevator and rudder ===&lt;br /&gt;
The code for these looks like this. The lines in italics are optional. The other lines are compulsory.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;axis n=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;Elevator&amp;lt;/desc&amp;gt;&lt;br /&gt;
    ''&amp;lt;dead-band type=&amp;quot;double&amp;quot;&amp;gt;0.0&amp;lt;/dead-band&amp;gt;''&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;property-scale&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;property&amp;gt;/controls/flight/elevator&amp;lt;/property&amp;gt;&lt;br /&gt;
      ''&amp;lt;offset type=&amp;quot;double&amp;quot;&amp;gt;0.0&amp;lt;/offset&amp;gt;''&lt;br /&gt;
      ''&amp;lt;factor type=&amp;quot;double&amp;quot;&amp;gt;-1.0&amp;lt;/factor&amp;gt;''&lt;br /&gt;
      ''&amp;lt;power type=&amp;quot;int&amp;quot;&amp;gt;3&amp;lt;/power&amp;gt;''&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;/axis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;desc&amp;gt;Elevator&amp;lt;/desc&amp;gt; let's us know that this axis controls the elevator. For human purposes only. All the other lines are for the benefit of FG.&lt;br /&gt;
&lt;br /&gt;
The optional lines need quite a bit of explanation. For a start, all three these axes have a center-zero action. At this point, they have a value of 0. As you move them to their extreme positions, their value gradually increases (decreases) to +1.0 or -1.0, depending on the direction of movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dead-band ..... : You may want a small movement around the center of the axis not to do anything. Or your joystick might be getting old, and it jitters around zero. Jittering is small, continuous value changes in the value. You can then supply a value for dead-band that will eliminate this. And it will be small. A dead-band of 1.0 means that the axis does nothing, a dead-band of 0.25 means that the axis does nothing for the first 25% of its movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;offset ..... : If you find that in its center position the axes outputs a non-zero value, you can put that same value here, with opposite + or - sign, to counter-act this. The HUD will show you if you have an offset problem, and can be used to see if you have solved it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;factor ...... : If you find that moving an axis results in the aileron, elevator or rudder moving in the wrong direction, change the -1.0 to 1.0 or the 1.0 to -1.0. This will make it work the other way round.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;power ...... : Sometimes the axes are too sensitive - a slight touch on aileron makes the plane barrel-roll. You can reduce this sensitivity by making the value of power more than 1. (It is a decimal number, so you can make small adjustments, but small adjustments are usually not enough to be noticible.) Never mind the maths, but the larger the value of power the less sensitive the aircraft will be to axis movement.&lt;br /&gt;
&lt;br /&gt;
Remember: ((property+offset)*factor)^power=result. See [[Bindings]], property-scale [[http://wiki.flightgear.org/Bindings#property-scale]]&lt;br /&gt;
&lt;br /&gt;
{{Note|In some joystick binding files, you'll find:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;squared type=&amp;quot;bool&amp;quot;&amp;amp;gt;true&amp;amp;lt;/squared&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is equivalent to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;power type=&amp;quot;int&amp;quot;&amp;amp;gt;2&amp;amp;lt;/power&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and not faster in any way, therefore I prefer using ''power'' since it's then easier to change the value if needed.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For aileron and rudder you replace ''&amp;gt;/controls/flight/elevator'' with ''/controls/flight/aileron'' and ''/controls/flight/rudder''. Don't forget to change the the name between &amp;lt;desc&amp;gt; and &amp;lt;/desc&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Other axes ===&lt;br /&gt;
Throttle, propeller-pitch, mixture and carburetor-heat. &lt;br /&gt;
&lt;br /&gt;
These do not have optional settings, after all you want a smooth linear response. This is the code for the throttle control, for the others, just replace throttleAxis with propellerAxis, mixtureAxis or carbHeatAxis.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;axis n=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;Throttle&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;controls.throttleAxis()&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/binding&amp;gt;&lt;br /&gt;
 &amp;lt;/axis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the &amp;quot;instructions&amp;quot; we give are in the Nasal language, so we have &lt;br /&gt;
  &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt; to let the interpreter know.&lt;br /&gt;
&lt;br /&gt;
The actual &amp;quot;instruction&amp;quot; is between the &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; tags.&lt;br /&gt;
  &amp;lt;script&amp;gt;controls.throttleAxis()&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Buttons ==&lt;br /&gt;
&lt;br /&gt;
There is almost no end to what we can do with buttons, limited usually by the number of buttons on the joystick, what we need, and what we can remember of the allocation of button actions.&lt;br /&gt;
&lt;br /&gt;
=== Repeatable/Non-repeatable ===&lt;br /&gt;
&lt;br /&gt;
There are two categories of buttons, repeatable and non-repeatable. With non-repeatable buttons, when we push it, a single action is carried out, and nothing else happens. An example of its use would be a button to lower the landing-gear. We press the button, the gear goes down. With repeatable buttons, when we hold the button in, the same action is carried out over and over, until we release the button. An example is zoom-in. We press the button, and the view keeps zooming in. When we have the view we want, we release the button, and zooming stops.&lt;br /&gt;
An important point to remeber is that if a button is repeatable, even if you just give it the briefest of touches, the instruction will be carried out a few times, thanks to the repeat-rate of the system.&lt;br /&gt;
Setting a button to repeatable or non-repeatable is part of the basic definition of the button (like its number), it cannot be changed willy-nilly. So when you decide on the use for joystick buttons, you decide ''which will be repeatable and which not''.&lt;br /&gt;
&lt;br /&gt;
The shell of a button definition looks lke this&lt;br /&gt;
  &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''What the button does''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Your code goes here''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Code for what happens when the button is released goes here''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a non-repeatable button&lt;br /&gt;
  &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make a  button repeatable, replace false with true.&lt;br /&gt;
&lt;br /&gt;
You can use this shell for all your buttons. Just use the correct button number, give the correct &amp;lt;desc&amp;gt;, decide repeatable or non-repeatable, and then type the correct code in place of ''Your code goes here'' and ''Code for what happens when the button is released goes here''. Not all actions need a &amp;lt;mod-up&amp;gt; section, but you will soon get the hang of what does and what doesn't.&lt;br /&gt;
&lt;br /&gt;
If your code has more than one command, then do this&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
    ''Command number 1'';&lt;br /&gt;
    ''Command number 2'';&lt;br /&gt;
    ''Command number 3''&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that all lines except the last have a ; at the end. This lets the interpreter know that you haven't finished yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== A note on &amp;lt;mod-up&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
I have been having a good look at the controls.nas file that comes with FG. With most of them, where you would use &lt;br /&gt;
  controls.someAction(1)&lt;br /&gt;
to do something, you are allowed to use&lt;br /&gt;
  controls.someAction(0)&lt;br /&gt;
in &amp;lt;mod-up&amp;gt;, but it does nothing. Xml files are full of such code, which is totally, unnecessary. It does no harm, just wastes time, albeit very little time. In fact, the only time a &amp;lt;mod-up&amp;gt; is needed is when a non-repeatable button starts an ongoing process, and we want to stop that process when we release the button. In Part2 and Part 3 you will see almost no &amp;lt;mod-up&amp;gt; code at all.&lt;br /&gt;
&lt;br /&gt;
One advantage  of leaving out unnecessary &amp;lt;mod-up&amp;gt; code is that it makes the code easier to read. (And saves a couple of trees when the files are printed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Giving buttons multiple choices ===&lt;br /&gt;
&lt;br /&gt;
There is a limit to the number of buttons on the joystick and lots of things we'd like to do with them. Fortunately, FG makes it easy for us. It lets us know if any or more than one of the Shift, Alt and Ctrl buttons are pressed. We can thus modify the action of a button with the &amp;lt;mod-shift&amp;gt;, &amp;lt;mod-ctrl&amp;gt; and &amp;lt;mod-alt&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
Here is an example of what you need to modify the action of a button when the Shift key is held in when you press the button. I have deliberately included &amp;lt;mod-up&amp;gt; tags so that you can see where they must go, should they be necessary.&lt;br /&gt;
  &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''Normal action/Shift action''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Normal: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Normal: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;mod-shift&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Shift: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;mod-up&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Shift: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-shift&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quite easy.&lt;br /&gt;
&lt;br /&gt;
Notice that the &amp;lt;repeatable&amp;gt; tag is right at the top. ''You cannot make the normale action repeatable and the modified action non-repeatable''.&lt;br /&gt;
&lt;br /&gt;
Now let's go crazy. We want:&lt;br /&gt;
  1. Normal action.&lt;br /&gt;
  2. Action when Ctrl is pressed.&lt;br /&gt;
  3. Action when Ctrl and Alt are pressed.&lt;br /&gt;
&lt;br /&gt;
Looks like this.&lt;br /&gt;
    &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''Normal action/Ctrl action/Ctrl-Alt action''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    # *****  Normal *****&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Normal: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Normal: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    # ***** Ctrl  *****&lt;br /&gt;
    &amp;lt;mod-ctrl&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Ctrl: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;mod-up&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Ctrl: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      # ***** Ctrl-Alt *****&lt;br /&gt;
      &amp;lt;mod-alt&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Ctrl &amp;amp; Alt: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
        &amp;lt;mod-up&amp;gt;&lt;br /&gt;
          &amp;lt;binding&amp;gt;&lt;br /&gt;
            &amp;lt;script&amp;gt;''Ctrl &amp;amp; Alt: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
          &amp;lt;/binding&amp;gt;&lt;br /&gt;
        &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-alt&amp;gt; &lt;br /&gt;
   &amp;lt;/mod-ctrl&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice four things:&lt;br /&gt;
   1. The &amp;lt;mod-alt&amp;gt; selection is between the &amp;lt;mod-ctrl&amp;gt; and &amp;lt;/mod-ctrl&amp;gt; tags. This means that the code is for Ctrl and Alt, not just Alt.&lt;br /&gt;
   2. I have spaced the sections with empty lines for readability.&lt;br /&gt;
   3. I have used comments # ***** Comment ***** to make it even more readable.&lt;br /&gt;
   4. By using comments and open lines, the block of code is a lot less daunting. In fact, once you have grasped the basics, it is quite easy to read.&lt;br /&gt;
&lt;br /&gt;
Anything that starts with # is ignored by the interpreter, even if it comes after some code. Such as&lt;br /&gt;
  &amp;lt;script&amp;gt;controls.throttleAxis&amp;lt;/script&amp;gt; # Controls the throttle axis&lt;br /&gt;
&lt;br /&gt;
The code will work and we humans have an explanation of the code.&lt;br /&gt;
&lt;br /&gt;
To write long comments you can do this&lt;br /&gt;
  &amp;amp;lt;!--  &lt;br /&gt;
     Lots and lots&lt;br /&gt;
     and even more&lt;br /&gt;
     lots of lines of comments.&lt;br /&gt;
  --&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use the function keys as modifiers: &amp;lt;mod-F1&amp;gt;, &amp;lt;mod-F2&amp;gt;, etc., but remember that with all the combinations of Shift, Ctrl and Alt you get 7 options, and that is a lot of options to remember for each button.&lt;br /&gt;
&lt;br /&gt;
In a later section I will show how to use buttons on the joystick as modifiers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== CDATA ==&lt;br /&gt;
If your code (or even comments) contains &amp;lt;, &amp;gt;, &amp;amp; or --, it can cause havoc with your xml file. Any area that contains any of these must be enclosed between&lt;br /&gt;
  &amp;lt;![CDATA[      and     ]]&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Any complaints/suggestions/questions/kudos can be posted [http://forum.flightgear.org/viewtopic.php?f=24&amp;amp;t=17892 here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Input_device&amp;diff=114657</id>
		<title>Input device</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Input_device&amp;diff=114657"/>
		<updated>2018-03-09T14:35:39Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Related content */Added a few links to Wiki 'Writing Joystick Code'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Could you imagine a pilot in his or her [[:Category:Cessna|Cessna]] controlling the machine with a keyboard alone? For getting the proper feeling of flight you will need a '''joystick/yoke''' plus [[rudder]] pedals, right? &lt;br /&gt;
&lt;br /&gt;
FlightGear has integrated joystick support, which automatically detects any joystick, yoke, or pedals attached. Just try it! If this does work for you, lean back and be happy! You can see what FlightGear has detected your joystick as in the Help &amp;gt; Joystick Configuration dialog from the [[menu]]. &lt;br /&gt;
&lt;br /&gt;
Unfortunately, for the above mentioned versatility, chances are your joystick does not work out of the box. This article explains you how to make FlightGear recognise your device&lt;br /&gt;
&lt;br /&gt;
== Joystick or yoke? ==&lt;br /&gt;
{| cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;right&amp;quot; style=&amp;quot;clear:right; background:#fafafa; font-size: 85%; border: 1px solid #CCCCCC;&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
| [[File:CH Products Fighterstick USB.jpg|x199px|CH Products Fighterstick USB]]&lt;br /&gt;
| [[File:Saitek Pro Flight Cessna Yoke front.jpg|300px|Saitek Pro Flight Cessna Yoke]]&lt;br /&gt;
|-&lt;br /&gt;
| CH Products Fighterstick USB&lt;br /&gt;
| Saitek Pro Flight Cessna Yoke&lt;br /&gt;
|}&lt;br /&gt;
The two most common control devices on aircraft are the joystick (left picture) and yoke (right picture). Joysticks can be found on military fighters, helicopters and Airbus [[airliner]]s, while yokes are used on almost all other fixed wing aircraft, including Boeing airliners.&lt;br /&gt;
&lt;br /&gt;
Joysticks are generally a lot cheaper, starting at $10. Yokes start at $100. When you are new to flightsimming, buying a cheap (ca. $20) joystick might be a good way to find out if it's something for you.&lt;br /&gt;
&lt;br /&gt;
The following table should help you decide which one is best suited for you:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! Joystick&lt;br /&gt;
! Yoke&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | Price&lt;br /&gt;
| $10+&lt;br /&gt;
| $100+&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | General aviation&lt;br /&gt;
| {{no}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | Gliders&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{no}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | Helicopter&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{no}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | Fighters&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{no}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | Most airliners including Boeing&lt;br /&gt;
| {{no}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | Airbus&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{no}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It should be noted that any type of input device (be it a joystick, a yoke or even a gamepad) will work with '''all''' aircraft in FlightGear and that the table above only suggests which ones are more suited to specific types of aircraft given how they are flown in real life.&lt;br /&gt;
&lt;br /&gt;
Some reviews of flight simulation hardware can be found in [[:Category:Hardware reviews]].&lt;br /&gt;
&lt;br /&gt;
== Built-in joystick support ==&lt;br /&gt;
In order for joystick auto-detection to work, a joystick bindings xml file must exist for each joystick. This file describes what axes and buttons are to be used to control which functions in FlightGear. The associations between functions and axes or buttons are called &amp;quot;bindings&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
FlightGear includes a large number of such bindings files for a variety of manufacturers. Chances are high that your joystick will be recognised straight away, so let's try that first. You can confirm whether it was recognised by looking in the &amp;lt;tt&amp;gt;Help &amp;gt; Joystick Configuration&amp;lt;/tt&amp;gt; dialog. &amp;quot;Used for&amp;quot; should contain a name/description of your joystick. It will contain &amp;quot;default&amp;quot; when FlightGear did not recognise your joystick.&lt;br /&gt;
&lt;br /&gt;
Most of the time when your joystick is not recognised, it is because of a missing name definition in the respective bindings file. Because FlightGear is used on all kind of operating systems, names vary a lot. You can find the files under &amp;lt;tt&amp;gt;[[$FG_ROOT]]/Input/Joysticks/&amp;lt;/tt&amp;gt; (despite the name, yokes and pedals are also found here!). For example, if you have a CH Products joystick, look in the folder &amp;lt;tt&amp;gt;[[$FG_ROOT]]/Input/Joysticks/CH&amp;lt;/tt&amp;gt; for a file that might work for your joystick. When such a file exists, do the following:&lt;br /&gt;
# Launch FlightGear with the joystick connected.&lt;br /&gt;
# Look under Help &amp;gt; Joystick Configuration and check the name behind &amp;quot;Joystick #0:&amp;quot;. &lt;br /&gt;
# Open your joystick's bindings file in a XML editor and add the following code to the file, below the already-present &amp;lt;code&amp;gt;&amp;lt;name&amp;gt;&amp;lt;/code&amp;gt; tags.&lt;br /&gt;
# &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;name&amp;gt;The EXACT name you found under step 2; including spaces, capitals etc.&amp;lt;/name&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Please report this name [http://forum.flightgear.org/viewforum.php?f=24 at our forum], so it can be added to the official file (and next releases).&lt;br /&gt;
&lt;br /&gt;
Please note that the latest config files are always to be found at {{fgdata file|Input/Joysticks}}. This link may contain additional binding files that were not included in the latest stable release.&lt;br /&gt;
&lt;br /&gt;
If there is no file for your joystick, you will have to create such a file. We will discuss that in [[Joystick#Writing or editing joystick binding xml files|a later section]], by cutting and pasting bindings from the examples that are included with FlightGear.&lt;br /&gt;
&lt;br /&gt;
=== Multiple devices on Windows ===&lt;br /&gt;
In case you have two USB devices (for instance a yoke plus pedals) to a Windows computer, there may be cases, where the same driver name is reported twice. In this case, you can get at least the yoke to work by assigning it number 0 (out of 0 and 1), by adding a line to &amp;lt;tt&amp;gt;[[$FG_ROOT]]/joystick.xml&amp;lt;/tt&amp;gt; like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;js n=&amp;quot;0&amp;quot; include=&amp;quot;Input/Joysticks/Saitek/ST290-Pro.xml&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
if you also have pedals (or another joystick), just add more lines, similar to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;js n=&amp;quot;1&amp;quot; include=&amp;quot;Input/Joysticks/Saitek/Pro-Flight-Rudder-Pedals.xml&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make sure that the first input device is indeed the yoke, rotate the yoke ([[aileron]] control) and observe the Help &amp;gt; Joystick Configuration dialog. If the aileron value does not change, you have to make the yoke the preferred device first. For doing so, enter the Windows &amp;quot;Control panel&amp;quot;, open &amp;quot;Game controllers&amp;quot; and select the &amp;quot;Advanced&amp;quot; button. Here you can select the yoke as the &amp;quot;Preferred&amp;quot; device. Afterwards you can check that assignment by restarting FlightGear. The yoke should now control the aileron.&lt;br /&gt;
&lt;br /&gt;
== Adding support for your joystick ==&lt;br /&gt;
=== Verifying your joystick is working ===&lt;br /&gt;
==== Linux ====&lt;br /&gt;
Reboot your system and immediately enter on the [[command line]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmesg | grep Joystick &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which pipes the boot message to grep which then prints every line in the boot message that contains the string “Joystick”. When you do this with a Saitek joystick attached, you will see a line similar to this one: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
input0: USB HID v1.00 Joystick [SAITEK CYBORG 3D USB] on usb2:3.0 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line tells us that a joystick has identified itself as SAITEK CYBORG 3D USB to the operating system. It does not tell us that the joystick driver sees your joystick.  You can verify that the joystick driver sees the joystick by entering:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
js_demo &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your joystick is not recognized by the driver, you may have to manually load the joystick device module with the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
modprobe joydev&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
Go to &amp;lt;tt&amp;gt;Start &amp;gt; Control Panel &amp;gt; Game Controller&amp;lt;/tt&amp;gt; and see whether the dialog displays (and responses) on your joystick. &lt;br /&gt;
&lt;br /&gt;
=== Confirming that the driver recognizes your joystick ===&lt;br /&gt;
FlightGear ships with a utility called js_demo. It will report the number of joysticks attached to a system, their respective &amp;quot;names&amp;quot; and their capabilities. Under Linux, you can run js_demo from the folder /FlightGear/bin as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd /usr/local/FlightGear/bin &lt;br /&gt;
$ js_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Under Windows, open a command shell (&amp;lt;tt&amp;gt;Start &amp;gt; All Programs &amp;gt; Accessories &amp;gt; Command Prompt&amp;lt;/tt&amp;gt;), go to the FlightGear binary folder and start the program as follows (given FlightGear is installed under &amp;lt;tt&amp;gt;C:/Program Files/Flightgear&amp;lt;/tt&amp;gt;) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
C:&lt;br /&gt;
cd /Program Files/FlightGear/bin/win32 &lt;br /&gt;
js_demo.exe &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--If js_demo.exe is not included in your version, download it [http://fgfs.beggabaur.de/forum/js_demo.exe here].--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On our system, the first few lines of output are (stop the program with C if it is quickly scrolling past your window!) as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
Joystick test program. &lt;br /&gt;
Joystick 0: “CH PRODUCTS CH FLIGHT SIM YOKE USB ” &lt;br /&gt;
Joystick 1: “CH PRODUCTS CH PRO PEDALS USB” &lt;br /&gt;
Joystick 2 not detected &lt;br /&gt;
Joystick 3 not detected &lt;br /&gt;
Joystick 4 not detected &lt;br /&gt;
Joystick 5 not detected &lt;br /&gt;
Joystick 6 not detected &lt;br /&gt;
Joystick 7 not detected &lt;br /&gt;
+——————–JS.0———————-+——————–JS.1———————-+ &lt;br /&gt;
| Btns Ax:0 Ax:1 Ax:2 Ax:3 Ax:4 Ax:5 Ax:6 | Btns Ax:0 Ax:1 Ax:2 | &lt;br /&gt;
+———————————————-+———————————————-+ &lt;br /&gt;
| 0000 +0.0 +0.0 +1.0 -1.0 -1.0 +0.0 +0.0 . | 0000 -1.0 -1.0 -1.0 . . . . . | &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First note that js demo reports which number is assigned to each joystick recognized by the driver. Also, note that the “name” each joystick reports is also included between quotes. We will need the names for each bindings file when we begin writing the binding xml files for each joystick.&lt;br /&gt;
&lt;br /&gt;
=== Identifying the numbering of axes and buttons ===&lt;br /&gt;
Axis and button numbers can be identified using js demo as follows. By observing the output of js demo while working your joystick axes and buttons you can determine what axis and button numbers are assigned to each joystick axis and button. It should be noted that numbering generally starts with zero. &lt;br /&gt;
&lt;br /&gt;
The buttons are handled internally as a binary number in which bit 0 (the least significant bit) represents button 0, bit 1 represents button 1, etc., but this number is displayed on the screen in hexadecimal notation, so: &lt;br /&gt;
&lt;br /&gt;
* 0001 ⇒ button 0 pressed &lt;br /&gt;
* 0002 ⇒ button 1 pressed &lt;br /&gt;
* 0004 ⇒ button 2 pressed &lt;br /&gt;
* 0008 ⇒ button 3 pressed &lt;br /&gt;
* 0010 ⇒ button 4 pressed &lt;br /&gt;
* 0020 ⇒ button 5 pressed &lt;br /&gt;
* 0040 ⇒ button 6 pressed &lt;br /&gt;
* ... etcp to ... &lt;br /&gt;
* 8000 ⇒ button 15 pressed &lt;br /&gt;
* ... and ... &lt;br /&gt;
* 0014 ⇒ buttons 2 and 4 pressed simultaneously &lt;br /&gt;
* ... etc. &lt;br /&gt;
&lt;br /&gt;
For Linux users, there is another option for identifying the “name” and the numbers assigned to each axis and button. Most Linux distributions include a very handy program, “jstest”. With a CH Product Yoke plugged into the system, the following output lines are displayed by jstest: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
jstest /dev/js3 &lt;br /&gt;
Joystick (CH PRODUCTS CH FLIGHT SIM YOKE USB ) has 7 axes and 12 buttons. Driver version is 2.1.0 &lt;br /&gt;
Testing…(interrupt to exit) &lt;br /&gt;
Axes: 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 Buttons: 0:off 1:off 2:off 3:on 4:off 5:off 6:off 7:off 8:off 9:off 10:off 11:off &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the “name” between parentheses. This is the name the system associates with your joystick. &lt;br /&gt;
&lt;br /&gt;
When you move any control, the numbers change after the axis number corresponding to that moving control and when you depress any button, the “off” after the button number corresponding to the button pressed changes to “on”. In this way, you can quickly write down the axes numbers and button numbers for each function without messing with binary.&lt;br /&gt;
&lt;br /&gt;
In most modern repositories, there is a graphical version of this program, called &amp;quot;jstest-gtk&amp;quot;, where you are given a list of attached devices to choose from, and then get a graphical representation of all axes and buttons.&lt;br /&gt;
&lt;br /&gt;
=== Calibration ===&lt;br /&gt;
For many/most joysticks this step might not be necessary.  If either, the centre position of the joystick does not yield near-zero values for relevant axes, or if the maximum value for an axis cannot be reached, or is reached too early, you need to calibrate the joystick. (Note that some calibration problems can be fixed with the flighgear joystick configuration files, but not all, e.g. if the maximum value is reached too early)&lt;br /&gt;
&lt;br /&gt;
==== Linux ====&lt;br /&gt;
The program &amp;quot;jscal&amp;quot; (install from repositories if not already available on your system) provides a calibration routine for joysticks.  You need to know or find out the device name of your joystick (usually /dev/js0  or /dev/input/js0 - instead of 0 a different number might need to be used, look at output of js_demo to figure out which). For example to calibrate the joystick with device name /dev/input/js0, execute&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;jscal -c /dev/input/js0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and follow instructions.&lt;br /&gt;
The calibration is retained until the joystick is unplugged, or the computer rebooted.  In order to save it for future use, execute &lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;jscal -p /dev/input/js0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which will print the command that needs to be entered to restore the calibration, for example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;jscal -s 6,1,0,8171,8171,65936,65374,1,0,8166,8166,65928,65494,1,0,128,128,4194176,4227201,1,0,128,128,4194176,4227201,1,0,0,0,536854528,536854528,1,0,0,0,536854528,536854528 /dev/input/js0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Copy the command you obtained into your startup script in order to restore calibration automatically.&lt;br /&gt;
&lt;br /&gt;
Recent versions of jscal have this simplified, you can store and restore your calibration settings.&lt;br /&gt;
After calibration store the settings:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;jscal-store /dev/input/js0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then in your startup script recall the settings for the given device:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;jscal-restore /dev/input/js0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However if you have multiple controllers connected, they might be renumbered on pluging/repluging. Best way to insure you get the correct calibration is to create a custom '''udev''' rule-set that you put into /etc/udev/rules.d/00-joystick.rules, similar to the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#joystick rules to make the names persistent and reload the stored calibration profile&lt;br /&gt;
ACTION!=&amp;quot;add|change&amp;quot;, GOTO=&amp;quot;joystick_end&amp;quot;&lt;br /&gt;
SUBSYSTEM!=&amp;quot;input&amp;quot;, GOTO=&amp;quot;joystick_end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KERNEL==&amp;quot;js*&amp;quot;, ATTRS{idProduct}==&amp;quot;a02f&amp;quot;, ATTRS{idVendor}==&amp;quot;12bd&amp;quot;, SYMLINK+=&amp;quot;input/joystick&amp;quot; RUN+=&amp;quot;/etc/udev/scripts/joycal.sh&amp;quot;&lt;br /&gt;
KERNEL==&amp;quot;js*&amp;quot;, ATTRS{name}==&amp;quot;Logitech Logitech Racing Wheel&amp;quot;, SYMLINK+=&amp;quot;input/logiwheel&amp;quot; RUN+=&amp;quot;/etc/udev/scripts/wheelcal.sh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;joystick_end&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the scripts called would be as follows:&lt;br /&gt;
*/etc/udev/scripts/joycal.sh:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
jscal-restore /dev/input/joystick&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*/etc/udev/scripts/wheelcal.sh&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
jscal-restore /dev/input/logiwheel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now each time you plug/replug your joysticks/controllers they will get the persistent device names, and will get the correct calibration profile restored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The calibration is even more comfortable using the program &amp;quot;jstest-gtk&amp;quot;, also available from most repositories. Starting this you are given a list of all attached joysticks with their device names. Pick the one you wish to inspect or calibrate and click 'Properties', then calibrate.  This calibration tool offers the possibility to fine-tune the calibration by editing the numbers. The program manipulates the same internals as jscal so you can use jscal to save the calibration information for later use, as before.&lt;br /&gt;
&lt;br /&gt;
=== Writing or editing joystick binding xml files ===&lt;br /&gt;
At this point, you have confirmed that the operating system and the joystick driver both recognize your joystick(s). You also know of several ways to identify the joystick “name” your joystick reports to the driver and operating system. You will need a written list of what control functions you wish to have assigned to which axis and button and the corresponding numbers. &lt;br /&gt;
&lt;br /&gt;
Make the following table from what you learned from js demo or jstest above (pencil and paper is fine). Here we assume there are 5 axes including 2 axes associated with the hat. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot; bgcolor=&amp;quot;#EFEFEF&amp;quot; | Axis&lt;br /&gt;
! align=&amp;quot;center&amp;quot; bgcolor=&amp;quot;#EFEFEF&amp;quot; | Button&lt;br /&gt;
|- &lt;br /&gt;
|elevator = 0 &lt;br /&gt;
|view cycle = 0  &lt;br /&gt;
|- &lt;br /&gt;
|rudder = 1  &lt;br /&gt;
|all brakes = 1  &lt;br /&gt;
|- &lt;br /&gt;
|aileron = 2  &lt;br /&gt;
|up trim = 2  &lt;br /&gt;
|- &lt;br /&gt;
|throttle = 3  &lt;br /&gt;
|down trim = 3  &lt;br /&gt;
|-&lt;br /&gt;
|leftright hat = 4 &lt;br /&gt;
|extend flaps = 4 &lt;br /&gt;
|- &lt;br /&gt;
|foreaft hat = 5  &lt;br /&gt;
|retract flaps = 5 &lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|decrease RPM = 6 &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|increase RPM = 7 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We will assume that our hypothetical joystick supplies the “name” QUICK STICK 3D USB to the system and driver. With all the examples included with FlightGear, the easiest way to get a so far unsupported joystick to be auto detected, is to edit an existing binding xml file. Look at the xml files in the sub-folders of '''/FlightGear/Input/Joysticks/'''. After evaluating several of the xml binding files supplied with FlightGear, we decide to edit the file &amp;lt;tt&amp;gt;[[$FG_ROOT]]/Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This file has all the axes functions above assigned to axes and all the button functions above assigned to buttons. This makes our editing almost trivial. &lt;br /&gt;
&lt;br /&gt;
Before we begin to edit, we need to choose a name for our bindings xml file, create the folder for the QS joysticks, and copy the original xml file into this directory with this name. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd /usr/local/FlightGear/Input/Joysticks &lt;br /&gt;
$ mkdir QS &lt;br /&gt;
$ cd QS &lt;br /&gt;
$ cp /usr/local/FlightGear/Input/Joysticks/Saitek/ &lt;br /&gt;
Cyborg-Gold-3d-USB.xml QuickStick.xml &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, we obviously have supposed a Linux/UNIX system with FlightGear being installed under '''/usr/local/FlightGear'''. For a similar procedure under Windows with FlightGear being installed under C:/Program Files/FlightGear, open a command shell and type &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
C: &lt;br /&gt;
cd /Program Files/FlightGear/Input/Joysticks &lt;br /&gt;
mkdir QS &lt;br /&gt;
cd QS &lt;br /&gt;
copy /Program Files/FlightGear/Input/Joysticks/Saitek/ &lt;br /&gt;
Cyborg-Gold-3d-USB.xml QuickStick.xml &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, open QuickStick.xml with your favorite editor. Before we forget to change the joystick name, search for the line containing &amp;lt;name&amp;gt;. You should find the line &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;name&amp;gt;SAITEK CYBORG 3D USB&amp;lt;/name&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and change it to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;name&amp;gt;QUICK STICK 3D USB&amp;lt;/name&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line illustrates a key feature of xml statements. They begin with a &amp;lt;tag&amp;gt; and end with a &amp;lt;/tag&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
You can now compare your table to the comment table at the top of your file copy. Note that the comments tell us that the Saitek elevator was assigned to axis 1. Search for the string &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;axis n=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and change this to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;axis n=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, note that the Saitek rudder was assigned to axis 2. Search for the string &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;axis n=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and change this to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;axis n=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continue comparing your table with the comment table for the Saitek and changing the axis numbers and button numbers accordingly. Since QUICKSTICK USB and the Saitek have the same number of axes but different number of buttons, you must delete the buttons left over. Just remember to double check that you have a closing tag for each opening tag or you will get an error using the file. &lt;br /&gt;
&lt;br /&gt;
Finally, be good to yourself (and others when you submit your new binding file to a FlightGear developers or users archive!), take the time to change the comment table in the edited file to match your changed axis and button assignments. The new comments should match the table you made from the js demo output. Save your edits. &lt;br /&gt;
&lt;br /&gt;
Several users have reported that the numbers of axes and buttons assigned to functions may be different with the same joystick under Windows and Linux. The above procedure should allow one to easily change a binding xml file created for a different operating system for use by their operating system.&lt;br /&gt;
&lt;br /&gt;
You can tell how FlightGear has interpretted your joystick setup by selecting &amp;lt;tt&amp;gt;Help &amp;gt; Joystick Configuration&amp;lt;/tt&amp;gt; from the menu.&lt;br /&gt;
&lt;br /&gt;
== Joystick support via .fgfsrc entries ==&lt;br /&gt;
Fortunately, there is a tool available now, which takes most of the burden from the average user who, maybe, is not that experienced with XML, the language which these files are written in. &lt;br /&gt;
&lt;br /&gt;
For configuring your joystick using this approach, open a command shell (command prompt under windows, to be found under Start|All programs|Accessories). Change to the directory &amp;lt;tt&amp;gt;[[$FG_ROOT]]/bin&amp;lt;/tt&amp;gt; via e.g. (modify to your path) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;dos&amp;quot;&amp;gt;cd C:/Program Files/FlightGear/bin&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and invoke the tool fgjs via &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./fgjs --fg-root=$FG_ROOT&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on a UNIX/Linux machine, or via &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;dos&amp;quot;&amp;gt;fgjs --fg-root=$FG_ROOT&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on a Windows machine. The program will tell you which joysticks, if any, were detected. Now follow the commands given on screen, i.eṁove the axis and press the buttons as required. Be careful, a minor touch already “counts” as a movement. Check the reports on screen. If you feel something went wrong, just re-start the program. &lt;br /&gt;
&lt;br /&gt;
After you are done with all the axis and switches, the directory above will hold a file called fgfsrc.js. If the FlightGear base directory FlightGear does not already contain an options file .fgfsrc (under UNIX)/system.fgfsrc (under Windows) mentioned above, just copy &lt;br /&gt;
&lt;br /&gt;
'''fgfsrc.js''' into '''.fgfsrc''' (UNIX)/'''system.fgfsrc''' (Windows) &lt;br /&gt;
&lt;br /&gt;
and place it into the directory FlightGear base directory FlightGear. In case you already wrote an options file, just open it as well as fgfsrc.js with an editor and copy the entries from fgfsrc.js into .fgfsrc/system.fgfsrc. One hint: The output of fgjs is UNIX formatted. As a result, Windows Editor may not display it the proper way. I suggest getting an editor being able to handle UNIX files as well, for example [https://notepad-plus-plus.org/ Notepad++]. &amp;lt;!-- My favorite freeware file editor for that purpose, although somewhat dated, is still PFE, to be obtained from http://www.lancs.ac.uk/people/cpaap/pfe/. --&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The the axis/button assignment of fgjs should, at least, get the axis assignments right, its output may need some tweaking. There may be axes moving the opposite way they should, the dead zones may be too small etc. For instance, I had to change &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--prop:/input/joysticks/js[1]/axis[1]/binding/factor=-1.0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--prop:/input/joysticks/js[1]/axis[1]/binding/factor=1.0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(USB CH Flightsim Yoke under Windows XP). Thus, here is a short introduction into the assignments of joystick properties. &lt;br /&gt;
&lt;br /&gt;
Basically, all axes settings are specified via lines having the following structure: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--prop:/input/joysticks/js[n]/axis[m]/binding/command=property-scale &lt;br /&gt;
--prop:/input/joysticks/js[n]/axis[m]/binding/property=/controls/steering option&lt;br /&gt;
--prop:/input/joysticks/js[n]/axis[m]/binding/dead-band=db&lt;br /&gt;
--prop:/input/joysticks/js[n]/axis[m]/binding/offset=os&lt;br /&gt;
--prop:/input/joysticks/js[n]/axis[m]/binding/factor=fa&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot; bgcolor=&amp;quot;#EFEFEF&amp;quot; | &lt;br /&gt;
! align=&amp;quot;center&amp;quot; bgcolor=&amp;quot;#EFEFEF&amp;quot; | &lt;br /&gt;
|- &lt;br /&gt;
|n&lt;br /&gt;
|number of device (usually starting with 0)  &lt;br /&gt;
|-&lt;br /&gt;
|m&lt;br /&gt;
|number of axis (usually starting with 0)&lt;br /&gt;
|-&lt;br /&gt;
|steering option&lt;br /&gt;
|elevator, aileron, rudder, throttle, mixture, pitch  &lt;br /&gt;
|-&lt;br /&gt;
|dead-band&lt;br /&gt;
|range, within which signals are discarded; useful to avoid jittering for minor yoke movements&lt;br /&gt;
|-&lt;br /&gt;
|offset&lt;br /&gt;
|specifies, if device not centered in its neutral position &lt;br /&gt;
|-&lt;br /&gt;
|factor&lt;br /&gt;
|controls sensitivity of that axis; defaults to +1, with a value of -1 reversing the behavior &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You should be able to at least get your joystick working along these lines. Concerning all the finer points, for instance, getting the joystick buttons working, John Check has written a very useful README being included in the base package to be found under '''FlightGear/Docs/Readme/Joystick.html'''. In case of any trouble with your input device, it is highly recommended to have a look into this document.&lt;br /&gt;
&lt;br /&gt;
== More about programming joystick XML files ==&lt;br /&gt;
=== General tips ===&lt;br /&gt;
* When testing a new xml file it is best to start FlightGear via a command window (rather than the GUI interface). Any error messages will then be displayed in the terminal. Error messages will give both a message and a line number, helping you pinpoint any errors.&lt;br /&gt;
* Errors can be detected on initial startup or at runtime. Both types of errors will be displayed in the terminal.&lt;br /&gt;
* One of the most common errors is including a character that makes XML choke. Such characters include&amp;lt;br&amp;gt;&amp;amp; &amp;lt; --&amp;lt;br&amp;gt;These characters will cause problems even if simply included in comments or within scripts.&lt;br /&gt;
* If your scripts contain any of these characters, you have to enclose the scripts in &amp;lt;script&amp;gt;&amp;lt;![CDATA[...]]&amp;gt;&amp;lt;/script&amp;gt;. Alternatively, you can 'escape' the characters, ie &amp;quot;&amp;lt;&amp;quot; becomes &amp;quot;&amp;amp;amp;lt;&amp;quot;.&lt;br /&gt;
* You can reload your edited joystick file without restarting FlightGear by selecting &amp;quot;Debug&amp;quot; &amp;amp;gt; &amp;quot;Reload Input&amp;quot; from the main simulator window.&lt;br /&gt;
* You can find many examples of different ways to program joysticks simply by examining the joystick xml files that are packaged with FlightGear. See the directory FlightGear/data/input/joysticks&lt;br /&gt;
* Many advanced functions can be programmed using the Nasal scripting language. These scripts are enclosed in &amp;lt;script&amp;gt;&amp;lt;/script&amp;gt; tags in the XML file. Helpful:&lt;br /&gt;
** A guide to the [[Nasal scripting language]] in FlightGear &lt;br /&gt;
** [[Nasal FAQ]]&lt;br /&gt;
** [[Howto: Write simple scripts in Nasal]]&lt;br /&gt;
* You can explore the internal property tree to see many variables that can be altered using joystick buttons or axes (File/Browse Internal Properties)&lt;br /&gt;
* You can test bits of Nasal code and do some other useful things using the Nasal Console (Debug/Nasal Console).&lt;br /&gt;
* All Nasal code shares a common namespace, so it's possible to set a variable in one nasal binding, and to read it in another.&lt;br /&gt;
&lt;br /&gt;
=== Useful hints for scripts ===&lt;br /&gt;
Some particularly useful ideas for programming scripts within joystick XML files:&lt;br /&gt;
* getprop and setprop can be used for getting &amp;amp; setting properties from the internal properties tree:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
var brake = !getprop(&amp;quot;/controls/gear/brake-parking&amp;quot;);&lt;br /&gt;
setprop(&amp;quot;/controls/gear/brake-parking&amp;quot;, brake);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* You can also make your own values on the property tree:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
setprop(&amp;quot;/input/joysticks/js[0]/myjoystick-modifier&amp;quot;, 1);&lt;br /&gt;
var mod = getprop(&amp;quot;/input/joysticks/js[0]/myjoystick-modifier&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* You can print to terminal using the print function. This is very useful for debugging.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
print(&amp;quot;Just&amp;quot;, &amp;quot; a &amp;quot;, &amp;quot;test&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* You can display info in FlightGear via a popup. This is useful for giving the user feedback about changes that may not be obvious via the panel. It can also be useful for debugging. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
gui.popupTip(&amp;quot;Parking Brake ON&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments for gui.popupTip must be strings, so if you want to display other types of variables they should be formatted with something like sprintf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
gui.popupTip(sprintf(&amp;quot;Elevator trim: %d&amp;quot;, 100 * getprop(&amp;quot;/controls/flight/elevator-trim&amp;quot;)));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
thv = getprop(&amp;quot;/controls/engines/engine[0]/mixture&amp;quot;);&lt;br /&gt;
gui.popupTip(&amp;quot;Thrust vector &amp;quot; ~ int(thv * 120 - 20));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* You can just start using variables, ie,&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
x = 10;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But [http://wiki.flightgear.org/index.php/Nasal_scripting_language#Variables for various reasons] it is generally better to declare variables with the &amp;quot;var&amp;quot; statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
var x = 10;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that &amp;quot;var&amp;quot; creates variables that are local in scope, but since all bindings for a joystick share the same scope, it will be seen across each script in the joystick file.&lt;br /&gt;
&lt;br /&gt;
* You can include a section of script that runs on startup to initialize variables, create functions, etc. Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;PropertyList&amp;gt;&lt;br /&gt;
  &amp;lt;name type=&amp;quot;string&amp;quot;&amp;gt;My joystick name&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;name type=&amp;quot;string&amp;quot;&amp;gt;My joystick name #2&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;nasal&amp;gt;&lt;br /&gt;
    &amp;lt;script&amp;gt;&lt;br /&gt;
       #initialize variables&lt;br /&gt;
       f1 = f2 = 0;&lt;br /&gt;
       left_brake = right_brake = 0;&lt;br /&gt;
       # create a function to be used with all buttons&lt;br /&gt;
       getmod = func { getprop(&amp;quot;/input/joysticks/js[0]/t-flight-hotas-x-modifier&amp;quot; ) }&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/nasal&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sample code for firing weapons with the joystick is found on the [[Gun Effects]] page.&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
{{Forum|24|Hardware}}&lt;br /&gt;
* [[Head tracking]]&lt;br /&gt;
* [[Joystick xml library]] &lt;br /&gt;
* [[Force feedback]]&lt;br /&gt;
* [[Troubleshooting input devices]]&lt;br /&gt;
* [[Writing Joystick Code: Part 1]]&lt;br /&gt;
* [[Writing Joystick Code: Part 2]]&lt;br /&gt;
* [[Writing Joystick Code: Part 3]]&lt;br /&gt;
* [[Writing Joystick Code: Part 4]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://www.flightgear.org/Docs/getstart/getstartch3.html#x8-360003.6 The FlightGear Manual]&lt;br /&gt;
* [http://sourceforge.net/projects/hapticsforfg/ Force Feedback]&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;br /&gt;
[[Category:Joysticks and Yokes]]&lt;br /&gt;
&lt;br /&gt;
[[de:Joystick]]&lt;br /&gt;
[[es:Joystick]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Input_device&amp;diff=114656</id>
		<title>Input device</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Input_device&amp;diff=114656"/>
		<updated>2018-03-09T14:33:27Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Related content */Added a few links to Wiki 'Writing Joystick Code'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Could you imagine a pilot in his or her [[:Category:Cessna|Cessna]] controlling the machine with a keyboard alone? For getting the proper feeling of flight you will need a '''joystick/yoke''' plus [[rudder]] pedals, right? &lt;br /&gt;
&lt;br /&gt;
FlightGear has integrated joystick support, which automatically detects any joystick, yoke, or pedals attached. Just try it! If this does work for you, lean back and be happy! You can see what FlightGear has detected your joystick as in the Help &amp;gt; Joystick Configuration dialog from the [[menu]]. &lt;br /&gt;
&lt;br /&gt;
Unfortunately, for the above mentioned versatility, chances are your joystick does not work out of the box. This article explains you how to make FlightGear recognise your device&lt;br /&gt;
&lt;br /&gt;
== Joystick or yoke? ==&lt;br /&gt;
{| cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;right&amp;quot; style=&amp;quot;clear:right; background:#fafafa; font-size: 85%; border: 1px solid #CCCCCC;&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
| [[File:CH Products Fighterstick USB.jpg|x199px|CH Products Fighterstick USB]]&lt;br /&gt;
| [[File:Saitek Pro Flight Cessna Yoke front.jpg|300px|Saitek Pro Flight Cessna Yoke]]&lt;br /&gt;
|-&lt;br /&gt;
| CH Products Fighterstick USB&lt;br /&gt;
| Saitek Pro Flight Cessna Yoke&lt;br /&gt;
|}&lt;br /&gt;
The two most common control devices on aircraft are the joystick (left picture) and yoke (right picture). Joysticks can be found on military fighters, helicopters and Airbus [[airliner]]s, while yokes are used on almost all other fixed wing aircraft, including Boeing airliners.&lt;br /&gt;
&lt;br /&gt;
Joysticks are generally a lot cheaper, starting at $10. Yokes start at $100. When you are new to flightsimming, buying a cheap (ca. $20) joystick might be a good way to find out if it's something for you.&lt;br /&gt;
&lt;br /&gt;
The following table should help you decide which one is best suited for you:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! Joystick&lt;br /&gt;
! Yoke&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | Price&lt;br /&gt;
| $10+&lt;br /&gt;
| $100+&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | General aviation&lt;br /&gt;
| {{no}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | Gliders&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{no}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | Helicopter&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{no}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | Fighters&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{no}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | Most airliners including Boeing&lt;br /&gt;
| {{no}}&lt;br /&gt;
| {{yes}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align:left;&amp;quot; | Airbus&lt;br /&gt;
| {{yes}}&lt;br /&gt;
| {{no}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It should be noted that any type of input device (be it a joystick, a yoke or even a gamepad) will work with '''all''' aircraft in FlightGear and that the table above only suggests which ones are more suited to specific types of aircraft given how they are flown in real life.&lt;br /&gt;
&lt;br /&gt;
Some reviews of flight simulation hardware can be found in [[:Category:Hardware reviews]].&lt;br /&gt;
&lt;br /&gt;
== Built-in joystick support ==&lt;br /&gt;
In order for joystick auto-detection to work, a joystick bindings xml file must exist for each joystick. This file describes what axes and buttons are to be used to control which functions in FlightGear. The associations between functions and axes or buttons are called &amp;quot;bindings&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
FlightGear includes a large number of such bindings files for a variety of manufacturers. Chances are high that your joystick will be recognised straight away, so let's try that first. You can confirm whether it was recognised by looking in the &amp;lt;tt&amp;gt;Help &amp;gt; Joystick Configuration&amp;lt;/tt&amp;gt; dialog. &amp;quot;Used for&amp;quot; should contain a name/description of your joystick. It will contain &amp;quot;default&amp;quot; when FlightGear did not recognise your joystick.&lt;br /&gt;
&lt;br /&gt;
Most of the time when your joystick is not recognised, it is because of a missing name definition in the respective bindings file. Because FlightGear is used on all kind of operating systems, names vary a lot. You can find the files under &amp;lt;tt&amp;gt;[[$FG_ROOT]]/Input/Joysticks/&amp;lt;/tt&amp;gt; (despite the name, yokes and pedals are also found here!). For example, if you have a CH Products joystick, look in the folder &amp;lt;tt&amp;gt;[[$FG_ROOT]]/Input/Joysticks/CH&amp;lt;/tt&amp;gt; for a file that might work for your joystick. When such a file exists, do the following:&lt;br /&gt;
# Launch FlightGear with the joystick connected.&lt;br /&gt;
# Look under Help &amp;gt; Joystick Configuration and check the name behind &amp;quot;Joystick #0:&amp;quot;. &lt;br /&gt;
# Open your joystick's bindings file in a XML editor and add the following code to the file, below the already-present &amp;lt;code&amp;gt;&amp;lt;name&amp;gt;&amp;lt;/code&amp;gt; tags.&lt;br /&gt;
# &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;name&amp;gt;The EXACT name you found under step 2; including spaces, capitals etc.&amp;lt;/name&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Please report this name [http://forum.flightgear.org/viewforum.php?f=24 at our forum], so it can be added to the official file (and next releases).&lt;br /&gt;
&lt;br /&gt;
Please note that the latest config files are always to be found at {{fgdata file|Input/Joysticks}}. This link may contain additional binding files that were not included in the latest stable release.&lt;br /&gt;
&lt;br /&gt;
If there is no file for your joystick, you will have to create such a file. We will discuss that in [[Joystick#Writing or editing joystick binding xml files|a later section]], by cutting and pasting bindings from the examples that are included with FlightGear.&lt;br /&gt;
&lt;br /&gt;
=== Multiple devices on Windows ===&lt;br /&gt;
In case you have two USB devices (for instance a yoke plus pedals) to a Windows computer, there may be cases, where the same driver name is reported twice. In this case, you can get at least the yoke to work by assigning it number 0 (out of 0 and 1), by adding a line to &amp;lt;tt&amp;gt;[[$FG_ROOT]]/joystick.xml&amp;lt;/tt&amp;gt; like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;js n=&amp;quot;0&amp;quot; include=&amp;quot;Input/Joysticks/Saitek/ST290-Pro.xml&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
if you also have pedals (or another joystick), just add more lines, similar to:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;js n=&amp;quot;1&amp;quot; include=&amp;quot;Input/Joysticks/Saitek/Pro-Flight-Rudder-Pedals.xml&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make sure that the first input device is indeed the yoke, rotate the yoke ([[aileron]] control) and observe the Help &amp;gt; Joystick Configuration dialog. If the aileron value does not change, you have to make the yoke the preferred device first. For doing so, enter the Windows &amp;quot;Control panel&amp;quot;, open &amp;quot;Game controllers&amp;quot; and select the &amp;quot;Advanced&amp;quot; button. Here you can select the yoke as the &amp;quot;Preferred&amp;quot; device. Afterwards you can check that assignment by restarting FlightGear. The yoke should now control the aileron.&lt;br /&gt;
&lt;br /&gt;
== Adding support for your joystick ==&lt;br /&gt;
=== Verifying your joystick is working ===&lt;br /&gt;
==== Linux ====&lt;br /&gt;
Reboot your system and immediately enter on the [[command line]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmesg | grep Joystick &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which pipes the boot message to grep which then prints every line in the boot message that contains the string “Joystick”. When you do this with a Saitek joystick attached, you will see a line similar to this one: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
input0: USB HID v1.00 Joystick [SAITEK CYBORG 3D USB] on usb2:3.0 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line tells us that a joystick has identified itself as SAITEK CYBORG 3D USB to the operating system. It does not tell us that the joystick driver sees your joystick.  You can verify that the joystick driver sees the joystick by entering:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
js_demo &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your joystick is not recognized by the driver, you may have to manually load the joystick device module with the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
modprobe joydev&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
Go to &amp;lt;tt&amp;gt;Start &amp;gt; Control Panel &amp;gt; Game Controller&amp;lt;/tt&amp;gt; and see whether the dialog displays (and responses) on your joystick. &lt;br /&gt;
&lt;br /&gt;
=== Confirming that the driver recognizes your joystick ===&lt;br /&gt;
FlightGear ships with a utility called js_demo. It will report the number of joysticks attached to a system, their respective &amp;quot;names&amp;quot; and their capabilities. Under Linux, you can run js_demo from the folder /FlightGear/bin as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd /usr/local/FlightGear/bin &lt;br /&gt;
$ js_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Under Windows, open a command shell (&amp;lt;tt&amp;gt;Start &amp;gt; All Programs &amp;gt; Accessories &amp;gt; Command Prompt&amp;lt;/tt&amp;gt;), go to the FlightGear binary folder and start the program as follows (given FlightGear is installed under &amp;lt;tt&amp;gt;C:/Program Files/Flightgear&amp;lt;/tt&amp;gt;) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
C:&lt;br /&gt;
cd /Program Files/FlightGear/bin/win32 &lt;br /&gt;
js_demo.exe &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--If js_demo.exe is not included in your version, download it [http://fgfs.beggabaur.de/forum/js_demo.exe here].--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On our system, the first few lines of output are (stop the program with C if it is quickly scrolling past your window!) as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
Joystick test program. &lt;br /&gt;
Joystick 0: “CH PRODUCTS CH FLIGHT SIM YOKE USB ” &lt;br /&gt;
Joystick 1: “CH PRODUCTS CH PRO PEDALS USB” &lt;br /&gt;
Joystick 2 not detected &lt;br /&gt;
Joystick 3 not detected &lt;br /&gt;
Joystick 4 not detected &lt;br /&gt;
Joystick 5 not detected &lt;br /&gt;
Joystick 6 not detected &lt;br /&gt;
Joystick 7 not detected &lt;br /&gt;
+——————–JS.0———————-+——————–JS.1———————-+ &lt;br /&gt;
| Btns Ax:0 Ax:1 Ax:2 Ax:3 Ax:4 Ax:5 Ax:6 | Btns Ax:0 Ax:1 Ax:2 | &lt;br /&gt;
+———————————————-+———————————————-+ &lt;br /&gt;
| 0000 +0.0 +0.0 +1.0 -1.0 -1.0 +0.0 +0.0 . | 0000 -1.0 -1.0 -1.0 . . . . . | &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First note that js demo reports which number is assigned to each joystick recognized by the driver. Also, note that the “name” each joystick reports is also included between quotes. We will need the names for each bindings file when we begin writing the binding xml files for each joystick.&lt;br /&gt;
&lt;br /&gt;
=== Identifying the numbering of axes and buttons ===&lt;br /&gt;
Axis and button numbers can be identified using js demo as follows. By observing the output of js demo while working your joystick axes and buttons you can determine what axis and button numbers are assigned to each joystick axis and button. It should be noted that numbering generally starts with zero. &lt;br /&gt;
&lt;br /&gt;
The buttons are handled internally as a binary number in which bit 0 (the least significant bit) represents button 0, bit 1 represents button 1, etc., but this number is displayed on the screen in hexadecimal notation, so: &lt;br /&gt;
&lt;br /&gt;
* 0001 ⇒ button 0 pressed &lt;br /&gt;
* 0002 ⇒ button 1 pressed &lt;br /&gt;
* 0004 ⇒ button 2 pressed &lt;br /&gt;
* 0008 ⇒ button 3 pressed &lt;br /&gt;
* 0010 ⇒ button 4 pressed &lt;br /&gt;
* 0020 ⇒ button 5 pressed &lt;br /&gt;
* 0040 ⇒ button 6 pressed &lt;br /&gt;
* ... etcp to ... &lt;br /&gt;
* 8000 ⇒ button 15 pressed &lt;br /&gt;
* ... and ... &lt;br /&gt;
* 0014 ⇒ buttons 2 and 4 pressed simultaneously &lt;br /&gt;
* ... etc. &lt;br /&gt;
&lt;br /&gt;
For Linux users, there is another option for identifying the “name” and the numbers assigned to each axis and button. Most Linux distributions include a very handy program, “jstest”. With a CH Product Yoke plugged into the system, the following output lines are displayed by jstest: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
jstest /dev/js3 &lt;br /&gt;
Joystick (CH PRODUCTS CH FLIGHT SIM YOKE USB ) has 7 axes and 12 buttons. Driver version is 2.1.0 &lt;br /&gt;
Testing…(interrupt to exit) &lt;br /&gt;
Axes: 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 Buttons: 0:off 1:off 2:off 3:on 4:off 5:off 6:off 7:off 8:off 9:off 10:off 11:off &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the “name” between parentheses. This is the name the system associates with your joystick. &lt;br /&gt;
&lt;br /&gt;
When you move any control, the numbers change after the axis number corresponding to that moving control and when you depress any button, the “off” after the button number corresponding to the button pressed changes to “on”. In this way, you can quickly write down the axes numbers and button numbers for each function without messing with binary.&lt;br /&gt;
&lt;br /&gt;
In most modern repositories, there is a graphical version of this program, called &amp;quot;jstest-gtk&amp;quot;, where you are given a list of attached devices to choose from, and then get a graphical representation of all axes and buttons.&lt;br /&gt;
&lt;br /&gt;
=== Calibration ===&lt;br /&gt;
For many/most joysticks this step might not be necessary.  If either, the centre position of the joystick does not yield near-zero values for relevant axes, or if the maximum value for an axis cannot be reached, or is reached too early, you need to calibrate the joystick. (Note that some calibration problems can be fixed with the flighgear joystick configuration files, but not all, e.g. if the maximum value is reached too early)&lt;br /&gt;
&lt;br /&gt;
==== Linux ====&lt;br /&gt;
The program &amp;quot;jscal&amp;quot; (install from repositories if not already available on your system) provides a calibration routine for joysticks.  You need to know or find out the device name of your joystick (usually /dev/js0  or /dev/input/js0 - instead of 0 a different number might need to be used, look at output of js_demo to figure out which). For example to calibrate the joystick with device name /dev/input/js0, execute&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;jscal -c /dev/input/js0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and follow instructions.&lt;br /&gt;
The calibration is retained until the joystick is unplugged, or the computer rebooted.  In order to save it for future use, execute &lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;jscal -p /dev/input/js0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which will print the command that needs to be entered to restore the calibration, for example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;jscal -s 6,1,0,8171,8171,65936,65374,1,0,8166,8166,65928,65494,1,0,128,128,4194176,4227201,1,0,128,128,4194176,4227201,1,0,0,0,536854528,536854528,1,0,0,0,536854528,536854528 /dev/input/js0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Copy the command you obtained into your startup script in order to restore calibration automatically.&lt;br /&gt;
&lt;br /&gt;
Recent versions of jscal have this simplified, you can store and restore your calibration settings.&lt;br /&gt;
After calibration store the settings:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;jscal-store /dev/input/js0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then in your startup script recall the settings for the given device:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;jscal-restore /dev/input/js0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However if you have multiple controllers connected, they might be renumbered on pluging/repluging. Best way to insure you get the correct calibration is to create a custom '''udev''' rule-set that you put into /etc/udev/rules.d/00-joystick.rules, similar to the following example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#joystick rules to make the names persistent and reload the stored calibration profile&lt;br /&gt;
ACTION!=&amp;quot;add|change&amp;quot;, GOTO=&amp;quot;joystick_end&amp;quot;&lt;br /&gt;
SUBSYSTEM!=&amp;quot;input&amp;quot;, GOTO=&amp;quot;joystick_end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KERNEL==&amp;quot;js*&amp;quot;, ATTRS{idProduct}==&amp;quot;a02f&amp;quot;, ATTRS{idVendor}==&amp;quot;12bd&amp;quot;, SYMLINK+=&amp;quot;input/joystick&amp;quot; RUN+=&amp;quot;/etc/udev/scripts/joycal.sh&amp;quot;&lt;br /&gt;
KERNEL==&amp;quot;js*&amp;quot;, ATTRS{name}==&amp;quot;Logitech Logitech Racing Wheel&amp;quot;, SYMLINK+=&amp;quot;input/logiwheel&amp;quot; RUN+=&amp;quot;/etc/udev/scripts/wheelcal.sh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;joystick_end&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the scripts called would be as follows:&lt;br /&gt;
*/etc/udev/scripts/joycal.sh:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
jscal-restore /dev/input/joystick&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*/etc/udev/scripts/wheelcal.sh&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
jscal-restore /dev/input/logiwheel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now each time you plug/replug your joysticks/controllers they will get the persistent device names, and will get the correct calibration profile restored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The calibration is even more comfortable using the program &amp;quot;jstest-gtk&amp;quot;, also available from most repositories. Starting this you are given a list of all attached joysticks with their device names. Pick the one you wish to inspect or calibrate and click 'Properties', then calibrate.  This calibration tool offers the possibility to fine-tune the calibration by editing the numbers. The program manipulates the same internals as jscal so you can use jscal to save the calibration information for later use, as before.&lt;br /&gt;
&lt;br /&gt;
=== Writing or editing joystick binding xml files ===&lt;br /&gt;
At this point, you have confirmed that the operating system and the joystick driver both recognize your joystick(s). You also know of several ways to identify the joystick “name” your joystick reports to the driver and operating system. You will need a written list of what control functions you wish to have assigned to which axis and button and the corresponding numbers. &lt;br /&gt;
&lt;br /&gt;
Make the following table from what you learned from js demo or jstest above (pencil and paper is fine). Here we assume there are 5 axes including 2 axes associated with the hat. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot; bgcolor=&amp;quot;#EFEFEF&amp;quot; | Axis&lt;br /&gt;
! align=&amp;quot;center&amp;quot; bgcolor=&amp;quot;#EFEFEF&amp;quot; | Button&lt;br /&gt;
|- &lt;br /&gt;
|elevator = 0 &lt;br /&gt;
|view cycle = 0  &lt;br /&gt;
|- &lt;br /&gt;
|rudder = 1  &lt;br /&gt;
|all brakes = 1  &lt;br /&gt;
|- &lt;br /&gt;
|aileron = 2  &lt;br /&gt;
|up trim = 2  &lt;br /&gt;
|- &lt;br /&gt;
|throttle = 3  &lt;br /&gt;
|down trim = 3  &lt;br /&gt;
|-&lt;br /&gt;
|leftright hat = 4 &lt;br /&gt;
|extend flaps = 4 &lt;br /&gt;
|- &lt;br /&gt;
|foreaft hat = 5  &lt;br /&gt;
|retract flaps = 5 &lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|decrease RPM = 6 &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|increase RPM = 7 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We will assume that our hypothetical joystick supplies the “name” QUICK STICK 3D USB to the system and driver. With all the examples included with FlightGear, the easiest way to get a so far unsupported joystick to be auto detected, is to edit an existing binding xml file. Look at the xml files in the sub-folders of '''/FlightGear/Input/Joysticks/'''. After evaluating several of the xml binding files supplied with FlightGear, we decide to edit the file &amp;lt;tt&amp;gt;[[$FG_ROOT]]/Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This file has all the axes functions above assigned to axes and all the button functions above assigned to buttons. This makes our editing almost trivial. &lt;br /&gt;
&lt;br /&gt;
Before we begin to edit, we need to choose a name for our bindings xml file, create the folder for the QS joysticks, and copy the original xml file into this directory with this name. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd /usr/local/FlightGear/Input/Joysticks &lt;br /&gt;
$ mkdir QS &lt;br /&gt;
$ cd QS &lt;br /&gt;
$ cp /usr/local/FlightGear/Input/Joysticks/Saitek/ &lt;br /&gt;
Cyborg-Gold-3d-USB.xml QuickStick.xml &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, we obviously have supposed a Linux/UNIX system with FlightGear being installed under '''/usr/local/FlightGear'''. For a similar procedure under Windows with FlightGear being installed under C:/Program Files/FlightGear, open a command shell and type &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;dos&amp;quot;&amp;gt;&lt;br /&gt;
C: &lt;br /&gt;
cd /Program Files/FlightGear/Input/Joysticks &lt;br /&gt;
mkdir QS &lt;br /&gt;
cd QS &lt;br /&gt;
copy /Program Files/FlightGear/Input/Joysticks/Saitek/ &lt;br /&gt;
Cyborg-Gold-3d-USB.xml QuickStick.xml &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, open QuickStick.xml with your favorite editor. Before we forget to change the joystick name, search for the line containing &amp;lt;name&amp;gt;. You should find the line &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;name&amp;gt;SAITEK CYBORG 3D USB&amp;lt;/name&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and change it to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;name&amp;gt;QUICK STICK 3D USB&amp;lt;/name&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line illustrates a key feature of xml statements. They begin with a &amp;lt;tag&amp;gt; and end with a &amp;lt;/tag&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
You can now compare your table to the comment table at the top of your file copy. Note that the comments tell us that the Saitek elevator was assigned to axis 1. Search for the string &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;axis n=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and change this to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;axis n=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, note that the Saitek rudder was assigned to axis 2. Search for the string &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;axis n=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and change this to &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;axis n=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continue comparing your table with the comment table for the Saitek and changing the axis numbers and button numbers accordingly. Since QUICKSTICK USB and the Saitek have the same number of axes but different number of buttons, you must delete the buttons left over. Just remember to double check that you have a closing tag for each opening tag or you will get an error using the file. &lt;br /&gt;
&lt;br /&gt;
Finally, be good to yourself (and others when you submit your new binding file to a FlightGear developers or users archive!), take the time to change the comment table in the edited file to match your changed axis and button assignments. The new comments should match the table you made from the js demo output. Save your edits. &lt;br /&gt;
&lt;br /&gt;
Several users have reported that the numbers of axes and buttons assigned to functions may be different with the same joystick under Windows and Linux. The above procedure should allow one to easily change a binding xml file created for a different operating system for use by their operating system.&lt;br /&gt;
&lt;br /&gt;
You can tell how FlightGear has interpretted your joystick setup by selecting &amp;lt;tt&amp;gt;Help &amp;gt; Joystick Configuration&amp;lt;/tt&amp;gt; from the menu.&lt;br /&gt;
&lt;br /&gt;
== Joystick support via .fgfsrc entries ==&lt;br /&gt;
Fortunately, there is a tool available now, which takes most of the burden from the average user who, maybe, is not that experienced with XML, the language which these files are written in. &lt;br /&gt;
&lt;br /&gt;
For configuring your joystick using this approach, open a command shell (command prompt under windows, to be found under Start|All programs|Accessories). Change to the directory &amp;lt;tt&amp;gt;[[$FG_ROOT]]/bin&amp;lt;/tt&amp;gt; via e.g. (modify to your path) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;dos&amp;quot;&amp;gt;cd C:/Program Files/FlightGear/bin&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and invoke the tool fgjs via &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;./fgjs --fg-root=$FG_ROOT&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on a UNIX/Linux machine, or via &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;dos&amp;quot;&amp;gt;fgjs --fg-root=$FG_ROOT&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on a Windows machine. The program will tell you which joysticks, if any, were detected. Now follow the commands given on screen, i.eṁove the axis and press the buttons as required. Be careful, a minor touch already “counts” as a movement. Check the reports on screen. If you feel something went wrong, just re-start the program. &lt;br /&gt;
&lt;br /&gt;
After you are done with all the axis and switches, the directory above will hold a file called fgfsrc.js. If the FlightGear base directory FlightGear does not already contain an options file .fgfsrc (under UNIX)/system.fgfsrc (under Windows) mentioned above, just copy &lt;br /&gt;
&lt;br /&gt;
'''fgfsrc.js''' into '''.fgfsrc''' (UNIX)/'''system.fgfsrc''' (Windows) &lt;br /&gt;
&lt;br /&gt;
and place it into the directory FlightGear base directory FlightGear. In case you already wrote an options file, just open it as well as fgfsrc.js with an editor and copy the entries from fgfsrc.js into .fgfsrc/system.fgfsrc. One hint: The output of fgjs is UNIX formatted. As a result, Windows Editor may not display it the proper way. I suggest getting an editor being able to handle UNIX files as well, for example [https://notepad-plus-plus.org/ Notepad++]. &amp;lt;!-- My favorite freeware file editor for that purpose, although somewhat dated, is still PFE, to be obtained from http://www.lancs.ac.uk/people/cpaap/pfe/. --&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The the axis/button assignment of fgjs should, at least, get the axis assignments right, its output may need some tweaking. There may be axes moving the opposite way they should, the dead zones may be too small etc. For instance, I had to change &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--prop:/input/joysticks/js[1]/axis[1]/binding/factor=-1.0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
into &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--prop:/input/joysticks/js[1]/axis[1]/binding/factor=1.0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(USB CH Flightsim Yoke under Windows XP). Thus, here is a short introduction into the assignments of joystick properties. &lt;br /&gt;
&lt;br /&gt;
Basically, all axes settings are specified via lines having the following structure: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--prop:/input/joysticks/js[n]/axis[m]/binding/command=property-scale &lt;br /&gt;
--prop:/input/joysticks/js[n]/axis[m]/binding/property=/controls/steering option&lt;br /&gt;
--prop:/input/joysticks/js[n]/axis[m]/binding/dead-band=db&lt;br /&gt;
--prop:/input/joysticks/js[n]/axis[m]/binding/offset=os&lt;br /&gt;
--prop:/input/joysticks/js[n]/axis[m]/binding/factor=fa&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot; bgcolor=&amp;quot;#EFEFEF&amp;quot; | &lt;br /&gt;
! align=&amp;quot;center&amp;quot; bgcolor=&amp;quot;#EFEFEF&amp;quot; | &lt;br /&gt;
|- &lt;br /&gt;
|n&lt;br /&gt;
|number of device (usually starting with 0)  &lt;br /&gt;
|-&lt;br /&gt;
|m&lt;br /&gt;
|number of axis (usually starting with 0)&lt;br /&gt;
|-&lt;br /&gt;
|steering option&lt;br /&gt;
|elevator, aileron, rudder, throttle, mixture, pitch  &lt;br /&gt;
|-&lt;br /&gt;
|dead-band&lt;br /&gt;
|range, within which signals are discarded; useful to avoid jittering for minor yoke movements&lt;br /&gt;
|-&lt;br /&gt;
|offset&lt;br /&gt;
|specifies, if device not centered in its neutral position &lt;br /&gt;
|-&lt;br /&gt;
|factor&lt;br /&gt;
|controls sensitivity of that axis; defaults to +1, with a value of -1 reversing the behavior &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You should be able to at least get your joystick working along these lines. Concerning all the finer points, for instance, getting the joystick buttons working, John Check has written a very useful README being included in the base package to be found under '''FlightGear/Docs/Readme/Joystick.html'''. In case of any trouble with your input device, it is highly recommended to have a look into this document.&lt;br /&gt;
&lt;br /&gt;
== More about programming joystick XML files ==&lt;br /&gt;
=== General tips ===&lt;br /&gt;
* When testing a new xml file it is best to start FlightGear via a command window (rather than the GUI interface). Any error messages will then be displayed in the terminal. Error messages will give both a message and a line number, helping you pinpoint any errors.&lt;br /&gt;
* Errors can be detected on initial startup or at runtime. Both types of errors will be displayed in the terminal.&lt;br /&gt;
* One of the most common errors is including a character that makes XML choke. Such characters include&amp;lt;br&amp;gt;&amp;amp; &amp;lt; --&amp;lt;br&amp;gt;These characters will cause problems even if simply included in comments or within scripts.&lt;br /&gt;
* If your scripts contain any of these characters, you have to enclose the scripts in &amp;lt;script&amp;gt;&amp;lt;![CDATA[...]]&amp;gt;&amp;lt;/script&amp;gt;. Alternatively, you can 'escape' the characters, ie &amp;quot;&amp;lt;&amp;quot; becomes &amp;quot;&amp;amp;amp;lt;&amp;quot;.&lt;br /&gt;
* You can reload your edited joystick file without restarting FlightGear by selecting &amp;quot;Debug&amp;quot; &amp;amp;gt; &amp;quot;Reload Input&amp;quot; from the main simulator window.&lt;br /&gt;
* You can find many examples of different ways to program joysticks simply by examining the joystick xml files that are packaged with FlightGear. See the directory FlightGear/data/input/joysticks&lt;br /&gt;
* Many advanced functions can be programmed using the Nasal scripting language. These scripts are enclosed in &amp;lt;script&amp;gt;&amp;lt;/script&amp;gt; tags in the XML file. Helpful:&lt;br /&gt;
** A guide to the [[Nasal scripting language]] in FlightGear &lt;br /&gt;
** [[Nasal FAQ]]&lt;br /&gt;
** [[Howto: Write simple scripts in Nasal]]&lt;br /&gt;
* You can explore the internal property tree to see many variables that can be altered using joystick buttons or axes (File/Browse Internal Properties)&lt;br /&gt;
* You can test bits of Nasal code and do some other useful things using the Nasal Console (Debug/Nasal Console).&lt;br /&gt;
* All Nasal code shares a common namespace, so it's possible to set a variable in one nasal binding, and to read it in another.&lt;br /&gt;
&lt;br /&gt;
=== Useful hints for scripts ===&lt;br /&gt;
Some particularly useful ideas for programming scripts within joystick XML files:&lt;br /&gt;
* getprop and setprop can be used for getting &amp;amp; setting properties from the internal properties tree:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
var brake = !getprop(&amp;quot;/controls/gear/brake-parking&amp;quot;);&lt;br /&gt;
setprop(&amp;quot;/controls/gear/brake-parking&amp;quot;, brake);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* You can also make your own values on the property tree:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
setprop(&amp;quot;/input/joysticks/js[0]/myjoystick-modifier&amp;quot;, 1);&lt;br /&gt;
var mod = getprop(&amp;quot;/input/joysticks/js[0]/myjoystick-modifier&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* You can print to terminal using the print function. This is very useful for debugging.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
print(&amp;quot;Just&amp;quot;, &amp;quot; a &amp;quot;, &amp;quot;test&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* You can display info in FlightGear via a popup. This is useful for giving the user feedback about changes that may not be obvious via the panel. It can also be useful for debugging. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
gui.popupTip(&amp;quot;Parking Brake ON&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments for gui.popupTip must be strings, so if you want to display other types of variables they should be formatted with something like sprintf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
gui.popupTip(sprintf(&amp;quot;Elevator trim: %d&amp;quot;, 100 * getprop(&amp;quot;/controls/flight/elevator-trim&amp;quot;)));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
thv = getprop(&amp;quot;/controls/engines/engine[0]/mixture&amp;quot;);&lt;br /&gt;
gui.popupTip(&amp;quot;Thrust vector &amp;quot; ~ int(thv * 120 - 20));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* You can just start using variables, ie,&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
x = 10;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But [http://wiki.flightgear.org/index.php/Nasal_scripting_language#Variables for various reasons] it is generally better to declare variables with the &amp;quot;var&amp;quot; statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nasal&amp;quot;&amp;gt;&lt;br /&gt;
var x = 10;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that &amp;quot;var&amp;quot; creates variables that are local in scope, but since all bindings for a joystick share the same scope, it will be seen across each script in the joystick file.&lt;br /&gt;
&lt;br /&gt;
* You can include a section of script that runs on startup to initialize variables, create functions, etc. Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;PropertyList&amp;gt;&lt;br /&gt;
  &amp;lt;name type=&amp;quot;string&amp;quot;&amp;gt;My joystick name&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;name type=&amp;quot;string&amp;quot;&amp;gt;My joystick name #2&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;nasal&amp;gt;&lt;br /&gt;
    &amp;lt;script&amp;gt;&lt;br /&gt;
       #initialize variables&lt;br /&gt;
       f1 = f2 = 0;&lt;br /&gt;
       left_brake = right_brake = 0;&lt;br /&gt;
       # create a function to be used with all buttons&lt;br /&gt;
       getmod = func { getprop(&amp;quot;/input/joysticks/js[0]/t-flight-hotas-x-modifier&amp;quot; ) }&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/nasal&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sample code for firing weapons with the joystick is found on the [[Gun Effects]] page.&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
{{Forum|24|Hardware}}&lt;br /&gt;
* [[Head tracking]]&lt;br /&gt;
* [[Joystick xml library]] &lt;br /&gt;
* [[Force feedback]]&lt;br /&gt;
* [[Troubleshooting input devices]]&lt;br /&gt;
* [[Writing Joystick Code: Part 1]]&lt;br /&gt;
* [[Writing Joystick Code: Part 2]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://www.flightgear.org/Docs/getstart/getstartch3.html#x8-360003.6 The FlightGear Manual]&lt;br /&gt;
* [http://sourceforge.net/projects/hapticsforfg/ Force Feedback]&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;br /&gt;
[[Category:Joysticks and Yokes]]&lt;br /&gt;
&lt;br /&gt;
[[de:Joystick]]&lt;br /&gt;
[[es:Joystick]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Writing_Joystick_Code:_Part_1&amp;diff=114655</id>
		<title>Writing Joystick Code: Part 1</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Writing_Joystick_Code:_Part_1&amp;diff=114655"/>
		<updated>2018-03-09T14:22:03Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Aileron, elevator and rudder */Minor formal change&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{JoystickScripting Navigation}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Before you start, read [[Input device]].&lt;br /&gt;
&lt;br /&gt;
All the examples below assume that you have obtained the correct axes and button numbers as described in the above article. You will have to substitute the correct axis and button numbers in these code examples.&lt;br /&gt;
&lt;br /&gt;
Note the indent in all examples. The indents have no effect on operation, they just make the code so much more readable.&lt;br /&gt;
&lt;br /&gt;
Here is some code to explain a few important basic concepts of xml files. (I have numbered the lines to aid the explanation below. In your xml file the line numbers will not be there.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line&amp;gt;&lt;br /&gt;
&amp;lt;button n=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;desc&amp;gt;Gear up&amp;lt;/desc&amp;gt;&lt;br /&gt;
  &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
  &amp;lt;binding&amp;gt;&lt;br /&gt;
    &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
    &amp;lt;script&amp;gt;controls.gearDown(-1)&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;controls.gearDown(0)&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ignoring the actual meaning of the code, let's got through it line by line.&lt;br /&gt;
&lt;br /&gt;
Line 1: &amp;lt;button&amp;gt; specifies that this is the code for a button, and the n=&amp;quot;4&amp;quot; means that this is the code for the button which ''your system'' reports as number 4.&lt;br /&gt;
&lt;br /&gt;
Line 2: &amp;lt;desc&amp;gt; A (short) description of what the button does.&lt;br /&gt;
&lt;br /&gt;
Line 3: &amp;lt;repeatable&amp;gt;true&amp;lt;/repeatable&amp;gt; means that ''as long as the button is held in'' the following action will be executed. If repeatable is false, the button action is one-shot, and won't execute again until the button is released and pressed again.&lt;br /&gt;
&lt;br /&gt;
Notice the &amp;lt;/repeatable&amp;gt; after the value true. Each tag (&amp;lt;word&amp;gt; must have a closing tag &amp;lt;/word&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Line 4: &amp;lt;binding&amp;gt; This is the start of the code which defines what happens when the button is pressed. Notice that there can be a few lines before the &amp;lt;/binding&amp;gt; tag. &lt;br /&gt;
&lt;br /&gt;
Line 5: &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt; means that the following line(s) is(are) written in the programming language nasal. That is all you need to know!!&lt;br /&gt;
&lt;br /&gt;
Line 6: &amp;lt;script&amp;gt;controls.gearDown&amp;lt;/script&amp;gt;. The text between &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; are the nasal commands to be performed. Here there is only one command, but there can be many.&lt;br /&gt;
&lt;br /&gt;
Line 7: &amp;lt;/binding&amp;gt; The end of what happens when the button is pressed.&lt;br /&gt;
&lt;br /&gt;
Line 8: &amp;lt;mod-up&amp;gt; (Modification up.) This is the start of the section to handle what happens when the button is released. The up part co9mes from the idea of pushing a button down, and it moves up when you take your finger off it. Not all button actions need a &amp;lt;mod-up&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
Lines 9 to 13: Same as above, except that it refers to what happens when the button is released.&lt;br /&gt;
&lt;br /&gt;
Line 14: &amp;lt;/button&amp;gt; The end of the button section. Not necessary to specify the button number again, as you can't use &amp;lt;button&amp;gt; &amp;lt;/button&amp;gt; inside another &amp;lt;button&amp;gt; &amp;lt;/button&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
== Axes ==&lt;br /&gt;
Axes are the controls on a joystick which con be moved over a whole arc of operation.&lt;br /&gt;
&lt;br /&gt;
Even though the hat hat-switch is classed as an axis, for the purpose of writing code for it, it is a set of buttons. It is, in fact, just a set of buttons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Aileron, elevator and rudder ===&lt;br /&gt;
The code for these looks like this. The lines in italics are optional. The other lines are compulsory.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;axis n=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;Elevator&amp;lt;/desc&amp;gt;&lt;br /&gt;
    ''&amp;lt;dead-band type=&amp;quot;double&amp;quot;&amp;gt;0.0&amp;lt;/dead-band&amp;gt;''&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;property-scale&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;property&amp;gt;/controls/flight/elevator&amp;lt;/property&amp;gt;&lt;br /&gt;
      ''&amp;lt;offset type=&amp;quot;double&amp;quot;&amp;gt;0.0&amp;lt;/offset&amp;gt;''&lt;br /&gt;
      ''&amp;lt;factor type=&amp;quot;double&amp;quot;&amp;gt;-1.0&amp;lt;/factor&amp;gt;''&lt;br /&gt;
      ''&amp;lt;power type=&amp;quot;int&amp;quot;&amp;gt;3&amp;lt;/power&amp;gt;''&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;/axis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;desc&amp;gt;Elevator&amp;lt;/desc&amp;gt; let's us know that this axis controls the elevator. For human purposes only. All the other lines are for the benefit of FG.&lt;br /&gt;
&lt;br /&gt;
The optional lines need quite a bit of explanation. For a start, all three these axes have a center-zero action. At this point, they have a value of 0. As you move them to their extreme positions, their value gradually increases (decreases) to +1.0 or -1.0, depending on the direction of movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dead-band ..... : You may want a small movement around the center of the axis not to do anything. Or your joystick might be getting old, and it jitters around zero. Jittering is small, continuous value changes in the value. You can then supply a value for dead-band that will eliminate this. And it will be small. A dead-band of 1.0 means that the axis does nothing, a dead-band of 0.25 means that the axis does nothing for the first 25% of its movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;offset ..... : If you find that in its center position the axes outputs a non-zero value, you can put that same value here, with opposite + or - sign, to counter-act this. The HUD will show you if you have an offset problem, and can be used to see if you have solved it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;factor ...... : If you find that moving an axis results in the aileron, elevator or rudder moving in the wrong direction, change the -1.0 to 1.0 or the 1.0 to -1.0. This will make it work the other way round.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;power ...... : Sometimes the axes are too sensitive - a slight touch on aileron makes the plane barrel-roll. You can reduce this sensitivity by making the value of power more than 1. (It is a decimal number, so you can make small adjustments, but small adjustments are usually not enough to be noticible.) Never mind the maths, but the larger the value of power the less sensitive the aircraft will be to axis movement.&lt;br /&gt;
&lt;br /&gt;
Remember: ((property+offset)*factor)^power=result&lt;br /&gt;
&lt;br /&gt;
{{Note|In some joystick binding files, you'll find:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;squared type=&amp;quot;bool&amp;quot;&amp;amp;gt;true&amp;amp;lt;/squared&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is equivalent to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;power type=&amp;quot;int&amp;quot;&amp;amp;gt;2&amp;amp;lt;/power&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and not faster in any way, therefore I prefer using ''power'' since it's then easier to change the value if needed.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For aileron and rudder you replace ''&amp;gt;/controls/flight/elevator'' with ''/controls/flight/aileron'' and ''/controls/flight/rudder''. Don't forget to change the the name between &amp;lt;desc&amp;gt; and &amp;lt;/desc&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Other axes ===&lt;br /&gt;
Throttle, propeller-pitch, mixture and carburetor-heat. &lt;br /&gt;
&lt;br /&gt;
These do not have optional settings, after all you want a smooth linear response. This is the code for the throttle control, for the others, just replace throttleAxis with propellerAxis, mixtureAxis or carbHeatAxis.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;axis n=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;Throttle&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;controls.throttleAxis()&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/binding&amp;gt;&lt;br /&gt;
 &amp;lt;/axis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the &amp;quot;instructions&amp;quot; we give are in the Nasal language, so we have &lt;br /&gt;
  &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt; to let the interpreter know.&lt;br /&gt;
&lt;br /&gt;
The actual &amp;quot;instruction&amp;quot; is between the &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; tags.&lt;br /&gt;
  &amp;lt;script&amp;gt;controls.throttleAxis()&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Buttons ==&lt;br /&gt;
&lt;br /&gt;
There is almost no end to what we can do with buttons, limited usually by the number of buttons on the joystick, what we need, and what we can remember of the allocation of button actions.&lt;br /&gt;
&lt;br /&gt;
=== Repeatable/Non-repeatable ===&lt;br /&gt;
&lt;br /&gt;
There are two categories of buttons, repeatable and non-repeatable. With non-repeatable buttons, when we push it, a single action is carried out, and nothing else happens. An example of its use would be a button to lower the landing-gear. We press the button, the gear goes down. With repeatable buttons, when we hold the button in, the same action is carried out over and over, until we release the button. An example is zoom-in. We press the button, and the view keeps zooming in. When we have the view we want, we release the button, and zooming stops.&lt;br /&gt;
An important point to remeber is that if a button is repeatable, even if you just give it the briefest of touches, the instruction will be carried out a few times, thanks to the repeat-rate of the system.&lt;br /&gt;
Setting a button to repeatable or non-repeatable is part of the basic definition of the button (like its number), it cannot be changed willy-nilly. So when you decide on the use for joystick buttons, you decide ''which will be repeatable and which not''.&lt;br /&gt;
&lt;br /&gt;
The shell of a button definition looks lke this&lt;br /&gt;
  &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''What the button does''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Your code goes here''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Code for what happens when the button is released goes here''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a non-repeatable button&lt;br /&gt;
  &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make a  button repeatable, replace false with true.&lt;br /&gt;
&lt;br /&gt;
You can use this shell for all your buttons. Just use the correct button number, give the correct &amp;lt;desc&amp;gt;, decide repeatable or non-repeatable, and then type the correct code in place of ''Your code goes here'' and ''Code for what happens when the button is released goes here''. Not all actions need a &amp;lt;mod-up&amp;gt; section, but you will soon get the hang of what does and what doesn't.&lt;br /&gt;
&lt;br /&gt;
If your code has more than one command, then do this&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
    ''Command number 1'';&lt;br /&gt;
    ''Command number 2'';&lt;br /&gt;
    ''Command number 3''&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that all lines except the last have a ; at the end. This lets the interpreter know that you haven't finished yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== A note on &amp;lt;mod-up&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
I have been having a good look at the controls.nas file that comes with FG. With most of them, where you would use &lt;br /&gt;
  controls.someAction(1)&lt;br /&gt;
to do something, you are allowed to use&lt;br /&gt;
  controls.someAction(0)&lt;br /&gt;
in &amp;lt;mod-up&amp;gt;, but it does nothing. Xml files are full of such code, which is totally, unnecessary. It does no harm, just wastes time, albeit very little time. In fact, the only time a &amp;lt;mod-up&amp;gt; is needed is when a non-repeatable button starts an ongoing process, and we want to stop that process when we release the button. In Part2 and Part 3 you will see almost no &amp;lt;mod-up&amp;gt; code at all.&lt;br /&gt;
&lt;br /&gt;
One advantage  of leaving out unnecessary &amp;lt;mod-up&amp;gt; code is that it makes the code easier to read. (And saves a couple of trees when the files are printed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Giving buttons multiple choices ===&lt;br /&gt;
&lt;br /&gt;
There is a limit to the number of buttons on the joystick and lots of things we'd like to do with them. Fortunately, FG makes it easy for us. It lets us know if any or more than one of the Shift, Alt and Ctrl buttons are pressed. We can thus modify the action of a button with the &amp;lt;mod-shift&amp;gt;, &amp;lt;mod-ctrl&amp;gt; and &amp;lt;mod-alt&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
Here is an example of what you need to modify the action of a button when the Shift key is held in when you press the button. I have deliberately included &amp;lt;mod-up&amp;gt; tags so that you can see where they must go, should they be necessary.&lt;br /&gt;
  &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''Normal action/Shift action''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Normal: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Normal: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;mod-shift&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Shift: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;mod-up&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Shift: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-shift&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quite easy.&lt;br /&gt;
&lt;br /&gt;
Notice that the &amp;lt;repeatable&amp;gt; tag is right at the top. ''You cannot make the normale action repeatable and the modified action non-repeatable''.&lt;br /&gt;
&lt;br /&gt;
Now let's go crazy. We want:&lt;br /&gt;
  1. Normal action.&lt;br /&gt;
  2. Action when Ctrl is pressed.&lt;br /&gt;
  3. Action when Ctrl and Alt are pressed.&lt;br /&gt;
&lt;br /&gt;
Looks like this.&lt;br /&gt;
    &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''Normal action/Ctrl action/Ctrl-Alt action''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    # *****  Normal *****&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Normal: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Normal: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    # ***** Ctrl  *****&lt;br /&gt;
    &amp;lt;mod-ctrl&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Ctrl: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;mod-up&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Ctrl: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      # ***** Ctrl-Alt *****&lt;br /&gt;
      &amp;lt;mod-alt&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Ctrl &amp;amp; Alt: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
        &amp;lt;mod-up&amp;gt;&lt;br /&gt;
          &amp;lt;binding&amp;gt;&lt;br /&gt;
            &amp;lt;script&amp;gt;''Ctrl &amp;amp; Alt: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
          &amp;lt;/binding&amp;gt;&lt;br /&gt;
        &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-alt&amp;gt; &lt;br /&gt;
   &amp;lt;/mod-ctrl&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice four things:&lt;br /&gt;
   1. The &amp;lt;mod-alt&amp;gt; selection is between the &amp;lt;mod-ctrl&amp;gt; and &amp;lt;/mod-ctrl&amp;gt; tags. This means that the code is for Ctrl and Alt, not just Alt.&lt;br /&gt;
   2. I have spaced the sections with empty lines for readability.&lt;br /&gt;
   3. I have used comments # ***** Comment ***** to make it even more readable.&lt;br /&gt;
   4. By using comments and open lines, the block of code is a lot less daunting. In fact, once you have grasped the basics, it is quite easy to read.&lt;br /&gt;
&lt;br /&gt;
Anything that starts with # is ignored by the interpreter, even if it comes after some code. Such as&lt;br /&gt;
  &amp;lt;script&amp;gt;controls.throttleAxis&amp;lt;/script&amp;gt; # Controls the throttle axis&lt;br /&gt;
&lt;br /&gt;
The code will work and we humans have an explanation of the code.&lt;br /&gt;
&lt;br /&gt;
To write long comments you can do this&lt;br /&gt;
  &amp;amp;lt;!--  &lt;br /&gt;
     Lots and lots&lt;br /&gt;
     and even more&lt;br /&gt;
     lots of lines of comments.&lt;br /&gt;
  --&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use the function keys as modifiers: &amp;lt;mod-F1&amp;gt;, &amp;lt;mod-F2&amp;gt;, etc., but remember that with all the combinations of Shift, Ctrl and Alt you get 7 options, and that is a lot of options to remember for each button.&lt;br /&gt;
&lt;br /&gt;
In a later section I will show how to use buttons on the joystick as modifiers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== CDATA ==&lt;br /&gt;
If your code (or even comments) contains &amp;lt;, &amp;gt;, &amp;amp; or --, it can cause havoc with your xml file. Any area that contains any of these must be enclosed between&lt;br /&gt;
  &amp;lt;![CDATA[      and     ]]&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Any complaints/suggestions/questions/kudos can be posted [http://forum.flightgear.org/viewtopic.php?f=24&amp;amp;t=17892 here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=JSBSim_Engines&amp;diff=107733</id>
		<title>JSBSim Engines</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=JSBSim_Engines&amp;diff=107733"/>
		<updated>2017-05-02T14:29:29Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[JSBSim]] provides a framework for aerodynamics. This page will attempt to explain how to create engines for the JSBSim framework.  Engines also require [[JSBSim Thrusters|thrusters]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FGPiston ==&lt;br /&gt;
Piston engine model. You enter values based on commonly available data and this model creates reasonable output values.&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
 &amp;lt;piston_engine name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;minmp unit=&amp;quot;{INHG | PA | ATM}&amp;quot;&amp;gt; {number} &amp;lt;/minmp&amp;gt;&lt;br /&gt;
  &amp;lt;maxmp unit=&amp;quot;{INHG | PA | ATM}&amp;quot;&amp;gt; {number} &amp;lt;/maxmp&amp;gt;&lt;br /&gt;
  &amp;lt;displacement unit=&amp;quot;{IN3 | LTR | CC}&amp;quot;&amp;gt; {number} &amp;lt;/displacement&amp;gt;&lt;br /&gt;
  &amp;lt;bore unit=&amp;quot;{IN | M}&amp;quot;&amp;gt; {number} &amp;lt;/bore&amp;gt; &amp;lt;!-- Unused --&amp;gt;&lt;br /&gt;
  &amp;lt;stroke unit=&amp;quot;{IN | M}&amp;quot;&amp;gt; {number} &amp;lt;/stroke&amp;gt;&lt;br /&gt;
  &amp;lt;cylinders&amp;gt; {number} &amp;lt;/cylinders&amp;gt;&amp;lt;!-- Unused --&amp;gt;&lt;br /&gt;
  &amp;lt;cylinder-head-mass unit=&amp;quot;{KG | LBS}&amp;quot;&amp;gt; {number} &amp;lt;/cylinder-head-mass&amp;gt; &lt;br /&gt;
  &amp;lt;compression-ratio&amp;gt; {number} &amp;lt;/compression-ratio&amp;gt;&lt;br /&gt;
  &amp;lt;sparkfaildrop&amp;gt; {number} &amp;lt;/sparkfaildrop&amp;gt;&lt;br /&gt;
  &amp;lt;maxhp unit=&amp;quot;{HP | WATTS}&amp;quot;&amp;gt; {number} &amp;lt;/maxhp&amp;gt;&lt;br /&gt;
  &amp;lt;cycles&amp;gt; {number} &amp;lt;/cycles&amp;gt; &lt;br /&gt;
  &amp;lt;idlerpm&amp;gt; {number} &amp;lt;/idlerpm&amp;gt;&lt;br /&gt;
  &amp;lt;maxrpm&amp;gt; {number} &amp;lt;/maxrpm&amp;gt;&lt;br /&gt;
  &amp;lt;numboostspeeds&amp;gt; {number} &amp;lt;/numboostspeeds&amp;gt;&lt;br /&gt;
  &amp;lt;boostoverride&amp;gt; {0 | 1} &amp;lt;/boostoverride&amp;gt;&lt;br /&gt;
  &amp;lt;boostmanual&amp;gt; {0 | 1} &amp;lt;/boostmanual&amp;gt;&lt;br /&gt;
  &amp;lt;ratedboost1 unit=&amp;quot;{INHG | PA | ATM}&amp;quot;&amp;gt; {number} &amp;lt;/ratedboost1&amp;gt;&lt;br /&gt;
  &amp;lt;ratedpower1 unit=&amp;quot;{HP | WATTS}&amp;quot;&amp;gt; {number} &amp;lt;/ratedpower1&amp;gt;&lt;br /&gt;
  &amp;lt;ratedrpm1&amp;gt; {number} &amp;lt;/ratedrpm1&amp;gt;&lt;br /&gt;
  &amp;lt;ratedaltitude1 unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/ratedaltitude1&amp;gt;&lt;br /&gt;
 (repeat for speeds 2 and 3)&lt;br /&gt;
  &amp;lt;takeoffboost unit=&amp;quot;{INHG | PA | ATM}&amp;quot;&amp;gt; {number} &amp;lt;/takeoffboost&amp;gt;&lt;br /&gt;
 &amp;lt;!-- advanced tags! --&amp;gt;&lt;br /&gt;
  &amp;lt;bsfc unit=&amp;quot;{LBS/HP*HR | KG/KW*HR}&amp;quot;&amp;gt; {number} &amp;lt;/bsfc&amp;gt;&lt;br /&gt;
  &amp;lt;volumetric-efficiency&amp;gt; {number} &amp;lt;/volumetric-efficiency&amp;gt;&lt;br /&gt;
  &amp;lt;air-intake-impedance-factor&amp;gt; {number} &amp;lt;/air-intake-impedance-factor&amp;gt;&lt;br /&gt;
  &amp;lt;ram-air-factor&amp;gt; {number} &amp;lt;/ram-air-factor&amp;gt;&lt;br /&gt;
  &amp;lt;cooling-factor&amp;gt; {number} &amp;lt;/cooling-factor&amp;gt; &lt;br /&gt;
&amp;lt;!-- Added in FlightGear 2.8 --&amp;gt;&lt;br /&gt;
  &amp;lt;starter-torque&amp;gt; {number} &amp;lt;/starter-torque&amp;gt;&lt;br /&gt;
  &amp;lt;starter-rpm&amp;gt; {number} &amp;lt;/starter-rpm&amp;gt;&lt;br /&gt;
  &amp;lt;static-friction  unit=&amp;quot;{HP | WATTS}&amp;quot;&amp;gt; {number} &amp;lt;/static-friction&amp;gt;&lt;br /&gt;
  &amp;lt;man-press-lag&amp;gt; {number} &amp;lt;/man-press-lag&amp;gt;&lt;br /&gt;
  &amp;lt;boost-loss-factor&amp;gt; {number} &amp;lt;/boost-loss-factor&amp;gt;&lt;br /&gt;
&amp;lt;!-- Added in FlightGear 2017.2 --&amp;gt;&lt;br /&gt;
  &amp;lt;oil-pressure-relief-valve-psi&amp;gt; {number} &amp;lt;/oil-pressure-relief-valve-psi&amp;gt;&lt;br /&gt;
  &amp;lt;design-oil-temp-degK&amp;gt; {number} &amp;lt;/design-oil-temp-degK&amp;gt;&lt;br /&gt;
  &amp;lt;oil-pressure-rpm-max&amp;gt; {number} &amp;lt;/oil-pressure-rpm-max&amp;gt;&lt;br /&gt;
  &amp;lt;oil-viscosity-index&amp;gt; {number} &amp;lt;/oil-viscosity-index&amp;gt;&lt;br /&gt;
 &amp;lt;/piston_engine&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|minmp&lt;br /&gt;
|this value is the nominal idle manifold pressure at sea-level without boost. Along with idlerpm, it determines the throttle response slope.&lt;br /&gt;
|- &lt;br /&gt;
|maxmp&lt;br /&gt;
|this value is the nomial maximum manifold pressure at sea-level without boost. Along with maxrpm it determines the resistance of the aircraft's intake system. See air-intake-impedance-factor&lt;br /&gt;
|-&lt;br /&gt;
|displacement&lt;br /&gt;
|this value is used to determine mass air and fuel flow which impacts engine power and cooling.&lt;br /&gt;
|-&lt;br /&gt;
|bore&lt;br /&gt;
|cylinder bore is currently unused.&lt;br /&gt;
|-&lt;br /&gt;
|stroke&lt;br /&gt;
|piston stroke is used to determine the mean piston speed. A longer stroke results in an engine that does not work as well at higher speeds.&lt;br /&gt;
|-&lt;br /&gt;
|cylinders &lt;br /&gt;
|number of cylinders scales the cylinder head mass.&lt;br /&gt;
|-&lt;br /&gt;
|cylinder-head-mass&lt;br /&gt;
|the nominal mass of a cylinder head. A larger value slows changes in engine temperature&lt;br /&gt;
|-&lt;br /&gt;
|compression-ratio&lt;br /&gt;
|the compression ratio affects the change in volumetric efficiency with altitude.&lt;br /&gt;
|-&lt;br /&gt;
|sparkfaildrop&lt;br /&gt;
|this is the percentage drop in horsepower for single magneto operation.&lt;br /&gt;
|-&lt;br /&gt;
|maxhp&lt;br /&gt;
|this value is the nominal power the engine creates at maxrpm. It will determine bsfc if that tag is not input. It also determines the starter motor power.&lt;br /&gt;
|-&lt;br /&gt;
|static-friction&lt;br /&gt;
|this value is the power required to turn an engine that is not running. Used to control and slow a windmilling propeller.&lt;br /&gt;
|-&lt;br /&gt;
|cycles&lt;br /&gt;
|Designate a 2 or 4 stroke engine. Currently only the 4 stroke engine is supported.&lt;br /&gt;
|-&lt;br /&gt;
|idlerpm&lt;br /&gt;
|this value affects the throttle fall off and the engine stops running if it is slowed below 80% of this value. The engine starts running when it reaches 80% of this value.&lt;br /&gt;
|-&lt;br /&gt;
|maxrpm&lt;br /&gt;
|this value is used to calculate air-box resistance and BSFC. It also affects oil pressure among other things.&lt;br /&gt;
|-&lt;br /&gt;
|maxthrottle&lt;br /&gt;
|Deprecated / unused&lt;br /&gt;
|-&lt;br /&gt;
|minthrottle&lt;br /&gt;
|Deprecated / unused&lt;br /&gt;
|-&lt;br /&gt;
|numboostspeed&lt;br /&gt;
| zero (or not present) for a naturally-aspirated engine, either 1, 2 or 3 for a boosted engine.  This corresponds to the number of supercharger speeds.  Merlin XII had 1 speed, Merlin 61 had 2, a late  Griffon engine apparently had 3.  No known engine more than 3, although some German engines apparently had a continuously variable-speed supercharger.&lt;br /&gt;
|-&lt;br /&gt;
|boostoverride&lt;br /&gt;
|unused&lt;br /&gt;
|-&lt;br /&gt;
|boost-loss-factor (fgfs 2.8)&lt;br /&gt;
|boost-loss-factor - zero (or not present) for 'free' supercharging. A value entered will be used as a multiplier to the power required to compress the input air. Typical value should be 1.15 to 1.20.&lt;br /&gt;
|-&lt;br /&gt;
|boostmanual&lt;br /&gt;
|whether a multispeed supercharger will manually or automatically shift boost speeds. On manual shifting the boost speeds is accomplished by controlling propulsion/engine/boostspeed&lt;br /&gt;
|-&lt;br /&gt;
|takeoffboost&lt;br /&gt;
|boost in psi above sea level ambient.&lt;br /&gt;
|-&lt;br /&gt;
|ratedboost[123]&lt;br /&gt;
|the absolute rated boost above sea level ambient (14.7 PSI, 29.92 inHg) for a given boost speed, in psi&lt;br /&gt;
|-&lt;br /&gt;
|ratedpower[123]&lt;br /&gt;
|required by the parser but ignored&lt;br /&gt;
|-&lt;br /&gt;
|ratedrpm[123]&lt;br /&gt;
|The rpm at which rated boost is developed&lt;br /&gt;
|-&lt;br /&gt;
|ratedaltitude[123]&lt;br /&gt;
|The altitude up to which rated boost can be maintained. Up to this altitude the boost is maintained constant for a given throttle position by the BCV or wastegate. Beyond this altitude the manifold pressure must drop, since the supercharger is now at maximum unregulated output. The actual pressure multiplier of the supercharger system is calculated at initialisation from this value.&lt;br /&gt;
|-&lt;br /&gt;
|bsfc (Advanced)&lt;br /&gt;
|Indicated Specific Fuel Consumption. The power produced per unit of fuel. Higher numbers give worse fuel economy. This number may need to be lowered slightly from actual BSFC numbers because some internal engine losses are modeled separately.&lt;br /&gt;
|-&lt;br /&gt;
|volumetric-efficiency (Advanced)&lt;br /&gt;
|the nominal volumetric efficiency of the engine. Boosted engines require values above 1.&lt;br /&gt;
|-&lt;br /&gt;
|air-intake-impedance-factor (Advanced)&lt;br /&gt;
|this number is the pressure drop across the intake system. Increasing it reduces available manifold pressure.&lt;br /&gt;
|-&lt;br /&gt;
|ram-air-factor (Advanced)&lt;br /&gt;
|this number creates a pressure increase with an increase in dynamic pressure (aircraft speed).&lt;br /&gt;
|-&lt;br /&gt;
|cooling-factor (Advanced)&lt;br /&gt;
|this number models how efficient the aircraft cooling system is.&lt;br /&gt;
|-&lt;br /&gt;
|starter-torque (fgfs 2.8)&lt;br /&gt;
|A value specifying the zero RPM torque in lb*ft the starter motor provides. Current default value is 40% of the maximum horsepower value.&lt;br /&gt;
|-&lt;br /&gt;
|starter-rpm (fgfs 2.8)&lt;br /&gt;
| A value specifying the maximum RPM the unloaded starter motor can achieve. Loads placed on the engine by the propeller and throttle will further limit RPM achieved in practice.  The actual RPM needs to be more than idlerpm * 0.8 for the engine to start running.&lt;br /&gt;
|-&lt;br /&gt;
|static-friction (fgfs 2.8)&lt;br /&gt;
|this value is the power required to turn an engine that is not running. Used to control and slow a windmilling propeller. Choose a small percentage of maxhp. It can also be adjusted at run-time to simulate accessory or other non-thruster engine load.&lt;br /&gt;
|-&lt;br /&gt;
|man-press-lag (fgfs 2.8)&lt;br /&gt;
|Delay in seconds for manifold pressure changes to take effect after the throttle is moved or the RPM changes. Default is 1 second.&lt;br /&gt;
|-&lt;br /&gt;
|oil-pressure-relief-valve-psi (fgfs 2017.2)&lt;br /&gt;
|the basic max value reached by oil pressure at engine RPM &amp;gt;= [oil-pressure-rpm-max]. Default = 60 psi. This basic value is later corrected for oil temperature and viscosity, to give the final oil pressure.&lt;br /&gt;
|-&lt;br /&gt;
|oil-pressure-rpm-max (fgfs 2017.2)&lt;br /&gt;
|the engine RPM value above which the basic oil pressure stabilizes at [oil-pressure-relief-valve-psi]. Default = maxrpm * 0.75. Below this regime, the oil pressure increases linearly with RPM as (oil-pressure-relief-valve-psi) * RPM / (oil-pressure-rpm-max).&lt;br /&gt;
|-&lt;br /&gt;
|design-oil-temp-degK (fgfs 2017.2)&lt;br /&gt;
|A characteristic oil temperature at which the final oil pressure = [oil-pressure-relief-valve-psi] if RPM are &amp;gt;= [oil-pressure-rpm-max]. Default = 358 K. Otherwise, the final oil pressure depends on oil temperature and viscosity index (and RPM at low regime).&lt;br /&gt;
|-&lt;br /&gt;
|oil-viscosity-index (fgfs 2017.2)&lt;br /&gt;
|A coefficient for oil viscosity dependence on oil temperature. Default = 0.25 psi / K regarding the effect on oil pressure.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
* Intake &amp;amp; Throttle&lt;br /&gt;
** The intake is modeled by &amp;lt;ram-air-factor&amp;gt;,&amp;lt;minmp&amp;gt;, &amp;lt;maxmp&amp;gt;, and &amp;lt;air-intake-impedance-factor&amp;gt;. &lt;br /&gt;
** &amp;lt;ram-air-factor&amp;gt; is the efficiency of the air scoop intake. 0 turns ram air off. Default is 1. This value is exposed on the property tree so it may be altered at runtime to simulate alternate air, etc. The value can be calculated by (ambient pressure)/(desired pressure)-1 where desired pressure is full throttle at rated RPM.&lt;br /&gt;
** &amp;lt;maxmp&amp;gt; is the maximum manifold pressure achievable. It is used for determining &amp;lt;BSFC&amp;gt; and &amp;lt;air-intake-impedance-factor&amp;gt; if a values are not supplied for those items.&lt;br /&gt;
** &amp;lt;minmp&amp;gt; is used along with &amp;lt;idlerpm&amp;gt; to determine the slope of the throttle response&lt;br /&gt;
** &amp;lt;air-intake-impedance-factor&amp;gt; is the fixed impedance in the air intake system. It is determined by &amp;lt;maxmp&amp;gt; if not supplied. This value is exposed on the property tree so it may be altered at runtime to simulate intake icing, alternate air, etc.&lt;br /&gt;
* Boost&lt;br /&gt;
** &amp;lt;boostmanual&amp;gt; whether a multispeed supercharger will manually or automatically shift boost speeds. On manual shifting the boost speeds is accomplished by controlling propulsion/engine/boostspeed&lt;br /&gt;
** &amp;lt;takeoffboost&amp;gt; -  Many aircraft had an extra boost setting beyond rated boost, but not totally uncontrolled as in the already mentioned boost-control-cutout, typically attained by pushing the throttle past a mechanical 'gate' preventing its inadvertant use. This was typically used for takeoff, and emergency situations, generally for not more than five minutes. This is a change in the boost control setting, not the actual supercharger speed, and so would only give extra power below the rated altitude. When TAKEOFFBOOST is specified in the config file (and is above RATEDBOOST1), then the throttle position is interpreted as:&lt;br /&gt;
*** 0 to 0.98 : idle manifold pressure to rated boost (where attainable)&lt;br /&gt;
*** 0.99, 1.0 : takeoff boost (where attainable).&lt;br /&gt;
*** A typical takeoff boost for an earlyish Merlin was about 12psi, compared with a rated boost of 9psi.&lt;br /&gt;
*** It is quite possible that other boost control settings could have been used on some aircraft, or that takeoff/extra boost could have activated by other means than pushing the throttle full forward through a gate, but this will suffice for now.&lt;br /&gt;
** &amp;lt;ratedboost[123]&amp;gt; - the absolute rated boost above sea level ambient (14.7 PSI, 29.92 inHg) for a given boost speed, in psi. Eg the Merlin XII had a rated boost of 9psi, giving approximately 39inHg manifold pressure up to the rated altitude.&lt;br /&gt;
*** Note that &amp;lt;maxmp&amp;gt; is still the non-boosted max manifold pressure even for boosted engines - effectively this is simply a measure of the pressure drop through the fully open throttle.&lt;br /&gt;
** &amp;lt;ratedaltitude[123]&amp;gt; - The altitude up to which rated boost can be maintained. Up to this altitude the boost is maintained constant for a given throttle position by the BCV or wastegate. Beyond this altitude the manifold pressure must drop, since the supercharger is now at maximum unregulated output. The actual pressure multiplier of the supercharger system is calculated at initialisation from this value.&lt;br /&gt;
** &amp;lt;ratedpower[123]&amp;gt; - The power developed at rated boost at rated altitude at rated rpm.&lt;br /&gt;
** &amp;lt;ratedrpm[123]&amp;gt; - The rpm at which rated power is developed.&lt;br /&gt;
* Power production&lt;br /&gt;
** &amp;lt;sparkfaildrop&amp;gt; is the amount of power you get for single magneto operation, try a value of 0.8 or so.&lt;br /&gt;
** &amp;lt;volumetric-efficiency&amp;gt; controls how much air goes through the engine at a given RPM. Values below 1 for unboosted engines and values over 1 for boosted engines. This value is exposed on the property tree so it may be altered at runtime.&lt;br /&gt;
** &amp;lt;bsfc&amp;gt; is the amount of power the engine produces per unit of fuel consumed. Use it to tune the power produced. This value is exposed on the property tree so it may be altered at runtime.&lt;br /&gt;
* Cooling&lt;br /&gt;
** &amp;lt;cylinder-head-mass&amp;gt; controls how fast the engine heats up and cools off. So if you have a '5-minute' limit on a power setting you can adjust this value so the engine just starts to overheat at the end of the given time frame.&lt;br /&gt;
** &amp;lt;cooling-factor&amp;gt; controls how much 'air' flows over the engine to cool it. Raising the value makes the engine run cooler. This value is exposed on the property tree so it may be altered at runtime to simulate cowl flaps, for example.&lt;br /&gt;
* Tuning&lt;br /&gt;
** Using a constant speed load, set the engine model to full throttle and rated RPM.&lt;br /&gt;
** Set &amp;lt;ram-air-factor&amp;gt; to zero.&lt;br /&gt;
** Adjust &amp;lt;air-intake-impedance-factor&amp;gt; to achieve the proper static full throttle manifold pressure.&lt;br /&gt;
** Increase airspeed to cruise and adjust &amp;lt;ram-air-factor&amp;gt; to achieve the proper dynamic full throttle manifold pressure.&lt;br /&gt;
** Adjust &amp;lt;volumetric-efficiency&amp;gt; first to achieve desired fuel flow rate, leaning engine as required.&lt;br /&gt;
** Adjust &amp;lt;bsfc&amp;gt; to achieve desired power.&lt;br /&gt;
** Some piston engines will have power curves that will need to be altered from default depending on operating conditions.  For example engines with multi-speed superchargers will produce less horse power on high speed at the same manifold pressure compared to low speed.  Functions can be setup to alter &amp;lt;volumetric-efficiency&amp;gt; and &amp;lt;bsfc&amp;gt; at run time to get the power and fuel consumption curves correct by using different values for high and low supercharger speeds.&lt;br /&gt;
&lt;br /&gt;
== FGTurbine ==&lt;br /&gt;
The jet turbine engine&lt;br /&gt;
&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
 &amp;lt;turbine_engine name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;milthrust unit=&amp;quot;{LBS | N}&amp;quot;&amp;gt; {number} &amp;lt;/milthrust&amp;gt;&lt;br /&gt;
  &amp;lt;maxthrust unit=&amp;quot;{LBS | N}&amp;quot;&amp;gt; {number} &amp;lt;/maxthrust&amp;gt;&lt;br /&gt;
  &amp;lt;bypassratio&amp;gt; {number} &amp;lt;/bypassratio&amp;gt;&lt;br /&gt;
  &amp;lt;bleed&amp;gt; {number} &amp;lt;/bleed&amp;gt;&lt;br /&gt;
  &amp;lt;tsfc&amp;gt; {number} &amp;lt;/tsfc&amp;gt;&lt;br /&gt;
  &amp;lt;atsfc&amp;gt; {number} &amp;lt;/atsfc&amp;gt;&lt;br /&gt;
  &amp;lt;idlen1&amp;gt; {number} &amp;lt;/idlen1&amp;gt;&lt;br /&gt;
  &amp;lt;idlen2&amp;gt; {number} &amp;lt;/idlen2&amp;gt;&lt;br /&gt;
  &amp;lt;n1spinup&amp;gt; {number} &amp;lt;/n1spinup&amp;gt;&lt;br /&gt;
  &amp;lt;n2spinup&amp;gt; {number} &amp;lt;/n2spinup&amp;gt;&lt;br /&gt;
  &amp;lt;maxn1&amp;gt; {number} &amp;lt;/maxn1&amp;gt;&lt;br /&gt;
  &amp;lt;maxn2&amp;gt; {number} &amp;lt;/maxn2&amp;gt;&lt;br /&gt;
  &amp;lt;augmented&amp;gt; {0 | 1} &amp;lt;/augmented&amp;gt;&lt;br /&gt;
  &amp;lt;augmethod&amp;gt; {0 | 1 | 2} &amp;lt;/augmethod&amp;gt;&lt;br /&gt;
  &amp;lt;injected&amp;gt; {0 | 1} &amp;lt;/injected&amp;gt;&lt;br /&gt;
  &amp;lt;injection-time&amp;gt; {number} &amp;lt;/injection-time&amp;gt;&lt;br /&gt;
  &amp;lt;function name=&amp;quot;IdleThrust&amp;quot;&amp;gt; &amp;lt;/function&amp;gt;&lt;br /&gt;
  &amp;lt;function name=&amp;quot;MilThrust&amp;quot;&amp;gt;  &amp;lt;/function&amp;gt;&lt;br /&gt;
  &amp;lt;function name=&amp;quot;AugThrust&amp;quot;&amp;gt;  &amp;lt;/function&amp;gt;&lt;br /&gt;
  &amp;lt;function name=&amp;quot;Injection&amp;quot;&amp;gt;  &amp;lt;/function&amp;gt;&lt;br /&gt;
 &amp;lt;/turbine_engine&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|milthrust&lt;br /&gt;
|Maximum thrust, static, at sea level.&lt;br /&gt;
|-&lt;br /&gt;
|maxthrust&lt;br /&gt;
|Afterburning thrust, static, at sea level.&lt;br /&gt;
|-&lt;br /&gt;
|bypassratio&lt;br /&gt;
|Ratio of bypass air flow to core air flow.&lt;br /&gt;
|-&lt;br /&gt;
|bleed&lt;br /&gt;
|Thrust reduction factor due to losses (0.0 to 1.0).&lt;br /&gt;
|-&lt;br /&gt;
|tsfc&lt;br /&gt;
|Thrust-specific fuel consumption at cruise, lbm/hr/lbf&lt;br /&gt;
|-&lt;br /&gt;
|atsfc&lt;br /&gt;
|Afterburning TSFC, lbm/hr/lbf&lt;br /&gt;
|-&lt;br /&gt;
|idlen1&lt;br /&gt;
|Fan rotor rpm (% of max) at idle&lt;br /&gt;
|-&lt;br /&gt;
|idlen2&lt;br /&gt;
|Core rotor rpm (% of max) at idle&lt;br /&gt;
|-&lt;br /&gt;
|n1spinup&lt;br /&gt;
|Fan rotor rpm starter acceleration (default 1.0%/sec)&lt;br /&gt;
|-&lt;br /&gt;
|n2spinup&lt;br /&gt;
|Core rotor rpm starter acceleration (default 3.0%/sec)&lt;br /&gt;
|-&lt;br /&gt;
|maxn1&lt;br /&gt;
|Fan rotor rpm (% of max) at full throttle&lt;br /&gt;
|-&lt;br /&gt;
|maxn2&lt;br /&gt;
|Core rotor rpm (% of max) at full throttle&lt;br /&gt;
|-&lt;br /&gt;
|augmented&lt;br /&gt;
|0 = afterburner not installed&amp;lt;br /&amp;gt;1 = afterburner installed&lt;br /&gt;
|-&lt;br /&gt;
|augmethod&lt;br /&gt;
|0 = afterburner activated by property /engines/engine[n]/augmentation&amp;lt;br /&amp;gt;1 = afterburner activated by pushing throttle above 99% position&amp;lt;br /&amp;gt;2 = throttle range is expanded in the FCS, and values above 1.0 are afterburner range&lt;br /&gt;
|-&lt;br /&gt;
|injected&lt;br /&gt;
|0 = Water injection not installed&amp;lt;br /&amp;gt;1 = Water injection installed&lt;br /&gt;
|-&lt;br /&gt;
|injection-time&lt;br /&gt;
|Time, in seconds, of water injection duration&lt;br /&gt;
|-&lt;br /&gt;
|function&lt;br /&gt;
|Two functions, IdleThrust and MilThrust must always be defined. AugThrust is required for afterburning (reheated) engines. Injection is for water injected engines. These functions return a multiplier that is applied to the supplied static thrust values. In aeromatic configurations these functions are tables based on sonic velocity and air density&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
*Bypass ratio is used only to estimate engine acceleration time. The effect of bypass ratio on engine efficiency is already included in the TSFC value. Feel free to set this parameter (even for turbojets) to whatever value gives a desired spool-up rate. Default value is 0.&lt;br /&gt;
*The bleed factor is multiplied by thrust to give a resulting thrust after losses. This can represent losses due to bleed, or any other cause. Default value is 0. A common value would be 0.04.&lt;br /&gt;
*Nozzle position, for variable area exhaust nozzles, is provided for users needing to drive a nozzle gauge or animate a virtual nozzle.&lt;br /&gt;
*This model can only be used with the &amp;quot;direct&amp;quot; thruster. See the file: /engine/direct.xml&lt;br /&gt;
*TSFC=fuel consumption per hour/thrust&lt;br /&gt;
*There is a Java program here to calculate thrust vs airspeed and altitude. http://adg.stanford.edu/aa241/propulsion/engmodel.html&lt;br /&gt;
* n1spinup and n2spinup are the rate (in %/sec) of increase below 25.8% N2, or until 15% if cutoff is false.&lt;br /&gt;
* acceleration between 25.8% N2 and Idle is at a preset rate of 2.0/%sec for M2, 1.4%/sec for N1&lt;br /&gt;
* once running the acceleration is (90.0 / (BypassRatio + 3.0) ) per second&lt;br /&gt;
&lt;br /&gt;
== FGTurboprop ==&lt;br /&gt;
The turboprop engine&lt;br /&gt;
&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;milthrust unit=&amp;quot;{LBS | N}&amp;quot;&amp;gt; {number} &amp;lt;/milthrust&amp;gt;&lt;br /&gt;
&amp;lt;idlen1&amp;gt; {number} &amp;lt;/idlen1&amp;gt;&lt;br /&gt;
&amp;lt;idlen2&amp;gt; {number} &amp;lt;/idlen2&amp;gt;&lt;br /&gt;
&amp;lt;maxn1&amp;gt; {number} &amp;lt;/maxn1&amp;gt;&lt;br /&gt;
&amp;lt;maxn2&amp;gt; {number} &amp;lt;/maxn2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;betarangeend&amp;gt; {number} &amp;lt;/betarangeend&amp;gt;&lt;br /&gt;
&amp;lt;reversemaxpower&amp;gt; {number} &amp;lt;/reversemaxpower&amp;gt;&lt;br /&gt;
&amp;lt;maxpower&amp;gt; {number} &amp;lt;/maxpower&amp;gt;&lt;br /&gt;
&amp;lt;psfc&amp;gt; {number} &amp;lt;/psfc&amp;gt;&lt;br /&gt;
&amp;lt;n1idle_max_delay&amp;gt; {number} &amp;lt;/n1idle_max_delay&amp;gt;&lt;br /&gt;
&amp;lt;maxstartingtime&amp;gt; {number} &amp;lt;/maxstartingtime&amp;gt;&lt;br /&gt;
&amp;lt;startern1&amp;gt; {number} &amp;lt;/startern1&amp;gt;&lt;br /&gt;
&amp;lt;ielumaxtorque&amp;gt; {number} &amp;lt;/ielumaxtorque&amp;gt;&lt;br /&gt;
&amp;lt;itt_delay&amp;gt; {number} &amp;lt;/itt_delay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;EnginePowerVC&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt; Engine power, function of airspeed and pressure &amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;independentVar lookup=&amp;quot;row&amp;quot;&amp;gt;atmosphere/P-sl-psf&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
    &amp;lt;independentVar lookup=&amp;quot;column&amp;quot;&amp;gt;velocities/ve-kts&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
                 0     50    100    150    200    250&lt;br /&gt;
       503   0.357  0.380  0.400  0.425  0.457  0.486&lt;br /&gt;
      1048   0.586  0.589  0.600  0.621  0.650  0.686&lt;br /&gt;
      1328   0.707  0.721  0.731  0.757  0.786  0.821&lt;br /&gt;
      1496   0.779  0.786  0.808  0.821  0.857  0.900&lt;br /&gt;
      1684   0.850  0.857  0.874  0.900  0.943  0.979&lt;br /&gt;
      1896   0.914  0.929  0.946  0.971  1      1.057&lt;br /&gt;
      2135   1      1.011  1.029  1.043  1.083  1.150&lt;br /&gt;
      2213   1.029  1.043  1.057  1.079  1.114  1.171&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;EnginePowerRPM_N1&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt; Engine Power, function of RPM and N1 &amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
            0   5   60    86   94   95   96   97   98   99  100  101&lt;br /&gt;
         0  0   0.5  0.5   0.5  0.5  0.5  0.5  0.5  0.5  0.5  0.5  0.5&lt;br /&gt;
       800  0   0.5 35   200  350  380  420  460  500  530  580  620&lt;br /&gt;
      1200  0   0.5 30   230  400  430  470  505  550  590  640  680&lt;br /&gt;
      1600  0   0.5  5   240  440  475  510  550  595  630  680  720&lt;br /&gt;
      2000  0   0.1  0.1 225  450  495  525  565  610  650  700  745&lt;br /&gt;
      2200  0   0.1  0.1 205  440  480  515  560  605  645  695  743&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;ITT_N1&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt; Inter-Turbine Temperature ITT [deg C] depending on N1 and engine run (0=off / 1=running) &amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
              0     1&lt;br /&gt;
      {n1 value} {number} {number}&lt;br /&gt;
       ...&lt;br /&gt;
      {n1 value} {number} {number}&lt;br /&gt;
      &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt; &lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;table name=&amp;quot;CombustionEfficiency_N1&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {n1 value} {number}&lt;br /&gt;
       ...&lt;br /&gt;
      {n1 value} {number}&lt;br /&gt;
      &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|milthrust&lt;br /&gt;
|[LBS]&lt;br /&gt;
|-&lt;br /&gt;
|idlen1&lt;br /&gt;
|[%]&lt;br /&gt;
|-&lt;br /&gt;
|maxn1&lt;br /&gt;
|[%]&lt;br /&gt;
|-&lt;br /&gt;
|betarangeend[%]&lt;br /&gt;
| if ThrottleCmd &amp;amp;lt; betarangeend/100.0 then engine power=idle, propeller pitch is controled by ThrottleCmd (between MINPITCH and  REVERSEPITCH).&amp;lt;br /&amp;gt; if ThrottleCmd &amp;amp;gt; betarangeend/100.0 then engine power increases up to max reverse power reversemaxpower [%] max engine power in reverse mode&lt;br /&gt;
|-&lt;br /&gt;
|maxpower&lt;br /&gt;
| [HP]&lt;br /&gt;
|-&lt;br /&gt;
|psfc&lt;br /&gt;
| power specific fuel consumption [pph/HP] for N1=100%&lt;br /&gt;
|-&lt;br /&gt;
|n1idle_max_delay&lt;br /&gt;
|[-] time constant for N1 change&lt;br /&gt;
|-&lt;br /&gt;
|maxstartenginetime [sec]&lt;br /&gt;
|    after this time the automatic starting cycle is interrupted when the engine doesn't start (0=automatic starting not present)&lt;br /&gt;
|-&lt;br /&gt;
|startern1&lt;br /&gt;
|[%] when starting starter spin up engine to this spin&lt;br /&gt;
|-&lt;br /&gt;
|ielumaxtorque [lb.ft]&lt;br /&gt;
|if torque&amp;gt;ielumaxtorque limiters decrease the throttle (ielu = Integrated Electronic Limiter Unit)&lt;br /&gt;
|-&lt;br /&gt;
|itt_delay&lt;br /&gt;
|[-] time constant for ITT change (ITT = Inter Turbine Temperature)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Starting the engine ===&lt;br /&gt;
In a [[YASim]] aircraft you need to simulate the spool-up of the engine in a [[Nasal]] script. For an example see lines 498-529 of [{{fgaddon aircraft url|b1900d|Nasal/systems.nas|l=498}} systems.nas] from the [[B1900d]].&lt;br /&gt;
&lt;br /&gt;
JSBSim however spools the engine up automatically when certain conditions are met. According to my experience the process is the following:&lt;br /&gt;
&lt;br /&gt;
# The [[property]] &amp;lt;code&amp;gt;/engines/engine[~n~]/cutoff&amp;lt;/code&amp;gt; has to be &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt;.&lt;br /&gt;
# Set the property &amp;lt;code&amp;gt;/controls/electric/engine[~n~]generator&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt;.&lt;br /&gt;
# Set the property &amp;lt;code&amp;gt;/controls/engines/engine[~n~]/starter&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt; as well.&lt;br /&gt;
# As result, &amp;lt;code&amp;gt;/engines/engine[~n~]/starter&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/engines/engine[~n~]/starting&amp;lt;/code&amp;gt; will be set to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt; and &amp;lt;code&amp;gt;/engines/engine[~n~]/n1&amp;lt;/code&amp;gt; will increase which means that the engine is spooling up. In JSBSim &amp;lt;code&amp;gt;n1&amp;lt;/code&amp;gt; represents the rotation speed of the turbine shaft which is significantly higher than the propeller speed.&lt;br /&gt;
# &amp;lt;code&amp;gt;/engines/engine[~n~]/n1&amp;lt;/code&amp;gt; stabilizes at a specific value which is defined in &amp;lt;code&amp;gt;&amp;lt;startern1&amp;gt;&amp;lt;/code&amp;gt; in the engine definition file of the FDM (see the table above or as an example the [{{fgaddon aircraft url|b1900d|Engines/PT6A67D.xml|l=11}} engine file] of the B1900d).&lt;br /&gt;
# When &amp;lt;code&amp;gt;/engines/engine[~n~]/n1&amp;lt;/code&amp;gt; rises above &amp;lt;b&amp;gt;15&amp;lt;/b&amp;gt; (at least I think), you can set &amp;lt;code&amp;gt;/engines/engine[~n~]/cutoff&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;false&amp;lt;/b&amp;gt; which simulates that the engine now gets supplied with fuel.&lt;br /&gt;
# This sets &amp;lt;code&amp;gt;/engines/engine[~n~]/starting&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;false&amp;lt;/b&amp;gt; and &amp;lt;code&amp;gt;/engines/engine[~n~]/cranking&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt;.&lt;br /&gt;
# Now you may set &amp;lt;code&amp;gt;/engines/engine[~n~]/starter&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;false&amp;lt;/b&amp;gt; without interrupting the starting process.&lt;br /&gt;
# &amp;lt;code&amp;gt;/engines/engine[~n~]/n1&amp;lt;/code&amp;gt; will increase further until it stabilizes at the value which is defined in &amp;lt;code&amp;gt;idlen1&amp;lt;/code&amp;gt; in the [{{fgaddon aircraft url|b1900d|Engines/PT6A67D.xml|l=5}} engine definition file].&lt;br /&gt;
# Finally &amp;lt;code&amp;gt;/engines/engine[~n~]/cranking&amp;lt;/code&amp;gt; will be set to &amp;lt;b&amp;gt;false&amp;lt;/b&amp;gt; and &amp;lt;code&amp;gt;/engines/engine[~n~]/running&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt; which means that the engine is now running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pleas note that the above described process is only an assumption based on my experiences with trying to create a JSBSim FDM for the [[Twin Otter]] which is equipped with turboprop engines, and unfortunately I cannot guarantee the correctness. If something is wrong here feel free to correct it.&lt;br /&gt;
: [[User:Dg-505|Dg-505]] ([[User talk:Dg-505|talk]]) 13:53, 5 December 2016 (EST)&lt;br /&gt;
&lt;br /&gt;
== FGRocket ==&lt;br /&gt;
The rocket engine&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;rocket_engine name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;isp&amp;gt; {number} &amp;lt;/isp&amp;gt;&lt;br /&gt;
  &amp;lt;builduptime&amp;gt; {number} &amp;lt;/builduptime&amp;gt;&lt;br /&gt;
  &amp;lt;maxthrottle&amp;gt; {number} &amp;lt;/maxthrottle&amp;gt;&lt;br /&gt;
  &amp;lt;minthrottle&amp;gt; {number} &amp;lt;/minthrottle&amp;gt;&lt;br /&gt;
  &amp;lt;slfuelflowmax&amp;gt; {number} &amp;lt;/slfuelflowmax&amp;gt;&lt;br /&gt;
  &amp;lt;sloxiflowmax&amp;gt;  {number} &amp;lt;/sloxiflowmax&amp;gt;&lt;br /&gt;
  &amp;lt;variation&amp;gt;&lt;br /&gt;
    &amp;lt;thrust&amp;gt; {number} &amp;lt;/thrust&amp;gt;&lt;br /&gt;
    &amp;lt;total_isp&amp;gt; {number} &amp;lt;/total_isp&amp;gt;&lt;br /&gt;
  &amp;lt;/variation&amp;gt; &lt;br /&gt;
  &amp;lt;thrust_table name=&amp;quot;propulsion/thrust_prop_remain&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {number} {number}&lt;br /&gt;
	...&lt;br /&gt;
      {number} {number}&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/thrust_table&amp;gt;&lt;br /&gt;
&amp;lt;/rocket_engine&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FGElectric ==&lt;br /&gt;
Simple thrust producer. You enter the max power as &amp;lt;power unit=&amp;quot;WATTS&amp;quot;&amp;gt; and the engine model produces throttle_setting*power watts of output.&lt;br /&gt;
* Enter the max power as &amp;lt;power unit=&amp;quot;WATTS&amp;quot;&amp;gt; and the engine model produces throttle_setting*power watts of output.&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;electric_engine name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;power unit=&amp;quot;{HP | WATTS}&amp;quot;&amp;gt; {number} &amp;lt;/power&amp;gt;&lt;br /&gt;
&amp;lt;/electric_engine&amp;gt; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
FGElectric models an electric motor based on the configuration file &amp;lt;power&amp;gt; parameter. The throttle controls motor output linearly from zero to &amp;lt;power&amp;gt;. This power value (converted internally to horsepower) is then used by FGPropeller to apply torque to the propeller.  At present there is no battery model available, so this motor does not consume any energy.  There is no internal friction.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
* http://jsbsim.sourceforge.net/JSBSim/classJSBSim_1_1FGPiston.html&lt;br /&gt;
* http://jsbsim.sourceforge.net/JSBSim/classJSBSim_1_1FGTurbine.html&lt;br /&gt;
* http://jsbsim.sourceforge.net/JSBSim/classJSBSim_1_1FGTurboProp.html&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=JSBSim_Engines&amp;diff=107727</id>
		<title>JSBSim Engines</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=JSBSim_Engines&amp;diff=107727"/>
		<updated>2017-05-01T14:27:23Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[JSBSim]] provides a framework for aerodynamics. This page will attempt to explain how to create engines for the JSBSim framework.  Engines also require [[JSBSim Thrusters|thrusters]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FGPiston ==&lt;br /&gt;
Piston engine model. You enter values based on commonly available data and this model creates reasonable output values.&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
 &amp;lt;piston_engine name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;minmp unit=&amp;quot;{INHG | PA | ATM}&amp;quot;&amp;gt; {number} &amp;lt;/minmp&amp;gt;&lt;br /&gt;
  &amp;lt;maxmp unit=&amp;quot;{INHG | PA | ATM}&amp;quot;&amp;gt; {number} &amp;lt;/maxmp&amp;gt;&lt;br /&gt;
  &amp;lt;displacement unit=&amp;quot;{IN3 | LTR | CC}&amp;quot;&amp;gt; {number} &amp;lt;/displacement&amp;gt;&lt;br /&gt;
  &amp;lt;bore unit=&amp;quot;{IN | M}&amp;quot;&amp;gt; {number} &amp;lt;/bore&amp;gt; &amp;lt;!-- Unused --&amp;gt;&lt;br /&gt;
  &amp;lt;stroke unit=&amp;quot;{IN | M}&amp;quot;&amp;gt; {number} &amp;lt;/stroke&amp;gt;&lt;br /&gt;
  &amp;lt;cylinders&amp;gt; {number} &amp;lt;/cylinders&amp;gt;&amp;lt;!-- Unused --&amp;gt;&lt;br /&gt;
  &amp;lt;cylinder-head-mass unit=&amp;quot;{KG | LBS}&amp;quot;&amp;gt; {number} &amp;lt;/cylinder-head-mass&amp;gt; &lt;br /&gt;
  &amp;lt;compression-ratio&amp;gt; {number} &amp;lt;/compression-ratio&amp;gt;&lt;br /&gt;
  &amp;lt;sparkfaildrop&amp;gt; {number} &amp;lt;/sparkfaildrop&amp;gt;&lt;br /&gt;
  &amp;lt;maxhp unit=&amp;quot;{HP | WATTS}&amp;quot;&amp;gt; {number} &amp;lt;/maxhp&amp;gt;&lt;br /&gt;
  &amp;lt;cycles&amp;gt; {number} &amp;lt;/cycles&amp;gt; &lt;br /&gt;
  &amp;lt;idlerpm&amp;gt; {number} &amp;lt;/idlerpm&amp;gt;&lt;br /&gt;
  &amp;lt;maxrpm&amp;gt; {number} &amp;lt;/maxrpm&amp;gt;&lt;br /&gt;
  &amp;lt;numboostspeeds&amp;gt; {number} &amp;lt;/numboostspeeds&amp;gt;&lt;br /&gt;
  &amp;lt;boostoverride&amp;gt; {0 | 1} &amp;lt;/boostoverride&amp;gt;&lt;br /&gt;
  &amp;lt;boostmanual&amp;gt; {0 | 1} &amp;lt;/boostmanual&amp;gt;&lt;br /&gt;
  &amp;lt;ratedboost1 unit=&amp;quot;{INHG | PA | ATM}&amp;quot;&amp;gt; {number} &amp;lt;/ratedboost1&amp;gt;&lt;br /&gt;
  &amp;lt;ratedpower1 unit=&amp;quot;{HP | WATTS}&amp;quot;&amp;gt; {number} &amp;lt;/ratedpower1&amp;gt;&lt;br /&gt;
  &amp;lt;ratedrpm1&amp;gt; {number} &amp;lt;/ratedrpm1&amp;gt;&lt;br /&gt;
  &amp;lt;ratedaltitude1 unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/ratedaltitude1&amp;gt;&lt;br /&gt;
 (repeat for speeds 2 and 3)&lt;br /&gt;
  &amp;lt;takeoffboost unit=&amp;quot;{INHG | PA | ATM}&amp;quot;&amp;gt; {number} &amp;lt;/takeoffboost&amp;gt;&lt;br /&gt;
 &amp;lt;!-- advanced tags! --&amp;gt;&lt;br /&gt;
  &amp;lt;bsfc unit=&amp;quot;{LBS/HP*HR | KG/KW*HR}&amp;quot;&amp;gt; {number} &amp;lt;/bsfc&amp;gt;&lt;br /&gt;
  &amp;lt;volumetric-efficiency&amp;gt; {number} &amp;lt;/volumetric-efficiency&amp;gt;&lt;br /&gt;
  &amp;lt;air-intake-impedance-factor&amp;gt; {number} &amp;lt;/air-intake-impedance-factor&amp;gt;&lt;br /&gt;
  &amp;lt;ram-air-factor&amp;gt; {number} &amp;lt;/ram-air-factor&amp;gt;&lt;br /&gt;
  &amp;lt;cooling-factor&amp;gt; {number} &amp;lt;/cooling-factor&amp;gt; &lt;br /&gt;
&amp;lt;!-- Added in FlightGear 2.8 --&amp;gt;&lt;br /&gt;
  &amp;lt;starter-torque&amp;gt; {number} &amp;lt;/starter-torque&amp;gt;&lt;br /&gt;
  &amp;lt;starter-rpm&amp;gt; {number} &amp;lt;/starter-rpm&amp;gt;&lt;br /&gt;
  &amp;lt;static-friction  unit=&amp;quot;{HP | WATTS}&amp;quot;&amp;gt; {number} &amp;lt;/static-friction&amp;gt;&lt;br /&gt;
  &amp;lt;man-press-lag&amp;gt; {number} &amp;lt;/man-press-lag&amp;gt;&lt;br /&gt;
  &amp;lt;boost-loss-factor&amp;gt; {number} &amp;lt;/boost-loss-factor&amp;gt;&lt;br /&gt;
&amp;lt;!-- Added in FlightGear 2017.2 --&amp;gt;&lt;br /&gt;
  &amp;lt;oil-pressure-relief-valve-psi&amp;gt; {number} &amp;lt;/oil-pressure-relief-valve-psi&amp;gt;&lt;br /&gt;
  &amp;lt;design-oil-temp-degK&amp;gt; {number} &amp;lt;/design-oil-temp-degK&amp;gt;&lt;br /&gt;
  &amp;lt;oil-pressure-rpm-max&amp;gt; {number} &amp;lt;/oil-pressure-rpm-max&amp;gt;&lt;br /&gt;
  &amp;lt;oil-viscosity-index&amp;gt; {number} &amp;lt;/oil-viscosity-index&amp;gt;&lt;br /&gt;
 &amp;lt;/piston_engine&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|minmp&lt;br /&gt;
|this value is the nominal idle manifold pressure at sea-level without boost. Along with idlerpm, it determines the throttle response slope.&lt;br /&gt;
|- &lt;br /&gt;
|maxmp&lt;br /&gt;
|this value is the nomial maximum manifold pressure at sea-level without boost. Along with maxrpm it determines the resistance of the aircraft's intake system. See air-intake-impedance-factor&lt;br /&gt;
|-&lt;br /&gt;
|displacement&lt;br /&gt;
|this value is used to determine mass air and fuel flow which impacts engine power and cooling.&lt;br /&gt;
|-&lt;br /&gt;
|bore&lt;br /&gt;
|cylinder bore is currently unused.&lt;br /&gt;
|-&lt;br /&gt;
|stroke&lt;br /&gt;
|piston stroke is used to determine the mean piston speed. A longer stroke results in an engine that does not work as well at higher speeds.&lt;br /&gt;
|-&lt;br /&gt;
|cylinders &lt;br /&gt;
|number of cylinders scales the cylinder head mass.&lt;br /&gt;
|-&lt;br /&gt;
|cylinder-head-mass&lt;br /&gt;
|the nominal mass of a cylinder head. A larger value slows changes in engine temperature&lt;br /&gt;
|-&lt;br /&gt;
|compression-ratio&lt;br /&gt;
|the compression ratio affects the change in volumetric efficiency with altitude.&lt;br /&gt;
|-&lt;br /&gt;
|sparkfaildrop&lt;br /&gt;
|this is the percentage drop in horsepower for single magneto operation.&lt;br /&gt;
|-&lt;br /&gt;
|maxhp&lt;br /&gt;
|this value is the nominal power the engine creates at maxrpm. It will determine bsfc if that tag is not input. It also determines the starter motor power.&lt;br /&gt;
|-&lt;br /&gt;
|static-friction&lt;br /&gt;
|this value is the power required to turn an engine that is not running. Used to control and slow a windmilling propeller.&lt;br /&gt;
|-&lt;br /&gt;
|cycles&lt;br /&gt;
|Designate a 2 or 4 stroke engine. Currently only the 4 stroke engine is supported.&lt;br /&gt;
|-&lt;br /&gt;
|idlerpm&lt;br /&gt;
|this value affects the throttle fall off and the engine stops running if it is slowed below 80% of this value. The engine starts running when it reaches 80% of this value.&lt;br /&gt;
|-&lt;br /&gt;
|maxrpm&lt;br /&gt;
|this value is used to calculate air-box resistance and BSFC. It also affects oil pressure among other things.&lt;br /&gt;
|-&lt;br /&gt;
|maxthrottle&lt;br /&gt;
|Deprecated / unused&lt;br /&gt;
|-&lt;br /&gt;
|minthrottle&lt;br /&gt;
|Deprecated / unused&lt;br /&gt;
|-&lt;br /&gt;
|numboostspeed&lt;br /&gt;
| zero (or not present) for a naturally-aspirated engine, either 1, 2 or 3 for a boosted engine.  This corresponds to the number of supercharger speeds.  Merlin XII had 1 speed, Merlin 61 had 2, a late  Griffon engine apparently had 3.  No known engine more than 3, although some German engines apparently had a continuously variable-speed supercharger.&lt;br /&gt;
|-&lt;br /&gt;
|boostoverride&lt;br /&gt;
|unused&lt;br /&gt;
|-&lt;br /&gt;
|boost-loss-factor (fgfs 2.8)&lt;br /&gt;
|boost-loss-factor - zero (or not present) for 'free' supercharging. A value entered will be used as a multiplier to the power required to compress the input air. Typical value should be 1.15 to 1.20.&lt;br /&gt;
|-&lt;br /&gt;
|boostmanual&lt;br /&gt;
|whether a multispeed supercharger will manually or automatically shift boost speeds. On manual shifting the boost speeds is accomplished by controlling propulsion/engine/boostspeed&lt;br /&gt;
|-&lt;br /&gt;
|takeoffboost&lt;br /&gt;
|boost in psi above sea level ambient.&lt;br /&gt;
|-&lt;br /&gt;
|ratedboost[123]&lt;br /&gt;
|the absolute rated boost above sea level ambient (14.7 PSI, 29.92 inHg) for a given boost speed, in psi&lt;br /&gt;
|-&lt;br /&gt;
|ratedpower[123]&lt;br /&gt;
|required by the parser but ignored&lt;br /&gt;
|-&lt;br /&gt;
|ratedrpm[123]&lt;br /&gt;
|The rpm at which rated boost is developed&lt;br /&gt;
|-&lt;br /&gt;
|ratedaltitude[123]&lt;br /&gt;
|The altitude up to which rated boost can be maintained. Up to this altitude the boost is maintained constant for a given throttle position by the BCV or wastegate. Beyond this altitude the manifold pressure must drop, since the supercharger is now at maximum unregulated output. The actual pressure multiplier of the supercharger system is calculated at initialisation from this value.&lt;br /&gt;
|-&lt;br /&gt;
|bsfc (Advanced)&lt;br /&gt;
|Indicated Specific Fuel Consumption. The power produced per unit of fuel. Higher numbers give worse fuel economy. This number may need to be lowered slightly from actual BSFC numbers because some internal engine losses are modeled separately.&lt;br /&gt;
|-&lt;br /&gt;
|volumetric-efficiency (Advanced)&lt;br /&gt;
|the nominal volumetric efficiency of the engine. Boosted engines require values above 1.&lt;br /&gt;
|-&lt;br /&gt;
|air-intake-impedance-factor (Advanced)&lt;br /&gt;
|this number is the pressure drop across the intake system. Increasing it reduces available manifold pressure.&lt;br /&gt;
|-&lt;br /&gt;
|ram-air-factor (Advanced)&lt;br /&gt;
|this number creates a pressure increase with an increase in dynamic pressure (aircraft speed).&lt;br /&gt;
|-&lt;br /&gt;
|cooling-factor (Advanced)&lt;br /&gt;
|this number models how efficient the aircraft cooling system is.&lt;br /&gt;
|-&lt;br /&gt;
|starter-torque (fgfs 2.8)&lt;br /&gt;
|A value specifying the zero RPM torque in lb*ft the starter motor provides. Current default value is 40% of the maximum horsepower value.&lt;br /&gt;
|-&lt;br /&gt;
|starter-rpm (fgfs 2.8)&lt;br /&gt;
| A value specifying the maximum RPM the unloaded starter motor can achieve. Loads placed on the engine by the propeller and throttle will further limit RPM achieved in practice.  The actual RPM needs to be more than idlerpm * 0.8 for the engine to start running.&lt;br /&gt;
|-&lt;br /&gt;
|static-friction (fgfs 2.8)&lt;br /&gt;
|this value is the power required to turn an engine that is not running. Used to control and slow a windmilling propeller. Choose a small percentage of maxhp. It can also be adjusted at run-time to simulate accessory or other non-thruster engine load.&lt;br /&gt;
|-&lt;br /&gt;
|man-press-lag (fgfs 2.8)&lt;br /&gt;
|Delay in seconds for manifold pressure changes to take effect after the throttle is moved or the RPM changes. Default is 1 second.&lt;br /&gt;
|-&lt;br /&gt;
|oil-pressure-relief-valve-psi (fgfs 2017.2)&lt;br /&gt;
|the basic max value reached by oil pressure at engine RPM &amp;gt;= [oil-pressure-rpm-max]. Default = 60 psi. This basic value is later corrected for oil temperature and viscosity, to give the final oil pressure.&lt;br /&gt;
|-&lt;br /&gt;
|oil-pressure-rpm-max (fgfs 2017.2)&lt;br /&gt;
|the engine RPM value above which the basic oil pressure stabilizes at [oil-pressure-relief-valve-psi]. Default = maxrpm * 0.75. Below this regime, the oil pressure increases linearly with RPM as (oil-pressure-relief-valve-psi) * RPM / (oil-pressure-rpm-max).&lt;br /&gt;
|-&lt;br /&gt;
|design-oil-temp-degK (fgfs 2017.2)&lt;br /&gt;
|A characteristic oil temperature at which the final oil pressure = [oil-pressure-relief-valve-psi] at high enough RPM. Default = 358 K. Otherwise, the final oil pressure depends on oil temperature and viscosity index.&lt;br /&gt;
|-&lt;br /&gt;
|oil-viscosity-index (fgfs 2017.2)&lt;br /&gt;
|A coefficient for oil viscosity dependence on oil temperature. Default = 0.25 psi / K.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
* Intake &amp;amp; Throttle&lt;br /&gt;
** The intake is modeled by &amp;lt;ram-air-factor&amp;gt;,&amp;lt;minmp&amp;gt;, &amp;lt;maxmp&amp;gt;, and &amp;lt;air-intake-impedance-factor&amp;gt;. &lt;br /&gt;
** &amp;lt;ram-air-factor&amp;gt; is the efficiency of the air scoop intake. 0 turns ram air off. Default is 1. This value is exposed on the property tree so it may be altered at runtime to simulate alternate air, etc. The value can be calculated by (ambient pressure)/(desired pressure)-1 where desired pressure is full throttle at rated RPM.&lt;br /&gt;
** &amp;lt;maxmp&amp;gt; is the maximum manifold pressure achievable. It is used for determining &amp;lt;BSFC&amp;gt; and &amp;lt;air-intake-impedance-factor&amp;gt; if a values are not supplied for those items.&lt;br /&gt;
** &amp;lt;minmp&amp;gt; is used along with &amp;lt;idlerpm&amp;gt; to determine the slope of the throttle response&lt;br /&gt;
** &amp;lt;air-intake-impedance-factor&amp;gt; is the fixed impedance in the air intake system. It is determined by &amp;lt;maxmp&amp;gt; if not supplied. This value is exposed on the property tree so it may be altered at runtime to simulate intake icing, alternate air, etc.&lt;br /&gt;
* Boost&lt;br /&gt;
** &amp;lt;boostmanual&amp;gt; whether a multispeed supercharger will manually or automatically shift boost speeds. On manual shifting the boost speeds is accomplished by controlling propulsion/engine/boostspeed&lt;br /&gt;
** &amp;lt;takeoffboost&amp;gt; -  Many aircraft had an extra boost setting beyond rated boost, but not totally uncontrolled as in the already mentioned boost-control-cutout, typically attained by pushing the throttle past a mechanical 'gate' preventing its inadvertant use. This was typically used for takeoff, and emergency situations, generally for not more than five minutes. This is a change in the boost control setting, not the actual supercharger speed, and so would only give extra power below the rated altitude. When TAKEOFFBOOST is specified in the config file (and is above RATEDBOOST1), then the throttle position is interpreted as:&lt;br /&gt;
*** 0 to 0.98 : idle manifold pressure to rated boost (where attainable)&lt;br /&gt;
*** 0.99, 1.0 : takeoff boost (where attainable).&lt;br /&gt;
*** A typical takeoff boost for an earlyish Merlin was about 12psi, compared with a rated boost of 9psi.&lt;br /&gt;
*** It is quite possible that other boost control settings could have been used on some aircraft, or that takeoff/extra boost could have activated by other means than pushing the throttle full forward through a gate, but this will suffice for now.&lt;br /&gt;
** &amp;lt;ratedboost[123]&amp;gt; - the absolute rated boost above sea level ambient (14.7 PSI, 29.92 inHg) for a given boost speed, in psi. Eg the Merlin XII had a rated boost of 9psi, giving approximately 39inHg manifold pressure up to the rated altitude.&lt;br /&gt;
*** Note that &amp;lt;maxmp&amp;gt; is still the non-boosted max manifold pressure even for boosted engines - effectively this is simply a measure of the pressure drop through the fully open throttle.&lt;br /&gt;
** &amp;lt;ratedaltitude[123]&amp;gt; - The altitude up to which rated boost can be maintained. Up to this altitude the boost is maintained constant for a given throttle position by the BCV or wastegate. Beyond this altitude the manifold pressure must drop, since the supercharger is now at maximum unregulated output. The actual pressure multiplier of the supercharger system is calculated at initialisation from this value.&lt;br /&gt;
** &amp;lt;ratedpower[123]&amp;gt; - The power developed at rated boost at rated altitude at rated rpm.&lt;br /&gt;
** &amp;lt;ratedrpm[123]&amp;gt; - The rpm at which rated power is developed.&lt;br /&gt;
* Power production&lt;br /&gt;
** &amp;lt;sparkfaildrop&amp;gt; is the amount of power you get for single magneto operation, try a value of 0.8 or so.&lt;br /&gt;
** &amp;lt;volumetric-efficiency&amp;gt; controls how much air goes through the engine at a given RPM. Values below 1 for unboosted engines and values over 1 for boosted engines. This value is exposed on the property tree so it may be altered at runtime.&lt;br /&gt;
** &amp;lt;bsfc&amp;gt; is the amount of power the engine produces per unit of fuel consumed. Use it to tune the power produced. This value is exposed on the property tree so it may be altered at runtime.&lt;br /&gt;
* Cooling&lt;br /&gt;
** &amp;lt;cylinder-head-mass&amp;gt; controls how fast the engine heats up and cools off. So if you have a '5-minute' limit on a power setting you can adjust this value so the engine just starts to overheat at the end of the given time frame.&lt;br /&gt;
** &amp;lt;cooling-factor&amp;gt; controls how much 'air' flows over the engine to cool it. Raising the value makes the engine run cooler. This value is exposed on the property tree so it may be altered at runtime to simulate cowl flaps, for example.&lt;br /&gt;
* Tuning&lt;br /&gt;
** Using a constant speed load, set the engine model to full throttle and rated RPM.&lt;br /&gt;
** Set &amp;lt;ram-air-factor&amp;gt; to zero.&lt;br /&gt;
** Adjust &amp;lt;air-intake-impedance-factor&amp;gt; to achieve the proper static full throttle manifold pressure.&lt;br /&gt;
** Increase airspeed to cruise and adjust &amp;lt;ram-air-factor&amp;gt; to achieve the proper dynamic full throttle manifold pressure.&lt;br /&gt;
** Adjust &amp;lt;volumetric-efficiency&amp;gt; first to achieve desired fuel flow rate, leaning engine as required.&lt;br /&gt;
** Adjust &amp;lt;bsfc&amp;gt; to achieve desired power.&lt;br /&gt;
** Some piston engines will have power curves that will need to be altered from default depending on operating conditions.  For example engines with multi-speed superchargers will produce less horse power on high speed at the same manifold pressure compared to low speed.  Functions can be setup to alter &amp;lt;volumetric-efficiency&amp;gt; and &amp;lt;bsfc&amp;gt; at run time to get the power and fuel consumption curves correct by using different values for high and low supercharger speeds.&lt;br /&gt;
&lt;br /&gt;
== FGTurbine ==&lt;br /&gt;
The jet turbine engine&lt;br /&gt;
&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
 &amp;lt;turbine_engine name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;milthrust unit=&amp;quot;{LBS | N}&amp;quot;&amp;gt; {number} &amp;lt;/milthrust&amp;gt;&lt;br /&gt;
  &amp;lt;maxthrust unit=&amp;quot;{LBS | N}&amp;quot;&amp;gt; {number} &amp;lt;/maxthrust&amp;gt;&lt;br /&gt;
  &amp;lt;bypassratio&amp;gt; {number} &amp;lt;/bypassratio&amp;gt;&lt;br /&gt;
  &amp;lt;bleed&amp;gt; {number} &amp;lt;/bleed&amp;gt;&lt;br /&gt;
  &amp;lt;tsfc&amp;gt; {number} &amp;lt;/tsfc&amp;gt;&lt;br /&gt;
  &amp;lt;atsfc&amp;gt; {number} &amp;lt;/atsfc&amp;gt;&lt;br /&gt;
  &amp;lt;idlen1&amp;gt; {number} &amp;lt;/idlen1&amp;gt;&lt;br /&gt;
  &amp;lt;idlen2&amp;gt; {number} &amp;lt;/idlen2&amp;gt;&lt;br /&gt;
  &amp;lt;n1spinup&amp;gt; {number} &amp;lt;/n1spinup&amp;gt;&lt;br /&gt;
  &amp;lt;n2spinup&amp;gt; {number} &amp;lt;/n2spinup&amp;gt;&lt;br /&gt;
  &amp;lt;maxn1&amp;gt; {number} &amp;lt;/maxn1&amp;gt;&lt;br /&gt;
  &amp;lt;maxn2&amp;gt; {number} &amp;lt;/maxn2&amp;gt;&lt;br /&gt;
  &amp;lt;augmented&amp;gt; {0 | 1} &amp;lt;/augmented&amp;gt;&lt;br /&gt;
  &amp;lt;augmethod&amp;gt; {0 | 1 | 2} &amp;lt;/augmethod&amp;gt;&lt;br /&gt;
  &amp;lt;injected&amp;gt; {0 | 1} &amp;lt;/injected&amp;gt;&lt;br /&gt;
  &amp;lt;injection-time&amp;gt; {number} &amp;lt;/injection-time&amp;gt;&lt;br /&gt;
  &amp;lt;function name=&amp;quot;IdleThrust&amp;quot;&amp;gt; &amp;lt;/function&amp;gt;&lt;br /&gt;
  &amp;lt;function name=&amp;quot;MilThrust&amp;quot;&amp;gt;  &amp;lt;/function&amp;gt;&lt;br /&gt;
  &amp;lt;function name=&amp;quot;AugThrust&amp;quot;&amp;gt;  &amp;lt;/function&amp;gt;&lt;br /&gt;
  &amp;lt;function name=&amp;quot;Injection&amp;quot;&amp;gt;  &amp;lt;/function&amp;gt;&lt;br /&gt;
 &amp;lt;/turbine_engine&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|milthrust&lt;br /&gt;
|Maximum thrust, static, at sea level.&lt;br /&gt;
|-&lt;br /&gt;
|maxthrust&lt;br /&gt;
|Afterburning thrust, static, at sea level.&lt;br /&gt;
|-&lt;br /&gt;
|bypassratio&lt;br /&gt;
|Ratio of bypass air flow to core air flow.&lt;br /&gt;
|-&lt;br /&gt;
|bleed&lt;br /&gt;
|Thrust reduction factor due to losses (0.0 to 1.0).&lt;br /&gt;
|-&lt;br /&gt;
|tsfc&lt;br /&gt;
|Thrust-specific fuel consumption at cruise, lbm/hr/lbf&lt;br /&gt;
|-&lt;br /&gt;
|atsfc&lt;br /&gt;
|Afterburning TSFC, lbm/hr/lbf&lt;br /&gt;
|-&lt;br /&gt;
|idlen1&lt;br /&gt;
|Fan rotor rpm (% of max) at idle&lt;br /&gt;
|-&lt;br /&gt;
|idlen2&lt;br /&gt;
|Core rotor rpm (% of max) at idle&lt;br /&gt;
|-&lt;br /&gt;
|n1spinup&lt;br /&gt;
|Fan rotor rpm starter acceleration (default 1.0%/sec)&lt;br /&gt;
|-&lt;br /&gt;
|n2spinup&lt;br /&gt;
|Core rotor rpm starter acceleration (default 3.0%/sec)&lt;br /&gt;
|-&lt;br /&gt;
|maxn1&lt;br /&gt;
|Fan rotor rpm (% of max) at full throttle&lt;br /&gt;
|-&lt;br /&gt;
|maxn2&lt;br /&gt;
|Core rotor rpm (% of max) at full throttle&lt;br /&gt;
|-&lt;br /&gt;
|augmented&lt;br /&gt;
|0 = afterburner not installed&amp;lt;br /&amp;gt;1 = afterburner installed&lt;br /&gt;
|-&lt;br /&gt;
|augmethod&lt;br /&gt;
|0 = afterburner activated by property /engines/engine[n]/augmentation&amp;lt;br /&amp;gt;1 = afterburner activated by pushing throttle above 99% position&amp;lt;br /&amp;gt;2 = throttle range is expanded in the FCS, and values above 1.0 are afterburner range&lt;br /&gt;
|-&lt;br /&gt;
|injected&lt;br /&gt;
|0 = Water injection not installed&amp;lt;br /&amp;gt;1 = Water injection installed&lt;br /&gt;
|-&lt;br /&gt;
|injection-time&lt;br /&gt;
|Time, in seconds, of water injection duration&lt;br /&gt;
|-&lt;br /&gt;
|function&lt;br /&gt;
|Two functions, IdleThrust and MilThrust must always be defined. AugThrust is required for afterburning (reheated) engines. Injection is for water injected engines. These functions return a multiplier that is applied to the supplied static thrust values. In aeromatic configurations these functions are tables based on sonic velocity and air density&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
*Bypass ratio is used only to estimate engine acceleration time. The effect of bypass ratio on engine efficiency is already included in the TSFC value. Feel free to set this parameter (even for turbojets) to whatever value gives a desired spool-up rate. Default value is 0.&lt;br /&gt;
*The bleed factor is multiplied by thrust to give a resulting thrust after losses. This can represent losses due to bleed, or any other cause. Default value is 0. A common value would be 0.04.&lt;br /&gt;
*Nozzle position, for variable area exhaust nozzles, is provided for users needing to drive a nozzle gauge or animate a virtual nozzle.&lt;br /&gt;
*This model can only be used with the &amp;quot;direct&amp;quot; thruster. See the file: /engine/direct.xml&lt;br /&gt;
*TSFC=fuel consumption per hour/thrust&lt;br /&gt;
*There is a Java program here to calculate thrust vs airspeed and altitude. http://adg.stanford.edu/aa241/propulsion/engmodel.html&lt;br /&gt;
* n1spinup and n2spinup are the rate (in %/sec) of increase below 25.8% N2, or until 15% if cutoff is false.&lt;br /&gt;
* acceleration between 25.8% N2 and Idle is at a preset rate of 2.0/%sec for M2, 1.4%/sec for N1&lt;br /&gt;
* once running the acceleration is (90.0 / (BypassRatio + 3.0) ) per second&lt;br /&gt;
&lt;br /&gt;
== FGTurboprop ==&lt;br /&gt;
The turboprop engine&lt;br /&gt;
&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;milthrust unit=&amp;quot;{LBS | N}&amp;quot;&amp;gt; {number} &amp;lt;/milthrust&amp;gt;&lt;br /&gt;
&amp;lt;idlen1&amp;gt; {number} &amp;lt;/idlen1&amp;gt;&lt;br /&gt;
&amp;lt;idlen2&amp;gt; {number} &amp;lt;/idlen2&amp;gt;&lt;br /&gt;
&amp;lt;maxn1&amp;gt; {number} &amp;lt;/maxn1&amp;gt;&lt;br /&gt;
&amp;lt;maxn2&amp;gt; {number} &amp;lt;/maxn2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;betarangeend&amp;gt; {number} &amp;lt;/betarangeend&amp;gt;&lt;br /&gt;
&amp;lt;reversemaxpower&amp;gt; {number} &amp;lt;/reversemaxpower&amp;gt;&lt;br /&gt;
&amp;lt;maxpower&amp;gt; {number} &amp;lt;/maxpower&amp;gt;&lt;br /&gt;
&amp;lt;psfc&amp;gt; {number} &amp;lt;/psfc&amp;gt;&lt;br /&gt;
&amp;lt;n1idle_max_delay&amp;gt; {number} &amp;lt;/n1idle_max_delay&amp;gt;&lt;br /&gt;
&amp;lt;maxstartingtime&amp;gt; {number} &amp;lt;/maxstartingtime&amp;gt;&lt;br /&gt;
&amp;lt;startern1&amp;gt; {number} &amp;lt;/startern1&amp;gt;&lt;br /&gt;
&amp;lt;ielumaxtorque&amp;gt; {number} &amp;lt;/ielumaxtorque&amp;gt;&lt;br /&gt;
&amp;lt;itt_delay&amp;gt; {number} &amp;lt;/itt_delay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;EnginePowerVC&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt; Engine power, function of airspeed and pressure &amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;independentVar lookup=&amp;quot;row&amp;quot;&amp;gt;atmosphere/P-sl-psf&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
    &amp;lt;independentVar lookup=&amp;quot;column&amp;quot;&amp;gt;velocities/ve-kts&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
                 0     50    100    150    200    250&lt;br /&gt;
       503   0.357  0.380  0.400  0.425  0.457  0.486&lt;br /&gt;
      1048   0.586  0.589  0.600  0.621  0.650  0.686&lt;br /&gt;
      1328   0.707  0.721  0.731  0.757  0.786  0.821&lt;br /&gt;
      1496   0.779  0.786  0.808  0.821  0.857  0.900&lt;br /&gt;
      1684   0.850  0.857  0.874  0.900  0.943  0.979&lt;br /&gt;
      1896   0.914  0.929  0.946  0.971  1      1.057&lt;br /&gt;
      2135   1      1.011  1.029  1.043  1.083  1.150&lt;br /&gt;
      2213   1.029  1.043  1.057  1.079  1.114  1.171&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;EnginePowerRPM_N1&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt; Engine Power, function of RPM and N1 &amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
            0   5   60    86   94   95   96   97   98   99  100  101&lt;br /&gt;
         0  0   0.5  0.5   0.5  0.5  0.5  0.5  0.5  0.5  0.5  0.5  0.5&lt;br /&gt;
       800  0   0.5 35   200  350  380  420  460  500  530  580  620&lt;br /&gt;
      1200  0   0.5 30   230  400  430  470  505  550  590  640  680&lt;br /&gt;
      1600  0   0.5  5   240  440  475  510  550  595  630  680  720&lt;br /&gt;
      2000  0   0.1  0.1 225  450  495  525  565  610  650  700  745&lt;br /&gt;
      2200  0   0.1  0.1 205  440  480  515  560  605  645  695  743&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;ITT_N1&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt; Inter-Turbine Temperature ITT [deg C] depending on N1 and engine run (0=off / 1=running) &amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
              0     1&lt;br /&gt;
      {n1 value} {number} {number}&lt;br /&gt;
       ...&lt;br /&gt;
      {n1 value} {number} {number}&lt;br /&gt;
      &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt; &lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;table name=&amp;quot;CombustionEfficiency_N1&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {n1 value} {number}&lt;br /&gt;
       ...&lt;br /&gt;
      {n1 value} {number}&lt;br /&gt;
      &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|milthrust&lt;br /&gt;
|[LBS]&lt;br /&gt;
|-&lt;br /&gt;
|idlen1&lt;br /&gt;
|[%]&lt;br /&gt;
|-&lt;br /&gt;
|maxn1&lt;br /&gt;
|[%]&lt;br /&gt;
|-&lt;br /&gt;
|betarangeend[%]&lt;br /&gt;
| if ThrottleCmd &amp;amp;lt; betarangeend/100.0 then engine power=idle, propeller pitch is controled by ThrottleCmd (between MINPITCH and  REVERSEPITCH).&amp;lt;br /&amp;gt; if ThrottleCmd &amp;amp;gt; betarangeend/100.0 then engine power increases up to max reverse power reversemaxpower [%] max engine power in reverse mode&lt;br /&gt;
|-&lt;br /&gt;
|maxpower&lt;br /&gt;
| [HP]&lt;br /&gt;
|-&lt;br /&gt;
|psfc&lt;br /&gt;
| power specific fuel consumption [pph/HP] for N1=100%&lt;br /&gt;
|-&lt;br /&gt;
|n1idle_max_delay&lt;br /&gt;
|[-] time constant for N1 change&lt;br /&gt;
|-&lt;br /&gt;
|maxstartenginetime [sec]&lt;br /&gt;
|    after this time the automatic starting cycle is interrupted when the engine doesn't start (0=automatic starting not present)&lt;br /&gt;
|-&lt;br /&gt;
|startern1&lt;br /&gt;
|[%] when starting starter spin up engine to this spin&lt;br /&gt;
|-&lt;br /&gt;
|ielumaxtorque [lb.ft]&lt;br /&gt;
|if torque&amp;gt;ielumaxtorque limiters decrease the throttle (ielu = Integrated Electronic Limiter Unit)&lt;br /&gt;
|-&lt;br /&gt;
|itt_delay&lt;br /&gt;
|[-] time constant for ITT change (ITT = Inter Turbine Temperature)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Starting the engine ===&lt;br /&gt;
In a [[YASim]] aircraft you need to simulate the spool-up of the engine in a [[Nasal]] script. For an example see lines 498-529 of [{{fgaddon aircraft url|b1900d|Nasal/systems.nas|l=498}} systems.nas] from the [[B1900d]].&lt;br /&gt;
&lt;br /&gt;
JSBSim however spools the engine up automatically when certain conditions are met. According to my experience the process is the following:&lt;br /&gt;
&lt;br /&gt;
# The [[property]] &amp;lt;code&amp;gt;/engines/engine[~n~]/cutoff&amp;lt;/code&amp;gt; has to be &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt;.&lt;br /&gt;
# Set the property &amp;lt;code&amp;gt;/controls/electric/engine[~n~]generator&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt;.&lt;br /&gt;
# Set the property &amp;lt;code&amp;gt;/controls/engines/engine[~n~]/starter&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt; as well.&lt;br /&gt;
# As result, &amp;lt;code&amp;gt;/engines/engine[~n~]/starter&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/engines/engine[~n~]/starting&amp;lt;/code&amp;gt; will be set to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt; and &amp;lt;code&amp;gt;/engines/engine[~n~]/n1&amp;lt;/code&amp;gt; will increase which means that the engine is spooling up. In JSBSim &amp;lt;code&amp;gt;n1&amp;lt;/code&amp;gt; represents the rotation speed of the turbine shaft which is significantly higher than the propeller speed.&lt;br /&gt;
# &amp;lt;code&amp;gt;/engines/engine[~n~]/n1&amp;lt;/code&amp;gt; stabilizes at a specific value which is defined in &amp;lt;code&amp;gt;&amp;lt;startern1&amp;gt;&amp;lt;/code&amp;gt; in the engine definition file of the FDM (see the table above or as an example the [{{fgaddon aircraft url|b1900d|Engines/PT6A67D.xml|l=11}} engine file] of the B1900d).&lt;br /&gt;
# When &amp;lt;code&amp;gt;/engines/engine[~n~]/n1&amp;lt;/code&amp;gt; rises above &amp;lt;b&amp;gt;15&amp;lt;/b&amp;gt; (at least I think), you can set &amp;lt;code&amp;gt;/engines/engine[~n~]/cutoff&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;false&amp;lt;/b&amp;gt; which simulates that the engine now gets supplied with fuel.&lt;br /&gt;
# This sets &amp;lt;code&amp;gt;/engines/engine[~n~]/starting&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;false&amp;lt;/b&amp;gt; and &amp;lt;code&amp;gt;/engines/engine[~n~]/cranking&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt;.&lt;br /&gt;
# Now you may set &amp;lt;code&amp;gt;/engines/engine[~n~]/starter&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;false&amp;lt;/b&amp;gt; without interrupting the starting process.&lt;br /&gt;
# &amp;lt;code&amp;gt;/engines/engine[~n~]/n1&amp;lt;/code&amp;gt; will increase further until it stabilizes at the value which is defined in &amp;lt;code&amp;gt;idlen1&amp;lt;/code&amp;gt; in the [{{fgaddon aircraft url|b1900d|Engines/PT6A67D.xml|l=5}} engine definition file].&lt;br /&gt;
# Finally &amp;lt;code&amp;gt;/engines/engine[~n~]/cranking&amp;lt;/code&amp;gt; will be set to &amp;lt;b&amp;gt;false&amp;lt;/b&amp;gt; and &amp;lt;code&amp;gt;/engines/engine[~n~]/running&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt; which means that the engine is now running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pleas note that the above described process is only an assumption based on my experiences with trying to create a JSBSim FDM for the [[Twin Otter]] which is equipped with turboprop engines, and unfortunately I cannot guarantee the correctness. If something is wrong here feel free to correct it.&lt;br /&gt;
: [[User:Dg-505|Dg-505]] ([[User talk:Dg-505|talk]]) 13:53, 5 December 2016 (EST)&lt;br /&gt;
&lt;br /&gt;
== FGRocket ==&lt;br /&gt;
The rocket engine&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;rocket_engine name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;isp&amp;gt; {number} &amp;lt;/isp&amp;gt;&lt;br /&gt;
  &amp;lt;builduptime&amp;gt; {number} &amp;lt;/builduptime&amp;gt;&lt;br /&gt;
  &amp;lt;maxthrottle&amp;gt; {number} &amp;lt;/maxthrottle&amp;gt;&lt;br /&gt;
  &amp;lt;minthrottle&amp;gt; {number} &amp;lt;/minthrottle&amp;gt;&lt;br /&gt;
  &amp;lt;slfuelflowmax&amp;gt; {number} &amp;lt;/slfuelflowmax&amp;gt;&lt;br /&gt;
  &amp;lt;sloxiflowmax&amp;gt;  {number} &amp;lt;/sloxiflowmax&amp;gt;&lt;br /&gt;
  &amp;lt;variation&amp;gt;&lt;br /&gt;
    &amp;lt;thrust&amp;gt; {number} &amp;lt;/thrust&amp;gt;&lt;br /&gt;
    &amp;lt;total_isp&amp;gt; {number} &amp;lt;/total_isp&amp;gt;&lt;br /&gt;
  &amp;lt;/variation&amp;gt; &lt;br /&gt;
  &amp;lt;thrust_table name=&amp;quot;propulsion/thrust_prop_remain&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {number} {number}&lt;br /&gt;
	...&lt;br /&gt;
      {number} {number}&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/thrust_table&amp;gt;&lt;br /&gt;
&amp;lt;/rocket_engine&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FGElectric ==&lt;br /&gt;
Simple thrust producer. You enter the max power as &amp;lt;power unit=&amp;quot;WATTS&amp;quot;&amp;gt; and the engine model produces throttle_setting*power watts of output.&lt;br /&gt;
* Enter the max power as &amp;lt;power unit=&amp;quot;WATTS&amp;quot;&amp;gt; and the engine model produces throttle_setting*power watts of output.&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;electric_engine name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;power unit=&amp;quot;{HP | WATTS}&amp;quot;&amp;gt; {number} &amp;lt;/power&amp;gt;&lt;br /&gt;
&amp;lt;/electric_engine&amp;gt; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
FGElectric models an electric motor based on the configuration file &amp;lt;power&amp;gt; parameter. The throttle controls motor output linearly from zero to &amp;lt;power&amp;gt;. This power value (converted internally to horsepower) is then used by FGPropeller to apply torque to the propeller.  At present there is no battery model available, so this motor does not consume any energy.  There is no internal friction.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
* http://jsbsim.sourceforge.net/JSBSim/classJSBSim_1_1FGPiston.html&lt;br /&gt;
* http://jsbsim.sourceforge.net/JSBSim/classJSBSim_1_1FGTurbine.html&lt;br /&gt;
* http://jsbsim.sourceforge.net/JSBSim/classJSBSim_1_1FGTurboProp.html&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=JSBSim_Engines&amp;diff=107726</id>
		<title>JSBSim Engines</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=JSBSim_Engines&amp;diff=107726"/>
		<updated>2017-05-01T14:03:16Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[JSBSim]] provides a framework for aerodynamics. This page will attempt to explain how to create engines for the JSBSim framework.  Engines also require [[JSBSim Thrusters|thrusters]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FGPiston ==&lt;br /&gt;
Piston engine model. You enter values based on commonly available data and this model creates reasonable output values.&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
 &amp;lt;piston_engine name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;minmp unit=&amp;quot;{INHG | PA | ATM}&amp;quot;&amp;gt; {number} &amp;lt;/minmp&amp;gt;&lt;br /&gt;
  &amp;lt;maxmp unit=&amp;quot;{INHG | PA | ATM}&amp;quot;&amp;gt; {number} &amp;lt;/maxmp&amp;gt;&lt;br /&gt;
  &amp;lt;displacement unit=&amp;quot;{IN3 | LTR | CC}&amp;quot;&amp;gt; {number} &amp;lt;/displacement&amp;gt;&lt;br /&gt;
  &amp;lt;bore unit=&amp;quot;{IN | M}&amp;quot;&amp;gt; {number} &amp;lt;/bore&amp;gt; &amp;lt;!-- Unused --&amp;gt;&lt;br /&gt;
  &amp;lt;stroke unit=&amp;quot;{IN | M}&amp;quot;&amp;gt; {number} &amp;lt;/stroke&amp;gt;&lt;br /&gt;
  &amp;lt;cylinders&amp;gt; {number} &amp;lt;/cylinders&amp;gt;&amp;lt;!-- Unused --&amp;gt;&lt;br /&gt;
  &amp;lt;cylinder-head-mass unit=&amp;quot;{KG | LBS}&amp;quot;&amp;gt; {number} &amp;lt;/cylinder-head-mass&amp;gt; &lt;br /&gt;
  &amp;lt;compression-ratio&amp;gt; {number} &amp;lt;/compression-ratio&amp;gt;&lt;br /&gt;
  &amp;lt;sparkfaildrop&amp;gt; {number} &amp;lt;/sparkfaildrop&amp;gt;&lt;br /&gt;
  &amp;lt;maxhp unit=&amp;quot;{HP | WATTS}&amp;quot;&amp;gt; {number} &amp;lt;/maxhp&amp;gt;&lt;br /&gt;
  &amp;lt;cycles&amp;gt; {number} &amp;lt;/cycles&amp;gt; &lt;br /&gt;
  &amp;lt;idlerpm&amp;gt; {number} &amp;lt;/idlerpm&amp;gt;&lt;br /&gt;
  &amp;lt;maxrpm&amp;gt; {number} &amp;lt;/maxrpm&amp;gt;&lt;br /&gt;
  &amp;lt;numboostspeeds&amp;gt; {number} &amp;lt;/numboostspeeds&amp;gt;&lt;br /&gt;
  &amp;lt;boostoverride&amp;gt; {0 | 1} &amp;lt;/boostoverride&amp;gt;&lt;br /&gt;
  &amp;lt;boostmanual&amp;gt; {0 | 1} &amp;lt;/boostmanual&amp;gt;&lt;br /&gt;
  &amp;lt;ratedboost1 unit=&amp;quot;{INHG | PA | ATM}&amp;quot;&amp;gt; {number} &amp;lt;/ratedboost1&amp;gt;&lt;br /&gt;
  &amp;lt;ratedpower1 unit=&amp;quot;{HP | WATTS}&amp;quot;&amp;gt; {number} &amp;lt;/ratedpower1&amp;gt;&lt;br /&gt;
  &amp;lt;ratedrpm1&amp;gt; {number} &amp;lt;/ratedrpm1&amp;gt;&lt;br /&gt;
  &amp;lt;ratedaltitude1 unit=&amp;quot;{FT | M}&amp;quot;&amp;gt; {number} &amp;lt;/ratedaltitude1&amp;gt;&lt;br /&gt;
 (repeat for speeds 2 and 3)&lt;br /&gt;
  &amp;lt;takeoffboost unit=&amp;quot;{INHG | PA | ATM}&amp;quot;&amp;gt; {number} &amp;lt;/takeoffboost&amp;gt;&lt;br /&gt;
 &amp;lt;!-- advanced tags! --&amp;gt;&lt;br /&gt;
  &amp;lt;bsfc unit=&amp;quot;{LBS/HP*HR | KG/KW*HR}&amp;quot;&amp;gt; {number} &amp;lt;/bsfc&amp;gt;&lt;br /&gt;
  &amp;lt;volumetric-efficiency&amp;gt; {number} &amp;lt;/volumetric-efficiency&amp;gt;&lt;br /&gt;
  &amp;lt;air-intake-impedance-factor&amp;gt; {number} &amp;lt;/air-intake-impedance-factor&amp;gt;&lt;br /&gt;
  &amp;lt;ram-air-factor&amp;gt; {number} &amp;lt;/ram-air-factor&amp;gt;&lt;br /&gt;
  &amp;lt;cooling-factor&amp;gt; {number} &amp;lt;/cooling-factor&amp;gt; &lt;br /&gt;
&amp;lt;!-- Added in FlightGear 2.8 --&amp;gt;&lt;br /&gt;
  &amp;lt;starter-torque&amp;gt; {number} &amp;lt;/starter-torque&amp;gt;&lt;br /&gt;
  &amp;lt;starter-rpm&amp;gt; {number} &amp;lt;/starter-rpm&amp;gt;&lt;br /&gt;
  &amp;lt;static-friction  unit=&amp;quot;{HP | WATTS}&amp;quot;&amp;gt; {number} &amp;lt;/static-friction&amp;gt;&lt;br /&gt;
  &amp;lt;man-press-lag&amp;gt; {number} &amp;lt;/man-press-lag&amp;gt;&lt;br /&gt;
  &amp;lt;boost-loss-factor&amp;gt; {number} &amp;lt;/boost-loss-factor&amp;gt;&lt;br /&gt;
&amp;lt;!-- Added in FlightGear 2017.2 --&amp;gt;&lt;br /&gt;
  &amp;lt;oil-pressure-relief-valve-psi&amp;gt; {number} &amp;lt;/oil-pressure-relief-valve-psi&amp;gt;&lt;br /&gt;
  &amp;lt;design-oil-temp-degK&amp;gt; {number} &amp;lt;/design-oil-temp-degK&amp;gt;&lt;br /&gt;
  &amp;lt;oil-pressure-rpm-max&amp;gt; {number} &amp;lt;/oil-pressure-rpm-max&amp;gt;&lt;br /&gt;
  &amp;lt;oil-viscosity-index&amp;gt; {number} &amp;lt;/oil-viscosity-index&amp;gt;&lt;br /&gt;
 &amp;lt;/piston_engine&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|minmp&lt;br /&gt;
|this value is the nominal idle manifold pressure at sea-level without boost. Along with idlerpm, it determines the throttle response slope.&lt;br /&gt;
|- &lt;br /&gt;
|maxmp&lt;br /&gt;
|this value is the nomial maximum manifold pressure at sea-level without boost. Along with maxrpm it determines the resistance of the aircraft's intake system. See air-intake-impedance-factor&lt;br /&gt;
|-&lt;br /&gt;
|displacement&lt;br /&gt;
|this value is used to determine mass air and fuel flow which impacts engine power and cooling.&lt;br /&gt;
|-&lt;br /&gt;
|bore&lt;br /&gt;
|cylinder bore is currently unused.&lt;br /&gt;
|-&lt;br /&gt;
|stroke&lt;br /&gt;
|piston stroke is used to determine the mean piston speed. A longer stroke results in an engine that does not work as well at higher speeds.&lt;br /&gt;
|-&lt;br /&gt;
|cylinders &lt;br /&gt;
|number of cylinders scales the cylinder head mass.&lt;br /&gt;
|-&lt;br /&gt;
|cylinder-head-mass&lt;br /&gt;
|the nominal mass of a cylinder head. A larger value slows changes in engine temperature&lt;br /&gt;
|-&lt;br /&gt;
|compression-ratio&lt;br /&gt;
|the compression ratio affects the change in volumetric efficiency with altitude.&lt;br /&gt;
|-&lt;br /&gt;
|sparkfaildrop&lt;br /&gt;
|this is the percentage drop in horsepower for single magneto operation.&lt;br /&gt;
|-&lt;br /&gt;
|maxhp&lt;br /&gt;
|this value is the nominal power the engine creates at maxrpm. It will determine bsfc if that tag is not input. It also determines the starter motor power.&lt;br /&gt;
|-&lt;br /&gt;
|static-friction&lt;br /&gt;
|this value is the power required to turn an engine that is not running. Used to control and slow a windmilling propeller.&lt;br /&gt;
|-&lt;br /&gt;
|cycles&lt;br /&gt;
|Designate a 2 or 4 stroke engine. Currently only the 4 stroke engine is supported.&lt;br /&gt;
|-&lt;br /&gt;
|idlerpm&lt;br /&gt;
|this value affects the throttle fall off and the engine stops running if it is slowed below 80% of this value. The engine starts running when it reaches 80% of this value.&lt;br /&gt;
|-&lt;br /&gt;
|maxrpm&lt;br /&gt;
|this value is used to calculate air-box resistance and BSFC. It also affects oil pressure among other things.&lt;br /&gt;
|-&lt;br /&gt;
|maxthrottle&lt;br /&gt;
|Deprecated / unused&lt;br /&gt;
|-&lt;br /&gt;
|minthrottle&lt;br /&gt;
|Deprecated / unused&lt;br /&gt;
|-&lt;br /&gt;
|numboostspeed&lt;br /&gt;
| zero (or not present) for a naturally-aspirated engine, either 1, 2 or 3 for a boosted engine.  This corresponds to the number of supercharger speeds.  Merlin XII had 1 speed, Merlin 61 had 2, a late  Griffon engine apparently had 3.  No known engine more than 3, although some German engines apparently had a continuously variable-speed supercharger.&lt;br /&gt;
|-&lt;br /&gt;
|boostoverride&lt;br /&gt;
|unused&lt;br /&gt;
|-&lt;br /&gt;
|boost-loss-factor (fgfs 2.8)&lt;br /&gt;
|boost-loss-factor - zero (or not present) for 'free' supercharging. A value entered will be used as a multiplier to the power required to compress the input air. Typical value should be 1.15 to 1.20.&lt;br /&gt;
|-&lt;br /&gt;
|boostmanual&lt;br /&gt;
|whether a multispeed supercharger will manually or automatically shift boost speeds. On manual shifting the boost speeds is accomplished by controlling propulsion/engine/boostspeed&lt;br /&gt;
|-&lt;br /&gt;
|takeoffboost&lt;br /&gt;
|boost in psi above sea level ambient.&lt;br /&gt;
|-&lt;br /&gt;
|ratedboost[123]&lt;br /&gt;
|the absolute rated boost above sea level ambient (14.7 PSI, 29.92 inHg) for a given boost speed, in psi&lt;br /&gt;
|-&lt;br /&gt;
|ratedpower[123]&lt;br /&gt;
|required by the parser but ignored&lt;br /&gt;
|-&lt;br /&gt;
|ratedrpm[123]&lt;br /&gt;
|The rpm at which rated boost is developed&lt;br /&gt;
|-&lt;br /&gt;
|ratedaltitude[123]&lt;br /&gt;
|The altitude up to which rated boost can be maintained. Up to this altitude the boost is maintained constant for a given throttle position by the BCV or wastegate. Beyond this altitude the manifold pressure must drop, since the supercharger is now at maximum unregulated output. The actual pressure multiplier of the supercharger system is calculated at initialisation from this value.&lt;br /&gt;
|-&lt;br /&gt;
|bsfc (Advanced)&lt;br /&gt;
|Indicated Specific Fuel Consumption. The power produced per unit of fuel. Higher numbers give worse fuel economy. This number may need to be lowered slightly from actual BSFC numbers because some internal engine losses are modeled separately.&lt;br /&gt;
|-&lt;br /&gt;
|volumetric-efficiency (Advanced)&lt;br /&gt;
|the nominal volumetric efficiency of the engine. Boosted engines require values above 1.&lt;br /&gt;
|-&lt;br /&gt;
|air-intake-impedance-factor (Advanced)&lt;br /&gt;
|this number is the pressure drop across the intake system. Increasing it reduces available manifold pressure.&lt;br /&gt;
|-&lt;br /&gt;
|ram-air-factor (Advanced)&lt;br /&gt;
|this number creates a pressure increase with an increase in dynamic pressure (aircraft speed).&lt;br /&gt;
|-&lt;br /&gt;
|cooling-factor (Advanced)&lt;br /&gt;
|this number models how efficient the aircraft cooling system is.&lt;br /&gt;
|-&lt;br /&gt;
|starter-torque (fgfs 2.8)&lt;br /&gt;
|A value specifying the zero RPM torque in lb*ft the starter motor provides. Current default value is 40% of the maximum horsepower value.&lt;br /&gt;
|-&lt;br /&gt;
|starter-rpm (fgfs 2.8)&lt;br /&gt;
| A value specifying the maximum RPM the unloaded starter motor can achieve. Loads placed on the engine by the propeller and throttle will further limit RPM achieved in practice.  The actual RPM needs to be more than idlerpm * 0.8 for the engine to start running.&lt;br /&gt;
|-&lt;br /&gt;
|static-friction (fgfs 2.8)&lt;br /&gt;
|this value is the power required to turn an engine that is not running. Used to control and slow a windmilling propeller. Choose a small percentage of maxhp. It can also be adjusted at run-time to simulate accessory or other non-thruster engine load.&lt;br /&gt;
|-&lt;br /&gt;
|man-press-lag (fgfs 2.8)&lt;br /&gt;
|Delay in seconds for manifold pressure changes to take effect after the throttle is moved or the RPM changes. Default is 1 second.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
* Intake &amp;amp; Throttle&lt;br /&gt;
** The intake is modeled by &amp;lt;ram-air-factor&amp;gt;,&amp;lt;minmp&amp;gt;, &amp;lt;maxmp&amp;gt;, and &amp;lt;air-intake-impedance-factor&amp;gt;. &lt;br /&gt;
** &amp;lt;ram-air-factor&amp;gt; is the efficiency of the air scoop intake. 0 turns ram air off. Default is 1. This value is exposed on the property tree so it may be altered at runtime to simulate alternate air, etc. The value can be calculated by (ambient pressure)/(desired pressure)-1 where desired pressure is full throttle at rated RPM.&lt;br /&gt;
** &amp;lt;maxmp&amp;gt; is the maximum manifold pressure achievable. It is used for determining &amp;lt;BSFC&amp;gt; and &amp;lt;air-intake-impedance-factor&amp;gt; if a values are not supplied for those items.&lt;br /&gt;
** &amp;lt;minmp&amp;gt; is used along with &amp;lt;idlerpm&amp;gt; to determine the slope of the throttle response&lt;br /&gt;
** &amp;lt;air-intake-impedance-factor&amp;gt; is the fixed impedance in the air intake system. It is determined by &amp;lt;maxmp&amp;gt; if not supplied. This value is exposed on the property tree so it may be altered at runtime to simulate intake icing, alternate air, etc.&lt;br /&gt;
* Boost&lt;br /&gt;
** &amp;lt;boostmanual&amp;gt; whether a multispeed supercharger will manually or automatically shift boost speeds. On manual shifting the boost speeds is accomplished by controlling propulsion/engine/boostspeed&lt;br /&gt;
** &amp;lt;takeoffboost&amp;gt; -  Many aircraft had an extra boost setting beyond rated boost, but not totally uncontrolled as in the already mentioned boost-control-cutout, typically attained by pushing the throttle past a mechanical 'gate' preventing its inadvertant use. This was typically used for takeoff, and emergency situations, generally for not more than five minutes. This is a change in the boost control setting, not the actual supercharger speed, and so would only give extra power below the rated altitude. When TAKEOFFBOOST is specified in the config file (and is above RATEDBOOST1), then the throttle position is interpreted as:&lt;br /&gt;
*** 0 to 0.98 : idle manifold pressure to rated boost (where attainable)&lt;br /&gt;
*** 0.99, 1.0 : takeoff boost (where attainable).&lt;br /&gt;
*** A typical takeoff boost for an earlyish Merlin was about 12psi, compared with a rated boost of 9psi.&lt;br /&gt;
*** It is quite possible that other boost control settings could have been used on some aircraft, or that takeoff/extra boost could have activated by other means than pushing the throttle full forward through a gate, but this will suffice for now.&lt;br /&gt;
** &amp;lt;ratedboost[123]&amp;gt; - the absolute rated boost above sea level ambient (14.7 PSI, 29.92 inHg) for a given boost speed, in psi. Eg the Merlin XII had a rated boost of 9psi, giving approximately 39inHg manifold pressure up to the rated altitude.&lt;br /&gt;
*** Note that &amp;lt;maxmp&amp;gt; is still the non-boosted max manifold pressure even for boosted engines - effectively this is simply a measure of the pressure drop through the fully open throttle.&lt;br /&gt;
** &amp;lt;ratedaltitude[123]&amp;gt; - The altitude up to which rated boost can be maintained. Up to this altitude the boost is maintained constant for a given throttle position by the BCV or wastegate. Beyond this altitude the manifold pressure must drop, since the supercharger is now at maximum unregulated output. The actual pressure multiplier of the supercharger system is calculated at initialisation from this value.&lt;br /&gt;
** &amp;lt;ratedpower[123]&amp;gt; - The power developed at rated boost at rated altitude at rated rpm.&lt;br /&gt;
** &amp;lt;ratedrpm[123]&amp;gt; - The rpm at which rated power is developed.&lt;br /&gt;
* Power production&lt;br /&gt;
** &amp;lt;sparkfaildrop&amp;gt; is the amount of power you get for single magneto operation, try a value of 0.8 or so.&lt;br /&gt;
** &amp;lt;volumetric-efficiency&amp;gt; controls how much air goes through the engine at a given RPM. Values below 1 for unboosted engines and values over 1 for boosted engines. This value is exposed on the property tree so it may be altered at runtime.&lt;br /&gt;
** &amp;lt;bsfc&amp;gt; is the amount of power the engine produces per unit of fuel consumed. Use it to tune the power produced. This value is exposed on the property tree so it may be altered at runtime.&lt;br /&gt;
* Cooling&lt;br /&gt;
** &amp;lt;cylinder-head-mass&amp;gt; controls how fast the engine heats up and cools off. So if you have a '5-minute' limit on a power setting you can adjust this value so the engine just starts to overheat at the end of the given time frame.&lt;br /&gt;
** &amp;lt;cooling-factor&amp;gt; controls how much 'air' flows over the engine to cool it. Raising the value makes the engine run cooler. This value is exposed on the property tree so it may be altered at runtime to simulate cowl flaps, for example.&lt;br /&gt;
* Tuning&lt;br /&gt;
** Using a constant speed load, set the engine model to full throttle and rated RPM.&lt;br /&gt;
** Set &amp;lt;ram-air-factor&amp;gt; to zero.&lt;br /&gt;
** Adjust &amp;lt;air-intake-impedance-factor&amp;gt; to achieve the proper static full throttle manifold pressure.&lt;br /&gt;
** Increase airspeed to cruise and adjust &amp;lt;ram-air-factor&amp;gt; to achieve the proper dynamic full throttle manifold pressure.&lt;br /&gt;
** Adjust &amp;lt;volumetric-efficiency&amp;gt; first to achieve desired fuel flow rate, leaning engine as required.&lt;br /&gt;
** Adjust &amp;lt;bsfc&amp;gt; to achieve desired power.&lt;br /&gt;
** Some piston engines will have power curves that will need to be altered from default depending on operating conditions.  For example engines with multi-speed superchargers will produce less horse power on high speed at the same manifold pressure compared to low speed.  Functions can be setup to alter &amp;lt;volumetric-efficiency&amp;gt; and &amp;lt;bsfc&amp;gt; at run time to get the power and fuel consumption curves correct by using different values for high and low supercharger speeds.&lt;br /&gt;
&lt;br /&gt;
== FGTurbine ==&lt;br /&gt;
The jet turbine engine&lt;br /&gt;
&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
 &amp;lt;turbine_engine name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;milthrust unit=&amp;quot;{LBS | N}&amp;quot;&amp;gt; {number} &amp;lt;/milthrust&amp;gt;&lt;br /&gt;
  &amp;lt;maxthrust unit=&amp;quot;{LBS | N}&amp;quot;&amp;gt; {number} &amp;lt;/maxthrust&amp;gt;&lt;br /&gt;
  &amp;lt;bypassratio&amp;gt; {number} &amp;lt;/bypassratio&amp;gt;&lt;br /&gt;
  &amp;lt;bleed&amp;gt; {number} &amp;lt;/bleed&amp;gt;&lt;br /&gt;
  &amp;lt;tsfc&amp;gt; {number} &amp;lt;/tsfc&amp;gt;&lt;br /&gt;
  &amp;lt;atsfc&amp;gt; {number} &amp;lt;/atsfc&amp;gt;&lt;br /&gt;
  &amp;lt;idlen1&amp;gt; {number} &amp;lt;/idlen1&amp;gt;&lt;br /&gt;
  &amp;lt;idlen2&amp;gt; {number} &amp;lt;/idlen2&amp;gt;&lt;br /&gt;
  &amp;lt;n1spinup&amp;gt; {number} &amp;lt;/n1spinup&amp;gt;&lt;br /&gt;
  &amp;lt;n2spinup&amp;gt; {number} &amp;lt;/n2spinup&amp;gt;&lt;br /&gt;
  &amp;lt;maxn1&amp;gt; {number} &amp;lt;/maxn1&amp;gt;&lt;br /&gt;
  &amp;lt;maxn2&amp;gt; {number} &amp;lt;/maxn2&amp;gt;&lt;br /&gt;
  &amp;lt;augmented&amp;gt; {0 | 1} &amp;lt;/augmented&amp;gt;&lt;br /&gt;
  &amp;lt;augmethod&amp;gt; {0 | 1 | 2} &amp;lt;/augmethod&amp;gt;&lt;br /&gt;
  &amp;lt;injected&amp;gt; {0 | 1} &amp;lt;/injected&amp;gt;&lt;br /&gt;
  &amp;lt;injection-time&amp;gt; {number} &amp;lt;/injection-time&amp;gt;&lt;br /&gt;
  &amp;lt;function name=&amp;quot;IdleThrust&amp;quot;&amp;gt; &amp;lt;/function&amp;gt;&lt;br /&gt;
  &amp;lt;function name=&amp;quot;MilThrust&amp;quot;&amp;gt;  &amp;lt;/function&amp;gt;&lt;br /&gt;
  &amp;lt;function name=&amp;quot;AugThrust&amp;quot;&amp;gt;  &amp;lt;/function&amp;gt;&lt;br /&gt;
  &amp;lt;function name=&amp;quot;Injection&amp;quot;&amp;gt;  &amp;lt;/function&amp;gt;&lt;br /&gt;
 &amp;lt;/turbine_engine&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|milthrust&lt;br /&gt;
|Maximum thrust, static, at sea level.&lt;br /&gt;
|-&lt;br /&gt;
|maxthrust&lt;br /&gt;
|Afterburning thrust, static, at sea level.&lt;br /&gt;
|-&lt;br /&gt;
|bypassratio&lt;br /&gt;
|Ratio of bypass air flow to core air flow.&lt;br /&gt;
|-&lt;br /&gt;
|bleed&lt;br /&gt;
|Thrust reduction factor due to losses (0.0 to 1.0).&lt;br /&gt;
|-&lt;br /&gt;
|tsfc&lt;br /&gt;
|Thrust-specific fuel consumption at cruise, lbm/hr/lbf&lt;br /&gt;
|-&lt;br /&gt;
|atsfc&lt;br /&gt;
|Afterburning TSFC, lbm/hr/lbf&lt;br /&gt;
|-&lt;br /&gt;
|idlen1&lt;br /&gt;
|Fan rotor rpm (% of max) at idle&lt;br /&gt;
|-&lt;br /&gt;
|idlen2&lt;br /&gt;
|Core rotor rpm (% of max) at idle&lt;br /&gt;
|-&lt;br /&gt;
|n1spinup&lt;br /&gt;
|Fan rotor rpm starter acceleration (default 1.0%/sec)&lt;br /&gt;
|-&lt;br /&gt;
|n2spinup&lt;br /&gt;
|Core rotor rpm starter acceleration (default 3.0%/sec)&lt;br /&gt;
|-&lt;br /&gt;
|maxn1&lt;br /&gt;
|Fan rotor rpm (% of max) at full throttle&lt;br /&gt;
|-&lt;br /&gt;
|maxn2&lt;br /&gt;
|Core rotor rpm (% of max) at full throttle&lt;br /&gt;
|-&lt;br /&gt;
|augmented&lt;br /&gt;
|0 = afterburner not installed&amp;lt;br /&amp;gt;1 = afterburner installed&lt;br /&gt;
|-&lt;br /&gt;
|augmethod&lt;br /&gt;
|0 = afterburner activated by property /engines/engine[n]/augmentation&amp;lt;br /&amp;gt;1 = afterburner activated by pushing throttle above 99% position&amp;lt;br /&amp;gt;2 = throttle range is expanded in the FCS, and values above 1.0 are afterburner range&lt;br /&gt;
|-&lt;br /&gt;
|injected&lt;br /&gt;
|0 = Water injection not installed&amp;lt;br /&amp;gt;1 = Water injection installed&lt;br /&gt;
|-&lt;br /&gt;
|injection-time&lt;br /&gt;
|Time, in seconds, of water injection duration&lt;br /&gt;
|-&lt;br /&gt;
|function&lt;br /&gt;
|Two functions, IdleThrust and MilThrust must always be defined. AugThrust is required for afterburning (reheated) engines. Injection is for water injected engines. These functions return a multiplier that is applied to the supplied static thrust values. In aeromatic configurations these functions are tables based on sonic velocity and air density&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
*Bypass ratio is used only to estimate engine acceleration time. The effect of bypass ratio on engine efficiency is already included in the TSFC value. Feel free to set this parameter (even for turbojets) to whatever value gives a desired spool-up rate. Default value is 0.&lt;br /&gt;
*The bleed factor is multiplied by thrust to give a resulting thrust after losses. This can represent losses due to bleed, or any other cause. Default value is 0. A common value would be 0.04.&lt;br /&gt;
*Nozzle position, for variable area exhaust nozzles, is provided for users needing to drive a nozzle gauge or animate a virtual nozzle.&lt;br /&gt;
*This model can only be used with the &amp;quot;direct&amp;quot; thruster. See the file: /engine/direct.xml&lt;br /&gt;
*TSFC=fuel consumption per hour/thrust&lt;br /&gt;
*There is a Java program here to calculate thrust vs airspeed and altitude. http://adg.stanford.edu/aa241/propulsion/engmodel.html&lt;br /&gt;
* n1spinup and n2spinup are the rate (in %/sec) of increase below 25.8% N2, or until 15% if cutoff is false.&lt;br /&gt;
* acceleration between 25.8% N2 and Idle is at a preset rate of 2.0/%sec for M2, 1.4%/sec for N1&lt;br /&gt;
* once running the acceleration is (90.0 / (BypassRatio + 3.0) ) per second&lt;br /&gt;
&lt;br /&gt;
== FGTurboprop ==&lt;br /&gt;
The turboprop engine&lt;br /&gt;
&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;milthrust unit=&amp;quot;{LBS | N}&amp;quot;&amp;gt; {number} &amp;lt;/milthrust&amp;gt;&lt;br /&gt;
&amp;lt;idlen1&amp;gt; {number} &amp;lt;/idlen1&amp;gt;&lt;br /&gt;
&amp;lt;idlen2&amp;gt; {number} &amp;lt;/idlen2&amp;gt;&lt;br /&gt;
&amp;lt;maxn1&amp;gt; {number} &amp;lt;/maxn1&amp;gt;&lt;br /&gt;
&amp;lt;maxn2&amp;gt; {number} &amp;lt;/maxn2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;betarangeend&amp;gt; {number} &amp;lt;/betarangeend&amp;gt;&lt;br /&gt;
&amp;lt;reversemaxpower&amp;gt; {number} &amp;lt;/reversemaxpower&amp;gt;&lt;br /&gt;
&amp;lt;maxpower&amp;gt; {number} &amp;lt;/maxpower&amp;gt;&lt;br /&gt;
&amp;lt;psfc&amp;gt; {number} &amp;lt;/psfc&amp;gt;&lt;br /&gt;
&amp;lt;n1idle_max_delay&amp;gt; {number} &amp;lt;/n1idle_max_delay&amp;gt;&lt;br /&gt;
&amp;lt;maxstartingtime&amp;gt; {number} &amp;lt;/maxstartingtime&amp;gt;&lt;br /&gt;
&amp;lt;startern1&amp;gt; {number} &amp;lt;/startern1&amp;gt;&lt;br /&gt;
&amp;lt;ielumaxtorque&amp;gt; {number} &amp;lt;/ielumaxtorque&amp;gt;&lt;br /&gt;
&amp;lt;itt_delay&amp;gt; {number} &amp;lt;/itt_delay&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;EnginePowerVC&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt; Engine power, function of airspeed and pressure &amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;independentVar lookup=&amp;quot;row&amp;quot;&amp;gt;atmosphere/P-sl-psf&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
    &amp;lt;independentVar lookup=&amp;quot;column&amp;quot;&amp;gt;velocities/ve-kts&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
                 0     50    100    150    200    250&lt;br /&gt;
       503   0.357  0.380  0.400  0.425  0.457  0.486&lt;br /&gt;
      1048   0.586  0.589  0.600  0.621  0.650  0.686&lt;br /&gt;
      1328   0.707  0.721  0.731  0.757  0.786  0.821&lt;br /&gt;
      1496   0.779  0.786  0.808  0.821  0.857  0.900&lt;br /&gt;
      1684   0.850  0.857  0.874  0.900  0.943  0.979&lt;br /&gt;
      1896   0.914  0.929  0.946  0.971  1      1.057&lt;br /&gt;
      2135   1      1.011  1.029  1.043  1.083  1.150&lt;br /&gt;
      2213   1.029  1.043  1.057  1.079  1.114  1.171&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;EnginePowerRPM_N1&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt; Engine Power, function of RPM and N1 &amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
            0   5   60    86   94   95   96   97   98   99  100  101&lt;br /&gt;
         0  0   0.5  0.5   0.5  0.5  0.5  0.5  0.5  0.5  0.5  0.5  0.5&lt;br /&gt;
       800  0   0.5 35   200  350  380  420  460  500  530  580  620&lt;br /&gt;
      1200  0   0.5 30   230  400  430  470  505  550  590  640  680&lt;br /&gt;
      1600  0   0.5  5   240  440  475  510  550  595  630  680  720&lt;br /&gt;
      2000  0   0.1  0.1 225  450  495  525  565  610  650  700  745&lt;br /&gt;
      2200  0   0.1  0.1 205  440  480  515  560  605  645  695  743&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;table name=&amp;quot;ITT_N1&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt; Inter-Turbine Temperature ITT [deg C] depending on N1 and engine run (0=off / 1=running) &amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
              0     1&lt;br /&gt;
      {n1 value} {number} {number}&lt;br /&gt;
       ...&lt;br /&gt;
      {n1 value} {number} {number}&lt;br /&gt;
      &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt; &lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;table name=&amp;quot;CombustionEfficiency_N1&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {n1 value} {number}&lt;br /&gt;
       ...&lt;br /&gt;
      {n1 value} {number}&lt;br /&gt;
      &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameter definitions ===&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|milthrust&lt;br /&gt;
|[LBS]&lt;br /&gt;
|-&lt;br /&gt;
|idlen1&lt;br /&gt;
|[%]&lt;br /&gt;
|-&lt;br /&gt;
|maxn1&lt;br /&gt;
|[%]&lt;br /&gt;
|-&lt;br /&gt;
|betarangeend[%]&lt;br /&gt;
| if ThrottleCmd &amp;amp;lt; betarangeend/100.0 then engine power=idle, propeller pitch is controled by ThrottleCmd (between MINPITCH and  REVERSEPITCH).&amp;lt;br /&amp;gt; if ThrottleCmd &amp;amp;gt; betarangeend/100.0 then engine power increases up to max reverse power reversemaxpower [%] max engine power in reverse mode&lt;br /&gt;
|-&lt;br /&gt;
|maxpower&lt;br /&gt;
| [HP]&lt;br /&gt;
|-&lt;br /&gt;
|psfc&lt;br /&gt;
| power specific fuel consumption [pph/HP] for N1=100%&lt;br /&gt;
|-&lt;br /&gt;
|n1idle_max_delay&lt;br /&gt;
|[-] time constant for N1 change&lt;br /&gt;
|-&lt;br /&gt;
|maxstartenginetime [sec]&lt;br /&gt;
|    after this time the automatic starting cycle is interrupted when the engine doesn't start (0=automatic starting not present)&lt;br /&gt;
|-&lt;br /&gt;
|startern1&lt;br /&gt;
|[%] when starting starter spin up engine to this spin&lt;br /&gt;
|-&lt;br /&gt;
|ielumaxtorque [lb.ft]&lt;br /&gt;
|if torque&amp;gt;ielumaxtorque limiters decrease the throttle (ielu = Integrated Electronic Limiter Unit)&lt;br /&gt;
|-&lt;br /&gt;
|itt_delay&lt;br /&gt;
|[-] time constant for ITT change (ITT = Inter Turbine Temperature)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Starting the engine ===&lt;br /&gt;
In a [[YASim]] aircraft you need to simulate the spool-up of the engine in a [[Nasal]] script. For an example see lines 498-529 of [{{fgaddon aircraft url|b1900d|Nasal/systems.nas|l=498}} systems.nas] from the [[B1900d]].&lt;br /&gt;
&lt;br /&gt;
JSBSim however spools the engine up automatically when certain conditions are met. According to my experience the process is the following:&lt;br /&gt;
&lt;br /&gt;
# The [[property]] &amp;lt;code&amp;gt;/engines/engine[~n~]/cutoff&amp;lt;/code&amp;gt; has to be &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt;.&lt;br /&gt;
# Set the property &amp;lt;code&amp;gt;/controls/electric/engine[~n~]generator&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt;.&lt;br /&gt;
# Set the property &amp;lt;code&amp;gt;/controls/engines/engine[~n~]/starter&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt; as well.&lt;br /&gt;
# As result, &amp;lt;code&amp;gt;/engines/engine[~n~]/starter&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/engines/engine[~n~]/starting&amp;lt;/code&amp;gt; will be set to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt; and &amp;lt;code&amp;gt;/engines/engine[~n~]/n1&amp;lt;/code&amp;gt; will increase which means that the engine is spooling up. In JSBSim &amp;lt;code&amp;gt;n1&amp;lt;/code&amp;gt; represents the rotation speed of the turbine shaft which is significantly higher than the propeller speed.&lt;br /&gt;
# &amp;lt;code&amp;gt;/engines/engine[~n~]/n1&amp;lt;/code&amp;gt; stabilizes at a specific value which is defined in &amp;lt;code&amp;gt;&amp;lt;startern1&amp;gt;&amp;lt;/code&amp;gt; in the engine definition file of the FDM (see the table above or as an example the [{{fgaddon aircraft url|b1900d|Engines/PT6A67D.xml|l=11}} engine file] of the B1900d).&lt;br /&gt;
# When &amp;lt;code&amp;gt;/engines/engine[~n~]/n1&amp;lt;/code&amp;gt; rises above &amp;lt;b&amp;gt;15&amp;lt;/b&amp;gt; (at least I think), you can set &amp;lt;code&amp;gt;/engines/engine[~n~]/cutoff&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;false&amp;lt;/b&amp;gt; which simulates that the engine now gets supplied with fuel.&lt;br /&gt;
# This sets &amp;lt;code&amp;gt;/engines/engine[~n~]/starting&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;false&amp;lt;/b&amp;gt; and &amp;lt;code&amp;gt;/engines/engine[~n~]/cranking&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt;.&lt;br /&gt;
# Now you may set &amp;lt;code&amp;gt;/engines/engine[~n~]/starter&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;false&amp;lt;/b&amp;gt; without interrupting the starting process.&lt;br /&gt;
# &amp;lt;code&amp;gt;/engines/engine[~n~]/n1&amp;lt;/code&amp;gt; will increase further until it stabilizes at the value which is defined in &amp;lt;code&amp;gt;idlen1&amp;lt;/code&amp;gt; in the [{{fgaddon aircraft url|b1900d|Engines/PT6A67D.xml|l=5}} engine definition file].&lt;br /&gt;
# Finally &amp;lt;code&amp;gt;/engines/engine[~n~]/cranking&amp;lt;/code&amp;gt; will be set to &amp;lt;b&amp;gt;false&amp;lt;/b&amp;gt; and &amp;lt;code&amp;gt;/engines/engine[~n~]/running&amp;lt;/code&amp;gt; to &amp;lt;b&amp;gt;true&amp;lt;/b&amp;gt; which means that the engine is now running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pleas note that the above described process is only an assumption based on my experiences with trying to create a JSBSim FDM for the [[Twin Otter]] which is equipped with turboprop engines, and unfortunately I cannot guarantee the correctness. If something is wrong here feel free to correct it.&lt;br /&gt;
: [[User:Dg-505|Dg-505]] ([[User talk:Dg-505|talk]]) 13:53, 5 December 2016 (EST)&lt;br /&gt;
&lt;br /&gt;
== FGRocket ==&lt;br /&gt;
The rocket engine&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;rocket_engine name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;isp&amp;gt; {number} &amp;lt;/isp&amp;gt;&lt;br /&gt;
  &amp;lt;builduptime&amp;gt; {number} &amp;lt;/builduptime&amp;gt;&lt;br /&gt;
  &amp;lt;maxthrottle&amp;gt; {number} &amp;lt;/maxthrottle&amp;gt;&lt;br /&gt;
  &amp;lt;minthrottle&amp;gt; {number} &amp;lt;/minthrottle&amp;gt;&lt;br /&gt;
  &amp;lt;slfuelflowmax&amp;gt; {number} &amp;lt;/slfuelflowmax&amp;gt;&lt;br /&gt;
  &amp;lt;sloxiflowmax&amp;gt;  {number} &amp;lt;/sloxiflowmax&amp;gt;&lt;br /&gt;
  &amp;lt;variation&amp;gt;&lt;br /&gt;
    &amp;lt;thrust&amp;gt; {number} &amp;lt;/thrust&amp;gt;&lt;br /&gt;
    &amp;lt;total_isp&amp;gt; {number} &amp;lt;/total_isp&amp;gt;&lt;br /&gt;
  &amp;lt;/variation&amp;gt; &lt;br /&gt;
  &amp;lt;thrust_table name=&amp;quot;propulsion/thrust_prop_remain&amp;quot; type=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tableData&amp;gt;&lt;br /&gt;
      {number} {number}&lt;br /&gt;
	...&lt;br /&gt;
      {number} {number}&lt;br /&gt;
    &amp;lt;/tableData&amp;gt;&lt;br /&gt;
  &amp;lt;/thrust_table&amp;gt;&lt;br /&gt;
&amp;lt;/rocket_engine&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FGElectric ==&lt;br /&gt;
Simple thrust producer. You enter the max power as &amp;lt;power unit=&amp;quot;WATTS&amp;quot;&amp;gt; and the engine model produces throttle_setting*power watts of output.&lt;br /&gt;
* Enter the max power as &amp;lt;power unit=&amp;quot;WATTS&amp;quot;&amp;gt; and the engine model produces throttle_setting*power watts of output.&lt;br /&gt;
=== Configuration File Format ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;electric_engine name=&amp;quot;{string}&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;power unit=&amp;quot;{HP | WATTS}&amp;quot;&amp;gt; {number} &amp;lt;/power&amp;gt;&lt;br /&gt;
&amp;lt;/electric_engine&amp;gt; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
FGElectric models an electric motor based on the configuration file &amp;lt;power&amp;gt; parameter. The throttle controls motor output linearly from zero to &amp;lt;power&amp;gt;. This power value (converted internally to horsepower) is then used by FGPropeller to apply torque to the propeller.  At present there is no battery model available, so this motor does not consume any energy.  There is no internal friction.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
* http://jsbsim.sourceforge.net/JSBSim/classJSBSim_1_1FGPiston.html&lt;br /&gt;
* http://jsbsim.sourceforge.net/JSBSim/classJSBSim_1_1FGTurbine.html&lt;br /&gt;
* http://jsbsim.sourceforge.net/JSBSim/classJSBSim_1_1FGTurboProp.html&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Aero_input_and_outputs&amp;diff=92537</id>
		<title>Aero input and outputs</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Aero_input_and_outputs&amp;diff=92537"/>
		<updated>2016-02-07T17:28:26Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Stall hysteresis, normalized: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Properties aerodynamic functions in JSBSim can read and output. &lt;br /&gt;
&lt;br /&gt;
== Function inputs ==&lt;br /&gt;
&lt;br /&gt;
Location of the aerodynamic reference point in the aircraft structural&lt;br /&gt;
frame, measured in inches:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/metrics/aero-rp-x-in&lt;br /&gt;
    /fdm/jsbsim/metrics/aero-rp-y-in&lt;br /&gt;
    /fdm/jsbsim/metrics/aero-rp-z-in&lt;br /&gt;
&lt;br /&gt;
Maximum and minimum alpha (angle of attack) in degrees:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-max-deg&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-min-deg&lt;br /&gt;
&lt;br /&gt;
Wing span/(2*Velocity)&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/bi2vel&lt;br /&gt;
&lt;br /&gt;
Wing chord/(2*Velocity)&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/ci2vel&lt;br /&gt;
&lt;br /&gt;
Alpha of the wing in radians (includes the angle of incidence of the wing,&lt;br /&gt;
if input):&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-wing-rad&lt;br /&gt;
&lt;br /&gt;
Altitude of CG divided by wing span:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/h_b-cg-ft&lt;br /&gt;
&lt;br /&gt;
Altitude of MAC (Mean aerodynamic chord) divided by wing span:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/h_b-mac-ft&lt;br /&gt;
&lt;br /&gt;
Aerodynamic rotational rates in rad/sec (includes wind effects, if any):&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/velocities/p-aero-rad_sec&lt;br /&gt;
    /fdm/jsbsim/velocities/q-aero-rad_sec&lt;br /&gt;
    /fdm/jsbsim/velocities/r-aero-rad_sec&lt;br /&gt;
&lt;br /&gt;
Aerodynamic velocities in ft/sec (includes wind effects, if any):&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/velocities/u-aero-fps&lt;br /&gt;
    /fdm/jsbsim/velocities/v-aero-fps&lt;br /&gt;
    /fdm/jsbsim/velocities/w-aero-fps&lt;br /&gt;
&lt;br /&gt;
The body axis aerodynamic force vector of the aircraft in lbs:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/forces/fbx-aero-lbs&lt;br /&gt;
    /fdm/jsbsim/forces/fby-aero-lbs&lt;br /&gt;
    /fdm/jsbsim/forces/fbz-aero-lbs&lt;br /&gt;
&lt;br /&gt;
The stability axis aerodynamic force vector of the aircraft in lbs:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/forces/fwx-aero-lbs&lt;br /&gt;
    /fdm/jsbsim/forces/fwy-aero-lbs&lt;br /&gt;
    /fdm/jsbsim/forces/fwz-aero-lbs&lt;br /&gt;
&lt;br /&gt;
The body axis aerodynamic moment vector of the aircraft in ft-lbs:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/moments/l-aero-lbsft&lt;br /&gt;
    /fdm/jsbsim/moments/m-aero-lbsft&lt;br /&gt;
    /fdm/jsbsim/moments/n-aero-lbsft&lt;br /&gt;
&lt;br /&gt;
The lift coefficient squared:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/cl-squared&lt;br /&gt;
&lt;br /&gt;
Dynamic pressure times reference area:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/qbar-area&lt;br /&gt;
&lt;br /&gt;
Angles of attack and sideslip in radians and degrees (and the magnitudes):&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-rad&lt;br /&gt;
    /fdm/jsbsim/aero/beta-rad&lt;br /&gt;
    /fdm/jsbsim/aero/mag-beta-rad&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-deg&lt;br /&gt;
    /fdm/jsbsim/aero/beta-deg&lt;br /&gt;
    /fdm/jsbsim/aero/mag-beta-deg&lt;br /&gt;
&lt;br /&gt;
Dynamic pressure in psf:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/qbar-psf&lt;br /&gt;
&lt;br /&gt;
Dynamic pressure in the body axis XZ plane:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/qbarUW-psf&lt;br /&gt;
&lt;br /&gt;
Dynamic pressure in the body axis XY plane:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/qbarUV-psf&lt;br /&gt;
&lt;br /&gt;
Chord:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/metrics/cbarw-ft&lt;br /&gt;
&lt;br /&gt;
Wingspan:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/metrics/bw-ft&lt;br /&gt;
&lt;br /&gt;
Wingarea:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/metrics/Sw-sqft&lt;br /&gt;
&lt;br /&gt;
=== Stall hysteresis, normalized: ===&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/stall-hyst-norm&lt;br /&gt;
&lt;br /&gt;
dany93 wrote on the forums about this:&lt;br /&gt;
&lt;br /&gt;
What I have understood at this point:&lt;br /&gt;
By setting, say&lt;br /&gt;
        &lt;br /&gt;
        &amp;lt;hysteresis_limits unit=&amp;quot;DEG&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;min&amp;gt;5.0&amp;lt;/min&amp;gt;&lt;br /&gt;
            &amp;lt;max&amp;gt;17&amp;lt;/max&amp;gt;&lt;br /&gt;
        &amp;lt;/hysteresis_limits&amp;gt;&lt;br /&gt;
&lt;br /&gt;
17 deg is typically the stall angle for a wing.&lt;br /&gt;
&lt;br /&gt;
stall-hyst-norm, normally at 0 ('good condition'), switches to 1 ('bad condition') at 17 deg alpha-deg (or corresponding alpha-rad value, different from alpha-wing-rad if wing incidence is not zero).&lt;br /&gt;
Later on, it returns back to 0 only when alpha-deg comes down to 5 deg (that is with some 'delay'). Close to the usual hysteresis behavior (usually, iron magnetization vs magnetic field, with magnetic field h corresponding to alpha angle for us), but the 'delay' (the return alpha value) is always 5 deg, not dependent on the max value attained by the variable alpha. A kind of 'rectangular' hysteresis loop, more simple but already good for aerodynamics (linear or turbulent) regimes.&lt;br /&gt;
&lt;br /&gt;
This stall-hyst-norm (0 or 1 values) can then be used as a parameter for tables, to set some command sensitivity, lift coefficient, moment, etc, to hold longer in it's 'bad' condition even when the cause has ceased. Stall holds for a longer time, like turbulent regime in the real case.&lt;br /&gt;
&lt;br /&gt;
Logically, the &amp;lt;max&amp;gt; value is close to the critical AoA for stall, but the lift curve and stall-hyst-norm are used independently.&lt;br /&gt;
&lt;br /&gt;
=== Time rate of change in alpha and sideslip in deg/sec and rad/sec: ===&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/alphadot-rad_sec&lt;br /&gt;
    /fdm/jsbsim/aero/betadot-rad_sec&lt;br /&gt;
    /fdm/jsbsim/aero/alphadot-deg_sec&lt;br /&gt;
    /fdm/jsbsim/aero/betadot-deg_sec&lt;br /&gt;
&lt;br /&gt;
== Function outputs ==&lt;br /&gt;
&lt;br /&gt;
Runtime-created aerodynamic force and moment components from definitions in&lt;br /&gt;
the &amp;lt;aerodynamics&amp;gt; section of the configuration file (varies per-aircraft):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alan wrote about lift:&lt;br /&gt;
&lt;br /&gt;
Lift = qbar-psf x Sw-sqft x CL&lt;br /&gt;
&lt;br /&gt;
Lift is a force, CL is the non-dimensional coefficient of lift, qbar-psf x Sw-sqft is the dimensionalisation factor&lt;br /&gt;
&lt;br /&gt;
It is common practice to build up the lift force from several sources.&lt;br /&gt;
&lt;br /&gt;
e.g., for the Lift Axis&lt;br /&gt;
&lt;br /&gt;
Lift = qbar-psf x Sw-sqft x (CLwing +CLtail +CLelevator +CLfuselage +... +...)&lt;br /&gt;
&lt;br /&gt;
here the various lift coefficients are summed before being dimensionalised.&lt;br /&gt;
&lt;br /&gt;
or you can also write&lt;br /&gt;
&lt;br /&gt;
Lift(wing) = qbar-psf x Sw-sqft x CLwing&lt;br /&gt;
Lift(tail) = qbar-psf x Sw-sqft x CLtail&lt;br /&gt;
Lift(fuselage) = qbar-psf x Sw-sqft x CLfuselage&lt;br /&gt;
....&lt;br /&gt;
Lift(total) = Lift(wing)+Lift(tail)+Lift(fuselage) +.... +...&lt;br /&gt;
&lt;br /&gt;
here the various lift coefficients are separately dimensionalised to produce a set of forces. These forces are then added to produce the total lift force.&lt;br /&gt;
&lt;br /&gt;
You can write CLwing = CLo + Alpha* dCL/Alpha, or alternatively use a table to generate CL as a function of alpha, Mach no etc.&lt;br /&gt;
&lt;br /&gt;
It is not necessary to slavishly follow the examples in the JSBSim reference manual, or copy other Flightgear examples. It is best to follow the conventions that apply to the data you have available.&lt;br /&gt;
&lt;br /&gt;
JSBsim allows you to specify these equations in any way that suits you, or suits the data that is available.&lt;br /&gt;
&lt;br /&gt;
One thing to be careful about is not including a component twice. e.g. the CL that you are given may already include the tail and fuselage effects, and this case they should not be added in again.&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Aero_input_and_outputs&amp;diff=92536</id>
		<title>Aero input and outputs</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Aero_input_and_outputs&amp;diff=92536"/>
		<updated>2016-02-07T17:19:41Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Stall hysteresis, normalized: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Properties aerodynamic functions in JSBSim can read and output. &lt;br /&gt;
&lt;br /&gt;
== Function inputs ==&lt;br /&gt;
&lt;br /&gt;
Location of the aerodynamic reference point in the aircraft structural&lt;br /&gt;
frame, measured in inches:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/metrics/aero-rp-x-in&lt;br /&gt;
    /fdm/jsbsim/metrics/aero-rp-y-in&lt;br /&gt;
    /fdm/jsbsim/metrics/aero-rp-z-in&lt;br /&gt;
&lt;br /&gt;
Maximum and minimum alpha (angle of attack) in degrees:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-max-deg&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-min-deg&lt;br /&gt;
&lt;br /&gt;
Wing span/(2*Velocity)&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/bi2vel&lt;br /&gt;
&lt;br /&gt;
Wing chord/(2*Velocity)&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/ci2vel&lt;br /&gt;
&lt;br /&gt;
Alpha of the wing in radians (includes the angle of incidence of the wing,&lt;br /&gt;
if input):&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-wing-rad&lt;br /&gt;
&lt;br /&gt;
Altitude of CG divided by wing span:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/h_b-cg-ft&lt;br /&gt;
&lt;br /&gt;
Altitude of MAC (Mean aerodynamic chord) divided by wing span:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/h_b-mac-ft&lt;br /&gt;
&lt;br /&gt;
Aerodynamic rotational rates in rad/sec (includes wind effects, if any):&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/velocities/p-aero-rad_sec&lt;br /&gt;
    /fdm/jsbsim/velocities/q-aero-rad_sec&lt;br /&gt;
    /fdm/jsbsim/velocities/r-aero-rad_sec&lt;br /&gt;
&lt;br /&gt;
Aerodynamic velocities in ft/sec (includes wind effects, if any):&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/velocities/u-aero-fps&lt;br /&gt;
    /fdm/jsbsim/velocities/v-aero-fps&lt;br /&gt;
    /fdm/jsbsim/velocities/w-aero-fps&lt;br /&gt;
&lt;br /&gt;
The body axis aerodynamic force vector of the aircraft in lbs:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/forces/fbx-aero-lbs&lt;br /&gt;
    /fdm/jsbsim/forces/fby-aero-lbs&lt;br /&gt;
    /fdm/jsbsim/forces/fbz-aero-lbs&lt;br /&gt;
&lt;br /&gt;
The stability axis aerodynamic force vector of the aircraft in lbs:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/forces/fwx-aero-lbs&lt;br /&gt;
    /fdm/jsbsim/forces/fwy-aero-lbs&lt;br /&gt;
    /fdm/jsbsim/forces/fwz-aero-lbs&lt;br /&gt;
&lt;br /&gt;
The body axis aerodynamic moment vector of the aircraft in ft-lbs:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/moments/l-aero-lbsft&lt;br /&gt;
    /fdm/jsbsim/moments/m-aero-lbsft&lt;br /&gt;
    /fdm/jsbsim/moments/n-aero-lbsft&lt;br /&gt;
&lt;br /&gt;
The lift coefficient squared:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/cl-squared&lt;br /&gt;
&lt;br /&gt;
Dynamic pressure times reference area:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/qbar-area&lt;br /&gt;
&lt;br /&gt;
Angles of attack and sideslip in radians and degrees (and the magnitudes):&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-rad&lt;br /&gt;
    /fdm/jsbsim/aero/beta-rad&lt;br /&gt;
    /fdm/jsbsim/aero/mag-beta-rad&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-deg&lt;br /&gt;
    /fdm/jsbsim/aero/beta-deg&lt;br /&gt;
    /fdm/jsbsim/aero/mag-beta-deg&lt;br /&gt;
&lt;br /&gt;
Dynamic pressure in psf:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/qbar-psf&lt;br /&gt;
&lt;br /&gt;
Dynamic pressure in the body axis XZ plane:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/qbarUW-psf&lt;br /&gt;
&lt;br /&gt;
Dynamic pressure in the body axis XY plane:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/qbarUV-psf&lt;br /&gt;
&lt;br /&gt;
Chord:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/metrics/cbarw-ft&lt;br /&gt;
&lt;br /&gt;
Wingspan:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/metrics/bw-ft&lt;br /&gt;
&lt;br /&gt;
Wingarea:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/metrics/Sw-sqft&lt;br /&gt;
&lt;br /&gt;
=== Stall hysteresis, normalized: ===&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/stall-hyst-norm&lt;br /&gt;
&lt;br /&gt;
dany93 wrote on the forums about this:&lt;br /&gt;
&lt;br /&gt;
What I have understood at this point:&lt;br /&gt;
By setting, say&lt;br /&gt;
&amp;lt;code&amp;gt;        &lt;br /&gt;
        &amp;lt;hysteresis_limits unit=&amp;quot;DEG&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;min&amp;gt;5.0&amp;lt;/min&amp;gt;&lt;br /&gt;
            &amp;lt;max&amp;gt;17&amp;lt;/max&amp;gt;&lt;br /&gt;
        &amp;lt;/hysteresis_limits&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
17 deg is typically the stall angle for a wing.&lt;br /&gt;
&lt;br /&gt;
stall-hyst-norm, normally at 0 ('good condition'), switches to 1 ('bad condition') at 17 deg (alpha-deg or corresponding alpha-rad value, different from alpha-wing-rad if wing incidence is not zero).&lt;br /&gt;
Later on, it returns back to 0 only when alpha-deg comes down to 5 deg (that is with some 'delay'). Close to the usual hysteresis behavior (usually, iron magnetization vs magnetic field, with magnetic field h corresponding to alpha angle for us), but the delay is not dependent on the max value attained by the variable alpha. A kind of 'rectangular' hysteresis loop, more simple but already good for aerodynamics (linear or turbulent) regimes.&lt;br /&gt;
&lt;br /&gt;
This stall-hyst-norm (0 or 1 values) can then be used as a parameter for tables, to set some command sensitivity, lift coefficient, moment, etc, to hold longer in it's 'bad' condition even when the cause has ceased. Stall holds for a longer time, like turbulent regime in the real case.&lt;br /&gt;
&lt;br /&gt;
Logically, the &amp;lt;max&amp;gt; value is close to the critical AoA for stall, but the lift curve and stall-hyst-norm are used independently.&lt;br /&gt;
&lt;br /&gt;
=== Time rate of change in alpha and sideslip in deg/sec and rad/sec: ===&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/alphadot-rad_sec&lt;br /&gt;
    /fdm/jsbsim/aero/betadot-rad_sec&lt;br /&gt;
    /fdm/jsbsim/aero/alphadot-deg_sec&lt;br /&gt;
    /fdm/jsbsim/aero/betadot-deg_sec&lt;br /&gt;
&lt;br /&gt;
== Function outputs ==&lt;br /&gt;
&lt;br /&gt;
Runtime-created aerodynamic force and moment components from definitions in&lt;br /&gt;
the &amp;lt;aerodynamics&amp;gt; section of the configuration file (varies per-aircraft):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alan wrote about lift:&lt;br /&gt;
&lt;br /&gt;
Lift = qbar-psf x Sw-sqft x CL&lt;br /&gt;
&lt;br /&gt;
Lift is a force, CL is the non-dimensional coefficient of lift, qbar-psf x Sw-sqft is the dimensionalisation factor&lt;br /&gt;
&lt;br /&gt;
It is common practice to build up the lift force from several sources.&lt;br /&gt;
&lt;br /&gt;
e.g., for the Lift Axis&lt;br /&gt;
&lt;br /&gt;
Lift = qbar-psf x Sw-sqft x (CLwing +CLtail +CLelevator +CLfuselage +... +...)&lt;br /&gt;
&lt;br /&gt;
here the various lift coefficients are summed before being dimensionalised.&lt;br /&gt;
&lt;br /&gt;
or you can also write&lt;br /&gt;
&lt;br /&gt;
Lift(wing) = qbar-psf x Sw-sqft x CLwing&lt;br /&gt;
Lift(tail) = qbar-psf x Sw-sqft x CLtail&lt;br /&gt;
Lift(fuselage) = qbar-psf x Sw-sqft x CLfuselage&lt;br /&gt;
....&lt;br /&gt;
Lift(total) = Lift(wing)+Lift(tail)+Lift(fuselage) +.... +...&lt;br /&gt;
&lt;br /&gt;
here the various lift coefficients are separately dimensionalised to produce a set of forces. These forces are then added to produce the total lift force.&lt;br /&gt;
&lt;br /&gt;
You can write CLwing = CLo + Alpha* dCL/Alpha, or alternatively use a table to generate CL as a function of alpha, Mach no etc.&lt;br /&gt;
&lt;br /&gt;
It is not necessary to slavishly follow the examples in the JSBSim reference manual, or copy other Flightgear examples. It is best to follow the conventions that apply to the data you have available.&lt;br /&gt;
&lt;br /&gt;
JSBsim allows you to specify these equations in any way that suits you, or suits the data that is available.&lt;br /&gt;
&lt;br /&gt;
One thing to be careful about is not including a component twice. e.g. the CL that you are given may already include the tail and fuselage effects, and this case they should not be added in again.&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Aero_input_and_outputs&amp;diff=92535</id>
		<title>Aero input and outputs</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Aero_input_and_outputs&amp;diff=92535"/>
		<updated>2016-02-07T17:15:31Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Stall hysteresis, normalized: */slight improvement in stall-hyst-norm explanation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Properties aerodynamic functions in JSBSim can read and output. &lt;br /&gt;
&lt;br /&gt;
== Function inputs ==&lt;br /&gt;
&lt;br /&gt;
Location of the aerodynamic reference point in the aircraft structural&lt;br /&gt;
frame, measured in inches:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/metrics/aero-rp-x-in&lt;br /&gt;
    /fdm/jsbsim/metrics/aero-rp-y-in&lt;br /&gt;
    /fdm/jsbsim/metrics/aero-rp-z-in&lt;br /&gt;
&lt;br /&gt;
Maximum and minimum alpha (angle of attack) in degrees:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-max-deg&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-min-deg&lt;br /&gt;
&lt;br /&gt;
Wing span/(2*Velocity)&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/bi2vel&lt;br /&gt;
&lt;br /&gt;
Wing chord/(2*Velocity)&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/ci2vel&lt;br /&gt;
&lt;br /&gt;
Alpha of the wing in radians (includes the angle of incidence of the wing,&lt;br /&gt;
if input):&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-wing-rad&lt;br /&gt;
&lt;br /&gt;
Altitude of CG divided by wing span:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/h_b-cg-ft&lt;br /&gt;
&lt;br /&gt;
Altitude of MAC (Mean aerodynamic chord) divided by wing span:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/h_b-mac-ft&lt;br /&gt;
&lt;br /&gt;
Aerodynamic rotational rates in rad/sec (includes wind effects, if any):&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/velocities/p-aero-rad_sec&lt;br /&gt;
    /fdm/jsbsim/velocities/q-aero-rad_sec&lt;br /&gt;
    /fdm/jsbsim/velocities/r-aero-rad_sec&lt;br /&gt;
&lt;br /&gt;
Aerodynamic velocities in ft/sec (includes wind effects, if any):&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/velocities/u-aero-fps&lt;br /&gt;
    /fdm/jsbsim/velocities/v-aero-fps&lt;br /&gt;
    /fdm/jsbsim/velocities/w-aero-fps&lt;br /&gt;
&lt;br /&gt;
The body axis aerodynamic force vector of the aircraft in lbs:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/forces/fbx-aero-lbs&lt;br /&gt;
    /fdm/jsbsim/forces/fby-aero-lbs&lt;br /&gt;
    /fdm/jsbsim/forces/fbz-aero-lbs&lt;br /&gt;
&lt;br /&gt;
The stability axis aerodynamic force vector of the aircraft in lbs:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/forces/fwx-aero-lbs&lt;br /&gt;
    /fdm/jsbsim/forces/fwy-aero-lbs&lt;br /&gt;
    /fdm/jsbsim/forces/fwz-aero-lbs&lt;br /&gt;
&lt;br /&gt;
The body axis aerodynamic moment vector of the aircraft in ft-lbs:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/moments/l-aero-lbsft&lt;br /&gt;
    /fdm/jsbsim/moments/m-aero-lbsft&lt;br /&gt;
    /fdm/jsbsim/moments/n-aero-lbsft&lt;br /&gt;
&lt;br /&gt;
The lift coefficient squared:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/cl-squared&lt;br /&gt;
&lt;br /&gt;
Dynamic pressure times reference area:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/qbar-area&lt;br /&gt;
&lt;br /&gt;
Angles of attack and sideslip in radians and degrees (and the magnitudes):&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-rad&lt;br /&gt;
    /fdm/jsbsim/aero/beta-rad&lt;br /&gt;
    /fdm/jsbsim/aero/mag-beta-rad&lt;br /&gt;
    /fdm/jsbsim/aero/alpha-deg&lt;br /&gt;
    /fdm/jsbsim/aero/beta-deg&lt;br /&gt;
    /fdm/jsbsim/aero/mag-beta-deg&lt;br /&gt;
&lt;br /&gt;
Dynamic pressure in psf:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/qbar-psf&lt;br /&gt;
&lt;br /&gt;
Dynamic pressure in the body axis XZ plane:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/qbarUW-psf&lt;br /&gt;
&lt;br /&gt;
Dynamic pressure in the body axis XY plane:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/qbarUV-psf&lt;br /&gt;
&lt;br /&gt;
Chord:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/metrics/cbarw-ft&lt;br /&gt;
&lt;br /&gt;
Wingspan:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/metrics/bw-ft&lt;br /&gt;
&lt;br /&gt;
Wingarea:&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/metrics/Sw-sqft&lt;br /&gt;
&lt;br /&gt;
=== Stall hysteresis, normalized: ===&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/stall-hyst-norm&lt;br /&gt;
&lt;br /&gt;
dany93 wrote on the forums about this:&lt;br /&gt;
&lt;br /&gt;
What I have understood at this point:&lt;br /&gt;
By setting, say&lt;br /&gt;
&amp;lt;code&amp;gt;        &lt;br /&gt;
        &amp;lt;hysteresis_limits unit=&amp;quot;DEG&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;min&amp;gt;5.0&amp;lt;/min&amp;gt;&lt;br /&gt;
            &amp;lt;max&amp;gt;17&amp;lt;/max&amp;gt;&lt;br /&gt;
        &amp;lt;/hysteresis_limits&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
17 deg is typically the stall angle for a wing.&lt;br /&gt;
stall-hyst-norm, normally at 0 ('good condition'), switches to 1 ('bad condition') at 17 deg (alpha-deg or corresponding alpha-rad value, different from alpha-wing-rad if wing incidence is not zero).&lt;br /&gt;
Later on, it returns back to 0 only when alpha-deg comes down to 5 deg (that is with some 'delay'). Close to the usual hysteresis behavior (usually, iron magnetization vs magnetic field, with magnetic field h corresponding to alpha angle for us), but the delay is not dependent on the max value attained by the variable alpha. A kind of 'rectangular' hysteresis loop, more simple but already good for aerodynamics (linear or turbulent) regimes.&lt;br /&gt;
&lt;br /&gt;
This stall-hyst-norm (0 or 1 values) can then be used as a parameter for tables, to set some command sensitivity, lift coefficient, moment, etc, to hold longer in it's 'bad' condition even when the cause has ceased. Stall holds for a longer time, like turbulent regime in the real case.&lt;br /&gt;
&lt;br /&gt;
Logically, the &amp;lt;max&amp;gt; value is close to the critical AoA for stall, but the lift curve and stall-hyst-norm are used independently.&lt;br /&gt;
&lt;br /&gt;
=== Time rate of change in alpha and sideslip in deg/sec and rad/sec: ===&lt;br /&gt;
&lt;br /&gt;
    /fdm/jsbsim/aero/alphadot-rad_sec&lt;br /&gt;
    /fdm/jsbsim/aero/betadot-rad_sec&lt;br /&gt;
    /fdm/jsbsim/aero/alphadot-deg_sec&lt;br /&gt;
    /fdm/jsbsim/aero/betadot-deg_sec&lt;br /&gt;
&lt;br /&gt;
== Function outputs ==&lt;br /&gt;
&lt;br /&gt;
Runtime-created aerodynamic force and moment components from definitions in&lt;br /&gt;
the &amp;lt;aerodynamics&amp;gt; section of the configuration file (varies per-aircraft):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alan wrote about lift:&lt;br /&gt;
&lt;br /&gt;
Lift = qbar-psf x Sw-sqft x CL&lt;br /&gt;
&lt;br /&gt;
Lift is a force, CL is the non-dimensional coefficient of lift, qbar-psf x Sw-sqft is the dimensionalisation factor&lt;br /&gt;
&lt;br /&gt;
It is common practice to build up the lift force from several sources.&lt;br /&gt;
&lt;br /&gt;
e.g., for the Lift Axis&lt;br /&gt;
&lt;br /&gt;
Lift = qbar-psf x Sw-sqft x (CLwing +CLtail +CLelevator +CLfuselage +... +...)&lt;br /&gt;
&lt;br /&gt;
here the various lift coefficients are summed before being dimensionalised.&lt;br /&gt;
&lt;br /&gt;
or you can also write&lt;br /&gt;
&lt;br /&gt;
Lift(wing) = qbar-psf x Sw-sqft x CLwing&lt;br /&gt;
Lift(tail) = qbar-psf x Sw-sqft x CLtail&lt;br /&gt;
Lift(fuselage) = qbar-psf x Sw-sqft x CLfuselage&lt;br /&gt;
....&lt;br /&gt;
Lift(total) = Lift(wing)+Lift(tail)+Lift(fuselage) +.... +...&lt;br /&gt;
&lt;br /&gt;
here the various lift coefficients are separately dimensionalised to produce a set of forces. These forces are then added to produce the total lift force.&lt;br /&gt;
&lt;br /&gt;
You can write CLwing = CLo + Alpha* dCL/Alpha, or alternatively use a table to generate CL as a function of alpha, Mach no etc.&lt;br /&gt;
&lt;br /&gt;
It is not necessary to slavishly follow the examples in the JSBSim reference manual, or copy other Flightgear examples. It is best to follow the conventions that apply to the data you have available.&lt;br /&gt;
&lt;br /&gt;
JSBsim allows you to specify these equations in any way that suits you, or suits the data that is available.&lt;br /&gt;
&lt;br /&gt;
One thing to be careful about is not including a component twice. e.g. the CL that you are given may already include the tail and fuselage effects, and this case they should not be added in again.&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=85848</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=85848"/>
		<updated>2015-07-02T12:58:46Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. The collector tank in the example has the capacity 130 lbs so making the check against collector tank level greater or equal to 129 instead of against 130 is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 1 lb margin creates a buffer for this difference as the value oscillates around 129 lbs as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (= 'OFF'), 0, 1, 2, 3, respectively for 'no tank selected', tank[0], [1], [2], [3].&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
* if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
* else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
* else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed or not, i.e. if it is connected to a tank, if this tank is not empty, with a running pump (or not).&lt;br /&gt;
&lt;br /&gt;
(This function above could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
'''For the fuel system presented here''', two small collector tanks [4] and [5] (each collector tank feeding one engine) have been added. In JSBSim, for this multi-engine aircraft (differently from a single-engine one), these collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (through rotary switches for left and right engines) and have their level kept constant. This functioning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ([4] and [5]), which themselves will be fed by the selected 'true' tanks ([0] to [3]).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 0 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 1 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is shown below (can be named fuel.xml, see at the top of this document for how to link the FDM to it).&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] have their level kept constant (at 0.25 lb content) by a step-controlled input flow rate (0 or 0.5 pps here). The &amp;quot;ON&amp;quot; value of this step flow rate must be a bit higher than the maximum&amp;quot; fuel-flow-rate-pps&amp;quot; needed by each engine at full power.&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] content is a compromise. A large content is secure but it gives an excessive delay between the moment when the 'true' tank runs out of fuel and the engine effectively stops running. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D with YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://equipe-flightgear.forumactif.com&lt;br /&gt;
 &lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- Tank 4 level maintenance --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
      &amp;lt;!-- from selected 'utility' tank to Collector Tank 4 Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0               &lt;br /&gt;
            propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1&lt;br /&gt;
            propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2               &lt;br /&gt;
            propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3&lt;br /&gt;
            propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt; &amp;lt;!-- Tank 4 filling --&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- for Tanks 0, 1, 2, 3 consumption --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank0-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank1-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank2-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank3-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- Tank 5 level maintenance --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
      &amp;lt;!-- from selected 'utility' tank to Collector Tank 5 Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0               &lt;br /&gt;
            propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1&lt;br /&gt;
            propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2               &lt;br /&gt;
            propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3&lt;br /&gt;
            propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt; &amp;lt;!-- Tank 5 filling --&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- for Tanks 0, 1, 2, 3 consumption --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank0-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank1-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank2-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank3-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank0-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank0-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank1-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank1-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank2-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank2-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank3-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank3-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Switching_default_texture_format_to_DDS&amp;diff=75938</id>
		<title>Switching default texture format to DDS</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Switching_default_texture_format_to_DDS&amp;diff=75938"/>
		<updated>2014-09-05T10:35:52Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The FG development team is considering to '''switch the default format for textures from png to DDS'''. This would offer a number of significant advantages:&lt;br /&gt;
&lt;br /&gt;
* DDS is a more compact format than png, hence the download size of the FG base package may be decreased&lt;br /&gt;
* Compressed DDS can be directly used by many graphics cards, reducing also GPU memory consumption&lt;br /&gt;
* DDS stores all texture resolution levels, in essence no lower resolution levels have to be generated when the texture is used, hence it loads much faster into memory&lt;br /&gt;
* The resolution levels ('mipmaps') can be customized, allowing for some interesting effects at no performance cost&lt;br /&gt;
&lt;br /&gt;
Practically all commercial simulations use DDS for these reasons. &lt;br /&gt;
&lt;br /&gt;
== Feedback needed - should FlightGear switch the defaults to DDS format for terrain texturing? ==&lt;br /&gt;
&lt;br /&gt;
However, the DDS compression algorithm is patented, which means that it is not readily available for open source graphics drivers used by Linux distributions. Dependent on the specific hardware, this may or may not be a problem (modern graphics cards typically do not need the driver to process DDS, for older graphics cards there are non-patented workarounds available which decompress the DDS on the software level). The development team is concerned about making the FlightGear experience pleasant for all users, hence we would like to gather feedback how many users would be affected by a change in practice.&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |let's collect some some feedback [on DDS usage in FlightGear] until late November and restart this topic. We probably know by then what we do for the next release. &amp;quot;Somebody&amp;quot; needs to collect the feedback, however.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32791750/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Torsten Dreyer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-03&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If there are no problems reported, FG will change defaults to textures in DDS format with the 3.4 release, and then phase out the use of png textures.&lt;br /&gt;
In other words, a lack of feedback from end users might very well mean that future FlightGear versions may require DDS support and may not necessarily work for people with outdated hardware - so if you care about backward compatibility, please do get involved, test DDS support and provide feedback!&lt;br /&gt;
&lt;br /&gt;
=== What we need you to do? ===&lt;br /&gt;
&lt;br /&gt;
FlightGear already provides the simple option to test a DDS texture set. If you are running on Linux and use an open source graphics driver, please take 5 minutes to help during your next FG session:&lt;br /&gt;
&lt;br /&gt;
# Open the dialog under View -&amp;gt; Rendering&lt;br /&gt;
# Under 'Terrain texture scheme', change the default 'Region-specific' to 'Global alternative (DDS format)' &lt;br /&gt;
# Press 'Okay' - FG will reload the terrain&lt;br /&gt;
# Do you see proper textures on the terrain (they may look different and may also not fit the location perfectly)? If yes, you're fine. If you see monochromatic, or even bright/pink, colors or other rendering artifacts, your system may have problems with DDS.&lt;br /&gt;
# Change back to the texture scheme you like best&lt;br /&gt;
# Enter your experiences in the list below&lt;br /&gt;
&lt;br /&gt;
Thanks for your help!&lt;br /&gt;
&lt;br /&gt;
== Tested hardware and graphics drivers ==&lt;br /&gt;
&lt;br /&gt;
=== NVIDIA proprietary driver ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Card&lt;br /&gt;
!Driver&lt;br /&gt;
!DDS ok&lt;br /&gt;
!Reported by&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GTX 670M&lt;br /&gt;
|310.19&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|ThorstenR&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GT 540M&lt;br /&gt;
|331.82&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|Gijs&lt;br /&gt;
|-&lt;br /&gt;
|N13M-NS Optimus &lt;br /&gt;
|340.32&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|Tom_ch&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GT640 &lt;br /&gt;
|343.13&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|lumni1968&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GTX 780 Ti&lt;br /&gt;
|340.52&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|Avionyx&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GT 750M&lt;br /&gt;
|331.38&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|Dutchguy&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GT 620 OEM&lt;br /&gt;
|331.38&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|C-GGKV&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GTX 650&lt;br /&gt;
|331.20&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|dany93&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== NVIDIA open source driver ===&lt;br /&gt;
&lt;br /&gt;
=== Intel proprietary driver ===&lt;br /&gt;
&lt;br /&gt;
=== Intel open source driver ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Card&lt;br /&gt;
!Driver&lt;br /&gt;
!DDS ok&lt;br /&gt;
!Reported by&lt;br /&gt;
|-&lt;br /&gt;
|HD Graphics 3000 (i7-2600K)&lt;br /&gt;
|10.2.6&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|cdesai&lt;br /&gt;
|-&lt;br /&gt;
|HD Graphics 3000 (i3-2330M)&lt;br /&gt;
|10.2.2&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|Flyhigh/saiarcot895&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ATI/AMD proprietary driver ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Card&lt;br /&gt;
!Driver&lt;br /&gt;
!DDS ok&lt;br /&gt;
!Reported by&lt;br /&gt;
|-&lt;br /&gt;
|ATI Radeon HD 6310&lt;br /&gt;
|14.6-1&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|ZLSA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ATI/AMD open source driver ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Card&lt;br /&gt;
!Driver&lt;br /&gt;
!DDS ok&lt;br /&gt;
!Reported by&lt;br /&gt;
|-&lt;br /&gt;
|AMD Radeon HD 7950&lt;br /&gt;
|10.2.1&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|Saga&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Sample test ==&lt;br /&gt;
&lt;br /&gt;
=== DDS Test at the airport of Orio (Bergamo - Italy) ===&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain texture scheme DDS 01-2000.jpg|800px|thumb|Comparison of texture in relation to the three possible choices in &amp;quot;Rendering Options&amp;quot; -&amp;gt; &amp;quot;Terrain texture scheme&amp;quot;]]The final result, with all the &amp;quot;Shader Options&amp;quot; active, is not very satisfactory, I would say very poor. Apparently not check on any improvement in the speed of image loading. I think on modern machines with quad-core processors 16 GB, with latest graphics cards (NVIDIA 870) 6 GB, the loading of these images is not really a &amp;quot;bottleneck&amp;quot;. I propose to insert the DDS functionality, but in a transparent way, ie convert &amp;quot;on the fly&amp;quot; the images before inserting them into the temporary memory, for example using the convert function of ImageMagick. However, I do not know if it really is a useful feature, I think there are many other things to do before this.&lt;br /&gt;
&lt;br /&gt;
== Excerpts from the ongoing discussion ==&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Here is my suggestion how to proceed:&lt;br /&gt;
&lt;br /&gt;
* Let's do your 1) and 2) on as many information channels we have.&lt;br /&gt;
* Collect the responses on a public place, I'd suggest a wiki page&lt;br /&gt;
* Do this for a well defined time frame. Is three month too much/too short?&lt;br /&gt;
* If we have the impression, it's safe to switch to DDS, define the dds texture sets as default, keeping the png sets as a fallback and publish how to use this fallback&lt;br /&gt;
* Keep this for one release.&lt;br /&gt;
* Depending on the feedback we get, keep it that way or move entirely to DDS.&lt;br /&gt;
&lt;br /&gt;
Does that sound reasonable for everybody?&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32788459/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Torsten Dreyer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'd propose [...] this process:&lt;br /&gt;
# Get out the information first that one can change materials files, where to do it and what the characteristics of the different sets are.&lt;br /&gt;
# Ask users (especially those running with ATI or Intel on Linux) nicely to do a quick check whether dds works fine.&lt;br /&gt;
&lt;br /&gt;
I think we have an information management problem in relation to the user base - a frequent forum situation is that a user requests something that's already there, but the information is just not out. So if we even envision such a change, I would start spreading the relevant information basically yesterday.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787957/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Renk Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== DDS Debate in 2012 ==&lt;br /&gt;
&lt;br /&gt;
=== Legalities ===&lt;br /&gt;
{{See also|Talk:Switching default texture format to DDS#Using patented algorithms}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |These kind of precompressed images limits their usage to a specific set of &amp;lt;br/&amp;gt;&lt;br /&gt;
drivers. And no, due to the patent issues no open source code including ours &amp;lt;br/&amp;gt;&lt;br /&gt;
is allowed to implement compression/decompression code for these image &amp;lt;br/&amp;gt;&lt;br /&gt;
formats. Even if this is easy implementation wise.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28604650/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |t is technically incorrect to provide these s3 patent &amp;lt;br/&amp;gt;&lt;br /&gt;
precompressed textures to a driver that does not announce the apropriate &amp;lt;br/&amp;gt;&lt;br /&gt;
extension and since we are not allowed to code something that deompresses &amp;lt;br/&amp;gt;&lt;br /&gt;
this, I think we should avoid using this compression for all the provided &amp;lt;br/&amp;gt;&lt;br /&gt;
models/textures.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I think of a warning that is issued from the image loader in flightgear that &amp;lt;br/&amp;gt;&lt;br /&gt;
detects when these precompressed textures are seen. So even people using &amp;lt;br/&amp;gt;&lt;br /&gt;
drivers that just offer this extension have a chance to see that the provided &amp;lt;br/&amp;gt;&lt;br /&gt;
textures will not work for others.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28612879/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-01&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Portability Concerns  ===&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |These kind of precompressed images limits their usage to a specific set of &amp;lt;br/&amp;gt;&lt;br /&gt;
drivers. And no, due to the patent issues no open source code including ours &amp;lt;br/&amp;gt;&lt;br /&gt;
is allowed to implement compression/decompression code for these image &amp;lt;br/&amp;gt;&lt;br /&gt;
formats. Even if this is easy implementation wise.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28604650/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |And this is what I try to do now:&amp;lt;br/&amp;gt;&lt;br /&gt;
Object against using these patented compression algorithms.&amp;lt;br/&amp;gt;&lt;br /&gt;
I do not care for the on disk format of any image file we have. But the problem &amp;lt;br/&amp;gt;&lt;br /&gt;
is that some kind of precompression that can be stored in these dds files &amp;lt;br/&amp;gt;&lt;br /&gt;
cannot be used with other drivers than the closed ati and nvidia ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
As long as these patented compression techiques are not used, every OpenGL &amp;lt;br/&amp;gt;&lt;br /&gt;
driver can use this and displays this fine.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Think: Intel has the hugest marketshare in graphics today. If I remember &amp;lt;br/&amp;gt;&lt;br /&gt;
right, they sell more than ati and nvidia together (*). This kind of change in &amp;lt;br/&amp;gt;&lt;br /&gt;
effect rules out the majority of users as intel cannot work with these files.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28604650/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |It's not limited to dds. If you use osgconv xxx.dds xxx.ivs you will probably &amp;lt;br/&amp;gt;&lt;br /&gt;
have the same effect. So I think simply ommitting DDS is ok?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Also, much more important, the comment is not about 'your video driver'. It is &amp;lt;br/&amp;gt;&lt;br /&gt;
in your (Vivian) case even wrong. Your driver will display this fine.&amp;lt;br/&amp;gt;&lt;br /&gt;
So, in the end I do not care if it is 'your particular video driver' that does &amp;lt;br/&amp;gt;&lt;br /&gt;
not like this. You will just see this in the best case as the models look &amp;lt;br/&amp;gt;&lt;br /&gt;
wrong, and in the worst case fgfs just crashes the driver if these textures &amp;lt;br/&amp;gt;&lt;br /&gt;
are used.&amp;lt;br/&amp;gt;&lt;br /&gt;
What I really care about is that these files are expected not to work on a huge &amp;lt;br/&amp;gt;&lt;br /&gt;
amount of graphics boards out there. The point is to tell people doing &amp;lt;br/&amp;gt;&lt;br /&gt;
textures that they should omit compression so that this message disapears.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678235/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I would like to have a flightgear that is by default just running on every &amp;lt;br/&amp;gt;&lt;br /&gt;
average system. Having this run faster on a special configured system with some &amp;lt;br/&amp;gt;&lt;br /&gt;
better configuration options and hand tuned hardware and drivers is very fine.&amp;lt;br/&amp;gt;&lt;br /&gt;
But without tuning it must at least work in an acceptable way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I have checked in a change to flightgear to make the use of the compressed &amp;lt;br/&amp;gt;&lt;br /&gt;
internal formats a starttime configuration option.&amp;lt;br/&amp;gt;&lt;br /&gt;
I am still interrested if we have that hangs also with texture compression &amp;lt;br/&amp;gt;&lt;br /&gt;
disabled and without providing precompressed dds textures?&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28602775/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |this is the reason for the message. If your machine would refuse to display this you, &amp;lt;br/&amp;gt;&lt;br /&gt;
developing that, would probably just say 'nice try, but it does not work' &amp;lt;br/&amp;gt;&lt;br /&gt;
before you check in something. In the case it displays fine, you probably say &amp;lt;br/&amp;gt;&lt;br /&gt;
'it works here, so I assume it works also for others, lets do'.&amp;lt;br/&amp;gt;&lt;br /&gt;
And the message tells you, 'despite of just seeing this working on this &amp;lt;br/&amp;gt;&lt;br /&gt;
current machine, it does not work for others'.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678784/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Seriously, I think plenty people not being on this list today and probably &amp;lt;br/&amp;gt;&lt;br /&gt;
never will be in touch with anybody here, will run into this issue.&amp;lt;br/&amp;gt;&lt;br /&gt;
People here are those few guys from the power users that want to develop this &amp;lt;br/&amp;gt;&lt;br /&gt;
stuff.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I am not going to discuss the patent stuff. Please search the mesa-dev archives &amp;lt;br/&amp;gt;&lt;br /&gt;
for the discussion and see there why they think that the nvidia tools and &amp;lt;br/&amp;gt;&lt;br /&gt;
other stuff out there cannot be used. Really - it is not that the code for that &amp;lt;br/&amp;gt;&lt;br /&gt;
is too dificult or unavailable. I am not a lawyer and I cannot change this &amp;lt;br/&amp;gt;&lt;br /&gt;
world - even if I would like to in this regard.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I agree that techically for drivers/gpus supporting these compression formats &amp;lt;br/&amp;gt;&lt;br /&gt;
it would be best to use these precompressed files.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678784/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Seriously, I think plenty people not being on this list today and probably &amp;lt;br/&amp;gt;&lt;br /&gt;
never will be in touch with anybody here, will run into this issue.&amp;lt;br/&amp;gt;&lt;br /&gt;
People here are those few guys from the power users that want to develop this &amp;lt;br/&amp;gt;&lt;br /&gt;
stuff.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678784/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Your driver will display this fine.&amp;lt;br/&amp;gt;&lt;br /&gt;
So, in the end I do not care if it is 'your particular video driver' that does &amp;lt;br/&amp;gt;&lt;br /&gt;
not like this. You will just see this in the best case as the models look &amp;lt;br/&amp;gt;&lt;br /&gt;
wrong, and in the worst case fgfs just crashes the driver if these textures &amp;lt;br/&amp;gt;&lt;br /&gt;
are used.&amp;lt;br/&amp;gt;&lt;br /&gt;
What I really care about is that these files are expected not to work on a huge &amp;lt;br/&amp;gt;&lt;br /&gt;
amount of graphics boards out there. The point is to tell people doing &amp;lt;br/&amp;gt;&lt;br /&gt;
textures that they should omit compression so that this message disapears.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678235/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Approaches ===&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Well, the default f16 does not work anymore for example.&amp;lt;br/&amp;gt;&lt;br /&gt;
I have also never tried the new textures, but I assume that these also contain &amp;lt;br/&amp;gt;&lt;br /&gt;
precompressed data? Also you claimed that the old texture files start to bitrot &amp;lt;br/&amp;gt;&lt;br /&gt;
comared to the new ones which makes me think that the new standard should be &amp;lt;br/&amp;gt;&lt;br /&gt;
the dds files. This together makes me think that the dds files should replace &amp;lt;br/&amp;gt;&lt;br /&gt;
the traditional image files.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28604650/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Hmm, regarding dds.&amp;lt;br/&amp;gt;&lt;br /&gt;
I have to say, that not all OpenGL drivers support texture compression, and &amp;lt;br/&amp;gt;&lt;br /&gt;
the models with dds files, are those that I cannot display, because of that.&amp;lt;br/&amp;gt;&lt;br /&gt;
And in fact this will not happen to the open source drivers before something &amp;lt;br/&amp;gt;&lt;br /&gt;
about 2020 because of patent issues.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Sorry to step in this so late - probably way too late - but is there a reason &amp;lt;br/&amp;gt;&lt;br /&gt;
that the on disk format must be compressed?&amp;lt;br/&amp;gt;&lt;br /&gt;
The previous strategy to have on disk an format that everybody can read and to &amp;lt;br/&amp;gt;&lt;br /&gt;
make the driver compress them as needed/possible is better I think?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
So, for me the f16 lost its livery lately - where I can live with this for the &amp;lt;br/&amp;gt;&lt;br /&gt;
f16, I hope that this does not happen to flightgear as a whole ...&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28594472/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-27&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Well, I hope that we can get rid of the compression.&amp;lt;br/&amp;gt;&lt;br /&gt;
Can somebody with the apropriate tools convert the compressed textures to non &amp;lt;br/&amp;gt;&lt;br /&gt;
compressed ones? That could still be dds, but dds without these compressions &amp;lt;br/&amp;gt;&lt;br /&gt;
that produce the warning. So no problem with cubemaps in dds as long as the &amp;lt;br/&amp;gt;&lt;br /&gt;
compression is not there.&amp;lt;br/&amp;gt;&lt;br /&gt;
Then *everybody* is again able to use this stuff.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678109/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I can see several approaches:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* Just do not use the patented compression stuff. The precomputed mipmaps could &amp;lt;br/&amp;gt;&lt;br /&gt;
probably do the job of avoiding the hangs (hopefully? to be checked?). May be &amp;lt;br/&amp;gt;&lt;br /&gt;
we could lower disk space usage by providing a dds.gz or similar wrapper?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* If it's just the mipmaps. May be we can precompute the mipmaps using the cpu &amp;lt;br/&amp;gt;&lt;br /&gt;
in the database loader thread. This would help all textures not only the ones &amp;lt;br/&amp;gt;&lt;br /&gt;
that could be converted. May be this is the most generic solution.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* Implement some kind of image lookup order that knows if the compressed files &amp;lt;br/&amp;gt;&lt;br /&gt;
could be handled or not. On loading an image in case of available compression &amp;lt;br/&amp;gt;&lt;br /&gt;
first try to find a dds file with the same name of the original one. That &amp;lt;br/&amp;gt;&lt;br /&gt;
involves some 'magic' which often leads to problems but that could at least &amp;lt;br/&amp;gt;&lt;br /&gt;
work.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28606576/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;[Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&lt;br /&gt;
	buildings)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-30&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Next step is to make sure that compression is not required to avoid the hangs.&amp;lt;br/&amp;gt;&lt;br /&gt;
My favorite bet would be that then the new configure option regarding texture &amp;lt;br/&amp;gt;&lt;br /&gt;
compression needs to be set to none.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28606576/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;[Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&lt;br /&gt;
	buildings)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-30&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
=== Precomputed mipmaps  ===&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Could we do dds files without compression but with precomputed mipmaps?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
So at next, can you try out which combination of compression/provided &amp;lt;br/&amp;gt;&lt;br /&gt;
mipmaps/forced simgear compression still work fine?&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28603114/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |The 4. Method that I can imagine is to precompute the mipmaps in the loader.&amp;lt;br/&amp;gt;&lt;br /&gt;
IIRC tests with some of the guys suffering from this problem, providing &amp;lt;br/&amp;gt;&lt;br /&gt;
premipmapped but uncompressed dds files had helped to get a fluent viewer.&amp;lt;br/&amp;gt;&lt;br /&gt;
The argument against providing these dds files in general was that these files &amp;lt;br/&amp;gt;&lt;br /&gt;
are really huge because of not including any compression and having all the &amp;lt;br/&amp;gt;&lt;br /&gt;
mipmaps.&amp;lt;br/&amp;gt;&lt;br /&gt;
But that means we could at the point where the warning happens compute the &amp;lt;br/&amp;gt;&lt;br /&gt;
mipmap levels on the cpu in the loader thread. osg::gluScaleImage could be &amp;lt;br/&amp;gt;&lt;br /&gt;
used to do this I think (or something similar not requireing a context). This &amp;lt;br/&amp;gt;&lt;br /&gt;
one is an imported version of the original glu function that is included in &amp;lt;br/&amp;gt;&lt;br /&gt;
osg for running on an EGL stack which no longer provides GLU.&amp;lt;br/&amp;gt;&lt;br /&gt;
That is take the image scale this to the 1st mipmap, take the 1.st mipmap and &amp;lt;br/&amp;gt;&lt;br /&gt;
scale this to the 2. mipmap and so forth.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This would have the advantage that the png's do not deviate from the dds files &amp;lt;br/&amp;gt;&lt;br /&gt;
over time.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/29571679/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS usage in effects files&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-07-21&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I think then, computing mipmaps for any texture file on the CPU in the loader &amp;lt;br/&amp;gt;&lt;br /&gt;
thread should globally improove the situation.&amp;lt;br/&amp;gt;&lt;br /&gt;
Also avoiding the compression already in the files should help every use case. &amp;lt;br/&amp;gt;&lt;br /&gt;
Except that the on disk memory consumption is higher.&amp;lt;br/&amp;gt;&lt;br /&gt;
Well and except that the database loader has more work to do on the CPU.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28612897/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-01&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Doing that differently will provide some overhead that could be kept at a &amp;lt;br/&amp;gt;&lt;br /&gt;
minimum I think:&amp;lt;br/&amp;gt;&lt;br /&gt;
For the disk usage, I think gzip compressing these will work sufficiently fine.&amp;lt;br/&amp;gt;&lt;br /&gt;
Ram usage of the images should not hurt too much. Sure the images are bigger &amp;lt;br/&amp;gt;&lt;br /&gt;
in memory. But fgfs is not just about images - far from that.&amp;lt;br/&amp;gt;&lt;br /&gt;
On the GPU, you can still use compression for the textures as the internal &amp;lt;br/&amp;gt;&lt;br /&gt;
format. This is what flightgear tries to do if the extension is supported &amp;lt;br/&amp;gt;&lt;br /&gt;
(checked by osg).&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The major point is that there are several ways that use slightly more &amp;lt;br/&amp;gt;&lt;br /&gt;
resources to get around this problem.&amp;lt;br/&amp;gt;&lt;br /&gt;
But once the patented compression is on disk, there is *no* way back for &amp;lt;br/&amp;gt;&lt;br /&gt;
people not having this feature.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
If you have better ideas that do not rule out intel and the oss drivers, you &amp;lt;br/&amp;gt;&lt;br /&gt;
are welcome!&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678784/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |On unix I usually get the gzip plugin installed by osg (osgdb_gz.so). Is this &amp;lt;br/&amp;gt;&lt;br /&gt;
also the case for the default win32 case? Is there a osgdb_gz.dll or something &amp;lt;br/&amp;gt;&lt;br /&gt;
along the lines in the directory containing the plugins?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
If yes, we can already tackle the size problem of the uncompressed dds files on &amp;lt;br/&amp;gt;&lt;br /&gt;
disk by just gzip compressing these makging a xxx.dds.gz from a xxx.dds and &amp;lt;br/&amp;gt;&lt;br /&gt;
just refering to xxx.dds.gz instead of xxx.dds. At least this works fine here. &amp;lt;br/&amp;gt;&lt;br /&gt;
And I assume that this works fine for all unix like operating systems including &amp;lt;br/&amp;gt;&lt;br /&gt;
mac?!&amp;lt;br/&amp;gt;&lt;br /&gt;
James?&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678235/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |What about solution 6 with (uncompressed premipmapped dds).gz?&amp;lt;br/&amp;gt;&lt;br /&gt;
On linux this should work as long as you have zlib installed which could be &amp;lt;br/&amp;gt;&lt;br /&gt;
regarded as a system library there.&amp;lt;br/&amp;gt;&lt;br /&gt;
Can we rely on zlib being compield into our osg distributions on win32? We do &amp;lt;br/&amp;gt;&lt;br /&gt;
need zlib in any case, it's mostly about teaching osg that it finds our zlib on &amp;lt;br/&amp;gt;&lt;br /&gt;
configure and build the gz plugin.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/29571819/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS usage in effects files&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-07-21&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I implemented a mipmap control and generation tool in effects when I last updated&amp;lt;br/&amp;gt;&lt;br /&gt;
the urban shader. For the moment, it relies on hardware when the average operator &amp;lt;br/&amp;gt;&lt;br /&gt;
is used for all texture channels but it could easily be modified to compute &amp;lt;br/&amp;gt;&lt;br /&gt;
all mipmap on the CPU. look the &amp;lt;mipmap-control&amp;gt; effect option and &amp;lt;br/&amp;gt;&lt;br /&gt;
mipmap.[ch]xx in SG material lib&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28606692/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees&lt;br /&gt;
	&amp;amp;	buildings)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Frederic Bouvier&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-30&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |As has been previously pointed out, the current DDS texture set is not&amp;lt;br/&amp;gt;&lt;br /&gt;
simply the global png texture set converted.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
For our own sanity and those of the users, we need to ensure that there's&amp;lt;br/&amp;gt;&lt;br /&gt;
an apples-to-apples comparison being made when we change the default.  I&amp;lt;br/&amp;gt;&lt;br /&gt;
therefore think we need to create a DDS version of the current default&amp;lt;br/&amp;gt;&lt;br /&gt;
texture set.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32797669/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Stuart Buchanan&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |2)  If we go down this path, we probably want to separate the underlying&amp;lt;br/&amp;gt;&lt;br /&gt;
texture format from the materials.xml definition entirely. For example, we&amp;lt;br/&amp;gt;&lt;br /&gt;
could simply remove the extention from the materials definition, and have&amp;lt;br/&amp;gt;&lt;br /&gt;
the C++ code append the appropriate extension based on a separate property.&amp;lt;br/&amp;gt;&lt;br /&gt;
This has a couple of advantages:&amp;lt;br/&amp;gt;&lt;br /&gt;
a) Makes testing easier and materials definitions less error-prone.&amp;lt;br/&amp;gt;&lt;br /&gt;
Assuming we have some batch job in place to generate dds textures, those&amp;lt;br/&amp;gt;&lt;br /&gt;
working on materials definitions could continue to work with png textures,&amp;lt;br/&amp;gt;&lt;br /&gt;
and only convert to dds as a final step (or indeed as part of the &amp;quot;make&amp;lt;br/&amp;gt;&lt;br /&gt;
release&amp;quot; jobs).&amp;lt;br/&amp;gt;&lt;br /&gt;
a) Avoids duplication of materials definitions.  Having just spent quite a&amp;lt;br/&amp;gt;&lt;br /&gt;
bit of time making the materials definitions more efficient, I'd like to&amp;lt;br/&amp;gt;&lt;br /&gt;
avoid making it worse again!&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I'm quite happy to do the C++ coding required for this in the materials&amp;lt;br/&amp;gt;&lt;br /&gt;
loader - it's probably pretty straightforward.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32797669/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Stuart Buchanan&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |That does leave the issue of what happens to the existing dds texture&amp;lt;br/&amp;gt;&lt;br /&gt;
definitions where there are special mipmap layers.  I'd suggest that we&amp;lt;br/&amp;gt;&lt;br /&gt;
have some Clever Script (tm) that is able to work out whether the DDS or&amp;lt;br/&amp;gt;&lt;br /&gt;
PNG version of a texture is the master, and then generate the other version&amp;lt;br/&amp;gt;&lt;br /&gt;
from it.  I admit that the PNG conversion of the DDS will lose some&amp;lt;br/&amp;gt;&lt;br /&gt;
information in this process, but it would allow those without DDS support&amp;lt;br/&amp;gt;&lt;br /&gt;
to at least use the textures.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32797669/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Stuart Buchanan&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |3) We need a sensible process for dealing with aircraft, which has been&amp;lt;br/&amp;gt;&lt;br /&gt;
identified as a significant issue.  Again, I think more aircraft developers&amp;lt;br/&amp;gt;&lt;br /&gt;
find .png easier to deal with, and there are a lot of aircraft out there&amp;lt;br/&amp;gt;&lt;br /&gt;
that would need conversion.  It feels like we need some build scripts to&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;quot;compile&amp;quot; aircraft to use DDS textures.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
A more far-fetched idea might be to have a cache of dds textures that are&amp;lt;br/&amp;gt;&lt;br /&gt;
generated on-the-fly, or when aircraft are loaded by the aircraft center.&amp;lt;br/&amp;gt;&lt;br /&gt;
Clearly that impacts initial load time the first time a new aircraft is&amp;lt;br/&amp;gt;&lt;br /&gt;
loaded, and would increase the size of .fgfs/ directories massively, but it&amp;lt;br/&amp;gt;&lt;br /&gt;
would remove the need for any work by aircraft/scenery developers and could&amp;lt;br/&amp;gt;&lt;br /&gt;
be made optional.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32797669/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Stuart Buchanan&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |&amp;quot;dds on an open source driver (radeon and intel) I was forced to use radeon at some time, and it was fun, the planes were pink :) once libtxc-dxtn installed, dds were loaded fine again, so it can be used on open source if you are ok to use the lib.&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Unless there's some way to make sure Linux users have that lib installed automatically, I'd say that's a no. We can't have a random user guess what additional packages to install. And maybe someone can educate me - googling the lib, this appears to be working for mesa - which usually is what we try to avoid if users do 3d rendering via mesa for performance reasons?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Also, what does 'If you are okay to use the lib' mean precisely? If that's some piece of code which circumvents a patented thing and isn't exactly legal and needs to be obtained from special servers outside the normal repo (sort of like the DVD decryption under Linux), then I doubt that's an option. Can anyone clarify?&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32786414/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Renk Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Another potential option would be to convert regions to .dds but keep &amp;lt;br/&amp;gt;&lt;br /&gt;
both global-png and global-dds, but making that user-friendly would &amp;lt;br/&amp;gt;&lt;br /&gt;
require a way to automatically detect lack of .dds support.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787117/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Download size,&lt;br /&gt;
 and hardware support (was .dds textures)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Rebecca Palmer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |On my system (Intel Ivybridge), DDS works with or without libtxc, but &amp;lt;br/&amp;gt;&lt;br /&gt;
this may not be true of all Intel hardware.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787117/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Download size,&lt;br /&gt;
 and hardware support (was .dds textures)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Rebecca Palmer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |You can specify the dependency on libtxc_dxtn, but then distributions like &amp;lt;br/&amp;gt;&lt;br /&gt;
openSUSE cannot ship FlightGear anymore. libtxc_dxtn implements S3 texture &amp;lt;br/&amp;gt;&lt;br /&gt;
compression which is patented in many parts of the world. Linux distributions &amp;lt;br/&amp;gt;&lt;br /&gt;
therefore cannot ship it. You can easily find it in add-on repositories, but &amp;lt;br/&amp;gt;&lt;br /&gt;
as I said, distributions would not be able to include FlightGear creating a &amp;lt;br/&amp;gt;&lt;br /&gt;
huge hurdle to installation for users.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787143/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Download size,&lt;br /&gt;
	and hardware support (was .dds textures)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Stefan Seifert&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Debian/Ubuntu's libtxc is libtxc-dxtn-s2tc, which claims to avoid the &amp;lt;br/&amp;gt;&lt;br /&gt;
patent at a small cost in visual quality: &amp;lt;br/&amp;gt;&lt;br /&gt;
https://github.com/divVerent/s2tc/wiki/libtxc_dxtn&amp;lt;br/&amp;gt;&lt;br /&gt;
That site also states that modern hardware doesn't need this software &amp;lt;br/&amp;gt;&lt;br /&gt;
fallback anyway (and hence won't hit either this quality loss or the &amp;lt;br/&amp;gt;&lt;br /&gt;
slowness of any software decoder), but doesn't define &amp;quot;modern hardware&amp;quot;.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787296/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Download size,&lt;br /&gt;
 and hardware support (was .dds textures)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Rebecca Palmer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |The dds textures seem to have some advantages over our png textures and &amp;lt;br/&amp;gt;&lt;br /&gt;
using them is tempting.&amp;lt;br/&amp;gt;&lt;br /&gt;
But the points from Thorsten R. are good points and if there is any &amp;lt;br/&amp;gt;&lt;br /&gt;
chance to have a step-wise transition to the new format, I'd prefer that &amp;lt;br/&amp;gt;&lt;br /&gt;
path.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Don't we have an alternate dds texture set already in fgdata that is &amp;lt;br/&amp;gt;&lt;br /&gt;
enabled with an option? What about making this the default, keeping the &amp;lt;br/&amp;gt;&lt;br /&gt;
png texture set as an alternate. That would get us reports from users &amp;lt;br/&amp;gt;&lt;br /&gt;
unable to run dds textures and provide an easy fallback method.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787378/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Torsten Dreyer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |We currently have regions-png, global-png and global-dds; as I noted &amp;lt;br/&amp;gt;&lt;br /&gt;
earlier, switching to regions-dds, global-png and global-dds has the &amp;lt;br/&amp;gt;&lt;br /&gt;
issue that while changing the texture set is easy (dropdown in View &amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
Rendering Options), knowing that one needs to do so may not be.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787717/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Rebecca Palmer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Can we invert the logic in, say, preferences.xml so xxx-dds is enabled &amp;lt;br/&amp;gt;&lt;br /&gt;
by default and switching to xxx-png has to be done in rendering options?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Torsten&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787787/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Torsten Dreyer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Changing the default (which is in preferences.xml) is easy: the problem &amp;lt;br/&amp;gt;&lt;br /&gt;
is how do users with non-.dds-supporting hardware (if this exists) know &amp;lt;br/&amp;gt;&lt;br /&gt;
they need to change back.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787851/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Rebecca Palmer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Conversion ==&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Automatic conversion script is welcome indeed. Also I'm pretty sure that we have some people here ready to convert a PNG to DDS as soon as you say &amp;quot;Hey boys I created a new PNG file, can you convert this file for me please ?&amp;quot; :-)&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32785592/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Download size,&lt;br /&gt;
 and hardware support (was .dds textures)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Clement de l'Hamaide&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |A few world about the conversion: once a png/rgb/jpg found, the script &amp;lt;br/&amp;gt;&lt;br /&gt;
try to guess the suitable dds format: with or without alpha channel, &amp;lt;br/&amp;gt;&lt;br /&gt;
bumpmap, if a .dds is allready found we just erase the png one, if not &amp;lt;br/&amp;gt;&lt;br /&gt;
we use nvcompress to get the dds. After we change the textures name &amp;lt;br/&amp;gt;&lt;br /&gt;
called in the differents files and that's it. There's a way to tell the &amp;lt;br/&amp;gt;&lt;br /&gt;
script what to do for each file, if the automatic mode is a failure.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I guess speaking theorically is not the best to make an opinion, so if &amp;lt;br/&amp;gt;&lt;br /&gt;
some of you are interested to make a test, I will make a 3.2 minimal dds &amp;lt;br/&amp;gt;&lt;br /&gt;
fgdata this we, once on my FG pc.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32785602/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;jean&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
== Pros ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I always got a loading problem with png textures, large  textures take &amp;lt;br/&amp;gt;&lt;br /&gt;
seconds to load and convert, and that ruin my close flight where you &amp;lt;br/&amp;gt;&lt;br /&gt;
can't afford to take pause in the air.&amp;lt;br/&amp;gt;&lt;br /&gt;
that's why i did a batch script to convert to dds ALL the textures in &amp;lt;br/&amp;gt;&lt;br /&gt;
the data, not only the matérial set, but everything. Now i only flight a &amp;lt;br/&amp;gt;&lt;br /&gt;
dds version of flightgear, and am quite happy with it, that's why i &amp;lt;br/&amp;gt;&lt;br /&gt;
propose to provide a dds fgdata for test, and maybe to make it an &amp;lt;br/&amp;gt;&lt;br /&gt;
alternate download possibility.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32785602/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;jean&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Cons ==&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |FG actually runs with dds textures, it just doesn't render anything reasonable, I believe you get monochromatic colors. But I don't expect the menu to be affected, it doesn't use textures.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787957/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Renk Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |If it's relevant, I recall having S2TC compression problems when running Flightgear, and updating this package to a newer version manually (outside of the main repos) fixed the issue. I'm on an Intel HD 3000, but I'm guessing that Intel HD 4000 doesn't have this problem, since it seems to have better OpenGL and OpenCL support.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787875/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Download size,&lt;br /&gt;
	and hardware support (was .dds textures)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Saikrishna Arcot&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Switching_default_texture_format_to_DDS&amp;diff=75937</id>
		<title>Switching default texture format to DDS</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Switching_default_texture_format_to_DDS&amp;diff=75937"/>
		<updated>2014-09-05T09:57:20Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The FG development team is considering to '''switch the default format for textures from png to DDS'''. This would offer a number of significant advantages:&lt;br /&gt;
&lt;br /&gt;
* DDS is a more compact format than png, hence the download size of the FG base package may be decreased&lt;br /&gt;
* Compressed DDS can be directly used by many graphics cards, reducing also GPU memory consumption&lt;br /&gt;
* DDS stores all texture resolution levels, in essence no lower resolution levels have to be generated when the texture is used, hence it loads much faster into memory&lt;br /&gt;
* The resolution levels ('mipmaps') can be customized, allowing for some interesting effects at no performance cost&lt;br /&gt;
&lt;br /&gt;
Practically all commercial simulations use DDS for these reasons. &lt;br /&gt;
&lt;br /&gt;
== Feedback needed - should FlightGear switch the defaults to DDS format for terrain texturing? ==&lt;br /&gt;
&lt;br /&gt;
However, the DDS compression algorithm is patented, which means that it is not readily available for open source graphics drivers used by Linux distributions. Dependent on the specific hardware, this may or may not be a problem (modern graphics cards typically do not need the driver to process DDS, for older graphics cards there are non-patented workarounds available which decompress the DDS on the software level). The development team is concerned about making the FlightGear experience pleasant for all users, hence we would like to gather feedback how many users would be affected by a change in practice.&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |let's collect some some feedback [on DDS usage in FlightGear] until late November and restart this topic. We probably know by then what we do for the next release. &amp;quot;Somebody&amp;quot; needs to collect the feedback, however.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32791750/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Torsten Dreyer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-03&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If there are no problems reported, FG will change defaults to textures in DDS format with the 3.4 release, and then phase out the use of png textures.&lt;br /&gt;
In other words, a lack of feedback from end users might very well mean that future FlightGear versions may require DDS support and may not necessarily work for people with outdated hardware - so if you care about backward compatibility, please do get involved, test DDS support and provide feedback!&lt;br /&gt;
&lt;br /&gt;
=== What we need you to do? ===&lt;br /&gt;
&lt;br /&gt;
FlightGear already provides the simple option to test a DDS texture set. If you are running on Linux and use an open source graphics driver, please take 5 minutes to help during your next FG session:&lt;br /&gt;
&lt;br /&gt;
# Open the dialog under View -&amp;gt; Rendering&lt;br /&gt;
# Under 'Terrain texture scheme', change the default 'Region-specific' to 'Global alternative (DDS format)' &lt;br /&gt;
# Press 'Okay' - FG will reload the terrain&lt;br /&gt;
# Do you see proper textures on the terrain (they may look different and may also not fit the location perfectly)? If yes, you're fine. If you see monochromatic, or even bright/pink, colors or other rendering artifacts, your system may have problems with DDS.&lt;br /&gt;
# Change back to the texture scheme you like best&lt;br /&gt;
# Enter your experiences in the list below&lt;br /&gt;
&lt;br /&gt;
Thanks for your help!&lt;br /&gt;
&lt;br /&gt;
== Tested hardware and graphics drivers ==&lt;br /&gt;
&lt;br /&gt;
=== NVIDIA proprietary driver ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Card&lt;br /&gt;
!Driver&lt;br /&gt;
!DDS ok&lt;br /&gt;
!Reported by&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GTX 670M&lt;br /&gt;
|310.19&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|ThorstenR&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GT 540M&lt;br /&gt;
|331.82&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|Gijs&lt;br /&gt;
|-&lt;br /&gt;
|N13M-NS Optimus &lt;br /&gt;
|340.32&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|Tom_ch&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GT640 &lt;br /&gt;
|343.13&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|lumni1968&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GTX 780 Ti&lt;br /&gt;
|340.52&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|Avionyx&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GT 750M&lt;br /&gt;
|331.38&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|Dutchguy&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GT 620 OEM&lt;br /&gt;
|331.38&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|C-GGKV&lt;br /&gt;
|-&lt;br /&gt;
|GeForce GTX 650&lt;br /&gt;
|331.20&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|Dany93&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== NVIDIA open source driver ===&lt;br /&gt;
&lt;br /&gt;
=== Intel proprietary driver ===&lt;br /&gt;
&lt;br /&gt;
=== Intel open source driver ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Card&lt;br /&gt;
!Driver&lt;br /&gt;
!DDS ok&lt;br /&gt;
!Reported by&lt;br /&gt;
|-&lt;br /&gt;
|HD Graphics 3000 (i7-2600K)&lt;br /&gt;
|10.2.6&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|cdesai&lt;br /&gt;
|-&lt;br /&gt;
|HD Graphics 3000 (i3-2330M)&lt;br /&gt;
|10.2.2&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|Flyhigh/saiarcot895&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ATI/AMD proprietary driver ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Card&lt;br /&gt;
!Driver&lt;br /&gt;
!DDS ok&lt;br /&gt;
!Reported by&lt;br /&gt;
|-&lt;br /&gt;
|ATI Radeon HD 6310&lt;br /&gt;
|14.6-1&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|ZLSA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ATI/AMD open source driver ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Card&lt;br /&gt;
!Driver&lt;br /&gt;
!DDS ok&lt;br /&gt;
!Reported by&lt;br /&gt;
|-&lt;br /&gt;
|AMD Radeon HD 7950&lt;br /&gt;
|10.2.1&lt;br /&gt;
|{{yes}}&lt;br /&gt;
|Saga&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Sample test ==&lt;br /&gt;
&lt;br /&gt;
=== DDS Test at the airport of Orio (Bergamo - Italy) ===&lt;br /&gt;
&lt;br /&gt;
[[File:Terrain texture scheme DDS 01-2000.jpg|800px|thumb|Comparison of texture in relation to the three possible choices in &amp;quot;Rendering Options&amp;quot; -&amp;gt; &amp;quot;Terrain texture scheme&amp;quot;]]The final result, with all the &amp;quot;Shader Options&amp;quot; active, is not very satisfactory, I would say very poor. Apparently not check on any improvement in the speed of image loading. I think on modern machines with quad-core processors 16 GB, with latest graphics cards (NVIDIA 870) 6 GB, the loading of these images is not really a &amp;quot;bottleneck&amp;quot;. I propose to insert the DDS functionality, but in a transparent way, ie convert &amp;quot;on the fly&amp;quot; the images before inserting them into the temporary memory, for example using the convert function of ImageMagick. However, I do not know if it really is a useful feature, I think there are many other things to do before this.&lt;br /&gt;
&lt;br /&gt;
== Excerpts from the ongoing discussion ==&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Here is my suggestion how to proceed:&lt;br /&gt;
&lt;br /&gt;
* Let's do your 1) and 2) on as many information channels we have.&lt;br /&gt;
* Collect the responses on a public place, I'd suggest a wiki page&lt;br /&gt;
* Do this for a well defined time frame. Is three month too much/too short?&lt;br /&gt;
* If we have the impression, it's safe to switch to DDS, define the dds texture sets as default, keeping the png sets as a fallback and publish how to use this fallback&lt;br /&gt;
* Keep this for one release.&lt;br /&gt;
* Depending on the feedback we get, keep it that way or move entirely to DDS.&lt;br /&gt;
&lt;br /&gt;
Does that sound reasonable for everybody?&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32788459/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Torsten Dreyer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I'd propose [...] this process:&lt;br /&gt;
# Get out the information first that one can change materials files, where to do it and what the characteristics of the different sets are.&lt;br /&gt;
# Ask users (especially those running with ATI or Intel on Linux) nicely to do a quick check whether dds works fine.&lt;br /&gt;
&lt;br /&gt;
I think we have an information management problem in relation to the user base - a frequent forum situation is that a user requests something that's already there, but the information is just not out. So if we even envision such a change, I would start spreading the relevant information basically yesterday.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787957/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Renk Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== DDS Debate in 2012 ==&lt;br /&gt;
&lt;br /&gt;
=== Legalities ===&lt;br /&gt;
{{See also|Talk:Switching default texture format to DDS#Using patented algorithms}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |These kind of precompressed images limits their usage to a specific set of &amp;lt;br/&amp;gt;&lt;br /&gt;
drivers. And no, due to the patent issues no open source code including ours &amp;lt;br/&amp;gt;&lt;br /&gt;
is allowed to implement compression/decompression code for these image &amp;lt;br/&amp;gt;&lt;br /&gt;
formats. Even if this is easy implementation wise.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28604650/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |t is technically incorrect to provide these s3 patent &amp;lt;br/&amp;gt;&lt;br /&gt;
precompressed textures to a driver that does not announce the apropriate &amp;lt;br/&amp;gt;&lt;br /&gt;
extension and since we are not allowed to code something that deompresses &amp;lt;br/&amp;gt;&lt;br /&gt;
this, I think we should avoid using this compression for all the provided &amp;lt;br/&amp;gt;&lt;br /&gt;
models/textures.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I think of a warning that is issued from the image loader in flightgear that &amp;lt;br/&amp;gt;&lt;br /&gt;
detects when these precompressed textures are seen. So even people using &amp;lt;br/&amp;gt;&lt;br /&gt;
drivers that just offer this extension have a chance to see that the provided &amp;lt;br/&amp;gt;&lt;br /&gt;
textures will not work for others.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28612879/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-01&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Portability Concerns  ===&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |These kind of precompressed images limits their usage to a specific set of &amp;lt;br/&amp;gt;&lt;br /&gt;
drivers. And no, due to the patent issues no open source code including ours &amp;lt;br/&amp;gt;&lt;br /&gt;
is allowed to implement compression/decompression code for these image &amp;lt;br/&amp;gt;&lt;br /&gt;
formats. Even if this is easy implementation wise.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28604650/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |And this is what I try to do now:&amp;lt;br/&amp;gt;&lt;br /&gt;
Object against using these patented compression algorithms.&amp;lt;br/&amp;gt;&lt;br /&gt;
I do not care for the on disk format of any image file we have. But the problem &amp;lt;br/&amp;gt;&lt;br /&gt;
is that some kind of precompression that can be stored in these dds files &amp;lt;br/&amp;gt;&lt;br /&gt;
cannot be used with other drivers than the closed ati and nvidia ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
As long as these patented compression techiques are not used, every OpenGL &amp;lt;br/&amp;gt;&lt;br /&gt;
driver can use this and displays this fine.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Think: Intel has the hugest marketshare in graphics today. If I remember &amp;lt;br/&amp;gt;&lt;br /&gt;
right, they sell more than ati and nvidia together (*). This kind of change in &amp;lt;br/&amp;gt;&lt;br /&gt;
effect rules out the majority of users as intel cannot work with these files.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28604650/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |It's not limited to dds. If you use osgconv xxx.dds xxx.ivs you will probably &amp;lt;br/&amp;gt;&lt;br /&gt;
have the same effect. So I think simply ommitting DDS is ok?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Also, much more important, the comment is not about 'your video driver'. It is &amp;lt;br/&amp;gt;&lt;br /&gt;
in your (Vivian) case even wrong. Your driver will display this fine.&amp;lt;br/&amp;gt;&lt;br /&gt;
So, in the end I do not care if it is 'your particular video driver' that does &amp;lt;br/&amp;gt;&lt;br /&gt;
not like this. You will just see this in the best case as the models look &amp;lt;br/&amp;gt;&lt;br /&gt;
wrong, and in the worst case fgfs just crashes the driver if these textures &amp;lt;br/&amp;gt;&lt;br /&gt;
are used.&amp;lt;br/&amp;gt;&lt;br /&gt;
What I really care about is that these files are expected not to work on a huge &amp;lt;br/&amp;gt;&lt;br /&gt;
amount of graphics boards out there. The point is to tell people doing &amp;lt;br/&amp;gt;&lt;br /&gt;
textures that they should omit compression so that this message disapears.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678235/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I would like to have a flightgear that is by default just running on every &amp;lt;br/&amp;gt;&lt;br /&gt;
average system. Having this run faster on a special configured system with some &amp;lt;br/&amp;gt;&lt;br /&gt;
better configuration options and hand tuned hardware and drivers is very fine.&amp;lt;br/&amp;gt;&lt;br /&gt;
But without tuning it must at least work in an acceptable way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I have checked in a change to flightgear to make the use of the compressed &amp;lt;br/&amp;gt;&lt;br /&gt;
internal formats a starttime configuration option.&amp;lt;br/&amp;gt;&lt;br /&gt;
I am still interrested if we have that hangs also with texture compression &amp;lt;br/&amp;gt;&lt;br /&gt;
disabled and without providing precompressed dds textures?&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28602775/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |this is the reason for the message. If your machine would refuse to display this you, &amp;lt;br/&amp;gt;&lt;br /&gt;
developing that, would probably just say 'nice try, but it does not work' &amp;lt;br/&amp;gt;&lt;br /&gt;
before you check in something. In the case it displays fine, you probably say &amp;lt;br/&amp;gt;&lt;br /&gt;
'it works here, so I assume it works also for others, lets do'.&amp;lt;br/&amp;gt;&lt;br /&gt;
And the message tells you, 'despite of just seeing this working on this &amp;lt;br/&amp;gt;&lt;br /&gt;
current machine, it does not work for others'.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678784/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Seriously, I think plenty people not being on this list today and probably &amp;lt;br/&amp;gt;&lt;br /&gt;
never will be in touch with anybody here, will run into this issue.&amp;lt;br/&amp;gt;&lt;br /&gt;
People here are those few guys from the power users that want to develop this &amp;lt;br/&amp;gt;&lt;br /&gt;
stuff.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I am not going to discuss the patent stuff. Please search the mesa-dev archives &amp;lt;br/&amp;gt;&lt;br /&gt;
for the discussion and see there why they think that the nvidia tools and &amp;lt;br/&amp;gt;&lt;br /&gt;
other stuff out there cannot be used. Really - it is not that the code for that &amp;lt;br/&amp;gt;&lt;br /&gt;
is too dificult or unavailable. I am not a lawyer and I cannot change this &amp;lt;br/&amp;gt;&lt;br /&gt;
world - even if I would like to in this regard.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I agree that techically for drivers/gpus supporting these compression formats &amp;lt;br/&amp;gt;&lt;br /&gt;
it would be best to use these precompressed files.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678784/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Seriously, I think plenty people not being on this list today and probably &amp;lt;br/&amp;gt;&lt;br /&gt;
never will be in touch with anybody here, will run into this issue.&amp;lt;br/&amp;gt;&lt;br /&gt;
People here are those few guys from the power users that want to develop this &amp;lt;br/&amp;gt;&lt;br /&gt;
stuff.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678784/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Your driver will display this fine.&amp;lt;br/&amp;gt;&lt;br /&gt;
So, in the end I do not care if it is 'your particular video driver' that does &amp;lt;br/&amp;gt;&lt;br /&gt;
not like this. You will just see this in the best case as the models look &amp;lt;br/&amp;gt;&lt;br /&gt;
wrong, and in the worst case fgfs just crashes the driver if these textures &amp;lt;br/&amp;gt;&lt;br /&gt;
are used.&amp;lt;br/&amp;gt;&lt;br /&gt;
What I really care about is that these files are expected not to work on a huge &amp;lt;br/&amp;gt;&lt;br /&gt;
amount of graphics boards out there. The point is to tell people doing &amp;lt;br/&amp;gt;&lt;br /&gt;
textures that they should omit compression so that this message disapears.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678235/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Approaches ===&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Well, the default f16 does not work anymore for example.&amp;lt;br/&amp;gt;&lt;br /&gt;
I have also never tried the new textures, but I assume that these also contain &amp;lt;br/&amp;gt;&lt;br /&gt;
precompressed data? Also you claimed that the old texture files start to bitrot &amp;lt;br/&amp;gt;&lt;br /&gt;
comared to the new ones which makes me think that the new standard should be &amp;lt;br/&amp;gt;&lt;br /&gt;
the dds files. This together makes me think that the dds files should replace &amp;lt;br/&amp;gt;&lt;br /&gt;
the traditional image files.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28604650/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Hmm, regarding dds.&amp;lt;br/&amp;gt;&lt;br /&gt;
I have to say, that not all OpenGL drivers support texture compression, and &amp;lt;br/&amp;gt;&lt;br /&gt;
the models with dds files, are those that I cannot display, because of that.&amp;lt;br/&amp;gt;&lt;br /&gt;
And in fact this will not happen to the open source drivers before something &amp;lt;br/&amp;gt;&lt;br /&gt;
about 2020 because of patent issues.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Sorry to step in this so late - probably way too late - but is there a reason &amp;lt;br/&amp;gt;&lt;br /&gt;
that the on disk format must be compressed?&amp;lt;br/&amp;gt;&lt;br /&gt;
The previous strategy to have on disk an format that everybody can read and to &amp;lt;br/&amp;gt;&lt;br /&gt;
make the driver compress them as needed/possible is better I think?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
So, for me the f16 lost its livery lately - where I can live with this for the &amp;lt;br/&amp;gt;&lt;br /&gt;
f16, I hope that this does not happen to flightgear as a whole ...&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28594472/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-27&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Well, I hope that we can get rid of the compression.&amp;lt;br/&amp;gt;&lt;br /&gt;
Can somebody with the apropriate tools convert the compressed textures to non &amp;lt;br/&amp;gt;&lt;br /&gt;
compressed ones? That could still be dds, but dds without these compressions &amp;lt;br/&amp;gt;&lt;br /&gt;
that produce the warning. So no problem with cubemaps in dds as long as the &amp;lt;br/&amp;gt;&lt;br /&gt;
compression is not there.&amp;lt;br/&amp;gt;&lt;br /&gt;
Then *everybody* is again able to use this stuff.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678109/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I can see several approaches:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* Just do not use the patented compression stuff. The precomputed mipmaps could &amp;lt;br/&amp;gt;&lt;br /&gt;
probably do the job of avoiding the hangs (hopefully? to be checked?). May be &amp;lt;br/&amp;gt;&lt;br /&gt;
we could lower disk space usage by providing a dds.gz or similar wrapper?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* If it's just the mipmaps. May be we can precompute the mipmaps using the cpu &amp;lt;br/&amp;gt;&lt;br /&gt;
in the database loader thread. This would help all textures not only the ones &amp;lt;br/&amp;gt;&lt;br /&gt;
that could be converted. May be this is the most generic solution.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* Implement some kind of image lookup order that knows if the compressed files &amp;lt;br/&amp;gt;&lt;br /&gt;
could be handled or not. On loading an image in case of available compression &amp;lt;br/&amp;gt;&lt;br /&gt;
first try to find a dds file with the same name of the original one. That &amp;lt;br/&amp;gt;&lt;br /&gt;
involves some 'magic' which often leads to problems but that could at least &amp;lt;br/&amp;gt;&lt;br /&gt;
work.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28606576/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;[Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&lt;br /&gt;
	buildings)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-30&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Next step is to make sure that compression is not required to avoid the hangs.&amp;lt;br/&amp;gt;&lt;br /&gt;
My favorite bet would be that then the new configure option regarding texture &amp;lt;br/&amp;gt;&lt;br /&gt;
compression needs to be set to none.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28606576/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;[Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&lt;br /&gt;
	buildings)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-30&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
=== Precomputed mipmaps  ===&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Could we do dds files without compression but with precomputed mipmaps?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
So at next, can you try out which combination of compression/provided &amp;lt;br/&amp;gt;&lt;br /&gt;
mipmaps/forced simgear compression still work fine?&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28603114/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Improving random trees &amp;amp; buildings&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-29&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |The 4. Method that I can imagine is to precompute the mipmaps in the loader.&amp;lt;br/&amp;gt;&lt;br /&gt;
IIRC tests with some of the guys suffering from this problem, providing &amp;lt;br/&amp;gt;&lt;br /&gt;
premipmapped but uncompressed dds files had helped to get a fluent viewer.&amp;lt;br/&amp;gt;&lt;br /&gt;
The argument against providing these dds files in general was that these files &amp;lt;br/&amp;gt;&lt;br /&gt;
are really huge because of not including any compression and having all the &amp;lt;br/&amp;gt;&lt;br /&gt;
mipmaps.&amp;lt;br/&amp;gt;&lt;br /&gt;
But that means we could at the point where the warning happens compute the &amp;lt;br/&amp;gt;&lt;br /&gt;
mipmap levels on the cpu in the loader thread. osg::gluScaleImage could be &amp;lt;br/&amp;gt;&lt;br /&gt;
used to do this I think (or something similar not requireing a context). This &amp;lt;br/&amp;gt;&lt;br /&gt;
one is an imported version of the original glu function that is included in &amp;lt;br/&amp;gt;&lt;br /&gt;
osg for running on an EGL stack which no longer provides GLU.&amp;lt;br/&amp;gt;&lt;br /&gt;
That is take the image scale this to the 1st mipmap, take the 1.st mipmap and &amp;lt;br/&amp;gt;&lt;br /&gt;
scale this to the 2. mipmap and so forth.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This would have the advantage that the png's do not deviate from the dds files &amp;lt;br/&amp;gt;&lt;br /&gt;
over time.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/29571679/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS usage in effects files&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-07-21&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I think then, computing mipmaps for any texture file on the CPU in the loader &amp;lt;br/&amp;gt;&lt;br /&gt;
thread should globally improove the situation.&amp;lt;br/&amp;gt;&lt;br /&gt;
Also avoiding the compression already in the files should help every use case. &amp;lt;br/&amp;gt;&lt;br /&gt;
Except that the on disk memory consumption is higher.&amp;lt;br/&amp;gt;&lt;br /&gt;
Well and except that the database loader has more work to do on the CPU.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28612897/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-01&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Doing that differently will provide some overhead that could be kept at a &amp;lt;br/&amp;gt;&lt;br /&gt;
minimum I think:&amp;lt;br/&amp;gt;&lt;br /&gt;
For the disk usage, I think gzip compressing these will work sufficiently fine.&amp;lt;br/&amp;gt;&lt;br /&gt;
Ram usage of the images should not hurt too much. Sure the images are bigger &amp;lt;br/&amp;gt;&lt;br /&gt;
in memory. But fgfs is not just about images - far from that.&amp;lt;br/&amp;gt;&lt;br /&gt;
On the GPU, you can still use compression for the textures as the internal &amp;lt;br/&amp;gt;&lt;br /&gt;
format. This is what flightgear tries to do if the extension is supported &amp;lt;br/&amp;gt;&lt;br /&gt;
(checked by osg).&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The major point is that there are several ways that use slightly more &amp;lt;br/&amp;gt;&lt;br /&gt;
resources to get around this problem.&amp;lt;br/&amp;gt;&lt;br /&gt;
But once the patented compression is on disk, there is *no* way back for &amp;lt;br/&amp;gt;&lt;br /&gt;
people not having this feature.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
If you have better ideas that do not rule out intel and the oss drivers, you &amp;lt;br/&amp;gt;&lt;br /&gt;
are welcome!&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678784/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |On unix I usually get the gzip plugin installed by osg (osgdb_gz.so). Is this &amp;lt;br/&amp;gt;&lt;br /&gt;
also the case for the default win32 case? Is there a osgdb_gz.dll or something &amp;lt;br/&amp;gt;&lt;br /&gt;
along the lines in the directory containing the plugins?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
If yes, we can already tackle the size problem of the uncompressed dds files on &amp;lt;br/&amp;gt;&lt;br /&gt;
disk by just gzip compressing these makging a xxx.dds.gz from a xxx.dds and &amp;lt;br/&amp;gt;&lt;br /&gt;
just refering to xxx.dds.gz instead of xxx.dds. At least this works fine here. &amp;lt;br/&amp;gt;&lt;br /&gt;
And I assume that this works fine for all unix like operating systems including &amp;lt;br/&amp;gt;&lt;br /&gt;
mac?!&amp;lt;br/&amp;gt;&lt;br /&gt;
James?&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28678235/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees &amp;amp;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-01-15&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |What about solution 6 with (uncompressed premipmapped dds).gz?&amp;lt;br/&amp;gt;&lt;br /&gt;
On linux this should work as long as you have zlib installed which could be &amp;lt;br/&amp;gt;&lt;br /&gt;
regarded as a system library there.&amp;lt;br/&amp;gt;&lt;br /&gt;
Can we rely on zlib being compield into our osg distributions on win32? We do &amp;lt;br/&amp;gt;&lt;br /&gt;
need zlib in any case, it's mostly about teaching osg that it finds our zlib on &amp;lt;br/&amp;gt;&lt;br /&gt;
configure and build the gz plugin.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/29571819/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS usage in effects files&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Mathias Fröhlich&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2012-07-21&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I implemented a mipmap control and generation tool in effects when I last updated&amp;lt;br/&amp;gt;&lt;br /&gt;
the urban shader. For the moment, it relies on hardware when the average operator &amp;lt;br/&amp;gt;&lt;br /&gt;
is used for all texture channels but it could easily be modified to compute &amp;lt;br/&amp;gt;&lt;br /&gt;
all mipmap on the CPU. look the &amp;lt;mipmap-control&amp;gt; effect option and &amp;lt;br/&amp;gt;&lt;br /&gt;
mipmap.[ch]xx in SG material lib&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/28606692/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] DDS texures (Was: Improving random trees&lt;br /&gt;
	&amp;amp;	buildings)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Frederic Bouvier&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2011-12-30&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |As has been previously pointed out, the current DDS texture set is not&amp;lt;br/&amp;gt;&lt;br /&gt;
simply the global png texture set converted.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
For our own sanity and those of the users, we need to ensure that there's&amp;lt;br/&amp;gt;&lt;br /&gt;
an apples-to-apples comparison being made when we change the default.  I&amp;lt;br/&amp;gt;&lt;br /&gt;
therefore think we need to create a DDS version of the current default&amp;lt;br/&amp;gt;&lt;br /&gt;
texture set.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32797669/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Stuart Buchanan&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |2)  If we go down this path, we probably want to separate the underlying&amp;lt;br/&amp;gt;&lt;br /&gt;
texture format from the materials.xml definition entirely. For example, we&amp;lt;br/&amp;gt;&lt;br /&gt;
could simply remove the extention from the materials definition, and have&amp;lt;br/&amp;gt;&lt;br /&gt;
the C++ code append the appropriate extension based on a separate property.&amp;lt;br/&amp;gt;&lt;br /&gt;
This has a couple of advantages:&amp;lt;br/&amp;gt;&lt;br /&gt;
a) Makes testing easier and materials definitions less error-prone.&amp;lt;br/&amp;gt;&lt;br /&gt;
Assuming we have some batch job in place to generate dds textures, those&amp;lt;br/&amp;gt;&lt;br /&gt;
working on materials definitions could continue to work with png textures,&amp;lt;br/&amp;gt;&lt;br /&gt;
and only convert to dds as a final step (or indeed as part of the &amp;quot;make&amp;lt;br/&amp;gt;&lt;br /&gt;
release&amp;quot; jobs).&amp;lt;br/&amp;gt;&lt;br /&gt;
a) Avoids duplication of materials definitions.  Having just spent quite a&amp;lt;br/&amp;gt;&lt;br /&gt;
bit of time making the materials definitions more efficient, I'd like to&amp;lt;br/&amp;gt;&lt;br /&gt;
avoid making it worse again!&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I'm quite happy to do the C++ coding required for this in the materials&amp;lt;br/&amp;gt;&lt;br /&gt;
loader - it's probably pretty straightforward.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32797669/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Stuart Buchanan&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |That does leave the issue of what happens to the existing dds texture&amp;lt;br/&amp;gt;&lt;br /&gt;
definitions where there are special mipmap layers.  I'd suggest that we&amp;lt;br/&amp;gt;&lt;br /&gt;
have some Clever Script (tm) that is able to work out whether the DDS or&amp;lt;br/&amp;gt;&lt;br /&gt;
PNG version of a texture is the master, and then generate the other version&amp;lt;br/&amp;gt;&lt;br /&gt;
from it.  I admit that the PNG conversion of the DDS will lose some&amp;lt;br/&amp;gt;&lt;br /&gt;
information in this process, but it would allow those without DDS support&amp;lt;br/&amp;gt;&lt;br /&gt;
to at least use the textures.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32797669/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Stuart Buchanan&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |3) We need a sensible process for dealing with aircraft, which has been&amp;lt;br/&amp;gt;&lt;br /&gt;
identified as a significant issue.  Again, I think more aircraft developers&amp;lt;br/&amp;gt;&lt;br /&gt;
find .png easier to deal with, and there are a lot of aircraft out there&amp;lt;br/&amp;gt;&lt;br /&gt;
that would need conversion.  It feels like we need some build scripts to&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;quot;compile&amp;quot; aircraft to use DDS textures.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
A more far-fetched idea might be to have a cache of dds textures that are&amp;lt;br/&amp;gt;&lt;br /&gt;
generated on-the-fly, or when aircraft are loaded by the aircraft center.&amp;lt;br/&amp;gt;&lt;br /&gt;
Clearly that impacts initial load time the first time a new aircraft is&amp;lt;br/&amp;gt;&lt;br /&gt;
loaded, and would increase the size of .fgfs/ directories massively, but it&amp;lt;br/&amp;gt;&lt;br /&gt;
would remove the need for any work by aircraft/scenery developers and could&amp;lt;br/&amp;gt;&lt;br /&gt;
be made optional.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32797669/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Stuart Buchanan&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-04&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |&amp;quot;dds on an open source driver (radeon and intel) I was forced to use radeon at some time, and it was fun, the planes were pink :) once libtxc-dxtn installed, dds were loaded fine again, so it can be used on open source if you are ok to use the lib.&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Unless there's some way to make sure Linux users have that lib installed automatically, I'd say that's a no. We can't have a random user guess what additional packages to install. And maybe someone can educate me - googling the lib, this appears to be working for mesa - which usually is what we try to avoid if users do 3d rendering via mesa for performance reasons?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Also, what does 'If you are okay to use the lib' mean precisely? If that's some piece of code which circumvents a patented thing and isn't exactly legal and needs to be obtained from special servers outside the normal repo (sort of like the DVD decryption under Linux), then I doubt that's an option. Can anyone clarify?&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32786414/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Renk Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Another potential option would be to convert regions to .dds but keep &amp;lt;br/&amp;gt;&lt;br /&gt;
both global-png and global-dds, but making that user-friendly would &amp;lt;br/&amp;gt;&lt;br /&gt;
require a way to automatically detect lack of .dds support.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787117/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Download size,&lt;br /&gt;
 and hardware support (was .dds textures)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Rebecca Palmer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |On my system (Intel Ivybridge), DDS works with or without libtxc, but &amp;lt;br/&amp;gt;&lt;br /&gt;
this may not be true of all Intel hardware.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787117/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Download size,&lt;br /&gt;
 and hardware support (was .dds textures)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Rebecca Palmer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |You can specify the dependency on libtxc_dxtn, but then distributions like &amp;lt;br/&amp;gt;&lt;br /&gt;
openSUSE cannot ship FlightGear anymore. libtxc_dxtn implements S3 texture &amp;lt;br/&amp;gt;&lt;br /&gt;
compression which is patented in many parts of the world. Linux distributions &amp;lt;br/&amp;gt;&lt;br /&gt;
therefore cannot ship it. You can easily find it in add-on repositories, but &amp;lt;br/&amp;gt;&lt;br /&gt;
as I said, distributions would not be able to include FlightGear creating a &amp;lt;br/&amp;gt;&lt;br /&gt;
huge hurdle to installation for users.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787143/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Download size,&lt;br /&gt;
	and hardware support (was .dds textures)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Stefan Seifert&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Debian/Ubuntu's libtxc is libtxc-dxtn-s2tc, which claims to avoid the &amp;lt;br/&amp;gt;&lt;br /&gt;
patent at a small cost in visual quality: &amp;lt;br/&amp;gt;&lt;br /&gt;
https://github.com/divVerent/s2tc/wiki/libtxc_dxtn&amp;lt;br/&amp;gt;&lt;br /&gt;
That site also states that modern hardware doesn't need this software &amp;lt;br/&amp;gt;&lt;br /&gt;
fallback anyway (and hence won't hit either this quality loss or the &amp;lt;br/&amp;gt;&lt;br /&gt;
slowness of any software decoder), but doesn't define &amp;quot;modern hardware&amp;quot;.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787296/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Download size,&lt;br /&gt;
 and hardware support (was .dds textures)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Rebecca Palmer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |The dds textures seem to have some advantages over our png textures and &amp;lt;br/&amp;gt;&lt;br /&gt;
using them is tempting.&amp;lt;br/&amp;gt;&lt;br /&gt;
But the points from Thorsten R. are good points and if there is any &amp;lt;br/&amp;gt;&lt;br /&gt;
chance to have a step-wise transition to the new format, I'd prefer that &amp;lt;br/&amp;gt;&lt;br /&gt;
path.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Don't we have an alternate dds texture set already in fgdata that is &amp;lt;br/&amp;gt;&lt;br /&gt;
enabled with an option? What about making this the default, keeping the &amp;lt;br/&amp;gt;&lt;br /&gt;
png texture set as an alternate. That would get us reports from users &amp;lt;br/&amp;gt;&lt;br /&gt;
unable to run dds textures and provide an easy fallback method.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787378/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Torsten Dreyer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |We currently have regions-png, global-png and global-dds; as I noted &amp;lt;br/&amp;gt;&lt;br /&gt;
earlier, switching to regions-dds, global-png and global-dds has the &amp;lt;br/&amp;gt;&lt;br /&gt;
issue that while changing the texture set is easy (dropdown in View &amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
Rendering Options), knowing that one needs to do so may not be.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787717/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Rebecca Palmer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Can we invert the logic in, say, preferences.xml so xxx-dds is enabled &amp;lt;br/&amp;gt;&lt;br /&gt;
by default and switching to xxx-png has to be done in rendering options?&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Torsten&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787787/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Torsten Dreyer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Changing the default (which is in preferences.xml) is easy: the problem &amp;lt;br/&amp;gt;&lt;br /&gt;
is how do users with non-.dds-supporting hardware (if this exists) know &amp;lt;br/&amp;gt;&lt;br /&gt;
they need to change back.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787851/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Rebecca Palmer&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Conversion ==&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |Automatic conversion script is welcome indeed. Also I'm pretty sure that we have some people here ready to convert a PNG to DDS as soon as you say &amp;quot;Hey boys I created a new PNG file, can you convert this file for me please ?&amp;quot; :-)&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32785592/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Download size,&lt;br /&gt;
 and hardware support (was .dds textures)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Clement de l'Hamaide&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |A few world about the conversion: once a png/rgb/jpg found, the script &amp;lt;br/&amp;gt;&lt;br /&gt;
try to guess the suitable dds format: with or without alpha channel, &amp;lt;br/&amp;gt;&lt;br /&gt;
bumpmap, if a .dds is allready found we just erase the png one, if not &amp;lt;br/&amp;gt;&lt;br /&gt;
we use nvcompress to get the dds. After we change the textures name &amp;lt;br/&amp;gt;&lt;br /&gt;
called in the differents files and that's it. There's a way to tell the &amp;lt;br/&amp;gt;&lt;br /&gt;
script what to do for each file, if the automatic mode is a failure.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
I guess speaking theorically is not the best to make an opinion, so if &amp;lt;br/&amp;gt;&lt;br /&gt;
some of you are interested to make a test, I will make a 3.2 minimal dds &amp;lt;br/&amp;gt;&lt;br /&gt;
fgdata this we, once on my FG pc.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32785602/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;jean&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
== Pros ==&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |I always got a loading problem with png textures, large  textures take &amp;lt;br/&amp;gt;&lt;br /&gt;
seconds to load and convert, and that ruin my close flight where you &amp;lt;br/&amp;gt;&lt;br /&gt;
can't afford to take pause in the air.&amp;lt;br/&amp;gt;&lt;br /&gt;
that's why i did a batch script to convert to dds ALL the textures in &amp;lt;br/&amp;gt;&lt;br /&gt;
the data, not only the matérial set, but everything. Now i only flight a &amp;lt;br/&amp;gt;&lt;br /&gt;
dds version of flightgear, and am quite happy with it, that's why i &amp;lt;br/&amp;gt;&lt;br /&gt;
propose to provide a dds fgdata for test, and maybe to make it an &amp;lt;br/&amp;gt;&lt;br /&gt;
alternate download possibility.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32785602/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;jean&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Cons ==&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |FG actually runs with dds textures, it just doesn't render anything reasonable, I believe you get monochromatic colors. But I don't expect the menu to be affected, it doesn't use textures.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787957/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures‏)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Renk Thorsten&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{FGCquote&lt;br /&gt;
  |If it's relevant, I recall having S2TC compression problems when running Flightgear, and updating this package to a newer version manually (outside of the main repos) fixed the issue. I'm on an Intel HD 3000, but I'm guessing that Intel HD 4000 doesn't have this problem, since it seems to have better OpenGL and OpenCL support.&lt;br /&gt;
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32787875/&lt;br /&gt;
     |title=&amp;lt;nowiki&amp;gt;Re: [Flightgear-devel] Download size,&lt;br /&gt;
	and hardware support (was .dds textures)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |author=&amp;lt;nowiki&amp;gt;Saikrishna Arcot&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     |date=&amp;lt;nowiki&amp;gt;2014-09-02&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Core development projects]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=FlightGear_hangars&amp;diff=74575</id>
		<title>FlightGear hangars</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=FlightGear_hangars&amp;diff=74575"/>
		<updated>2014-08-02T09:46:56Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{cleanup}}&lt;br /&gt;
&lt;br /&gt;
''See [[Links]] for an overall listing of FlightGear related external websites''&lt;br /&gt;
&lt;br /&gt;
FlightGear has [[aircraft]] and other content available from 3rd-party hangars, some which are GPL compatible and also included in official distributions while others are independent. Aircraft versions range from requiring a developmental build, to being compatible with the latest primary release, to requiring an older version. &lt;br /&gt;
&lt;br /&gt;
Be careful with external links! &lt;br /&gt;
&lt;br /&gt;
== Official hangars ==&lt;br /&gt;
=== Aircraft ===&lt;br /&gt;
* [http://www.flightgear.org/download/aircraft-2-12-filterable/ FlightGear Official 2.12 Hangar]&lt;br /&gt;
* [http://www.flightgear.org/download/aircraft-2-10-filterable/ FlightGear Official 2.10 Hangar]&lt;br /&gt;
* [http://www.flightgear.org/download/aircraft-v2-8/ FlightGear Official 2.8 Hangar]&lt;br /&gt;
* [http://www.flightgear.org/download/aircraft-v2-6/ FlightGear Official 2.6 Hangar]&lt;br /&gt;
* [http://www.flightgear.org/download/aircraft-v2-4/ FlightGear Official 2.4 Hangar] (Legacy site)&lt;br /&gt;
* [http://www.flightgear.org/Downloads/aircraft-2.0.0/ FlightGear Official 2.0 Hangar] (Legacy site)&lt;br /&gt;
* [http://gitorious.org/fg/fgdata/trees/master/Aircraft Git Hangar] (for [[Git]] builds)&lt;br /&gt;
&lt;br /&gt;
=== Liveries ===&lt;br /&gt;
* [http://liveries.flightgear.org FlightGear Livery Database]&lt;br /&gt;
&lt;br /&gt;
== Unofficial sites ==&lt;br /&gt;
=== Aircraft hangars ===&lt;br /&gt;
* [http://fg-acjza.wix.com/hangar/ ACJZA Hangar] (Land, Sea, Air)&lt;br /&gt;
* [https://www.gitorious.org/airbus-aircraft Airbus Aircraft Development Git] (A320, A330, A340-300, A380 - various authors)&lt;br /&gt;
* [http://www.gidenstam.org/FlightGear/Airships/ Anders Lighter-than-air Hangar] with [http://gitorious.org/anders-hangar aircraft repositories at gitorious].&lt;br /&gt;
* [http://andinogonthaeler.wordpress.com/ Andino's Hangar] (Boeing 707-3J9C and 707-320C, 777-200LR).&lt;br /&gt;
* [http://www.buckarooshangar.com/flightgear/ Buckaroo's Hangar] (Velocity XL RG, Edgley Optica, Lockheed 1049H Constellation, Grumman Goose, McDonnell Douglas MD-81) (&amp;amp; a YASim intro)&lt;br /&gt;
* [http://charles.ingels.free.fr/flightgear/ French FlightGear Hangar] (FR) (Aermacchi MB326, Dassault Mirage F1 Mikoyan Gurevitch Mig 31 Foxhound, and more)&lt;br /&gt;
* [http://fgnl.freehostia.com/ Gijs Hangar] (Aircraft, Liveries, Scenery, Vehicles)&lt;br /&gt;
* [https://sites.google.com/site/fghangar JOFH - Just Another Flightgear Hangar] (JA-37, scenario)&lt;br /&gt;
* [http://hcilab.uniud.it/pan/downloads.html HCI Lab - University of Udine] (Aermacchi MB339 Frecce Tricolori)&lt;br /&gt;
* [http://helijah.free.fr/flightgear/hangar.htm Helijah FlightGear Hangar] (200+ original aircraft)&lt;br /&gt;
* [http://hhfgfs.weebly.com/index.html Hellcat's FlightGear Hangar] (scenarios, skins, film inspired aerospace vehicles) &lt;br /&gt;
* [http://www.hoerbird.net/aircrafts.html Hoerbird Hangar] (misc. projects)&lt;br /&gt;
* [http://horizonflightgearhangar.yolasite.com/ Horizon Flightgear Hangar] Dabolim Naval Air Station (VAGO), Goa, India; Murray Bridge/Pallama Airfield (YMBD), Australia; and ADFX-02 Morgan, a fictional aircraft.&lt;br /&gt;
* [http://hsotfhangar.wordpress.com/ HSOTF Official Hangar]&lt;br /&gt;
* [http://mysite.verizon.net/vzeuyecs/ Kent Esbenshade's Boneyard Hangar] (Classic aircraft)&lt;br /&gt;
* [http://http://marc-kraus.de/ Lake of Constance Hangar] Quality Signature Series Aircrafts by Marc Kraus from Friedrichshafen home of The Dornier Museum.&lt;br /&gt;
* &amp;lt;s&amp;gt;[http://flightgear.bplaced.de/ longfly's hangar] (not only German!)&amp;lt;/s&amp;gt; {{dead link|2014-01}}&lt;br /&gt;
** &amp;lt;s&amp;gt;[http://flightgear.bplaced.de/filemanager/aircraft-list/index.html list of all aircrafts]&amp;lt;/s&amp;gt; (under development) {{dead link|2014-01}}&lt;br /&gt;
* [http://nickfg.blogspot.com/ Nick's FlightGear Hangar] (Blog, CRJ-200)&lt;br /&gt;
* [http://theomegahangar.flymerlion.org/ Omega Hangar] (Embraer E-jet Family, A330-200, A320neo, CRJ-700 Full First Class, ATR-42-family, A321-series, Mobile Stairway)&lt;br /&gt;
* [http://equipe-flightgear.forumactif.com/t835-hangar-de-la-paf-paf-team-hangar#14330 PAF team Hangar] (Cap 10b, Robin DR400 JSBSim, Douglas DC-3 C47, Tecnam P92 Echo...)&lt;br /&gt;
* [http://pattenflightgear.wifeo.com/avions.php  FG Patten's hangar] (Alouette-2, DHC6-300, Robin DR400 JSBsim, Tecnam P92 Echo, CAP 10 C, CAP 10 B, Douglas DC3 C47-JSBsim, Sceneries, Ground textures...) &lt;br /&gt;
* [http://pjedvaj.eu5.org/ pjedvaj's Hangar] (MiG-21bis, PC-9M, PC-21, T-50, Harrier GR.1, F-35B, RAH-66)&lt;br /&gt;
* [http://presteshangar.wikidot.com/start Prestes Hangar] (many Brazilian aircraft articles)&lt;br /&gt;
* [http://riktov.synthasite.com/ Riktov's FlightGear Hangar] (BN-2 Islander, Giant Marshmallow Man)&lt;br /&gt;
* [http://digilander.libero.it/scighera_fg/index.html Scighera's Hangar] (models &amp;amp; liveries)&lt;br /&gt;
* [http://seahorseCorral.org/flightgear_aircraft.html Stewart's SEA-horse Aircraft Hanger]&lt;br /&gt;
* [https://sites.google.com/site/sydshangar/ Syd's Google Hangar ]  (newer 2.0 versions)&lt;br /&gt;
* [http://macflightgear.sourceforge.net/home/aircraft Tat's Aircraft for FlightGear] (A6M2 &amp;quot;Zero&amp;quot;, J7W, Ki-84, T-4, HondaJet, OH-1, K5Y1, RV-6A, YS-11)&lt;br /&gt;
* [http://vicmar.weebly.com/ VicMar] (Yanagisawa Gen H-4, Stung Biker, Quad Bikes, SRN4, Water Skier, G2 Thunderpack, Martin Jetpack)&lt;br /&gt;
* [http://www.treborlogic.com/fgfs/hangar/ Yourgod's Hangar: Douglas DC-8]&lt;br /&gt;
* [http://www.fgpipistrel.org/ FG Pipistrel Hangar] Developing Pipistrel Aircraft&lt;br /&gt;
&lt;br /&gt;
=== Old Hangars ===&lt;br /&gt;
* &amp;lt;s&amp;gt;[http://croo.murgl.org/fgfs/index.html A-10 and A-6 stuff]&amp;lt;/s&amp;gt;&lt;br /&gt;
* &amp;lt;s&amp;gt;[http://www.sol2500.net/flightgear/aircraft.html DFaber Hangar]&amp;lt;/s&amp;gt;{{dead link|2012-04}} (Eurofighter, PC-6, Bf 109, Beufighter, F4U, Ju 52, DH Mosquito, G. Albatross, F-86, and more)&lt;br /&gt;
* [http://pagesperso-orange.fr/GRTux/tux/index-en.html GRTux Hangar] (28+ aircraft and add-ons) (last updated 2011)&lt;br /&gt;
* &amp;lt;s&amp;gt;[http://thefancyflightgearhangar.blogspot.com the fancy flight gear hangar]&amp;lt;/s&amp;gt;{{dead link|2012-04}} (a few well made aircraft)&lt;br /&gt;
* &amp;lt;s&amp;gt;[http://flier95-flightgear.blogspot.com/ Flier95's Hangar]&amp;lt;/s&amp;gt;{{dead link|2012-08}} (Blog format)&lt;br /&gt;
* [http://www.ae.uiuc.edu/m-selig/apasim/Aircraft-uiuc.html UIUC Hangar] (for FGFS 0.7.8, last update 2002) &lt;br /&gt;
&lt;br /&gt;
=== Livery/Scenery hangars ===&lt;br /&gt;
* [http://berwickskins.yolasite.com/ Berwick-skins]&lt;br /&gt;
* [http://dliveryhangar.synthasite.com/ Dodger4's Livery Hangar]&lt;br /&gt;
* [http://hsotfhangar.wordpress.com/ HSOTF Official Hangar]&lt;br /&gt;
* [http://jchnd.blogspot.com/ JcHnd's Liveries for FlightGear]&lt;br /&gt;
* [http://lukashangar.jimdo.com/ Lukas' hangar] (Scenery projects, Liveries)&lt;br /&gt;
* [http://mojos-hangar.webs.com/ MOJO's Flightgear Livery Hangar]&lt;br /&gt;
* &amp;lt;s&amp;gt;[http://members.cox.net/scotsg8r/hangar/ N-SCOT's Hangar]&amp;lt;/s&amp;gt;{{dead link|2012-04}} (5+ liveries &amp;amp; mods)&lt;br /&gt;
* &amp;lt;s&amp;gt;[https://planepainter.yolasite.com/ The Planepainter]&amp;lt;/s&amp;gt;{{dead link|2012-04}} (Liveries, Scenery)&lt;br /&gt;
* [http://simbabeathangar.webs.com/ Simbabeat's Livery Hangar]&lt;br /&gt;
&lt;br /&gt;
=== Homepages, blogs, etc. ===&lt;br /&gt;
* [http://www.jaunty.bplaced.net/flightgear/index.php A small FlightGear page]&lt;br /&gt;
* &amp;lt;s&amp;gt;[http://www.flightgeararg.com.ar/ Argentina Flightgear Community Portal]&amp;lt;/s&amp;gt;{{dead link|2013-01}}&lt;br /&gt;
* [http://daveshangar.blogspot.com/ Dave's Hangar Blog]&lt;br /&gt;
* [http://helldiversquadron.wordpress.com/ Helldiver Squadron Offensive Tactical Force Homepage]&lt;br /&gt;
* [http://djrick1.wix.com/grupofgbr Grupo FGBR Brazilian Portal] (Broken site - only accesible with flash player)&lt;br /&gt;
* [http://flightgearblog.blogspot.com/ FlightGear Blog] (Last post Dec. 2008)&lt;br /&gt;
* [http://flightgear2009.blogspot.com/ FlightGear Brasil 2009] (non-english)&lt;br /&gt;
* [http://geoffmclane.com/fg/index.htm FlightGear Build Centre]&lt;br /&gt;
* [http://www.flightgearcanada.ca/ FlightGear Canada] (The home of everything Canadian for FlightGear)&lt;br /&gt;
* [http://flightgearcorner.tk The FlightGear Corner] (News, Downloads, Tutorials and more)&lt;br /&gt;
* [http://www.fguk.eu/ FlightGear United Kingdom] &lt;br /&gt;
* [http://hsotfhangar.wordpress.com/ HSOTF Official Hangar]&lt;br /&gt;
* [http://www.emmerich-j.de/FGFS/index.html jomo's FlightGear Homepage]&lt;br /&gt;
* [http://flightgear.mxchange.org/ Quix0r's FlightGear Website] Simple tutorials and fgdata.bundle&lt;br /&gt;
* &amp;lt;s&amp;gt;[http://tehwarlock.tk/ Tehwarlock Blog]&amp;lt;/s&amp;gt;{{dead link|2012-04}}&lt;br /&gt;
* [http://www.vivefg.org/ Vive FlightGear!] Aircrafts, scenery, manuals and forum (non-english)&lt;br /&gt;
&lt;br /&gt;
=== Other FlightGear repositories/mirrors ===&lt;br /&gt;
* [http://www.flightgearplanes.com Flightgear Planes Website]&lt;br /&gt;
* [http://hsotfhangar.wordpress.com/ HSOTF Official Hangar]&lt;br /&gt;
* [http://lukeafg.com/ LukeaFG] (FlightGear tutorials and developments)&lt;br /&gt;
* [http://ftp.riken.go.jp/pub/FreeBSD/distfiles/flightgear-aircrafts/ Older versions of FlightGear aircraft]&lt;br /&gt;
* [http://www.unitedfreeworld.com/ Unitedfreeworld] (scenery, plane models, and livery)&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
* [[Table of models]]&lt;br /&gt;
* [[Aircraft]] - [[Helicopter]] - [[Vehicle]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Lists]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Writing_Joystick_Code:_Part_1&amp;diff=74346</id>
		<title>Writing Joystick Code: Part 1</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Writing_Joystick_Code:_Part_1&amp;diff=74346"/>
		<updated>2014-07-30T21:35:13Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Aileron, elevator and rudder */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{JoystickScripting Navigation}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Before you start, read [[Input device]].&lt;br /&gt;
&lt;br /&gt;
All the examples below assume that you have obtained the correct axes and button numbers as described in the above article. You will have to substitute the correct axis and button numbers in these code examples.&lt;br /&gt;
&lt;br /&gt;
Note the indent in all examples. The indents have no effect on operation, they just make the code so much more readable.&lt;br /&gt;
&lt;br /&gt;
Here is some code to explain a few important basic concepts of xml files. (I have numbered the lines to aid the explanation below. In your xml file the line numbers will not be there.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line&amp;gt;&lt;br /&gt;
&amp;lt;button n=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;desc&amp;gt;Gear up&amp;lt;/desc&amp;gt;&lt;br /&gt;
  &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
  &amp;lt;binding&amp;gt;&lt;br /&gt;
    &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
    &amp;lt;script&amp;gt;controls.gearDown(-1)&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;controls.gearDown(0)&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ignoring the actual meaning of the code, let's got through it line by line.&lt;br /&gt;
&lt;br /&gt;
Line 1: &amp;lt;button&amp;gt; specifies that this is the code for a button, and the n=&amp;quot;4&amp;quot; means that this is the code for the button which ''your system'' reports as number 4.&lt;br /&gt;
&lt;br /&gt;
Line 2: &amp;lt;desc&amp;gt; A (short) description of what the button does.&lt;br /&gt;
&lt;br /&gt;
Line 3: &amp;lt;repeatable&amp;gt;true&amp;lt;/repeatable&amp;gt; means that ''as long as the button is held in'' the following action will be executed. If repeatable is false, the button action is one-shot, and won't execute again until the button is released and pressed again.&lt;br /&gt;
&lt;br /&gt;
Notice the &amp;lt;/repeatable&amp;gt; after the value true. Each tag (&amp;lt;word&amp;gt; must have a closing tag &amp;lt;/word&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Line 4: &amp;lt;binding&amp;gt; This is the start of the code which defines what happens when the button is pressed. Notice that there can be a few lines before the &amp;lt;/binding&amp;gt; tag. &lt;br /&gt;
&lt;br /&gt;
Line 5: &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt; means that the following line(s) is(are) written in the programming language nasal. That is all you need to know!!&lt;br /&gt;
&lt;br /&gt;
Line 6: &amp;lt;script&amp;gt;controls.gearDown&amp;lt;/script&amp;gt;. The text between &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; are the nasal commands to be performed. Here there is only one command, but there can be many.&lt;br /&gt;
&lt;br /&gt;
Line 7: &amp;lt;/binding&amp;gt; The end of what happens when the button is pressed.&lt;br /&gt;
&lt;br /&gt;
Line 8: &amp;lt;mod-up&amp;gt; (Modification up.) This is the start of the section to handle what happens when the button is released. The up part co9mes from the idea of pushing a button down, and it moves up when you take your finger off it. Not all button actions need a &amp;lt;mod-up&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
Lines 9 to 13: Same as above, except that it refers to what happens when the button is released.&lt;br /&gt;
&lt;br /&gt;
Line 14: &amp;lt;/button&amp;gt; The end of the button section. Not necessary to specify the button number again, as you can't use &amp;lt;button&amp;gt; &amp;lt;/button&amp;gt; inside another &amp;lt;button&amp;gt; &amp;lt;/button&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
== Axes ==&lt;br /&gt;
Axes are the controls on a joystick which con be moved over a whole arc of operation.&lt;br /&gt;
&lt;br /&gt;
Even though the hat hat-switch is classed as an axis, for the purpose of writing code for it, it is a set of buttons. It is, in fact, just a set of buttons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Aileron, elevator and rudder ===&lt;br /&gt;
The code for these looks like this. The lines in italics are optional. The other lines are compulsory.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;axis n=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;Elevator&amp;lt;/desc&amp;gt;&lt;br /&gt;
    ''&amp;lt;dead-band type=&amp;quot;double&amp;quot;&amp;gt;0.0&amp;lt;/dead-band&amp;gt;''&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;property-scale&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;property&amp;gt;/controls/flight/elevator&amp;lt;/property&amp;gt;&lt;br /&gt;
      ''&amp;lt;factor type=&amp;quot;double&amp;quot;&amp;gt;-1.0&amp;lt;/factor&amp;gt;''&lt;br /&gt;
      ''&amp;lt;power type=&amp;quot;int&amp;quot;&amp;gt;3&amp;lt;/power&amp;gt;''&lt;br /&gt;
      ''&amp;lt;offset&amp;gt;0.0&amp;lt;/offset&amp;gt;''&lt;br /&gt;
      ''&amp;lt;squared type=&amp;quot;bool&amp;quot;&amp;gt;true&amp;lt;/squared&amp;gt;''&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
  &amp;lt;/axis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;desc&amp;gt;Elevator&amp;lt;/desc&amp;gt; let's us know that this axis controls the elevator. For human purposes only. All the other lines are for the benefit of FG.&lt;br /&gt;
&lt;br /&gt;
The optional lines need quite a bit of explanation. For a start, all three these axes have a center-zero action. At this point, they have a value of 0. As you move them to their extreme positions, their value gradually increases (decreases) to +1.0 or -1.0, depending on the direction of movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dead-band ..... : You may want a small movement around the center of the axis not to do anything. Or your joystick might be getting old, and it jitters around zero. Jittering is small, continuous value changes in the value. You can then supply a value for dead-band that will eliminate this. And it will be small. A dead-band of 1.0 means that the axis does nothing, a dead-band of 0.25 means that the axis does nothing for the first 25% of its movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;factor ...... : If you find that moving an axis results in the aileron, elevator or rudder moving in the wrong direction, change the -1.0 to 1.0 or the 1.0 to -1.0. This will make it work the other way round.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;power ...... : Sometimes the axes are too sensitive - a slight touch on aileron makes the plane barrel-roll. You can reduce this sensitivity by making the value of power more than 1. (It is a decimal number, so you can make small adjustments, but small adjustments are usually not enough to be noticible.) Never mind the maths, but the larger the value of power the less sensitive the aircraft will be to axis movement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;offset ..... : If you find that in its center position the axes outputs a non-zero value, you can put that same value here, with opposite + or - sign, to counter-act this. The HUD will show you if you have an offset problem, and can be used to see if you have solved it.&lt;br /&gt;
&lt;br /&gt;
For aileron and rudder you replace ''&amp;gt;/controls/flight/elevator'' with ''/controls/flight/aileron'' and ''/controls/flight/rudder''. Don't forget to change the the name between &amp;lt;desc&amp;gt; and &amp;lt;/desc&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Other axes ===&lt;br /&gt;
Throttle, propeller-pitch, mixture and carburetor-heat. &lt;br /&gt;
&lt;br /&gt;
These do not have optional settings, after all you want a smooth linear response. This is the code for the throttle control, for the others, just replace throttleAxis with propellerAxis, mixtureAxis or carbHeatAxis.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;axis n=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;Throttle&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;controls.throttleAxis()&amp;lt;/script&amp;gt;&lt;br /&gt;
   &amp;lt;/binding&amp;gt;&lt;br /&gt;
 &amp;lt;/axis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the &amp;quot;instructions&amp;quot; we give are in the Nasal language, so we have &lt;br /&gt;
  &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt; to let the interpreter know.&lt;br /&gt;
&lt;br /&gt;
The actual &amp;quot;instruction&amp;quot; is between the &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; tags.&lt;br /&gt;
  &amp;lt;script&amp;gt;controls.throttleAxis()&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Buttons ==&lt;br /&gt;
&lt;br /&gt;
There is almost no end to what we can do with buttons, limited usually by the number of buttons on the joystick, what we need, and what we can remember of the allocation of button actions.&lt;br /&gt;
&lt;br /&gt;
=== Repeatable/Non-repeatable ===&lt;br /&gt;
&lt;br /&gt;
There are two categories of buttons, repeatable and non-repeatable. With non-repeatable buttons, when we push it, a single action is carried out, and nothing else happens. An example of its use would be a button to lower the landing-gear. We press the button, the gear goes down. With repeatable buttons, when we hold the button in, the same action is carried out over and over, until we release the button. An example is zoom-in. We press the button, and the view keeps zooming in. When we have the view we want, we release the button, and zooming stops.&lt;br /&gt;
An important point to remeber is that if a button is repeatable, even if you just give it the briefest of touches, the instruction will be carried out a few times, thanks to the repeat-rate of the system.&lt;br /&gt;
Setting a button to repeatable or non-repeatable is part of the basic definition of the button (like its number), it cannot be changed willy-nilly. So when you decide on the use for joystick buttons, you decide ''which will be repeatable and which not''.&lt;br /&gt;
&lt;br /&gt;
The shell of a button definition looks lke this&lt;br /&gt;
  &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''What the button does''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Your code goes here''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Code for what happens when the button is released goes here''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a non-repeatable button&lt;br /&gt;
  &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make a  button repeatable, replace false with true.&lt;br /&gt;
&lt;br /&gt;
You can use this shell for all your buttons. Just use the correct button number, give the correct &amp;lt;desc&amp;gt;, decide repeatable or non-repeatable, and then type the correct code in place of ''Your code goes here'' and ''Code for what happens when the button is released goes here''. Not all actions need a &amp;lt;mod-up&amp;gt; section, but you will soon get the hang of what does and what doesn't.&lt;br /&gt;
&lt;br /&gt;
If your code has more than one command, then do this&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
    ''Command number 1'';&lt;br /&gt;
    ''Command number 2'';&lt;br /&gt;
    ''Command number 3''&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that all lines except the last have a ; at the end. This lets the interpreter know that you haven't finished yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== A note on &amp;lt;mod-up&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
I have been having a good look at the controls.nas file that comes with FG. With most of them, where you would use &lt;br /&gt;
  controls.someAction(1)&lt;br /&gt;
to do something, you are allowed to use&lt;br /&gt;
  controls.someAction(0)&lt;br /&gt;
in &amp;lt;mod-up&amp;gt;, but it does nothing. Xml files are full of such code, which is totally, unnecessary. It does no harm, just wastes time, albeit very little time. In fact, the only time a &amp;lt;mod-up&amp;gt; is needed is when a non-repeatable button starts an ongoing process, and we want to stop that process when we release the button. In Part2 and Part 3 you will see almost no &amp;lt;mod-up&amp;gt; code at all.&lt;br /&gt;
&lt;br /&gt;
One advantage  of leaving out unnecessary &amp;lt;mod-up&amp;gt; code is that it makes the code easier to read. (And saves a couple of trees when the files are printed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Giving buttons multiple choices ===&lt;br /&gt;
&lt;br /&gt;
There is a limit to the number of buttons on the joystick and lots of things we'd like to do with them. Fortunately, FG makes it easy for us. It lets us know if any or more than one of the Shift, Alt and Ctrl buttons are pressed. We can thus modify the action of a button with the &amp;lt;mod-shift&amp;gt;, &amp;lt;mod-ctrl&amp;gt; and &amp;lt;mod-alt&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
Here is an example of what you need to modify the action of a button when the Shift key is held in when you press the button. I have deliberately included &amp;lt;mod-up&amp;gt; tags so that you can see where they must go, should they be necessary.&lt;br /&gt;
  &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''Normal action/Shift action''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Normal: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Normal: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;mod-shift&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Shift: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;mod-up&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Shift: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-shift&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quite easy.&lt;br /&gt;
&lt;br /&gt;
Notice that the &amp;lt;repeatable&amp;gt; tag is right at the top. ''You cannot make the normale action repeatable and the modified action non-repeatable''.&lt;br /&gt;
&lt;br /&gt;
Now let's go crazy. We want:&lt;br /&gt;
  1. Normal action.&lt;br /&gt;
  2. Action when Ctrl is pressed.&lt;br /&gt;
  3. Action when Ctrl and Alt are pressed.&lt;br /&gt;
&lt;br /&gt;
Looks like this.&lt;br /&gt;
    &amp;lt;button n=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;desc&amp;gt;''Normal action/Ctrl action/Ctrl-Alt action''&amp;lt;/desc&amp;gt;&lt;br /&gt;
    &amp;lt;repeatable&amp;gt;false&amp;lt;/repeatable&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    # *****  Normal *****&lt;br /&gt;
    &amp;lt;binding&amp;gt;&lt;br /&gt;
      &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
      &amp;lt;script&amp;gt;''Normal: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Normal: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
    &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    # ***** Ctrl  *****&lt;br /&gt;
    &amp;lt;mod-ctrl&amp;gt;&lt;br /&gt;
      &amp;lt;binding&amp;gt;&lt;br /&gt;
        &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
        &amp;lt;script&amp;gt;''Ctrl: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
      &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;mod-up&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Ctrl: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
      # ***** Ctrl-Alt *****&lt;br /&gt;
      &amp;lt;mod-alt&amp;gt;&lt;br /&gt;
        &amp;lt;binding&amp;gt;&lt;br /&gt;
          &amp;lt;command&amp;gt;nasal&amp;lt;/command&amp;gt;&lt;br /&gt;
          &amp;lt;script&amp;gt;''Ctrl &amp;amp; Alt: button pressed''&amp;lt;/script&amp;gt;&lt;br /&gt;
        &amp;lt;/binding&amp;gt;&lt;br /&gt;
        &amp;lt;mod-up&amp;gt;&lt;br /&gt;
          &amp;lt;binding&amp;gt;&lt;br /&gt;
            &amp;lt;script&amp;gt;''Ctrl &amp;amp; Alt: button released''&amp;lt;/script&amp;gt;&lt;br /&gt;
          &amp;lt;/binding&amp;gt;&lt;br /&gt;
        &amp;lt;/mod-up&amp;gt;&lt;br /&gt;
      &amp;lt;/mod-alt&amp;gt; &lt;br /&gt;
   &amp;lt;/mod-ctrl&amp;gt;&lt;br /&gt;
  &amp;lt;/button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice four things:&lt;br /&gt;
   1. The &amp;lt;mod-alt&amp;gt; selection is between the &amp;lt;mod-ctrl&amp;gt; and &amp;lt;/mod-ctrl&amp;gt; tags. This means that the code is for Ctrl and Alt, not just Alt.&lt;br /&gt;
   2. I have spaced the sections with empty lines for readability.&lt;br /&gt;
   3. I have used comments # ***** Comment ***** to make it even more readable.&lt;br /&gt;
   4. By using comments and open lines, the block of code is a lot less daunting. In fact, once you have grasped the basics, it is quite easy to read.&lt;br /&gt;
&lt;br /&gt;
Anything that starts with # is ignored by the interpreter, even if it comes after some code. Such as&lt;br /&gt;
  &amp;lt;script&amp;gt;controls.throttleAxis&amp;lt;/script&amp;gt; # Controls the throttle axis&lt;br /&gt;
&lt;br /&gt;
The code will work and we humans have an explanation of the code.&lt;br /&gt;
&lt;br /&gt;
To write long comments you can do this&lt;br /&gt;
  &amp;amp;lt;!--  &lt;br /&gt;
     Lots and lots&lt;br /&gt;
     and even more&lt;br /&gt;
     lots of lines of comments.&lt;br /&gt;
  --&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use the function keys as modifiers: &amp;lt;mod-F1&amp;gt;, &amp;lt;mod-F2&amp;gt;, etc., but remember that with all the combinations of Shift, Ctrl and Alt you get 7 options, and that is a lot of options to remember for each button.&lt;br /&gt;
&lt;br /&gt;
In a later section I will show how to use buttons on the joystick as modifiers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== CDATA ==&lt;br /&gt;
If your code (or even comments) contains &amp;lt;, &amp;gt;, &amp;amp; or --, it can cause havoc with your xml file. Any area that contains any of these must be enclosed between&lt;br /&gt;
  &amp;lt;![CDATA[      and     ]]&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Any complaints/suggestions/questions/kudos can be posted [http://forum.flightgear.org/viewtopic.php?f=24&amp;amp;t=17892 here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=$FG_HOME&amp;diff=71280</id>
		<title>$FG HOME</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=$FG_HOME&amp;diff=71280"/>
		<updated>2014-05-15T13:19:58Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''$FG_HOME''' is a placeholder variable representing the path to where user-specific FlightGear data is stored (not application data). Unlike $FG_ROOT, $FG_HOME is NOT an environment variable that needs to be specifically configured for FlightGear to work. $FG_HOME is the only place were FlightGear data is written to, $FG_ROOT is generally read-only.&lt;br /&gt;
&lt;br /&gt;
$FG_HOME is only used to refer to the OS-specific location for some settings/folders. The actual location of $FG_HOME will be determined by the fgfs binary during startup, it is a name for a directory that varies with the various operating systems supported by FG (Windows, OSX and Linux) and it stores information between sessions, such as: configuration/preferences, properties marked with the &amp;quot;user-archive&amp;quot; attribute and aircraft-specific settings (using the data helper class in aircraft.nas). $FG_HOME is also the location for the SQLite-based NavDB cache.&lt;br /&gt;
&lt;br /&gt;
($FG_HOME and the '''/sim/fg-home''' property should be considered read-only, because they cannot be affected during startup or at runtime)&lt;br /&gt;
&lt;br /&gt;
'''Note that the [[Fgfsrc]] config file will not actually be saved in $FG_HOME, but just in $HOME'''&lt;br /&gt;
===Common paths===&lt;br /&gt;
* '''Linux:''' ~/.fgfs/&lt;br /&gt;
* '''Mac OS X:''' &amp;lt;tt&amp;gt;~/Library/Application Support/FlightGear&amp;lt;/tt&amp;gt; (to learn more about viewing hidden folders, see [http://www.mikesel.info/show-hidden-files-mac-os-x-10-7-lion/])&lt;br /&gt;
: As all future FlightGear versions will take their preferences from here, it is a good idea to have their access available easily.&lt;br /&gt;
: Desktop/Finder/Go/Go to Folder is where you need to start.&lt;br /&gt;
: When given the option, input:  ~/Library/Application Support/FlightGear&lt;br /&gt;
: It is probably a good idea to have '~/Library/Application Support/FlightGear' saved on a Stickies note just in case you forget it.&lt;br /&gt;
: If you want/need to refer to any of these files frequently, you could make an alias of a file, or the whole folder, and place it somewhere easier to access. TerraSync data is also stored inside the user's home folder, in the 'only' location we are permitted to write too, $HOME/Library/Application Support/FlightGear. To be technical, that's the value of '$FG_HOME', which is where we store all temporary / user-local data such as saved prefs, TerraSync files and aircraft-specific config state. The OSX launcher doesn't actually set this path (any more), this location is the default used by FlightGear itself. You can of course override these paths and set FG_HOME or the TerraSync path manually, from the command line or a config file, but the defaults should 'do what you want'.&lt;br /&gt;
&lt;br /&gt;
* '''Windows:''' &amp;lt;tt&amp;gt;%APPDATA%\flightgear.org\&amp;lt;/tt&amp;gt;&lt;br /&gt;
: %APPDATA% is another environment variable that depends on your Windows version. On XP and older, it can be found under &amp;lt;tt&amp;gt;C:\Documents and Settings\{username}\Application Data&amp;lt;/tt&amp;gt;. On Vista and later it can be found under &amp;lt;tt&amp;gt;C:\Users\{username}\AppData\Roaming&amp;lt;/tt&amp;gt;. The folder is hidden by default; see [http://windows.microsoft.com/en-US/windows-vista/show-hidden-files these instructions] to unhide the folder.&lt;br /&gt;
&lt;br /&gt;
You can determine the location of your $FG_HOME by using the [[Property browser|property tree browser]] and checking the value of '''/sim/fg-home''', the '''/sim/''' branch is also the place where you can find other folders, such as fg-root, fg-scenery and the current working directory (fg-current).&lt;br /&gt;
&lt;br /&gt;
[[Category:Special directories|HOME]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Fr/TerraSync&amp;diff=70597</id>
		<title>Fr/TerraSync</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Fr/TerraSync&amp;diff=70597"/>
		<updated>2014-05-06T12:50:54Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pour voir le terrain que vous survolez avec votre [[aircraft|appareil]], vous devez installer les [[scenery|scènes]] correspondantes. On peut le faire en téléchargeant certaines portions de scènes avant de décoller : voir l'article [[Howto: Install scenery|installing scenery]]. &lt;br /&gt;
&lt;br /&gt;
Mais, si vous avez une connexion Internet stable et assez rapide, vous pouvez utiliser '''TerraSync'''. C'est un utilitaire qui télécharge automatiquement la dernière version des [[scenery|scènes]] de [[FlightGear]] tandis que le simulateur marche. TerraSync fonctionne en arrière plan dans un processus séparé, surveille votre position, et télécharge (ou met à jour) en temps réel la dernière version des paysages depuis le serveur où les scènes sont centralisées.&lt;br /&gt;
&lt;br /&gt;
Le référentiel maître pour TerraSync, à savoir la ressource en ligne à partir de laquelle TerraSync télécharge ses fichiers, est synchronisé avec la [http://scenemodels.flightgear.org/ Base de données des objets de FlightGear] deux fois par jour. Donc, lorsque vous utilisez TerraSync, vous aurez toujours &lt;br /&gt;
# les derniers [[File Formats#.2A.stg|.stg-fichiers]], indiquant à FlightGear où placer un objet &lt;br /&gt;
# les derniers modèles statiques. (Les modèles statiques définissent des objets uniques qui existent dans un seul endroit, comme les bâtiments célèbres ou points de repère.) &lt;br /&gt;
&lt;br /&gt;
Depuis Mars 2011, TerraSync télécharge également les modèles '''shared''' (ou partagés, modèles génériques utilisés plus d'une fois dans des lieux différents, chacun pouvant représenter de nombreux objets différents, comme des maisons génériques ou des navires), du moins quand il s'exécute en premier. Par contre il ne fait pas l'installation des modèles &amp;quot;shared&amp;quot; (partagés) et tant qu'ils ne sont pas installés au bon endroit, vous n'en verrez aucun. Vous devrez copier tous les fichiers du répertoire Models de TerraSync vers &amp;lt;code&amp;gt;[[$FG_ROOT]]/Models&amp;lt;/code&amp;gt;, en remplacement des fichiers qui sont déjà là. Si vous pensez que vos modèles ne sont pas à jour, vous pouvez également télécharger manuellement [http://scenemodels.flightgear.org/download/SharedModels.tgz l'archive de modèles '''partagés'''] la plus récente depuis [http://scenemodels.flightgear.org/ Base de données des scènes de FlightGear]. Dézippez-la vers &amp;lt;code&amp;gt;[[$FG_ROOT]]/Models&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Il est recommandé d'utiliser un répertoire distinct pour les scènes de TerraSync (c'est-à-dire ne pas le faire stocker ses fichiers téléchargés dans votre répertoire principal de scènes), parce qu'une interruption de réseau peut affecter le protocole de synchronisation et corrompre les fichiers stockés). Si cela devait arriver, le plus simple est de supprimer le sous-répertoire concerné puis laisser TerraSync télécharger le répertoire.&lt;br /&gt;
&lt;br /&gt;
== Lancement de Terrasync ==&lt;br /&gt;
&lt;br /&gt;
=== Lancement de TerraSync depuis FlightGear 2.99, 3.0 et suivantes ===&lt;br /&gt;
A partir de la version FlightGear 3.0, Terrasync a significativement changé. Par défault, Terrasync télécharge maintenant dans un dossier situé dans le répertoire [[$FG_HOME]] s'il est activé avec --enable-terrasync (en ligne de commande) ou par la case sur la dernière page de FGRun. Éventuellement, un répertoire TerraSync peut être attribué avec --terrasync-dir= ou  par la boîte de dialogue Avancé... &amp;gt; Général de [http://wiki.flightgear.org/Fr/FlightGear_Launch_Control FGRun]. TerraSync sera alors téléchargé dans ce répertoire. Aucune autre configuration n'est nécessaire.&lt;br /&gt;
&lt;br /&gt;
=== Lancement de TerraSync dans FlightGear 2.4 à 2.12 ===&lt;br /&gt;
Depuis FlightGear 2.4, les contrôles de TerraSync sont intégrés dans le menu habituel de FlightGear, sous la rubrique Environnement &amp;gt; Télécharger les scènes.  Vous pouvez également cocher la case &amp;quot;Télécharger le paysage à la volée&amp;quot; dans l'interface de configuration.  Notez que si vous placez votre avion pour commencer dans une nouvelle scène, où vous n'avez encore téléchargé aucun paysage, votre avion peut d'abord sembler être dans l'eau jusqu'à ce qu'une quantité suffisante de scène ait été téléchargée. Vous pouvez aller à Environnement&amp;gt; Télécharger les scènes et choisir &amp;quot;Manual Refresh&amp;quot; pour appliquer les mises à jour de scènes.&lt;br /&gt;
&lt;br /&gt;
=== Exemple d'utilisation (pour les shell en [[command line|ligne de commande]] conforme à POSIX) ===&lt;br /&gt;
&lt;br /&gt;
Lancer TerraSync :&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;% nice terrasync -p 5500 -S -d &amp;quot;$HOME/fgfsScenery&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
L'option -S dit à Terrasync d'utiliser le protocole SVN pour extraire les données. Si vous l'omettez, Terrasync utilisera le programme rsync à la place (qui doit être installé sur votre système).&lt;br /&gt;
&lt;br /&gt;
Lancer FlightGear :&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;% fgfs --atlas=socket,out,1,localhost,5500,udp --fg-scenery=&amp;quot;[[$FG_ROOT]]/Scenery/:$HOME/fgfsScenery&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La documentation complète et la source pour TerraSync est situé dans la distribution source de FlightGear (sous &amp;lt;code&amp;gt;utils/TerraSync/&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== Lancement de TerraSync depuis [[FGRun]] dans FlightGear 2.2.0 ===&lt;br /&gt;
# Après le démarrage de FGRun, assurez-vous que vous êtes dans le premier écran où vous pouvez configurer les répertoires. Une fois &amp;quot;Retour&amp;quot; à partir de la page de sélection des avions. Vous êtes maintenant à la page des &amp;quot;chemins&amp;quot;.&lt;br /&gt;
# Vous pouvez créer une liste de répertoires à côté de &amp;quot;[[$FG_SCENERY|FG_SCENERY]]&amp;quot;. Sélectionnez la ligne qui sera utilisée par TerraSync et appuyez sur le bouton &amp;quot;répertoire TerraSync&amp;quot; sur le côté droit. Un petit &amp;quot;T&amp;quot; apparaît sur la ligne sélectionnée, indiquant que celui-ci est configuré en tant que répertoire TerraSync.&lt;br /&gt;
#* Les répertoires sont chargés de haut en bas, alors assurez-vous TerraSync est en haut (sauf si vous voulez &amp;quot;surpasser&amp;quot; la version des scènes TerraSync et afficher dans un autre répertoire). Quand deux dossiers contiennent des décors pour la même région, FlightGear prendra le paysage à partir du répertoire le plus haut dans la liste.&lt;br /&gt;
# Enfin, rendez-vous au dernier écran. Il vous faut activer TerraSync comme dans la capture d'écran ci-dessous. Maintenant TerraSync devrait fonctionner.&amp;lt;br /&amp;gt;[[File:TerraSync 2.png|500px]]&lt;br /&gt;
&lt;br /&gt;
''Note: Attendez-vous à ce que votre pare-feu vous bloque la première fois que vous exécutez TerraSync; dites tout simplement au pare-feu de permettre à TerraSync d'utiliser le port.''&lt;br /&gt;
&lt;br /&gt;
=== Lancement de TerraSync depuis [[FGRun]] dans FlightGear 1.9.1 ===&lt;br /&gt;
# Après le démarrage de FGRun, assurez-vous que vous êtes dans le premier écran où vous pouvez configurer les répertoires. Une fois &amp;quot;Retour&amp;quot; à partir de la page de sélection des avions. Vous êtes maintenant ici :&amp;lt;br/&amp;gt;[[File:TerraSync 1.png|500px]]&lt;br /&gt;
# Sélectionnez le dossier de destination pour tous les fichiers téléchargés par TerraSync. Habituellement le répertoire &amp;lt;code&amp;gt;[[$FG_ROOT]]\terrasync&amp;lt;/code&amp;gt; existe déjà et vous n'avez qu'à l'ajouter à la liste (comme dans l'exemple ci-dessus). Assurez-vous que il est positionné '''au-dessus de''' votre dossier standard de paysage (ici il s'agit de &amp;lt;code&amp;gt;FlightGear191\scenery&amp;lt;/code&amp;gt;) et tous les autres répertoires sur lesquels TerraSync est censé avoir la priorité. Quand deux dossiers contiennent des décors pour la même région, FlightGear prendra le paysage à partir du répertoire le plus haut dans la liste. Sur Linux vérifiez que le répertoire n'est pas seulement le répertoire avec le T, mais aussi le répertoire le plus haut.&lt;br /&gt;
# Pour que TerraSync puisse savoir où déposer les fichiers téléchargés, vous devez indiquer au programme quel dossier est le dossier de destination. Dans l'exemple ci-dessus, c'est le 3&amp;lt;sup&amp;gt;ème&amp;lt;/sup&amp;gt; dans la liste.&lt;br /&gt;
# Enfin, rendez-vous au dernier écran. Il vous faut activer TerraSync comme dans la capture d'écran ci-dessous. Maintenant TerraSync devrait fonctionner.&amp;lt;br /&amp;gt;[[File:TerraSync 2.png|500px]]&lt;br /&gt;
&lt;br /&gt;
''Note: Attendez-vous à ce que votre pare-feu vous bloque la première fois que vous exécutez TerraSync; dites tout simplement au pare-feu de permettre à TerraSync d'utiliser le port.''&lt;br /&gt;
&lt;br /&gt;
== Dépannage ==&lt;br /&gt;
&lt;br /&gt;
=== Problème 1 ===&lt;br /&gt;
Si vous obtenez une erreur semblable à la suivante dans la console de ligne de commande (fenêtre noire) :&lt;br /&gt;
&lt;br /&gt;
 Airports/L ... failed:&lt;br /&gt;
 Can't move 'C:\FlightGear\terrasync\Airports\L\E\.svn\tmp\entries' to 'C:\FlightGear\terrasync\Airports\L\E\.svn\entries': The file or directory is corrupted and unreadable.&lt;br /&gt;
&lt;br /&gt;
et, éventuellement, le popup suivant apparaît :&lt;br /&gt;
&lt;br /&gt;
[[File:TerraSync Taskbar Error.png]]&lt;br /&gt;
&lt;br /&gt;
=== Solution 1 ===&lt;br /&gt;
&lt;br /&gt;
Vous pouvez probablement corriger l'erreur en upgradant vers le service Windows 7 Édition Familiale Premium Pack 1.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== problème 2 ===&lt;br /&gt;
Vous obtenez une erreur indiquant que des répertoires d'aéroport sont verrouillés pendant que TerraSync est en cours d'exécution.&lt;br /&gt;
&lt;br /&gt;
 Working copy 'D:\Program Files\FlightGear 2.4.0\terrasync\Airports\K' locked&lt;br /&gt;
&lt;br /&gt;
Bien que ces répertoires soient ''réellement'' mis à jour, l'erreur est ennuyeuse.&lt;br /&gt;
&lt;br /&gt;
=== Solution 2 ===&lt;br /&gt;
Rechercher dans le répertoire TerraSync les fichiers nommés &amp;lt;tt&amp;gt;lock&amp;lt;/tt&amp;gt; et supprimer les. Ils sont censés être supprimés automatiquement lors de chaque mise à jour de TerraSync, mais parfois cela échoue.&lt;br /&gt;
&lt;br /&gt;
== Liens en rapport avec ce sujet ==&lt;br /&gt;
&lt;br /&gt;
* [[Howto: Install scenery]]&lt;br /&gt;
* [[TerraMaster]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery software]]&lt;br /&gt;
[[Category:FlightGear feature]]&lt;br /&gt;
&lt;br /&gt;
[[de:TerraSync]]&lt;br /&gt;
[[en:TerraSync]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Fr/TerraSync&amp;diff=70596</id>
		<title>Fr/TerraSync</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Fr/TerraSync&amp;diff=70596"/>
		<updated>2014-05-06T11:10:52Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: Terrasync for 2.4 - 2.12, 3.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pour voir le terrain que vous survolez avec votre [[aircraft|appareil]], vous devez installer les [[scenery|scènes]] correspondantes. On peut le faire en téléchargeant certaines portions de scènes avant de décoller : voir l'article [[Howto: Install scenery|installing scenery]]. &lt;br /&gt;
&lt;br /&gt;
Mais, si vous avez une connexion Internet stable et assez rapide, vous pouvez utiliser '''TerraSync'''. C'est un utilitaire qui télécharge automatiquement la dernière version des [[scenery|scènes]] de [[FlightGear]] tandis que le simulateur marche. TerraSync fonctionne en arrière plan dans un processus séparé, surveille votre position, et télécharge (ou met à jour) en temps réel la dernière version des paysages depuis le serveur où les scènes sont centralisées.&lt;br /&gt;
&lt;br /&gt;
Le référentiel maître pour TerraSync, à savoir la ressource en ligne à partir de laquelle TerraSync télécharge ses fichiers, est synchronisé avec la [http://scenemodels.flightgear.org/ Base de données des objets de FlightGear] deux fois par jour. Donc, lorsque vous utilisez TerraSync, vous aurez toujours &lt;br /&gt;
# les derniers [[File Formats#.2A.stg|.stg-fichiers]], indiquant à FlightGear où placer un objet &lt;br /&gt;
# les derniers modèles statiques. (Les modèles statiques définissent des objets uniques qui existent dans un seul endroit, comme les bâtiments célèbres ou points de repère.) &lt;br /&gt;
&lt;br /&gt;
Depuis Mars 2011, TerraSync télécharge également les modèles '''shared''' (ou partagés, modèles génériques utilisés plus d'une fois dans des lieux différents, chacun pouvant représenter de nombreux objets différents, comme des maisons génériques ou des navires), du moins quand il s'exécute en premier. Par contre il ne fait pas l'installation des modèles &amp;quot;shared&amp;quot; (partagés) et tant qu'ils ne sont pas installés au bon endroit, vous n'en verrez aucun. Vous devrez copier tous les fichiers du répertoire Models de TerraSync vers &amp;lt;code&amp;gt;[[$FG_ROOT]]/Models&amp;lt;/code&amp;gt;, en remplacement des fichiers qui sont déjà là. Si vous pensez que vos modèles ne sont pas à jour, vous pouvez également télécharger manuellement [http://scenemodels.flightgear.org/download/SharedModels.tgz l'archive de modèles '''partagés'''] la plus récente depuis [http://scenemodels.flightgear.org/ Base de données des scènes de FlightGear]. Dézippez-la vers &amp;lt;code&amp;gt;[[$FG_ROOT]]/Models&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Il est recommandé d'utiliser un répertoire distinct pour les scènes de TerraSync (c'est-à-dire ne pas le faire stocker ses fichiers téléchargés dans votre répertoire principal de scènes), parce qu'une interruption de réseau peut affecter le protocole de synchronisation et corrompre les fichiers stockés). Si cela devait arriver, le plus simple est de supprimer le sous-répertoire concerné puis laisser TerraSync télécharger le répertoire.&lt;br /&gt;
=== Lancement de TerraSync depuis FlightGear 2.99, 3.0 et suivantes ===&lt;br /&gt;
A partir de la version FlightGear 3.0, Terrasync a sigificativement changé. Par défault, Terrasync télécharge maintenant dans un dossier situé dans le répertoire $FG_HOME s'il est activé avec --enable-terrasync (en ligne de commande) ou par la case sur la dernière page de FGRun. Éventuellement, un répertoire TerraSync peut être attribué avec --terrasync-dir= ou  par la boîte de dialogue Avancé... &amp;gt; Général de [FGRun]. TerraSync sera alors téléchargé dans ce répertoire. Aucune autre configuration n'est nécessaire.&lt;br /&gt;
&lt;br /&gt;
=== Lancement de TerraSync dans FlightGear 2.4 à 2.12 ===&lt;br /&gt;
Depuis FlightGear 2.4, les contrôles de TerraSync sont intégrés dans le menu habituel de FlightGear, sous la rubrique Environnement&amp;gt; Télécharger les scènes.  Vous pouvez également cocher la case &amp;quot;Télécharger le paysage à la volée&amp;quot; dans l'interface de configuration.  Notez que si vous placez votre avion pour commencer dans une nouvelle scène, où vous n'avez encore téléchargé aucun paysage, votre avion peut d'abord sembler être dans l'eau jusqu'à ce qu'une quantité suffisante de scène ait été téléchargée. Vous pouvez aller à Environnement&amp;gt; Télécharger les scènes et choisir &amp;quot;Manual Refresh&amp;quot; pour appliquer les mises à jour de scène.&lt;br /&gt;
&lt;br /&gt;
=== Exemple d'utilisation (pour les shell en [[command line|ligne de commande]] conforme à POSIX) ===&lt;br /&gt;
&lt;br /&gt;
Lancer TerraSync :&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;% nice terrasync -p 5500 -S -d &amp;quot;$HOME/fgfsScenery&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
L'option -S dit à Terrasync d'utiliser le protocole SVN pour extraire les données. Si vous l'omettez, Terrasync utilisera le programme rsync à la place (qui doit être installé sur votre système).&lt;br /&gt;
&lt;br /&gt;
Lancer FlightGear :&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;% fgfs --atlas=socket,out,1,localhost,5500,udp --fg-scenery=&amp;quot;[[$FG_ROOT]]/Scenery/:$HOME/fgfsScenery&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La documentation complète et la source pour TerraSync est situé dans la distribution source de FlightGear (sous &amp;lt;code&amp;gt;utils/TerraSync/&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== Lancement de TerraSync depuis [[FGRun]] dans FlightGear 2.2.0 ===&lt;br /&gt;
# Après le démarrage de FGRun, assurez-vous que vous êtes dans le premier écran où vous pouvez configurer les répertoires. Une fois &amp;quot;Retour&amp;quot; à partir de la page de sélection des avions. Vous êtes maintenant à la page des &amp;quot;chemins&amp;quot;.&lt;br /&gt;
# Vous pouvez créer une liste de répertoires à côté de &amp;quot;[[$FG_SCENERY|FG_SCENERY]]&amp;quot;. Sélectionnez la ligne qui sera utilisée par TerraSync et appuyez sur le bouton &amp;quot;répertoire TerraSync&amp;quot; sur le côté droit. Un petit &amp;quot;T&amp;quot; apparaît sur la ligne sélectionnée, indiquant que celui-ci est configuré en tant que répertoire TerraSync.&lt;br /&gt;
#* Les répertoires sont chargés de haut en bas, alors assurez-vous TerraSync est en haut (sauf si vous voulez &amp;quot;surpasser&amp;quot; la version des scènes TerraSync et afficher dans un autre répertoire). Quand deux dossiers contiennent des décors pour la même région, FlightGear prendra le paysage à partir du répertoire le plus haut dans la liste.&lt;br /&gt;
# Enfin, rendez-vous au dernier écran. Il vous faut activer TerraSync comme dans la capture d'écran ci-dessous. Maintenant TerraSync devrait fonctionner.&amp;lt;br /&amp;gt;[[File:TerraSync 2.png|500px]]&lt;br /&gt;
&lt;br /&gt;
''Note: Attendez-vous à ce que votre pare-feu vous bloque la première fois que vous exécutez TerraSync; dites tout simplement au pare-feu de permettre à TerraSync d'utiliser le port.''&lt;br /&gt;
&lt;br /&gt;
=== Lancement de TerraSync depuis [[FGRun]] dans FlightGear 1.9.1 ===&lt;br /&gt;
# Après le démarrage de FGRun, assurez-vous que vous êtes dans le premier écran où vous pouvez configurer les répertoires. Une fois &amp;quot;Retour&amp;quot; à partir de la page de sélection des avions. Vous êtes maintenant ici :&amp;lt;br/&amp;gt;[[File:TerraSync 1.png|500px]]&lt;br /&gt;
# Sélectionnez le dossier de destination pour tous les fichiers téléchargés par TerraSync. Habituellement le répertoire &amp;lt;code&amp;gt;[[$FG_ROOT]]\terrasync&amp;lt;/code&amp;gt; existe déjà et vous n'avez qu'à l'ajouter à la liste (comme dans l'exemple ci-dessus). Assurez-vous que il est positionné '''au-dessus de''' votre dossier standard de paysage (ici il s'agit de &amp;lt;code&amp;gt;FlightGear191\scenery&amp;lt;/code&amp;gt;) et tous les autres répertoires sur lesquels TerraSync est censé avoir la priorité. Quand deux dossiers contiennent des décors pour la même région, FlightGear prendra le paysage à partir du répertoire le plus haut dans la liste. Sur Linux vérifiez que le répertoire n'est pas seulement le répertoire avec le T, mais aussi le répertoire le plus haut.&lt;br /&gt;
# Pour que TerraSync puisse savoir où déposer les fichiers téléchargés, vous devez indiquer au programme quel dossier est le dossier de destination. Dans l'exemple ci-dessus, c'est le 3&amp;lt;sup&amp;gt;ème&amp;lt;/sup&amp;gt; dans la liste.&lt;br /&gt;
# Enfin, rendez-vous au dernier écran. Il vous faut activer TerraSync comme dans la capture d'écran ci-dessous. Maintenant TerraSync devrait fonctionner.&amp;lt;br /&amp;gt;[[File:TerraSync 2.png|500px]]&lt;br /&gt;
&lt;br /&gt;
''Note: Attendez-vous à ce que votre pare-feu vous bloque la première fois que vous exécutez TerraSync; dites tout simplement au pare-feu de permettre à TerraSync d'utiliser le port.''&lt;br /&gt;
&lt;br /&gt;
== Dépannage ==&lt;br /&gt;
&lt;br /&gt;
=== Problème 1 ===&lt;br /&gt;
Si vous obtenez une erreur semblable à la suivante dans la console de ligne de commande (fenêtre noire) :&lt;br /&gt;
&lt;br /&gt;
 Airports/L ... failed:&lt;br /&gt;
 Can't move 'C:\FlightGear\terrasync\Airports\L\E\.svn\tmp\entries' to 'C:\FlightGear\terrasync\Airports\L\E\.svn\entries': The file or directory is corrupted and unreadable.&lt;br /&gt;
&lt;br /&gt;
et, éventuellement, le popup suivant apparaît :&lt;br /&gt;
&lt;br /&gt;
[[File:TerraSync Taskbar Error.png]]&lt;br /&gt;
&lt;br /&gt;
=== Solution 1 ===&lt;br /&gt;
&lt;br /&gt;
Vous pouvez probablement corriger l'erreur en upgradant vers le service Windows 7 Édition Familiale Premium Pack 1.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== problème 2 ===&lt;br /&gt;
Vous obtenez une erreur indiquant que des répertoires d'aéroport sont verrouillés pendant que TerraSync est en cours d'exécution.&lt;br /&gt;
&lt;br /&gt;
 Working copy 'D:\Program Files\FlightGear 2.4.0\terrasync\Airports\K' locked&lt;br /&gt;
&lt;br /&gt;
Bien que ces répertoires soient ''réellement'' mis à jour, l'erreur est ennuyeuse.&lt;br /&gt;
&lt;br /&gt;
=== Solution 2 ===&lt;br /&gt;
Rechercher dans le répertoire TerraSync les fichiers nommés &amp;lt;tt&amp;gt;lock&amp;lt;/tt&amp;gt; et supprimer les. Ils sont censés être supprimés automatiquement lors de chaque mise à jour de TerraSync, mais parfois cela échoue.&lt;br /&gt;
&lt;br /&gt;
== Liens en rapport avec ce sujet ==&lt;br /&gt;
&lt;br /&gt;
* [[Howto: Install scenery]]&lt;br /&gt;
* [[TerraMaster]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery software]]&lt;br /&gt;
[[Category:FlightGear feature]]&lt;br /&gt;
&lt;br /&gt;
[[de:TerraSync]]&lt;br /&gt;
[[en:TerraSync]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=66571</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=66571"/>
		<updated>2014-01-19T23:16:15Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. The collector tank in the example has the capacity 130 lbs so making the check against collector tank level greater or equal to 129 instead of against 130 is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 1 lb margin creates a buffer for this difference as the value oscillates around 129 lbs as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (= 'OFF'), 0, 1, 2, 3, respectively for 'no tank selected', tank[0], [1], [2], [3].&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
* if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
* else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
* else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed or not, i.e. if it is connected to a tank, if this tank is not empty, with a running pump (or not).&lt;br /&gt;
&lt;br /&gt;
(This function above could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
'''For the fuel system presented here''', two small collector tanks [4] and [5] (each collector tank feeding one engine) have been added. In JSBSim, for this multi-engine aircraft (differently from a single-engine one), these collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (through rotary switches for left and right engines) and have their level kept constant. This functioning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ([4] and [5]), which themselves will be fed by the selected 'true' tanks ([0] to [3]).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 0 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 1 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is shown below (can be named fuel.xml, see at the top of this document for how to link the FDM to it).&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] have their level kept constant (at 0.25 lb content) by a step-controlled input flow rate (0 or 0.5 pps here). The &amp;quot;ON&amp;quot; value of this step flow rate must be a bit higher than the maximum&amp;quot; fuel-flow-rate-pps&amp;quot; needed by each engine at full power.&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] content is a compromise. A large content is secure but it gives an excessive delay between the moment when the 'true' tank runs out of fuel and the engine effectively stops running. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D with YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://equipe-flightgear.forumactif.com&lt;br /&gt;
 &lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- Tank 4 level maintenance --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
      &amp;lt;!-- from selected 'utility' tank to Collector Tank 4 Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0               &lt;br /&gt;
            propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1&lt;br /&gt;
            propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2               &lt;br /&gt;
            propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3&lt;br /&gt;
            propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt; &amp;lt;!-- Tank 4 filling --&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- for Tanks 0, 1, 2, 3 consumption --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank0-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank1-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank2-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank3-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- Tank 5 level maintenance --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
      &amp;lt;!-- from selected 'utility' tank to Collector Tank 5 Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0               &lt;br /&gt;
            propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1&lt;br /&gt;
            propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2               &lt;br /&gt;
            propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3&lt;br /&gt;
            propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt; &amp;lt;!-- Tank 5 filling --&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- for Tanks 0, 1, 2, 3 consumption --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank0-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank1-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank2-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank3-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank0-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank0-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank1-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank1-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank2-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank2-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank3-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank3-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60326</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60326"/>
		<updated>2013-05-20T14:50:20Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Douglas DC3 (2 engines, 4 tanks) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. The collector tank in the example has the capacity 130 lbs so making the check against collector tank level greater or equal to 129 instead of against 130 is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 1 lb margin creates a buffer for this difference as the value oscillates around 129 lbs as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (OFF), 0, 1, 2, 3, for 'no tank selected', tank[0], [1], [2], [3] respectively.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
* if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
* else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
* else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed or not, i.e. if it is connected to a tank, if this tank is not empty, with a running pump (or not).&lt;br /&gt;
&lt;br /&gt;
(This function above could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
'''For the fuel system presented here''', two small collector tanks [4] and [5] (each collector tank feeding one engine) have been added. In JSBSim, for this multi-engine aircraft (differently from a single-engine one), these collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (through rotary switches for left and right engines) and have their level kept constant. This functioning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ([4] and [5]), which themselves will be fed by the selected 'true' tanks ([0] to [3]).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 0 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 1 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is shown below (can be named fuel.xml, see at the top of this document for how to link the FDM to it).&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] have their level kept constant (at 0.25 lb content) by a step-controlled input flow rate (0 or 0.5 pps here). The &amp;quot;ON&amp;quot; value of this step flow rate must be a bit higher than the maximum&amp;quot; fuel-flow-rate-pps&amp;quot; needed by each engine at full power.&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] content is a compromise. A large content is secure but it gives an excessive delay between the moment when the 'true' tank runs out of fuel and the engine effectively stops running. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D with YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://equipe-flightgear.forumactif.com&lt;br /&gt;
 &lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- Tank 4 level maintenance --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
      &amp;lt;!-- from selected 'utility' tank to Collector Tank 4 Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0               &lt;br /&gt;
            propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1&lt;br /&gt;
            propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2               &lt;br /&gt;
            propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3&lt;br /&gt;
            propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt; &amp;lt;!-- Tank 4 filling --&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- for Tanks 0, 1, 2, 3 consumption --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank0-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank1-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank2-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank3-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- Tank 5 level maintenance --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
      &amp;lt;!-- from selected 'utility' tank to Collector Tank 5 Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0               &lt;br /&gt;
            propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1&lt;br /&gt;
            propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2               &lt;br /&gt;
            propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3&lt;br /&gt;
            propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt; &amp;lt;!-- Tank 5 filling --&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- for Tanks 0, 1, 2, 3 consumption --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank0-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank1-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank2-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank3-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank0-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank0-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank1-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank1-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank2-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank2-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank3-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank3-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60239</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60239"/>
		<updated>2013-05-18T09:04:53Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Douglas DC3 (2 engines, 4 tanks) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. The collector tank in the example has the capacity 130 lbs so making the check against collector tank level greater or equal to 129 instead of against 130 is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 1 lb margin creates a buffer for this difference as the value oscillates around 129 lbs as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (OFF), 0, 1, 2, 3, for 'no tank selected', tank[0], [1], [2], [3] respectively.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
* if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
* else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
* else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed or not, i.e. if it is connected to a tank, if this tank is not empty, with a running pump (or not).&lt;br /&gt;
&lt;br /&gt;
(This function above could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
'''For the fuel system presented here''', two small collector tanks [4] and [5] (each collector tank feeding one engine) have been added. In JSBSim, for this multi-engine aircraft (differently from a single-engine one), these collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (through rotary switches for left and right engines) and have their level kept constant. This functioning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ([4] and [5]), which themselves will be fed by the selected 'true' tanks ([0] to [3]).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 0 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 1 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is shown below (can be named fuel.xml, see at the top of this document for how to link the FDM to it).&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] have their level kept constant (at 0.25 lb content) by a step-controlled input flow rate (0 or 0.5 pps here). The &amp;quot;ON&amp;quot; value of this step flow rate must be a bit higher than the maximum&amp;quot; fuel-flow-rate-pps&amp;quot; needed by each engine at full power.&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] content is a compromise. A large content is secure but it gives an excessive delay between the moment when the 'true' tank runs out of fuel and the engine effectively stops running. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D with YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://http://equipe-flightgear.forumactif.com&lt;br /&gt;
 &lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- Tank 4 level maintenance --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
      &amp;lt;!-- from selected 'utility' tank to Collector Tank 4 Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0               &lt;br /&gt;
            propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1&lt;br /&gt;
            propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2               &lt;br /&gt;
            propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3&lt;br /&gt;
            propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt; &amp;lt;!-- Tank 4 filling --&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- for Tanks 0, 1, 2, 3 consumption --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank0-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank1-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank2-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank3-to-tank4&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- Tank 5 level maintenance --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
      &amp;lt;!-- from selected 'utility' tank to Collector Tank 5 Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0               &lt;br /&gt;
            propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1&lt;br /&gt;
            propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2               &lt;br /&gt;
            propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;            &lt;br /&gt;
         &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3&lt;br /&gt;
            propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
            /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
            /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt; &amp;lt;!-- Tank 5 filling --&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- for Tanks 0, 1, 2, 3 consumption --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank0-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank1-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank2-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/from-tank3-to-tank5&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank0-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank0-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank1-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank1-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank2-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank2-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank3-to-tank4&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/from-tank3-to-tank5&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60221</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60221"/>
		<updated>2013-05-16T15:52:34Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Douglas DC3 (2 engines, 4 tanks) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. The collector tank in the example has the capacity 130 lbs so making the check against collector tank level greater or equal to 129 instead of against 130 is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 1 lb margin creates a buffer for this difference as the value oscillates around 129 lbs as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (OFF), 0, 1, 2, 3, for 'no tank selected', tank[0], [1], [2], [3] respectively.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
* if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
* else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
* else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed or not, i.e. if it is connected to a tank, if this tank is not empty, with a running pump (or not).&lt;br /&gt;
&lt;br /&gt;
(This function above could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
'''For the fuel system presented here''', two small collector tanks [4] and [5] (each collector tank feeding one engine) have been added. These collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (rotary switches) and have their level kept constant. This functioning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ([4] and [5]), which themselves will be fed by the selected 'true' tanks ([0] to [3]).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 0 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 1 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is shown below (can be named fuel.xml, see at the top of this document for how to link the FDM to it).&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] have their level kept constant (at 0.25 lb content) by a step-controlled input flow rate (0 or 0.5 pps here). The &amp;quot;ON&amp;quot; value of this step flow rate must be a bit higher than the maximum&amp;quot; fuel-flow-rate-pps&amp;quot; needed by each engine at full power.&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] content is a compromise. A large content is secure but it gives an excessive delay between the moment when the 'true' tank runs out of fuel and the engine effectively stops running. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D and YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://http://equipe-flightgear.forumactif.com&lt;br /&gt;
 &lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from selected 'utility' tank to Collector Tank 4 (Left Engine) Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Collector Tank 4 through Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from selected 'utility' tank to Collector Tank 5 (Right Engine) Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Collector Tank 5 through Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60209</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60209"/>
		<updated>2013-05-15T15:20:34Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Douglas DC3 (2 engines, 4 tanks) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. The collector tank in the example has the capacity 130 lbs so making the check against collector tank level greater or equal to 129 instead of against 130 is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 1 lb margin creates a buffer for this difference as the value oscillates around 129 lbs as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (OFF), 0, 1, 2, 3, for 'no tank selected', tank[0], [1], [2], [3] respectively.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
* if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
* else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
* else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed or not, i.e. if it is connected to a tank, if this tank is not empty, with a running pump (or not).&lt;br /&gt;
&lt;br /&gt;
(This function above could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
'''For the fuel system presented here''', two small collector tanks [4] and [5] (each collector tank feeding one engine) have been added. These collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (rotary switches) and have their level kept constant. This functioning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ([4] and [5]), which themselves will be fed by the selected 'true' tanks ([0] to [3]).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 0 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 1 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is shown below (can be named fuel.xml, see at the top of this document for how to link the FDM to it).&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] have their level kept constant (at 0.25 lb content) by a step-controlled input flow rate (0 or 0.5 pps here). The &amp;quot;ON&amp;quot; value of this step flow rate must be a bit higher than the maximum&amp;quot; fuel-flow-rate-pps&amp;quot; needed by each engine at full power.&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] content is a compromise. A large content is secure but it gives an excessive delay between the moment when the 'true' tank runs out of fuel and the engine effectively stops running. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D and YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://http://equipe-flightgear.forumactif.com&lt;br /&gt;
&lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from 'main' tanks to Collector Tank 4 (Left Engine) Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from 'main' tanks to Collector Tank 5 (Right Engine) Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60208</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60208"/>
		<updated>2013-05-15T15:05:17Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Douglas DC3 (2 engines, 4 tanks) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. The collector tank in the example has the capacity 130 lbs so making the check against collector tank level greater or equal to 129 instead of against 130 is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 1 lb margin creates a buffer for this difference as the value oscillates around 129 lbs as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (OFF), 0, 1, 2, 3, for 'no tank selected', tank[0], [1], [2], [3] respectively.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
* if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
* else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
* else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed or not, i.e. if it is connected to a tank, if this tank is not empty, with a running pump (or not).&lt;br /&gt;
&lt;br /&gt;
(This function above could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
'''For the fuel system presented here''', two small collector tanks [4] and [5] (each collector tank feeding one engine) have been added. These collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (rotary switches) and have their level kept constant. This functioning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ([4] and [5]), which themselves will be fed by the selected 'true' tanks ([0] to [3]).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 0 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 1 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is shown below (can be named fuel.xml, see at the top of this document for how to link the FDM to it).&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] have their level kept constant (at 0.25 lb content) by a step-controlled input flow rate (0 or 0.5 pps here). The &amp;quot;ON&amp;quot; value of this step flow rate must be a bit higher than the maximum&amp;quot; fuel-flow-rate-pps&amp;quot; needed by each engine at full power.&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] content is a compromise. A large content is secure but it gives an excessive delay between the moment when the 'true' tank runs out of fuel and the engine effectively stops running. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D and YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://http://equipe-flightgear.forumactif.com&lt;br /&gt;
&lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 4 (Left Engine) Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Left Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 5 (Right Engine) Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Right Valve Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60207</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60207"/>
		<updated>2013-05-15T13:43:15Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: /* Douglas DC3 (2 engines, 4 tanks) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. The collector tank in the example has the capacity 130 lbs so making the check against collector tank level greater or equal to 129 instead of against 130 is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 1 lb margin creates a buffer for this difference as the value oscillates around 129 lbs as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/contents-lbs LE 0&lt;br /&gt;
        propulsion/tank[2]/contents-lbs GE 129 &amp;lt;!-- 1 lb below capacity --&amp;gt;&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (OFF), 0, 1, 2, 3, for 'no tank selected', tank[0], [1], [2], [3] respectively.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
* if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
* else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
* else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed or not, i.e. if it is connected to a tank, if this tank is not empty, with a running pump (or not).&lt;br /&gt;
&lt;br /&gt;
(This function could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
'''For the fuel system presented here''', two small collector tanks 4 and 5 (each collector tank feeding one engine) have been added. These collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (rotary switches) and have their level kept constant. This functioning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ((4 and 5), which themselves will be fed by the selected 'true' tanks (0 to 3).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 0 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 1 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is shown below (can be named fuel.xml, see at the top of this document for how to link the FDM to it).&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] have their level kept constant by a step-controlled input flow rate (0 or 0.5 pps here). The &amp;quot;ON&amp;quot; value of this step flow rate must be a bit higher than the maximum&amp;quot; fuel-flow-rate-pps&amp;quot; needed by each engine at full power.&lt;br /&gt;
&lt;br /&gt;
Collector tanks [4] and [5] capacity is a compromise. A large capacity is secure but it gives an excessive delay between the moment when the 'true' tank runs out of fuel and the engine effectively stops running. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D and YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://http://equipe-flightgear.forumactif.com&lt;br /&gt;
&lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 4 and Left Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 5 and Right Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60188</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60188"/>
		<updated>2013-05-13T12:52:51Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. Making the check against collector tank level greater or equal to 99.5 % instead of against 100% is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 0.5% margin creates a buffer for this difference as the value oscillates around 99.5% as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (OFF), 0, 1, 2, 3, for 'no tank selected', tank[0], [1], [2], [3] respectively.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
* if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
* else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
* else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed ot not, i.e. if it is connected to a tank, if this tank is filled, with a running pump (or not).&lt;br /&gt;
(This function could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
'''For the fuel system presented here''', two small collector tanks 4 and 5 (each collector tank feeding one engine) have been added. These collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (rotary switches) and have their level kept constant. This functionning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ((4 and 5), which themselves will be fed by the selected 'true' tanks (0 to 3).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 0 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 1 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is (can be named fuel.xml, see at the top of this document for how to link the FDM to it):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D and YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://http://equipe-flightgear.forumactif.com&lt;br /&gt;
&lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 4 and Left Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 5 and Right Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60169</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60169"/>
		<updated>2013-05-12T21:00:55Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. Making the check against collector tank level greater or equal to 99.5 % instead of against 100% is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 0.5% margin creates a buffer for this difference as the value oscillates around 99.5% as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (OFF), 0, 1, 2, 3, for 'no tank selected', tank[0], [1], [2], [3] respectively.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
* if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
* else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
* else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed ot not, i.e. if it is connected to a tank, if this tank is filled, with a running pump (or not).&lt;br /&gt;
(This function could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
'''For the fuel system presented here''', two small collector tanks 4 and 5 (each collector tank feeding one engine) have been added. These collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (rotary switches) and have their level kept constant. This functionning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ((4 and 5), which themselves will be fed by the selected 'true' tanks (0 to 3).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 0 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt; &amp;lt;!-- number 1 --&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is (can be named fuel.xml, see at the top of this document for how to link the FDM to it):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D and YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://http://equipe-flightgear.forumactif.com&lt;br /&gt;
&lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 4 and Left Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
               &amp;lt;/test&amp;gt;&lt;br /&gt;
               &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 5 and Right Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
               &amp;lt;/test&amp;gt;&lt;br /&gt;
               &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60149</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60149"/>
		<updated>2013-05-12T14:41:58Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. Making the check against collector tank level greater or equal to 99.5 % instead of against 100% is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 0.5% margin creates a buffer for this difference as the value oscillates around 99.5% as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (OFF), 0, 1, 2, 3, for 'no tank selected', tank[0], [1], [2], [3] respectively.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
* if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
* else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
* else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed ot not, i.e. if it is connected to a tank, if this tank is filled, with a running pump (or not).&lt;br /&gt;
(This function could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
'''For the fuel system presented here''', two small collector tanks 4 and 5 (each collector tank feeding one engine) have been added. These collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (rotary switches) and have their level kept constant. This functionning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ((4 and 5), which themselves will be fed by the selected 'true' tanks (0 to 3).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is (can be named fuel.xml, see at the top of this document for how to link the FDM to it):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D and YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://http://equipe-flightgear.forumactif.com&lt;br /&gt;
&lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 4 and Left Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
               &amp;lt;/test&amp;gt;&lt;br /&gt;
               &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 5 and Right Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
               &amp;lt;/test&amp;gt;&lt;br /&gt;
               &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60146</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60146"/>
		<updated>2013-05-12T13:50:14Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. Making the check against collector tank level greater or equal to 99.5 % instead of against 100% is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 0.5% margin creates a buffer for this difference as the value oscillates around 99.5% as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (OFF), 0, 1, 2, 3, for 'no tank selected', tank[0], [1], [2], [3] respectively.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
 - if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
 - else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
 - else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed ot not, i.e. if it is connected to a tank, if this tank is filled, with a running pump (or not).&lt;br /&gt;
(This function could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
'''For the fuel system presented here''', two small collector tanks 4 and 5 (each collector tank feeding one engine) have been added. These collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (rotary switches) and have their level kept constant. This functionning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ((4 and 5), which themselves will be fed by the selected 'true' tanks (0 to 3).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is (can be named fuel.xml, see at the top of this document for how to link the FDM to it):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D and YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://http://equipe-flightgear.forumactif.com&lt;br /&gt;
&lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 4 and Left Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
               &amp;lt;/test&amp;gt;&lt;br /&gt;
               &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 5 and Right Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
               &amp;lt;/test&amp;gt;&lt;br /&gt;
               &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60145</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60145"/>
		<updated>2013-05-12T13:40:23Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. Making the check against collector tank level greater or equal to 99.5 % instead of against 100% is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 0.5% margin creates a buffer for this difference as the value oscillates around 99.5% as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions ('OFF' + 4 tanks) rotary switch. Its positions are numbered -1 (OFF), 0, 1, 2, 3, for 'no tank selected', tank[0], [1], [2], [3] respectively.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
 - if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
 - else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
 - else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed ot not, i.e. if it is connected to a tank, if this tank is filled, with a running pump (or not).&lt;br /&gt;
(This function could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
For the fuel system presented here, two small collector tanks 4 and 5 (each collector tank feeding one engine) have been added. These collector tanks are necessary to have each engine be separately fed by its selected 'true' tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (rotary switches) and have their level kept constant. This functionning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ((4 and 5), which themselves will be fed by the selected 'true' tanks (0 to 3).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is (can be named fuel.xml, see at the top of this document for how to link the FDM to it):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D and YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://http://equipe-flightgear.forumactif.com&lt;br /&gt;
&lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 4 and Left Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
               &amp;lt;/test&amp;gt;&lt;br /&gt;
               &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 5 and Right Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
               &amp;lt;/test&amp;gt;&lt;br /&gt;
               &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60144</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60144"/>
		<updated>2013-05-12T13:12:30Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. Making the check against collector tank level greater or equal to 99.5 % instead of against 100% is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 0.5% margin creates a buffer for this difference as the value oscillates around 99.5% as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions rotary switch (&amp;quot;OFF&amp;quot; + 4 tanks). Its positions are numbered -1 (OFF) or 0, 1, 2, 3, for 'no tank selected' or tank[0], [1], [2], [3] respectively.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite''': A nasal code logic says:&lt;br /&gt;
 - if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
 - else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
 - else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed ot not.&lt;br /&gt;
(This function could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
For the fuel system presented here, two small collector tanks 4 and 5 (each collector tank feeding one engine) have been added. These collector tanks are necessary to have each engine be separately fed by its selected tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (rotary switches) and have their level kept constant. This functionning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
'''The FDM''' contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ((4 and 5), which themselves will be fed by the selected 'true' tanks (0 to 3).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Fuel system XML file''' itself is (can be named fuel.xml, see at the top of this document for how to link the FDM to it):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D and YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://http://equipe-flightgear.forumactif.com&lt;br /&gt;
&lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 4 and Left Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
               &amp;lt;/test&amp;gt;&lt;br /&gt;
               &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 5 and Right Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
               &amp;lt;/test&amp;gt;&lt;br /&gt;
               &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60143</id>
		<title>Howto:Write a fuel system in JSBSim</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Write_a_fuel_system_in_JSBSim&amp;diff=60143"/>
		<updated>2013-05-12T13:01:04Z</updated>

		<summary type="html">&lt;p&gt;Dany9a3: Douglas DC3 fuel system&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of [[FlightGear]] 2.4.0, JSBSim aircraft have a new tank-property: &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt;. Setting this property will either draw fuel from (value &amp;lt; 0), or insert fuel into (value &amp;gt; 0) the respective tank. By using this property, one can simulate complex fuel systems.&lt;br /&gt;
&lt;br /&gt;
== A fuel system file ==&lt;br /&gt;
First we create a system file, in which we will write the actual system. It's advised to save this file as &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt; &lt;br /&gt;
	&amp;lt;!-- we will write the system here --&amp;gt;&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We link the main FDM to this system by adding the following line, somewhere in your aircraft's FDM (I advise to put it below &amp;lt;tt&amp;gt;&amp;lt;/propulsion&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;system file=&amp;quot;fuel&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice how &amp;quot;fuel&amp;quot; refers to &amp;lt;tt&amp;gt;Aircraft/.../Systems/fuel.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Fuel handling in JSBSim ==&lt;br /&gt;
To make JSBSim handle the fuel system during simulation we create one or more channels in the system file. Within these we can use the different control components [http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf available in JSBSim].&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;propulsion/tank[n]/external-flow-rate-pps&amp;lt;/tt&amp;gt; there is no automatic detection if the tank is full or empty. Fuel filling an already full tank will just disappear, creating a &amp;quot;leak&amp;quot;. Fuel drawn from an empty tank will make new fuel magically appear in the system. In most cases we will have to make checks to avoid these problems.&lt;br /&gt;
&lt;br /&gt;
Two control components that is useful in a fuel system are summers and switches.&lt;br /&gt;
 &lt;br /&gt;
=== Summers ===&lt;br /&gt;
To calculate the total fuel-flows to/from each tank, we need to sum up the independent flows. This must be done for each single tank, but the principle is the same every time and simple to understand. Every flow that transports fuel ''from'' a tank should get a minus sign.&lt;br /&gt;
&lt;br /&gt;
This summer calculates the total flow to or from tank[0].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;summer&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/input&amp;gt;		&amp;lt;!-- jettison --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[1]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[2]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate/tank[3]&amp;lt;/input&amp;gt;		&amp;lt;!-- to tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[1]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 1 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[2]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 2 --&amp;gt;&lt;br /&gt;
	&amp;lt;input&amp;gt;propulsion/tank[3]/external-flow-rate/tank[0]&amp;lt;/input&amp;gt;		&amp;lt;!-- from tank 3 --&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/summer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Switches ===&lt;br /&gt;
To turn the flow on or off we need a switch.&lt;br /&gt;
&lt;br /&gt;
This switch draws 5 lbs/s from tank[0] until its empty as long as the collector vale is open.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Jettison switch  ===&lt;br /&gt;
The /controls/fuel/fuel-to-remain property controls the amount of fuel (in lbs) that should be kept a board. When the total-fuel-level reaches that level, fuel dumping will auomatically stop. Fuel dumping can also be stopped by closing the jettison valves (disable &amp;lt;tt&amp;gt;/controls/fuel/dump-valve&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;switch&amp;gt;&lt;br /&gt;
	&amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;12.25&amp;quot;&amp;gt;&lt;br /&gt;
		/controls/fuel/dump-valve == 1&lt;br /&gt;
		propulsion/total-fuel-lbs gt /controls/fuel/fuel-to-remain&lt;br /&gt;
	&amp;lt;/test&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
	&amp;lt;output&amp;gt;propulsion/tank[7]/external-flow-rate/jettison&amp;lt;/output&amp;gt;&lt;br /&gt;
&amp;lt;/switch&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The output properties should be added as inputs to the respective summers. Add a minus sign, as the fuel is taken ''from'' the tank.&lt;br /&gt;
&lt;br /&gt;
=== Two tanks and a collector tank ===&lt;br /&gt;
A system with two tanks (tank[0] and tank[1]) feeding a collector tank (tank[2]). The engine is fed from the collector tank. There is valves between each of the tanks and the collector that can be set open or closed. Negative Gs cut the  supply to the collector.&lt;br /&gt;
&lt;br /&gt;
The system consists of two properties: propulsion/tank[0]/collector-valve and propulsion/tank[1]/collector-valve that represent the valves and a channel that handles the fuel transfer from the tanks to the collector and the necessary checks.&lt;br /&gt;
&lt;br /&gt;
The fuel transfer using external-flow-rate-pps does not check against if tanks are empty or full. This can create fuel when &amp;quot;fuel&amp;quot; is drawn from an empty tank or a &amp;quot;leak&amp;quot; when fuel is pumped into a full tank. Making the check against collector tank level greater or equal to 99.5 % instead of against 100% is done to avoid the later kind of leak since the collector tank normally receives more fuel every time step than the engine uses. The 0.5% margin creates a buffer for this difference as the value oscillates around 99.5% as the switch turns on and off the flow.&lt;br /&gt;
&lt;br /&gt;
[[File:Collector-tank-system2.png|thumb|Two tanks and a collector tank]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- tank[2] collector tank connected to the engine fuel pump, tank[0] and tank[1] feeds the collector through valves.&lt;br /&gt;
Negative Gs (&amp;lt;-0.5g) cuts the supply to the collector tanks --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[0]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;propulsion/tank[1]/collector-valve&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;channel name=&amp;quot;Fuel pumping&amp;quot;&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[0]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[0]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5&lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;switch&amp;gt;&lt;br /&gt;
      &amp;lt;default value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;test logic=&amp;quot;OR&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        propulsion/tank[1]/collector-valve EQ 0&lt;br /&gt;
        propulsion/tank[1]/pct-full LE 0&lt;br /&gt;
        propulsion/tank[2]/pct-full GE 99.5&lt;br /&gt;
        accelerations/Nz LE -0.5 &lt;br /&gt;
      &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;summer&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[0]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;-propulsion/tank[1]/external-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/summer&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spitfire: Carburetor engine ===&lt;br /&gt;
&lt;br /&gt;
Spitfire II fuel system. This systems have properties for damage, leaks and simulates the carburetor as a small tank to handle fuel starvation at negative Gs.&lt;br /&gt;
The Spitfire has two interconnected tanks with fuel flowing from an upper tank to a lower and both connected to the engine through cocks. The layout of the system can be seen [http://616sqn.tidesofwar.net/gallery/spitfuelsm.jpg here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    &amp;lt;system name=&amp;quot;Fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;bool&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt; /fdm/jsbsim/fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/priming&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_top_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &amp;lt;property type=&amp;quot;double&amp;quot; value=&amp;quot;0&amp;quot;&amp;gt; /fdm/jsbsim/fuel/leak_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;carburetor&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Carburetor Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/float_chamber-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;input&amp;gt;-propulsion/engine/fuel-flow-rate-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;      &lt;br /&gt;
          &amp;lt;/summer&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Fuel Pump&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- float throttle valve position --&amp;gt;         &lt;br /&gt;
          &amp;lt;aerosurface_scale name=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;propulsion/tank[0]/contents-lbs&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;zero_centered&amp;gt;false&amp;lt;/zero_centered&amp;gt;&lt;br /&gt;
             &amp;lt;domain&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.5&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/domain&amp;gt;                  &lt;br /&gt;
             &amp;lt;range&amp;gt;&lt;br /&gt;
                &amp;lt;min&amp;gt;1.0&amp;lt;/min&amp;gt;&lt;br /&gt;
                &amp;lt;max&amp;gt;0.0&amp;lt;/max&amp;gt;&lt;br /&gt;
             &amp;lt;/range&amp;gt;&lt;br /&gt;
          &amp;lt;/aerosurface_scale &amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &amp;lt;!-- Fuel Flow into Float Chamber in pps --&amp;gt;&lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/flowing_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/float_throttle-valve-cmd&amp;quot;&amp;gt;&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
                &amp;lt;test logic=&amp;quot;OR&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_top_cock EQ 1               &lt;br /&gt;
                      propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;            &lt;br /&gt;
                   &amp;lt;test logic=&amp;quot;AND&amp;quot;&amp;gt;&lt;br /&gt;
                      fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                      propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
                   &amp;lt;/test&amp;gt;      &lt;br /&gt;
                &amp;lt;/test&amp;gt;&lt;br /&gt;
             &amp;lt;/test&amp;gt;               &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/pump_flow_to_float-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                   &amp;lt;product&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/flowing_from_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Fuel pump in pps --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/engine/engine-rpm&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt; &amp;lt;!-- Fuel pump curve --&amp;gt;               &lt;br /&gt;
                            0      0&lt;br /&gt;
                            100      1&lt;br /&gt;
                            3000   10                  &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/damage&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;value&amp;gt;0.12&amp;lt;/value&amp;gt; &amp;lt;!-- full throttle max fuel demand in pps  --&amp;gt;&lt;br /&gt;
                   &amp;lt;/product&amp;gt;            &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Tanks&amp;quot;&amp;gt;&lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel flow to be divided aross a number of tanks --&amp;gt;      &lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;quotient&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/pump_flow_to_float-pps&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_top_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/tank_bottom_cock&amp;lt;/property&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/quotient&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/flow_from_tank&amp;lt;/output&amp;gt;         &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;         &lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/channel&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Top Tank&amp;quot;&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
          &amp;lt;!-- top_bottom_transfer --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/top_bottom_transfer&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
                propulsion/tank[2]/contents-lbs LT 322&lt;br /&gt;
                accelerations/Nz GE -0.5&lt;br /&gt;
             &amp;lt;/test&amp;gt;         &lt;br /&gt;
          &amp;lt;/switch&amp;gt;   &lt;br /&gt;
             &lt;br /&gt;
          &amp;lt;!-- Fuel tranfer rate in pps--&amp;gt;&lt;br /&gt;
          &amp;lt;fcs_function name=&amp;quot;fuel/top_bottom_transfer-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;function&amp;gt;&lt;br /&gt;
                &amp;lt;product&amp;gt;&lt;br /&gt;
                   &amp;lt;property&amp;gt;fuel/top_bottom_transfer&amp;lt;/property&amp;gt;            &lt;br /&gt;
                   &amp;lt;sum&amp;gt;&lt;br /&gt;
                      &amp;lt;property&amp;gt;fuel/from_bottom_tank&amp;lt;/property&amp;gt;&lt;br /&gt;
                      &amp;lt;table&amp;gt;      &amp;lt;!-- Liquid finds it's own level --&amp;gt;&lt;br /&gt;
                         &amp;lt;independentVar&amp;gt;propulsion/tank[2]/contents-lbs&amp;lt;/independentVar&amp;gt;&lt;br /&gt;
                         &amp;lt;tableData&amp;gt;&lt;br /&gt;
                            319      1&lt;br /&gt;
                            322      0       &lt;br /&gt;
                         &amp;lt;/tableData&amp;gt;&lt;br /&gt;
                      &amp;lt;/table&amp;gt;&lt;br /&gt;
                   &amp;lt;/sum&amp;gt;&lt;br /&gt;
                &amp;lt;/product&amp;gt;               &lt;br /&gt;
             &amp;lt;/function&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/output&amp;gt;   &lt;br /&gt;
          &amp;lt;/fcs_function&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_top_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;   &lt;br /&gt;
                fuel/tank_top_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5   &lt;br /&gt;
             &amp;lt;/test&amp;gt;      &lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Top Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_top_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_top_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;&lt;br /&gt;
       &lt;br /&gt;
       &amp;lt;channel name=&amp;quot;Bottom Tank&amp;quot;&amp;gt;         &lt;br /&gt;
                &lt;br /&gt;
          &amp;lt;!-- Bottom Tank Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
          &amp;lt;switch name=&amp;quot;fuel/from_bottom_tank&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;fuel/flow_from_tank&amp;quot;&amp;gt;&lt;br /&gt;
                fuel/tank_bottom_cock EQ 1&lt;br /&gt;
                accelerations/Nz GE -0.5         &lt;br /&gt;
             &amp;lt;/test&amp;gt;&lt;br /&gt;
          &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;!-- Total Bottom Tank Fuel Flow Rate in pps --&amp;gt;         &lt;br /&gt;
          &amp;lt;summer name=&amp;quot;fuel/total_from_bottom_tank-pps&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;fuel/top_bottom_transfer-pps&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-/fdm/jsbsim/fuel/priming&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/from_bottom_tank&amp;lt;/input&amp;gt;&lt;br /&gt;
             &amp;lt;input&amp;gt;-fuel/leak_bottom_tank&amp;lt;/input&amp;gt;         &lt;br /&gt;
             &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;            &lt;br /&gt;
          &amp;lt;/summer&amp;gt;&lt;br /&gt;
          &lt;br /&gt;
       &amp;lt;/channel&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Douglas DC3 (2 engines, 4 tanks) ===&lt;br /&gt;
The real aircraft has two engines and four tanks.Two tank selectors (one per engine) allows each engine to be fed by each tank, separately and one tank at a time for a given engine. The diagram of the fuel system can be seen [http://www.theaviatornetwork.com/pdf/GTM-05-050130-Fuel-System.pdf at the end of this document].&lt;br /&gt;
For FG, the engines are numbered [0] and (1], the 'true' feed tanks [0], [1], [2], [3]. Each tank selector is a 5-positions rotary switch (&amp;quot;OFF&amp;quot; + 4 tanks). Its positions are numbered -1 (OFF) or 0, 1, 2, 3, for 'no tank selected' or tank[0], [1], [2], [3] respectively.&lt;br /&gt;
&lt;br /&gt;
Prerequisite: A nasal code logic says:&lt;br /&gt;
 - if an engine[N] boost-pump is &amp;quot;ON&amp;quot;, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 16 psi&lt;br /&gt;
 - else, if engine[N] is running, and fuel-level &amp;gt; 4 lbs in the tank selected for this engine[N] ==&amp;gt; fuel-pressure = 14.5&lt;br /&gt;
 - else of all that, fuel-pressure = 0&lt;br /&gt;
Hence, fuel pressure is a a good criteria to tell that an engine is fed ot not.&lt;br /&gt;
(This function could probably be implemented by XML)&lt;br /&gt;
&lt;br /&gt;
For the fuel system presented here, two small collector tanks 4 and 5 (each collector tank feeding one engine) have been added. These collector tanks are necessary to have each engine be separately fed by its selected tank and selectively stop if the tank runs out of fuel. The collector tanks are fed by the selected tanks (rotary switches) and have their level kept constant. This functionning is close to a constant level carburetor.&lt;br /&gt;
&lt;br /&gt;
The FDM contains the following lines which set the tanks.&lt;br /&gt;
Notice that the engines are written as fed by the collector tanks ((4 and 5), which themselves will be fed by the selected 'true' tanks (0 to 3).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;propulsion&amp;gt;&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;4&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;engine file=&amp;quot;DC3_engine&amp;quot;&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
    &amp;lt;feed&amp;gt;5&amp;lt;/feed&amp;gt;&lt;br /&gt;
    .........&lt;br /&gt;
  &amp;lt;/engine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
     .........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
      ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1210 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
     ...............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 1202 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 600 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;!-- Collector Tank (left engine) --&amp;gt;&lt;br /&gt;
     ...........&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tank type=&amp;quot;FUEL&amp;quot; number=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- Collector Tank (right engine) --&amp;gt;&lt;br /&gt;
     ..............&lt;br /&gt;
     &amp;lt;capacity unit=&amp;quot;LBS&amp;quot;&amp;gt; 0.5 &amp;lt;/capacity&amp;gt;&lt;br /&gt;
     &amp;lt;contents unit=&amp;quot;LBS&amp;quot;&amp;gt; 0 &amp;lt;/contents&amp;gt;&lt;br /&gt;
  &amp;lt;/tank&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/propulsion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fuel system XML file (can be named fuel.xml, see at the top of this document how to link the FDM to it):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
Douglas DC-3 C47, initial 3D and YASim FDM by Emmanuel BARANGER,&lt;br /&gt;
further modifications by PAF team:  http://http://equipe-flightgear.forumactif.com&lt;br /&gt;
&lt;br /&gt;
May 2013, Daniel DUBREUIL, fuel system for JSBSim FDM&lt;br /&gt;
with Bomber (Simon), jam007, Jon S. Berndt Assistance. Thank you!&lt;br /&gt;
***********************************************************************************&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;system name=&amp;quot;fuel&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ LEFT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 0 Rotary Left Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 4 and Left Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 4 works like a constant-level carburetor for left engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/left-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[4]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[0]/fuel-psi-norm GT 5&lt;br /&gt;
               &amp;lt;/test&amp;gt;&lt;br /&gt;
               &amp;lt;output&amp;gt;propulsion/tank[4]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Left Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng0-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-left-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/left-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ RIGHT ENGINE *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;channel name=&amp;quot;Engine 1 Rotary Right Valve Logic&amp;quot;&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- to Collector Tank 5 and Right Engine Fuel Flow Rate in pps --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- Collector Tank 5 works like a constant-level carburetor for right engine --&amp;gt;&lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 0               &lt;br /&gt;
               propulsion/tank[0]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 1&lt;br /&gt;
               propulsion/tank[1]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;&lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 2               &lt;br /&gt;
               propulsion/tank[2]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
            &amp;lt;/test&amp;gt;            &lt;br /&gt;
            &amp;lt;test logic=&amp;quot;AND&amp;quot; value=&amp;quot;0.5&amp;quot;&amp;gt;&lt;br /&gt;
               /controls/fuel/right-valve EQ 3&lt;br /&gt;
               propulsion/tank[3]/contents-lbs GT 0&lt;br /&gt;
               /consumables/fuel/tank[5]/level-lbs LT 0.25&lt;br /&gt;
               /engines/engine[1]/fuel-psi-norm GT 5&lt;br /&gt;
               &amp;lt;/test&amp;gt;&lt;br /&gt;
               &amp;lt;output&amp;gt;propulsion/tank[5]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
      &amp;lt;!-- from Tank 0 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank0&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 0      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 1 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank1&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 1      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;!-- from Tank 2 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 2      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;      &lt;br /&gt;
&lt;br /&gt;
      &amp;lt;!-- from Tank 3 to Right Engine Fuel Flow Rate in pps --&amp;gt;            &lt;br /&gt;
      &amp;lt;switch name=&amp;quot;fuel/eng1-from-tank3&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;default value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;test value=&amp;quot;-fuel/through-right-valve&amp;quot;&amp;gt;&lt;br /&gt;
            /controls/fuel/right-valve EQ 3      &lt;br /&gt;
         &amp;lt;/test&amp;gt;&lt;br /&gt;
      &amp;lt;/switch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ************ TOTAL FLOW RATE per TANK *************** --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *********************************************************************************** --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
     &amp;lt;channel name=&amp;quot;Total flow rates&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank0-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank0&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[0]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
       &amp;lt;summer name=&amp;quot;fuel/tank1-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank1&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[1]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank2-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank2&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[2]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;summer name=&amp;quot;fuel/tank3-flow-rate&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng0-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;input&amp;gt;fuel/eng1-from-tank3&amp;lt;/input&amp;gt;&lt;br /&gt;
         &amp;lt;output&amp;gt;propulsion/tank[3]/external-flow-rate-pps&amp;lt;/output&amp;gt;&lt;br /&gt;
      &amp;lt;/summer&amp;gt;&lt;br /&gt;
      &lt;br /&gt;
   &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/system&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JSBSim}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Aircraft enhancement|Fuel system JSBSim]]&lt;br /&gt;
[[Category:Howto|Fuel system JSBSim]]&lt;/div&gt;</summary>
		<author><name>Dany9a3</name></author>
	</entry>
</feed>