|
From: James G. <jam...@gm...> - 2013-03-09 22:30:31
|
Thanks for all the feedback and help with spotting bugs Adam! The trim is
failing because I modified JSBSim to throw an exception when trim fails and
I use this in my solver. You will need to use my branch to get the bada
generation working.
On Mar 8, 2013 7:07 PM, "Adam Dershowitz" <ade...@ex...> wrote:
> I made some progress with bada, and I thought I would let you know.
> To solve the problem that I mentioned earlier, it seems that python
> doesn't like having default values for the print format. Perhaps we are
> using different versions of python? I am using 2.6.
> So making changes to the print statements from this:
> print "flight level: {}\n".format(fl)
>
> To this:
> print "flight level: {0}\n".format(fl)
>
> Allows it run fine. Similar change in bada.py: line 219,234, line
> 246-247,259 and also in line 35 of 737_bada_gen.py.
>
> But, I now get a trim failure:
>
> python ../pyjsbsim_examples/737_bada_gen.py
> Property aero/qbar-psf is already defined.
> Property attitude/phi-rad is already defined.
> Property position/h-sl-ft is already defined.
> Property velocities/vc-kts is already defined.
> Property fcs/throttle-cmd-norm is already defined.
> Property fcs/elevator-pos-norm is already defined.
> ==================================
> flight level: 0
>
> ==================================
> ic/h-agl-ft : 10.0
> ic/vc-kts : 249.996314625
> ic/vt-kts : 250.033266007
> Trim Results:
> Angle of Attack: 1 wdot: 7.55e-04 Tolerance: 1e-03 Passed
> Throttle: 0.57 udot: 7.56e-04 Tolerance: 1e-03 Passed
> Pitch Trim: 0.12 qdot: -1.75e-10 Tolerance: 1e-04 Passed
> Cruise trim failed!
> No valid flight levels
>
>
>
> I also had to manually copy files/bada_ptf.template because pip didn't
> install it.
>
> --Adam
>
>
>
>
> On 3/7/13 2:05 PM, "James Goppert" <jam...@gm...> wrote:
>
> >Here is a quick start at your question:
> >
> >Dependencies are Cython > 0.18, NumPy.
> >
> >The easiest way to install everything is:
> >
> >pip install PyJSBSim
> >(of course this requires that you install pip first)
> >
> >I have it generating BADA files now, see attached for a 737 bada file
> >that was produced. This still needs some work probably. But it is a
> >great way to see how JSBSim compares with real flight data!
> >
> >Here is a short example with plotting:
> >
> >from pyjsbsim import FGFDMExec
> >from pylab import *
> >
> ># load
> >fdm = FGFDMExec(debug_level=0)
> >fdm.load_model("f16")
> >
> ># trim
> >fdm.set_property_value("ic/h-agl-ft",1000)
> >fdm.set_property_value("ic/vc-kts",400)
> >fdm.set_property_value("ic/gamma-deg",0)
> >fdm.do_trim(0)
> >
> ># simulate
> >(t,y) = fdm.simulate(
> > t_final=10,
> > dt=0.1,
> > record_properties=["position/h-agl-ft", "attitude/theta-deg"])
> >
> ># plot
> >title("test")
> >xlabel("t, sec")
> >ylabel("h-agl, ft")
> >plot(t,y["position/h-agl-ft"])
> >show()
> >
> >-James
> >
> >On Mon, Mar 4, 2013 at 4:46 PM, Agostino De Marco <ago...@un...>
> >wrote:
> >> Hey James,
> >> this looks really interesting. I've looked into the
> >> 737_trim.py where you call many times the simplex trim function.
> >>
> >> It would be cool if we could write some tips to get started
> >> with this work environment.
> >> Like:
> >> How to setup the python environment and which are the
> >> suggested additional packages to install (such as numpy).
> >> How to start a simulation from Python.
> >> How can time histories be plotted (e.g. matplotlib).
> >>
> >> It would be nice to add these new features to the JSBSim manual.
> >>
> >> Agostino
> >>
> >>
> >>
> >>
> >> James Goppert <jam...@gm...> ha scritto:
> >>
> >>> This is now functional. I am using it to generate BADA tables for
> >>> aircraft modeled in JSBSim. There is an example script in
> >>> scripts/737_trim.py
> >>>
> >>> I have interfaced all of the FGFDMExec class. You can do about
> >>> anything using the set/get property functions, so not really a need to
> >>> interface the rests of the classes, also will keep maintenance
> >>> requirements low.
> >>>
> >>> -James
> >>>
> >>> On Sat, Mar 2, 2013 at 5:16 PM, James Goppert
> >>> <jam...@gm...> wrote:
> >>>> I'm working on interfacing JSBSim with Cython. I looked at the
> >>>> existing python jsbsim wrapper, but it seemed to be out of date. Also
> >>>> cython seems to be much faster.
> >>>>
> >>>> https://pypi.python.org/pypi/PyJSBSim
> >>>>
> >>>> -James
> >>>
> >>>
> >>>------------------------------------------------------------------------
> >>>------
> >>> Everyone hates slow websites. So do we.
> >>> Make your web apps faster with AppDynamics
> >>> Download AppDynamics Lite for free today:
> >>> http://p.sf.net/sfu/appdyn_d2d_feb
> >>> _______________________________________________
> >>> Jsbsim-devel mailing list
> >>> Jsb...@li...
> >>> https://lists.sourceforge.net/lists/listinfo/jsbsim-devel
> >>> _______________________________________________
> >>> The JSBSim Flight Dynamics Model project
> >>> http://www.JSBSim.org
> >>> _______________________________________________
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >> -------------------------------------------------------
> >> Agostino De Marco, PhD
> >>
> >> Assistant Professor
> >>
> >> Università degli Studi di Napoli Federico II
> >>
> >> Dipartimento di Ingegneria Industriale - Sezione Aerospaziale
> >>
> >> Aircraft Design & AeroFlightDynamics Group (ADAG)
> >>
> >> ** University of Naples Federico II
> >> ** Industrial Engineering Department
> >> ** Aircraft Design & AeroFlightDynamics Group
> >>
> >> via Claudio 21, 80125 Napoli - Italy
> >> Tel.: +39 0817683323
> >> Fax: +39 0817683622
> >> Email: ago...@un...
> >> Web 1: www.dii.unina.it
> >> Web 2: www.adag.unina.it
> >> Web 3: www.eolpowergroup.com
> >> -------------------------------------------------------
> >>
> >>
> >>
> >>-------------------------------------------------------------------------
> >>-----
> >> Everyone hates slow websites. So do we.
> >> Make your web apps faster with AppDynamics
> >> Download AppDynamics Lite for free today:
> >> http://p.sf.net/sfu/appdyn_d2d_feb
> >> _______________________________________________
> >> Jsbsim-devel mailing list
> >> Jsb...@li...
> >> https://lists.sourceforge.net/lists/listinfo/jsbsim-devel
> >> _______________________________________________
> >> The JSBSim Flight Dynamics Model project
> >> http://www.JSBSim.org
> >> _______________________________________________
> >>
>
>
>
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> endpoint security space. For insight on selecting the right partner to
> tackle endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
> _______________________________________________
> Jsbsim-devel mailing list
> Jsb...@li...
> https://lists.sourceforge.net/lists/listinfo/jsbsim-devel
> _______________________________________________
> The JSBSim Flight Dynamics Model project
> http://www.JSBSim.org
> _______________________________________________
>
>
|