scimba_torch.flows.create_solution¶
Create solutions using various ODE integrators.
Functions
|
Create a solution using the specified solver. |
|
Convert solution data to training format based on the solver used. |
- create_solution(x0, mu, m, dt, f, solver='RK4')[source]¶
Create a solution using the specified solver.
- Parameters:
x0 (
Tensor) – initial condition,mu (
Tensor) – parameter of the equation,m (
int) – number of time steps,dt (
float) – time step,f (
list[Callable]) – list of functions defining the ODE,solver (
str) – the solver to use (default: “RK4”).
- Returns:
- A tuple of tensors (t, mu, res) where:
t: time steps,
mu: parameters repeated for each time step,
res: solution at each time step.
The solution tensor res.
- Return type:
A tuple containing
- solution_to_training_format(data, solver='RK4')[source]¶
Convert solution data to training format based on the solver used.
- Parameters:
data (
Tensor) – The solution tensor to be converted.solver (
str) – The solver used to generate the solution (default: “RK4”).
- Return type:
Tensor- Returns:
The reshaped solution tensor suitable for training.