Simulation Functions¶
- finds.simulation.perform_simulation(initial_state, end_time, *, use_barnes_hut=False, bh_ratio=None, integration_method='RK45', rtol=1e-06, atol=1e-08, time_step=0.01, print_time_progression=False, print_each_fish=False, print_file_output=True)¶
Performs the simulation using Runge-Kutta fourth-order, then optionally saves the path information for each state to a datafile and produces an animation.
- Parameters:
initial_state (NDArray) – The initial system state, \(\mathbf{X}(t=0)\).
end_time (float) – The time to stop the simulation at.
- Parameters:
use_barnes_hut (bool) – Whether or not to simplify with Barnes-Hut approximation.
bh_ratio (float) – The Barnes-Hut maximum ratio \(\theta\) for which to compute the interactions using clustered nodes.
integration_method ('RK45' | 'RK23' | 'DOP853' | 'Radau' | 'BDF' | 'LSODA') – The integration method to use. View scipy’s solve_ivp documentation for exact details.
rtol (float) – The relative tolerance for the integrator.
atol (float) – The absolute tolerance for the integrator.
time_step (float) – The time step for the simulation. This is purely cosmetic, and determines what times to return for the simulation (but not what the times actually calculated are). It essentially allows for a fixed FPS on the resulting animation. Error is controlled with rtol and atol
print_time_progression (bool) – Whether or not to show the time progression progress bar for the integration.
print_each_fish (bool) – Whether or not to show the progress of each fish interaction calculation (for Barnes-Hut computations only).
print_file_output (bool) – Whether or not to print the location of the produced file.
- Returns:
The path of the testing output directory.
- Return type:
Path