Coder Social home page Coder Social logo

camurban / pterasoftware Goto Github PK

View Code? Open in Web Editor NEW
168.0 9.0 32.0 187.22 MB

Ptera Software is a fast, easy-to-use, and open-source software package for analyzing flapping-wing flight.

License: MIT License

Python 99.64% Inno Setup 0.36%
unmanned-aerial-vehicle ornithopter ornithology aerospace aerodynamics aerospace-engineering aeronautics computational-biology computational-fluid-dynamics vortex-lattice-method

pterasoftware's People

Contributors

camurban avatar zach10a avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pterasoftware's Issues

Workaround to Issue Installing WebP Package

As pointed out by @RaphZufferey via email, installing Ptera Software's WebP dependency can be problematic on Windows. @RaphZufferey came up with the following useful workaround:

  1. Download Visual Studio 2022 Community. Before installing, check the box to also install "Desktop development with C++" tools. The default installation options are okay.
  2. Run pip install conan in the local Windows Terminal.
  3. Run conan profile update "settings.compiler=Visual Studio" default in the local Windows Terminal.
  4. Run conan profile update "settings.compiler.version=14" default in the local Windows Terminal.
  5. If downloading the package via PyPI, run pip install pterasoftware in the local Windows Terminal. If you've forked or cloned the repository, instead run pip install -r requirments.txt.

This procedure worked for me while running PteraSoftware-2.0.0 on Windows 11.

I'll open a new issue on the WebP package's repository to see if this process can be automated during the package's installation.

Missing 2D Plots

Hi,
I was running the 'unsteady_ring_vortex_lattice_method_solver_variable_example' but I can't see any 2D force/moment graphs once the simulation ends. On the other hand, I'm allowed to save the animation in the 'example' folder pressing 'q' from the visualizer. Have you ever had any similar trouble? I checked all the necessary requirements and 'testing' is set to 'False' in the code. Thanks a lot, this is an incredibly useful tool!!

Testing

We should make sure that all the integration tests compare output against expected results. This means getting rid of all the "test_method_does_not_throw" tests.

We could also implement PyTests or some other methodology with a simpler syntax.

[BUG] No module named 'pterasoftware'

Bug Description

After installing PteraSoftware through pip, (as stated in the README), Python is unable to import it. Running import pterasoftware as ps raises an exception.

When looking in the packages listed in the virtual environment, there is not a folder for pterasoftware, only PteraSoftware-1.2.0.dist-info. This seems wrong.

Reproduction

Create a virtual environment and install PteraSoftware:

python -m venv .venv
".venv/scripts/activate"
pip install pterasoftware
python

Make sure you are using Python 3.8.

Python shell:

>>> import pterasoftware as ps
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pterasoftware'

Desktop

  • OS: Windows 10, build 20H2
  • Python version: 3.8.10

Additional Context

I have tested this on two different Windows machines, both with Pip directly and with Poetry. All have had the same issue.

[FEATURE]

When I ran "steady_horseshoe_vortex_lattice_method_solver_example",the result I got was different with yours.The streamlines was confusion and the pressures was wrong. When I ran "unsteady_ring_vortex_lattice_method_solver_variable_example",I got "SystemError: PyEval_EvalFrameEx returned a result with an error set".I could not get the same result which is in docs/examples.

[FEATURE]

Hi, Cam. Today I went through your geometry.py and operating_point.py and areodynamic.py. Then I succefully customizied Operating Points and geometry following the rules and get the aerodynamic result. But I met problem in the method of "Customizable Aircraft Geometry".

Problem Statement

In geometry.py, Wings can be defined as a collection of two or more wing cross sections of any dimensions and positions. And wing cross sections can be specified to match the mean camber line of an airfoil. In this way, the planform of wing is determined by a group of airfoils designer selected from the "Airfoil" file. It is good to divide into panel and run the solver.

However, I hope to define the Wings in a different way for more variations of shape. For example, wings is a curve like the insects' wing.

Proposed Solution

I tried to define the Wings directly. Such as, I input the wing planform which represented as a set of points(x,y), and set the wing thickness of wing as a constent number instead of a set of wing_cross_sections. Is that possible in Pterasoftware?

Unnecessary Dependencies

Codecov, Black, and Pre-commit, according to the README, are all required dependencies of PteraSoftware, even though these are only development tools and are not used during execution of software by a typical user.

