![]() ![]() ![]() ![]() For this particular system we could actually build a function that does not take the parameter t but I include it because it can be useful if you want to add discontinuities that depend on t. So why can we ignore t here? The answer is that our numerical integrator will keep track of t for us. The amount of change certainly depends on the amount of time. The fact that the variable t does not show up in any of these equations is a common point of confusion. This is followed by the three differential equations that described the dynamic changes of the state variables. Inside the lorenz function, the first thing we do is to unpack the state into the three state variables. Our state object has to be a sequence with an order that reflects this. Most importantly, the first parameter must be the state of the system.The state of the Lorenz system is defined by three variables: x, y, z. This function needs a specific call signature ( lorenz(state, t, sigma, beta, rho)) because we will later pass it to odeint which expects specific parameters in specific places. It consists of three differential equations that we fit into one function called lorenz. After that we define the system of differential equations that defines our Lorenz system. Matplotlib will be used to plot the result of our simulation. Of course we need NumPy and odeint is imported from scipy.integrat. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |