Skip to content

Add a thrust vectoring python script example #1280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 22, 2025

Conversation

seanmcleod70
Copy link
Contributor

Based on a user asking how to make use of thrust vectoring in JSBSim in - #1279

Copy link

codecov bot commented May 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 24.76%. Comparing base (f794e04) to head (1d92d9d).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1280   +/-   ##
=======================================
  Coverage   24.76%   24.76%           
=======================================
  Files         169      169           
  Lines       19598    19598           
=======================================
  Hits         4854     4854           
  Misses      14744    14744           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bcoconni
Copy link
Member

Nice ! 👍

Your PR just made me realize that we are not advertising about the Python example scripts in README.md. May be you could take the opportunity of your PR to update README.md to point to examples/python where visitors could find some non trivial examples of what JSBSim is capable of using Python ?

@agodemar
Copy link
Contributor

@seanmcleod70 @bcoconni
If you agree, I can advertise the Python scripting feature of JSBSim on my LinkedIn account. I usually get a lot of impressions there on this kind of topic.

@seanmcleod70
Copy link
Contributor Author

I've pushed a commit with an update to the README.md. Feel free to edit it.

@agodemar no problem with you advertising these Python scripting examples on LinkedIn. But rather than just pointing to the README.md and/or source code in the repo I think the post would have more impact if you included the example output plots from some/all of the current Python examples.

@agodemar
Copy link
Contributor

@seanmcleod70 What about pointing to Jupyter notebooks that render the plots?

@seanmcleod70
Copy link
Contributor Author

Yep, one option is to convert the 4 samples from stand-alone Python scripts to Jupyter notebooks.

@agodemar
Copy link
Contributor

agodemar commented May 20, 2025

@seanmcleod70 Something along the line of these notebooks: https://github.com/agodemar/WiReS/tree/master/calc

But all made using the JSBSim interface to Python.

@seanmcleod70
Copy link
Contributor Author

Okay, I've converted all 4 standalone Python scripts to individual Jupyter notebooks. Easiest way to double-check them is to view the Jupyter notebooks via Github's automatic Jupyter notebook rendering by viewing them in my branch.

https://github.com/seanmcleod70/jsbsim/tree/ThrustVectoringExample/examples/python

I've done the bare minimum to turn them into Jupyter notebooks for now. We could later on make some of them interactive by using ipywidgets to allow a user to use a slider to select for example the airspeed etc. and have the graph update as the slider is moved etc.

The advantage of the Jupyter notebook approach is that users who don't have Python installed, or don't have matplotlib etc. installed can view the code and the generated output simply by viewing them via Github's automatic Jupyter notebook rendering, given there are saved versions of the matplotlib output in the notebooks.

@seanmcleod70
Copy link
Contributor Author

I've pushed another commit which stores the cached matplotlib plot outputs as SVG instead of PNG since the PNGs looked really 'fuzzy/soft'.

Take a look at the notebooks at - https://github.com/seanmcleod70/jsbsim/tree/ThrustVectoringExample/examples/python to see what the plot outputs look like now as SVG renderings.

So @agodemar when you post links now we'll have much better looking plots 😉

README.md Outdated

The [examples/python](https://github.com/JSBSim-Team/jsbsim/tree/master/examples/python) directory contains a number of example Python based scripts embedded in Jupyter notebooks demonstrating the use of JSBSim to determine and analyse aircraft performance.

- [AoA vs CAS.ipynb](https://github.com/JSBSim-Team/jsbsim/blob/master/examples/python/AoA%20vs%20CAS.ipynb) calculates and plots the AoA versus CAS for level trim for a range in aircraft weight, altitude and cg.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain the meaning of the acronyms (AoA = Angle of Attack, CAS=Calibrated Air Speed, cg=center of gravity, etc.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a commit spelling out the acronyms. I did sort of assume that users of JSBSim would know these already 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you, but I think we should avoid using acronyms and technical jargon, at least in the README file. Since it's our homepage, it shouldn't intimidate potential users who don't have an aeronautical background — I'm particularly thinking of game developers who might want to use JSBSim with the Unreal Engine.

Spell out acronyms for AoA, CAS and cg.
@bcoconni
Copy link
Member

Looks good to me.

@bcoconni bcoconni merged commit a1f43db into JSBSim-Team:master May 22, 2025
26 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants