Comments (6)
This is implemented in pull request #50
from py-ballisticcalc.
I implemented constant time-step calculation here: https://github.com/dbookstaber/py_ballistics/blob/time-step/py_ballisticcalc/trajectory_calc.py
However it looks like it will always take more iterations than the current method to achieve any particular level of precision, so I do not recommend pursuing this.
from py-ballisticcalc.
but in addition to the number of iterations, it is necessary to take into account the time for performing the calculation, it may turn out that due to a decrease in the number of calculations, the number of iterations can be increased without losing performance
we have to make a profiling and performance comparing
u can use timeit
built-in module to got time some function are executing
from py-ballisticcalc.
By "iterations" I meant the number of passes through the #region Trajectory Loop
to calculate any particular trajectory. (This is without regard to the zero-finding logic.)
I think the current method of setting the time step based on the velocity is optimal. Any other approach will create excess precision at some points and lower precision at others.
from py-ballisticcalc.
To improve efficiency, JBM recommends switching from this simple integration approach to something like RK4, which is what he uses.
from py-ballisticcalc.
I implemented RK4 integration in this branch. It is more robust than the Euler implementation we are running, meaning that as step_size increases errors grow more slowly. However on the example I studied it's not like orders of magnitude better.
This provides a foundation for some desirable improvements, including:
- Adaptive step_size
- I included two different RK4 implementations, one using
time
and the other usingrange.x
as the independent variable. The latter (CalcMethod.RK_dx
) version could particularly benefitTrajectoryCalc.zero_angle
since, as long aszero_distance % step_size == 0
then it will end exactly at the distance of interest.
from py-ballisticcalc.
Related Issues (18)
- Zero given elevation unittests fails
- Update the library to python 3.12
- Add an optional pure or cython based package installation
- Create a full readable documentation
- Update the README.md for the packages HOT 2
- Add optional backend for optimized calculations using pandas, numpy, etc
- Add the metods to take in account on other target's altitude onto plot HOT 4
- Refactor the unit.py module to make it simplier and flexible HOT 2
- Add optional support of the Coriolis force
- Test cases for wind and cant HOT 1
- until_distance() in _trajectory() have to be replaced with until_distance, cause of property
- Refactoring to got a calculation of adjustment relative to sight zero line HOT 3
- Units features HOT 1
- Enforce sort order for winds HOT 5
- MultiBC not working with TrajectoryCalc HOT 3
- Commandline and TOML interfaces
- Can't instantiate Weapon with itself HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py-ballisticcalc.