In addition, I am uncertain if Codecov even possesses an open-source license, making its installation and usage ethically dubious for some.

Therefore, Codecov, Black, and Pre-commit should be removed as dependencies from the general pip package.

Separation Modeling

Hello Cam,

This is an awesome project. I was wondering at what flapping frequency do you expect the unsteady VLM solver to stop giving accurate results? Have you attempted any validation on the force outputs? I would imagine that at higher frequencies you'd need some leading edge vortex shedding to capture what is happening (but maybe not?!)

Morphing

Hello,

Would it be possible to implement wing morphing? Like this:

bendingandtwsting

If so how would one go about it?

Thanks

[BUG]

Hi Cam, I read your description of this project, it's cool, thanks for your work.
But I try to run your example codes several times and meet this bug.

Bug Description

  1. Go to 'example_solver = ps.steady_horseshoe_vortex_lattice_method.SteadyHorseshoeVortexLatticeMethodSolver(
    steady_problem=example_problem
    )

example_solver.run()'

  1. See error in SteadyHorseshoeVortexLatticeMethodSolver ---for airplane in self.airplanes :"'Airplane 'object is not iterable."
  2. I print its type is class which define in SteadyHorseshoeVortexLatticeMethodSolver. And try to add a metaclass iter but its not work.

Expected Behavior

Airplane 'object is iterable. and make this command run
example_solver = ps.steady_horseshoe_vortex_lattice_method.SteadyHorseshoeVortexLatticeMethodSolver(
steady_problem=example_problem
)

Screenshots

image

[BUG]

Hey there, when I run "unsteady_ring_vortex_lattice_method_solver_variable" in example, it shows:

