Knapp.RungeKutta
1.0.0
dotnet add package Knapp.RungeKutta --version 1.0.0
NuGet\Install-Package Knapp.RungeKutta -Version 1.0.0
<PackageReference Include="Knapp.RungeKutta" Version="1.0.0" />
paket add Knapp.RungeKutta --version 1.0.0
#r "nuget: Knapp.RungeKutta, 1.0.0"
// Install Knapp.RungeKutta as a Cake Addin
#addin nuget:?package=Knapp.RungeKutta&version=1.0.0
// Install Knapp.RungeKutta as a Cake Tool
#tool nuget:?package=Knapp.RungeKutta&version=1.0.0
Knapp RungeKutta API
The Knapp.RungeKutta
namespace provides a Solver
Runge-Kutta order 4 method for solving numerical integration problems. It can be used to solve various mathematical models and simulations.
Solver Class
The Solver
class provides a Runge-Kutta order 4 method for solving numerical integration problems. It can be used to solve various mathematical models and simulations.
Example: Bomb Trajectory
To solve a bomb trajectory, you can follow these steps:
- Create a delegate method that represents the derivative function. This method should take the current time
t
, an array of state variablesX
, and an optional array of additional parametersextras
. It should return an array representing the derivative of each state variable at the given time.
public double[] BombTrajectoryDerivative(double t, double[] X, object[] extras)
{
// Implementation of the derivative function for bomb trajectory
// Calculate and return the derivatives of the state variables
}
- Create a delegate method that represents the break condition. This method should take an array of state variables
X
and return a boolean indicating whether the break condition is met (e.g., bomb hits the ground).
public bool BombTrajectoryBreakCondition(double[] X)
{
// Implementation of the break condition for bomb trajectory
// Check if the bomb hits the ground or any other breaking condition
}
- Use the
Solver.Solve
method to solve the bomb trajectory problem. Pass the initial time t0, initial conditionsX0
as an array of state variables, the time stepdt
, the maximum number of steps steps, the derivative delegatebombTrajectoryDerivative
, and the break delegatebombTrajectoryBreakCondition
. Optionally, you can provide an array of additional parameters extras if required.
// Solve bomb trajectory.
double t0 = 0; // initial time
double[] X0 = new double[] { x0, y0, vx0, vy0 }; // initial conditions
double dt = 0.1; // time step
int steps = 1000; // max number of steps
(double[] T, double[][] X) result = Solver.Solve(t0, X0, dt, steps, BombTrajectoryDerivative, BombTrajectoryBreakCondition);
double[] weaponT = result.T; // array of time values
double[][] weaponXf = result.X; // array of state variable arrays
// Use the results for further analysis or visualization
In the above example, x0
, y0
, vx0
, and vy0
represent the initial position, initial velocity components in the x and y directions, respectively.
The Solver.Solve
method returns a tuple containing two arrays: T
and X
. The T
array contains the time values at each step, and the X
array contains the state variable arrays at each step.
Feel free to customize the example according to your specific use case. Make sure to import the Knapp.RungeKutta
namespace and include any necessary dependencies for the bomb trajectory problem.
Note: The example provided above is a simplified illustration of the usage of the Solver
class. Make sure to adapt it to your specific problem and customize the derivative and break condition methods accordingly.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 153 | 7/9/2023 |