Feature Request: Allow configurable access to trajectory_calc parameters #106
Replies: 6 comments
-
@serhiy-yevtushenko from py_ballisticcalc import trajectory_calc
trajectory_calc.cMinimumVelocity = 0 @dbookstaber |
Beta Was this translation helpful? Give feedback.
-
@serhiy-yevtushenko I work on more flexible concept of a TrajCalculator class to allow advanced users to define their's own logic of calculations for special cases, but the result will not be very soon, and besides it will add overhead costs |
Beta Was this translation helpful? Give feedback.
-
The problem is that the current # Time step is set to advance bullet calc_step distance along x axis
delta_time = self.calc_step / velocity_vector.x If you don't care about simulation speed and you don't simulate a scenario in which The correct approach is to use higher-order integration, like what I have implemented in the RK4 branch. However currently those implementations still require
|
Beta Was this translation helpful? Give feedback.
-
@serhiy-yevtushenko @dbookstaber For other calculation methods, such as the one provided in the RK4 branch, I can add the ability for the Calculator interface to set up a custom solver class. Then, you can inherit from TrajectoryCalc and implement custom calculation logic. Next, we will review what else needs to be done to adapt the code to support custom solvers and how to save it easily maintainable. Such an expansion of capabilities could become the next major release, so it will require discussion and suggestions |
Beta Was this translation helpful? Give feedback.
-
I think the issue topic request is satisfied in #104, you have the ability to configure the Calculator now. |
Beta Was this translation helpful? Give feedback.
-
This is an interesting issue! The problem with the simulation being aborted when using high launch angles seems to stem from the cMinimumVelocity threshold. By allowing it to be set to zero, it could help simulate lofted trajectories to the end, as you've suggested. This change could be very beneficial for those of us working with ballistic calculators in optimization algorithms, where we need more predictable and consistent results. For anyone facing similar challenges, the full explanation and code in this article may be helpful: Python Calculator Guide. |
Beta Was this translation helpful? Give feedback.
-
Use case:
Simulating shots with high launch angles (close to 90 degrees)
The constanct cMinimumVelocity is set to 50 in trajectory_calc.
However, in case, when one would like to simulate shots with high launch angles, the limitation of cMinimumVelocity to 50 leads to simulation being aborted in the following line in trajectory_calc:
For lofted trajectories this may lead to the situation, that shot is simulated till reaching some high point, and then simulation is aborted, and the descending branch is not being simulated.
Having the ability to set cMinimumVelocity to zero would allow simulating shot to the end.
Possible changes include:
Example demonstrating issue:
In the first case, the whole trajectory till hitting ground is getting simulated, in the second case the simulation is being stopped in the middle. Such unpredictable behaviour makes it hard to use ballistic calculator inside optimization/root finding algorithm (like in scipy or similar)
Beta Was this translation helpful? Give feedback.
All reactions