Simulating: 1% |โ– | Elapsed: 00:01, Remaining: 01:59
Traceback (most recent call last):
File "D:/soft/PteraSoftware/examples/unsteady_ring_vortex_lattice_method_solver_variable.py", line 432, in
example_solver.run(
File "D:\soft\PteraSoftware\pterasoftware\unsteady_ring_vortex_lattice_method.py", line 456, in run
self.calculate_near_field_forces_and_moments()
File "D:\soft\PteraSoftware\pterasoftware\unsteady_ring_vortex_lattice_method.py", line 962, in calculate_near_field_forces_and_moments
self.calculate_solution_velocity(points=self.panel_front_vortex_centers)
File "D:\soft\PteraSoftware\pterasoftware\unsteady_ring_vortex_lattice_method.py", line 816, in calculate_solution_velocity
velocities_from_wings = aerodynamics.collapsed_velocities_from_ring_vortices(
ZeroDivisionError: division by zero

Process finished with exit code 1

Can you have me with that? Thanks a lot.

New release

Problem Statement

Preparing for the release of V1.0.0

Proposed Solution

I am currently compiling a .exe installer using Inno Setup and PyInstaller.

If you could give me the ability to provide releases this would be a very much streamlined process. Get in touch with me via this or my email if you have any questions, however I will try and provide relevant documentation in case you aren't able to give me this level of access.

I will update this when there is something relevant! Hope you are well.

Modeling UVLM for Flapping wing

Hi Cameron. I had a doubt. How do you model flapping in UVLM? Do you just give a roll-rate to the wings or do you also change the geometry of the wing as the dihedral changes? Your help will be greatly appreciated.
Thanks
Bharath

GUI or CLI

We should create a command-line interface or GUI.

Frontend development is not something I know well, so I'd love some help on this feature!

[INSTALLATION ISSUE]

Bug Description

I am getting dependency errors while installing PteraSoftware.

Reproduction

This is while installing Ptera using "pip install PteraSoftware"

Screenshots

ERROR: Cannot install -r requirements.txt (line 3) because these package versions have conflicting dependencies.

The conflict is caused by:
pyvista 0.36.1 depends on vtk
pyvista 0.36.0 depends on vtk<=9.2.0 and >=8.1.2; python_version < "3.10"
pyvista 0.35.2 depends on vtk
pyvista 0.35.1 depends on vtk
pyvista 0.34.2 depends on vtk
pyvista 0.34.1 depends on vtk

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Desktop

  • OS: Windows 10

[FEATURE] Add requirements_dev.txt

Problem Statement

Issue #3 saw the removal of development dependencies from the requirements.txt file. I agree with this decision, however, I do not agree with limiting their reference to only the README.

Proposed Solution

Instead, development dependencies should be added to a requirements_dev.txt file.

James Murphy from the YouTube channel mCoding did a great video about packages that goes over this very concept (and others). See how he adds the requirements_dev.txt here: https://youtu.be/DhUpxWjOhME?t=515.

Setup Video

We should create a setup tutorial video and link to it in the documentation. This should be geared toward a user who doesn't have Python, an IDE, or Ptera Software installed on their computer yet.

[BUG] Negative Spike in Lift Forces

Bug Description

Thank you for this great software. @RaphZufferey and I am using it currently to analyse flapping flight with UVLM to incorporate Aeroelasticity effects. I observed an initial Negative spike in Lift Force after plotting results from Ptera. This spike makes no physical sense for a flapping wing, so I was wondering if this is a numerical issue that could potentially be solved.

image

Reproduction

Running the provided example
with the addition of

ps.output.plot_results_versus_time(
    show=True,
    save=True,
)

will reproduce the above results

Expected Behavior

No spike in the lift coefficient is observed in the README.

Desktop

Please complete the following information.

  • OS: 'Windows 10 Home'
  • Version: '22H2'
  • PteraSoftware Version : I have forked the "develop" branch, the closest release would be 3.0.1

Additional Context

A similar issue was being discussed about a year ago here #17 . I am wondering if any resolution was achieved to the same or any work is in progress. I am open to picking up some work towards this issue as I have been making myself familiar with Ptera's UVLM solver.

[BUG]

Firstly, I think PteraSoftware is very useful for analyzing flapping wings.But when I ran the "steady_horseshoe_vortex_lattice_method_solver_example", I can not get the same result with yours. And when I ran "unsteady_ring_vortex_lattice_method_solver_static_example", I got some errors. I do not change your codes. I need your help.

Request: Conda Package Support

The Conda package manager allows easy installation of packages and, more importantly, independent environments for compartmentalization of dependencies. PteraSoftware could benefit greatly from the addition of a conda package, perhaps through conda-forge.

The PteraSoftware README recommends installing PteraSoftware through Anaconda, but only a pip package exists, even though Anaconda recommends against installing pip packages since these can create conflicts with the conda package manager.

Therefore, PteraSoftware should be released as a conda package, in addition to or as a replacement of its PyPi release.

Create Package Installer

Creation of a Package Installer

Users with no familiarity of Python or IDE's will be unable to use this software. A fully packaged installer created at this stage will save hassle down the line.

Proposed Solution

Use of PyInstaller and Inno Setup to create package installer.

[FEATURE] Aeroelasticity feedback for UVLM

Problem Statement

@RaphZufferey and I are working on a Flapping wing robot with flexible wings. Using PteraSoftware, we aim towards "closing the loop" in the UVLM solver by adding aeroelastic structural effects due to wing flexibility. We have a model that describes structural effects of the wing as wing torsion around the leading edge.
Currently, PteraSoftware predefines the movement of the wing cross-sections, wings and the airplane as a whole before the UVLM solver is called. The overall aim of our solver is to enable redefinition of the wing with dynamic movement parameters (such as wing twist) at every timestep. This will enhance the capabilities of PteraSoftware and introduce the potential framework for adding feedback loops within simulations.
Integrating this aeroelasticity solver in PteraSoftware this would require some changes to the current structuring of the "Movement" class, which would allow for the redefinition of wing movement at every timestep. We have implemented this change and would like to have an open discussion about whether this method seems feasible or if there are any other approaches currently being investigated.

Proposed Solution

We would like to add the Aeroelasticity Solver as another feature within the Unsteady Ring Vortex Lattice Solver. The deformation we are trying to express is a "Wing Cross-section Twist" that can be redefined at every timestep. To implement this, I have mirrored the existing logic of the "Movement" class in PteraSoftware. A short diagram explaining my implementation can be found below :
MovementChange

This solution is stable and convergent upto a certain extent. At large "twist" angles, the solver is unable to keep up with the sudden deformation. So we plan to further add a convergence layer to interpolate the twist till a stable solution is achieved. We will update you on our progress with the same.

To this end, I have created some bugs/issues in PteraSoftware regarding some force outputs that don't make physical sense, #27. I will like to actively work on this issue as well and am open to your ideas/suggestions on this implementation. I will be able to take on some work to implement the changes/additional features.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.