Trajectories2D
Trajectory2D
Bases: trajectory
Trajectory2D
Class dedicated to compute and represent trajectories in 2D.
Methods
- thermalize : Adds thermalization steps and random initial position.
- initial_position : Adds a trajectory with the given initial position.
- plot : Prepares the plots and computes the values. Returns the axis and the figure.
- add_slider : Adds a
Slider
for thedF
function. - _prepare_plot : Prepares the plots.
- _scatter_start_point : Scatter all the start points.
- _scatter_trajectory : Scatter all the trajectories.
- _plot_lines : Plots the lines of all the trajectories.
- _create_sliders_plot : Creates the sliders plot.
Source code in phaseportrait/Trajectories2D.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
__init__(dF, *, Range=None, dF_args={}, n_points=10000, runge_kutta_step=0.01, runge_kutta_freq=1, **kargs)
Creates an instance of Trjaectoy2D
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dF |
callable)
|
A |
required |
Range |
list, optional)
|
Ranges if the axis in the main plot, by default None |
None
|
dF_args |
dict, optional)
|
If necesary, must contain the kargs for the |
{}
|
n_points |
int, optional)
|
Maximum number of points to be calculated and represented, by default 10000 |
10000
|
runge_kutta_step |
float, optional)
|
Step of 'time' in the Runge-Kutta method, by default 0.01 |
0.01
|
runge_kutta_freq |
int, optional)
|
Number of times |
1
|
xlabel |
str, optional)
|
x label of the plot, by default 'X' |
required |
ylabel |
str, optional)
|
y label of the plot, by default 'Y' |
required |
Source code in phaseportrait/Trajectories2D.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|