Replies: 4 comments 3 replies
-
This is what I do. <aerodynamics>
<property value="-0.6"> aero/stability_coefficients/Cm-alpha </property>
<property value="-27.0"> aero/stability_coefficients/Cm-q </property>
<property value="-16.0"> aero/stability_coefficients/Cm-alpha-dot </property>
<property value="1.0"> aero/stability_coefficients/Cm-d-elevator </property>
<property value="-0.2"> aero/stability_coefficients/Cl-beta </property>
<property value="-0.4"> aero/stability_coefficients/Cl-p </property>
<property value="0.09"> aero/stability_coefficients/Cl-r </property>
<property value="1.0"> aero/stability_coefficients/Cl-d-aileron </property>
<property value="0.01"> aero/stability_coefficients/Cl-d-rudder </property>
<property value="0.1"> aero/stability_coefficients/Cn-beta </property>
<property value="0.00"> aero/stability_coefficients/Cn-p-xx </property>
<property value="-0.35"> aero/stability_coefficients/Cn-r </property>
<property value="0.00"> aero/stability_coefficients/Cn-d-aileron-xx </property>
<property value="-0.2"> aero/stability_coefficients/Cn-d-rudder </property>
<axis name="PITCH" unit="LBS*FT">
<function name="aero/coefficient/Cmalpha">
<description>Pitch_moment_due_to_alpha</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/cbarw-ft</property>
<property>aero/alpha-rad</property>
<property>aero/stability_coefficients/Cm-alpha</property>
</product>
</function>
<function name="aero/coefficient/Cmde">
<description>Pitch_moment_due_to_elevator</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/cbarw-ft</property>
<property>fcs/elevator-pos-rad</property>
<property>aero/stability_coefficients/Cm-d-elevator</property>
<table>
<independentVar>velocities/mach</independentVar>
<tableData>
0 -1.2
2 -0.3
</tableData>
</table>
</product>
</function>
<function name="aero/coefficient/Cmq">
<description>Pitch_moment_due_to_pitch_rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/cbarw-ft</property>
<property>aero/ci2vel</property>
<property>velocities/q-aero-rad_sec</property>
<property>aero/stability_coefficients/Cm-q</property>
</product>
</function>
|
Beta Was this translation helpful? Give feedback.
-
I'm re-opening this thread, please tell me if I need to open a new discussion about it. <function name="aero/coefficient/CLalpha">
<description>Lift per radian of alpha</description>
<product>
<property>aero/qbar-area</property>
<!-- <property>aero/alpha-rad</property> -->
<table>
<independentVar lookup="row">aero/alpha-rad</independentVar>
<tableData>
-1.5714 -0.0028
-1.4614 -0.2135
-1.3252 -0.4569
-1.0581 -0.7448
-0.9691 -0.7705
-0.7491 -0.6746
-0.4925 -0.3937
-0.3406 -0.2369
-0.2987 -0.3492
-0.2725 -0.5412
-0.2254 -0.7308
-0.1573 -0.5412
-0.0682 -0.1596
-0.0001 0.1119
0.1308 0.6222
0.2146 0.8960
0.2722 0.5800
0.3403 0.2453
0.5288 0.4466
0.6441 0.5777
0.7802 0.7041
0.9583 0.7696
1.1940 0.6362
1.3511 0.4092
1.4821 0.1751
1.5711 0.0042
</tableData>
</table>
<!-- <value> 4.0203 </value> -->
</product>
</function> And I would like to know how you manage to apply randomization to such data at runtime ? |
Beta Was this translation helpful? Give feedback.
-
So I'm assuming the same applies to your lift and drag data? I'm also assuming you want to shift the whole lift versus alpha curve say up or down by a maximum of 10%, as opposed to randomizing each entry in the alpha vs CL table? If so then you can use the same approach I suggested above. <property value="1.0"> aero/CL-random </property>
<function name="aero/coefficient/CLalpha">
<description>Lift per radian of alpha</description>
<product>
<property>aero/qbar-area</property>
<property>aero/CL-random</property>
<table>
<independentVar lookup="row">aero/alpha-rad</independentVar>
<tableData>
-1.5714 -0.0028
-1.4614 -0.2135
-1.3252 -0.4569
-1.0581 -0.7448
-0.9691 -0.7705
-0.7491 -0.6746
-0.4925 -0.3937
-0.3406 -0.2369
-0.2987 -0.3492
-0.2725 -0.5412
-0.2254 -0.7308
-0.1573 -0.5412
-0.0682 -0.1596
-0.0001 0.1119
0.1308 0.6222
0.2146 0.8960
0.2722 0.5800
0.3403 0.2453
0.5288 0.4466
0.6441 0.5777
0.7802 0.7041
0.9583 0.7696
1.1940 0.6362
1.3511 0.4092
1.4821 0.1751
1.5711 0.0042
</tableData>
</table>
</product>
</function> Then at the start of each training episode you simply use a random number generator to generate a value between 0.9 and 1.1 and then set |
Beta Was this translation helpful? Give feedback.
-
@Dobid how about creating a new discussion item as category "Show and tell" to document your RL-based auto-pilot development using JSBSim? I'd be interested in some more details and possibly also asking some questions about it. |
Beta Was this translation helpful? Give feedback.
-
Hello JSBSim Team,
I'm working on a RL-based autopilot for a UAV and I would need to sample random coefficient values let's say +/- 10% around the existing value and apply them at the start of each new training episode. This is for counteracting overfitting of my learned autopilot and to ease the transferability to a real UAV.
However from my knowledge of JSBSim, those values are statically defined in the fdm.xml file and the corresponding properties eg. aero/coefficient/CLalpha are read-only values (from what the
print_property_catalog()
function returns).Q: Is it possible to change those FDM coefs are runtime through python code ?
By the way, I'm using the python API of JSBSim v.1.13 installed through conda on a Ubuntu 20.04 computer.
Thanks !
Beta Was this translation helpful? Give feedback.
All reactions