Ordinary Differential Equations Exercise 1

Imports


In [2]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
from IPython.html.widgets import interact, fixed


:0: FutureWarning: IPython widgets are experimental and may change in the future.

Lorenz system

The Lorenz system is one of the earliest studied examples of a system of differential equations that exhibits chaotic behavior, such as bifurcations, attractors, and sensitive dependence on initial conditions. The differential equations read:

$$ \frac{dx}{dt} = \sigma(y-x) $$$$ \frac{dy}{dt} = x(\rho-z) - y $$$$ \frac{dz}{dt} = xy - \beta z $$

The solution vector is $[x(t),y(t),z(t)]$ and $\sigma$, $\rho$, and $\beta$ are parameters that govern the behavior of the solutions.

Write a function lorenz_derivs that works with scipy.integrate.odeint and computes the derivatives for this system.


In [3]:
def lorentz_derivs(yvec, t, sigma, rho, beta):
    """Compute the the derivatives for the Lorentz system at yvec(t)."""
    d1 = sigma * (yvec[1] - yvec[0])
    d2 = yvec[0] * (rho - yvec[2]) - yvec[1]
    d3 = yvec[0] * yvec[1] - beta * yvec[2]
    
    return(d1, d2, d3)
    
    #raise NotImplementedError()

In [4]:
assert np.allclose(lorentz_derivs((1,1,1),0, 1.0, 1.0, 2.0),[0.0,-1.0,-1.0])

Write a function solve_lorenz that solves the Lorenz system above for a particular initial condition $[x(0),y(0),z(0)]$. Your function should return a tuple of the solution array and time array.


In [14]:
def solve_lorentz(ic, max_time=4.0, sigma=10.0, rho=28.0, beta=8.0/3.0):
    """Solve the Lorenz system for a single initial condition.
    
    Parameters
    ----------
    ic : array, list, tuple
        Initial conditions [x,y,z].
    max_time: float
        The max time to use. Integrate with 250 points per time unit.
    sigma, rho, beta: float
        Parameters of the differential equation.
        
    Returns
    -------
    soln : np.ndarray
        The array of the solution. Each row will be the solution vector at that time.
    t : np.ndarray
        The array of time points used.
    
    """
    t = np.linspace(0.0, max_time, 250 * max_time)
    soln = odeint(lorentz_derivs, ic, t, (sigma, rho, beta))
    return(soln, t)
    #raise NotImplementedError()

In [19]:
res = solve_lorentz((.5, .5, .5))
soln = res[0]
soln[:,0]


Out[19]:
array([  0.5       ,   0.50104714,   0.50413271,   0.50918206,
         0.51613188,   0.5249295 ,   0.53553224,   0.54790666,
         0.56202822,   0.57788068,   0.59545569,   0.61475244,
         0.63577731,   0.65854356,   0.68307115,   0.70938647,
         0.7375222 ,   0.76751717,   0.79941623,   0.83327017,
         0.86913567,   0.90707528,   0.94715739,   0.98945627,
         1.03405206,   1.08103088,   1.13048485,   1.18251222,
         1.23721744,   1.2947113 ,   1.35511106,   1.41854058,
         1.4851305 ,   1.55501837,   1.62834885,   1.7052739 ,
         1.78595291,   1.87055295,   1.95924891,   2.05222369,
         2.14966841,   2.25178251,   2.35877398,   2.4708594 ,
         2.58826416,   2.71122241,   2.83997721,   2.97478044,
         3.11589278,   3.26358354,   3.41813045,   3.57981938,
         3.74894386,   3.92580456,   4.11070858,   4.30396853,
         4.50590151,   4.7168277 ,   4.93706882,   5.16694628,
         5.40677889,   5.65688028,   5.91755584,   6.18909919,
         6.47178811,   6.76587987,   7.07160596,   7.38916598,
         7.71872094,   8.06038559,   8.41421994,   8.78021992,
         9.15830699,   9.54831697,   9.94998781,  10.36294662,
        10.78669588,  11.22059902,  11.66386566,  12.1155366 ,
        12.57446912,  13.03932287,  13.50854689,  13.98036849,
        14.45278457,  14.9235561 ,  15.39020705,  15.8500278 ,
        16.30008479,  16.73723669,  17.15815796,  17.55937028,
        17.93728223,  18.28823692,  18.60856748,  18.89465914,
        19.14301689,  19.35033668,  19.51357805,  19.63003558,
        19.69740648,  19.71385125,  19.67804507,  19.58921707,
        19.44717598,  19.25232034,  19.00563344,  18.70866222,
        18.36348199,  17.97264792,  17.53913599,  17.06627571,
        16.55767761,  16.01715829,  15.4486658 ,  14.85620774,
        14.24378424,  13.61532738,  12.97464824,  12.32539224,
        11.671003  ,  11.01469464,  10.35943211,   9.7079189 ,
         9.06259128,   8.42561819,   7.7989062 ,   7.18410789,
         6.58263354,   5.99566503,   5.42417124,   4.86892436,
         4.33051664,   3.80937722,   3.30578856,   2.81990234,
         2.35175457,   1.90127984,   1.46832461,   1.0526594 ,
         0.65399006,   0.27196796,  -0.09380079,  -0.44374702,
        -0.77833117,  -1.09803664,  -1.40336405,  -1.69482608,
        -1.97294308,  -2.23823911,  -2.49123868,  -2.73246378,
        -2.9624315 ,  -3.1816519 ,  -3.39062629,  -3.58984577,
        -3.77979004,  -3.96092643,  -4.13370915,  -4.29857869,
        -4.45596138,  -4.60626911,  -4.74989911,  -4.88723386,
        -5.01864108,  -5.14447381,  -5.26507051,  -5.38075519,
        -5.49183768,  -5.59861386,  -5.70136591,  -5.80036261,
        -5.89585966,  -5.98810001,  -6.07731413,  -6.16372045,
        -6.2475256 ,  -6.32892482,  -6.40810224,  -6.48523127,
        -6.56047491,  -6.63398604,  -6.70590782,  -6.77637391,
        -6.84550882,  -6.91342822,  -6.98023919,  -7.04604049,
        -7.11092289,  -7.17496935,  -7.23825533,  -7.300849  ,
        -7.36281148,  -7.42419706,  -7.48505345,  -7.54542194,
        -7.60533762,  -7.66482963,  -7.72392126,  -7.78263023,
        -7.84096879,  -7.89894397,  -7.95655773,  -8.01380711,
        -8.07068445,  -8.12717753,  -8.18326977,  -8.23894036,
        -8.2941645 ,  -8.34891352,  -8.40315508,  -8.45685337,
        -8.50996928,  -8.5624606 ,  -8.6142822 ,  -8.66538627,
        -8.71572247,  -8.76523821,  -8.81387884,  -8.86158785,
        -8.90830716,  -8.95397731,  -8.99853775,  -9.04192704,
        -9.08408316,  -9.12494373,  -9.16444633,  -9.2025287 ,
        -9.23912908,  -9.27418647,  -9.30764087,  -9.33943362,
        -9.36950764,  -9.3978077 ,  -9.42428074,  -9.44887607,
        -9.47154571,  -9.49224458,  -9.51093078,  -9.52756583,
        -9.54211487,  -9.5545469 ,  -9.56483494,  -9.57295626,
        -9.57889249,  -9.58262983,  -9.5841591 ,  -9.58347591,
        -9.58058072,  -9.57547889,  -9.56818076,  -9.55870162,
        -9.54706175,  -9.53328638,  -9.51740562,  -9.49945441,
        -9.47947245,  -9.45750402,  -9.43359793,  -9.40780728,
        -9.38018937,  -9.35080545,  -9.31972056,  -9.28700329,
        -9.25272554,  -9.21696231,  -9.17979142,  -9.14129328,
        -9.10155059,  -9.06064811,  -9.01867236,  -8.97571136,
        -8.93185434,  -8.88719153,  -8.8418138 ,  -8.79581247,
        -8.74927905,  -8.70230493,  -8.65498124,  -8.60739851,
        -8.55964654,  -8.51181415,  -8.46398899,  -8.41625733,
        -8.36870392,  -8.32141183,  -8.27446229,  -8.22793454,
        -8.18190573,  -8.13645082,  -8.09164245,  -8.04755091,
        -8.00424399,  -7.96178701,  -7.92024269,  -7.87967119,
        -7.84013001,  -7.80167402,  -7.76435544,  -7.72822383,
        -7.69332612,  -7.65970657,  -7.62740689,  -7.59646616,
        -7.56692093,  -7.53880525,  -7.51215067,  -7.48698634,
        -7.46333902,  -7.44123313,  -7.42069084,  -7.40173208,
        -7.38437459,  -7.36863402,  -7.35452395,  -7.34205591,
        -7.3312395 ,  -7.3220824 ,  -7.31459043,  -7.30876757,
        -7.30461605,  -7.30213635,  -7.30132725,  -7.30218589,
        -7.30470775,  -7.30888675,  -7.3147152 ,  -7.32218389,
        -7.33128206,  -7.34199743,  -7.35431622,  -7.36822318,
        -7.38370152,  -7.40073299,  -7.41929786,  -7.43937486,
        -7.46094127,  -7.4839728 ,  -7.50844367,  -7.53432653,
        -7.56159248,  -7.59021103,  -7.62015009,  -7.65137591,
        -7.68385311,  -7.71754463,  -7.75241168,  -7.78841375,
        -7.82550857,  -7.86365208,  -7.9027984 ,  -7.94289984,
        -7.98390684,  -8.02576797,  -8.06842994,  -8.11183755,
        -8.15593369,  -8.20065937,  -8.24595371,  -8.29175394,
        -8.33799544,  -8.38461174,  -8.43153458,  -8.47869391,
        -8.52601802,  -8.5734335 ,  -8.6208654 ,  -8.66823724,
        -8.71547116,  -8.76248799,  -8.80920737,  -8.85554787,
        -8.90142717,  -8.94676213,  -8.99146905,  -9.03546378,
        -9.0786619 ,  -9.12097895,  -9.16233064,  -9.20263305,
        -9.24180283,  -9.2797575 ,  -9.31641567,  -9.35169726,
        -9.3855238 ,  -9.41781865,  -9.44850735,  -9.47751775,
        -9.5047804 ,  -9.53022877,  -9.55379952,  -9.57543273,
        -9.59507219,  -9.61266564,  -9.62816499,  -9.64152653,
        -9.65271119,  -9.66168468,  -9.66841769,  -9.67288606,
        -9.6750709 ,  -9.67495873,  -9.67254155,  -9.66781694,
        -9.6607881 ,  -9.65146389,  -9.63985881,  -9.62599299,
        -9.60989216,  -9.59158754,  -9.57111575,  -9.54851875,
        -9.5238436 ,  -9.49714239,  -9.46847198,  -9.43789384,
        -9.40547381,  -9.37128187,  -9.33539187,  -9.29788128,
        -9.2588309 ,  -9.21832458,  -9.17644891,  -9.13329296,
        -9.08894789,  -9.04350675,  -8.99706411,  -8.94971575,
        -8.90155839,  -8.85268937,  -8.8032064 ,  -8.75320722,
        -8.70278936,  -8.65204989,  -8.60108515,  -8.54999051,
        -8.49886017,  -8.44778691,  -8.39686194,  -8.34617466,
        -8.29581255,  -8.24586099,  -8.19640309,  -8.14751965,
        -8.09928895,  -8.05178674,  -8.00508611,  -7.95925744,
        -7.91436835,  -7.87048363,  -7.82766525,  -7.78597232,
        -7.74546108,  -7.70618488,  -7.66819426,  -7.63153688,
        -7.59625761,  -7.56239853,  -7.52999898,  -7.49909559,
        -7.46972237,  -7.44191068,  -7.4156894 ,  -7.39108488,
        -7.36812106,  -7.34681951,  -7.32719951,  -7.30927808,
        -7.29307008,  -7.27858825,  -7.26584325,  -7.25484378,
        -7.24559657,  -7.23810647,  -7.23237649,  -7.22840786,
        -7.22620007,  -7.22575089,  -7.22705645,  -7.23011126,
        -7.2349082 ,  -7.24143862,  -7.2496923 ,  -7.25965751,
        -7.27132102,  -7.28466806,  -7.29968241,  -7.31634635,
        -7.33464065,  -7.3545446 ,  -7.376036  ,  -7.39909111,
        -7.42368467,  -7.44978987,  -7.47737833,  -7.50642007,
        -7.53688348,  -7.56873533,  -7.60194066,  -7.63646284,
        -7.67226345,  -7.70930232,  -7.74753747,  -7.78692502,
        -7.82741926,  -7.86897255,  -7.91153527,  -7.95505587,
        -7.99948078,  -8.0447544 ,  -8.0908191 ,  -8.13761521,
        -8.18508098,  -8.2331526 ,  -8.28176422,  -8.33084793,
        -8.38033379,  -8.43014989,  -8.48022235,  -8.53047538,
        -8.58083137,  -8.6312109 ,  -8.68153286,  -8.73171457,
        -8.78167183,  -8.83131906,  -8.88056947,  -8.92933517,
        -8.97752732,  -9.02505632,  -9.07183204,  -9.11776395,
        -9.16276136,  -9.20673366,  -9.24959058,  -9.29124237,
        -9.33160012,  -9.37057602,  -9.40808361,  -9.44403811,
        -9.47835666,  -9.51095868,  -9.5417661 ,  -9.5707037 ,
        -9.59769936,  -9.62268445,  -9.64559404,  -9.66636719,
        -9.68494724,  -9.70128209,  -9.71532441,  -9.7270319 ,
        -9.73636753,  -9.74329968,  -9.74780235,  -9.74985535,
        -9.74944438,  -9.74656116,  -9.74120352,  -9.73337545,
        -9.72308712,  -9.71035488,  -9.69520126,  -9.67765488,
        -9.65775036,  -9.63552827,  -9.61103491,  -9.58432221,
        -9.5554475 ,  -9.52447334,  -9.49146722,  -9.4565014 ,
        -9.41965255,  -9.38100152,  -9.340633  ,  -9.29863524,
        -9.2550997 ,  -9.21012075,  -9.16379528,  -9.11622241,
        -9.06750312,  -9.01773994,  -8.96703657,  -8.91549759,
        -8.86322808,  -8.81033337,  -8.75691869,  -8.70308886,
        -8.64894806,  -8.5945995 ,  -8.54014521,  -8.48568577,
        -8.43132008,  -8.3771452 ,  -8.32325609,  -8.26974548,
        -8.21670372,  -8.16421859,  -8.11237522,  -8.06125596,
        -8.0109403 ,  -7.96150479,  -7.91302294,  -7.86556526,
        -7.81919912,  -7.77398881,  -7.72999549,  -7.68727719,
        -7.64588885,  -7.60588232,  -7.56730639,  -7.53020683,
        -7.49462643,  -7.46060507,  -7.42817976,  -7.3973847 ,
        -7.36825135,  -7.34080848,  -7.3150823 ,  -7.29109644,
        -7.2688721 ,  -7.24842807,  -7.22978084,  -7.21294467,
        -7.19793162,  -7.18475166,  -7.17341272,  -7.16392076,
        -7.15627984,  -7.15049214,  -7.14655807,  -7.14447628,
        -7.14424372,  -7.14585567,  -7.14930581,  -7.15458622,
        -7.16168744,  -7.17059845,  -7.18130675,  -7.19379832,
        -7.20805766,  -7.22406779,  -7.24181024,  -7.26126509,
        -7.2824109 ,  -7.30522472,  -7.32968211,  -7.35575707,
        -7.38342205,  -7.41264789,  -7.44340384,  -7.47565746,
        -7.50937465,  -7.54451956,  -7.58105458,  -7.6189403 ,
        -7.65813544,  -7.69859682,  -7.74027933,  -7.78313588,
        -7.82711734,  -7.87217253,  -7.91824816,  -7.9652888 ,
        -8.01323684,  -8.06203248,  -8.1116137 ,  -8.16191624,
        -8.21287359,  -8.26441699,  -8.31647544,  -8.36897567,
        -8.42184223,  -8.4749975 ,  -8.5283617 ,  -8.58185297,
        -8.63538744,  -8.68887934,  -8.74224102,  -8.79538313,
        -8.8482147 ,  -8.90064331,  -8.95257521,  -9.00391553,
        -9.05456841,  -9.10443727,  -9.15342498,  -9.20143409,
        -9.24836708,  -9.29412664,  -9.33861593,  -9.38173888,
        -9.42340042,  -9.4635069 ,  -9.50196631,  -9.53868867,
        -9.57358629,  -9.60657416,  -9.63757027,  -9.66649593,
        -9.69327612,  -9.71783976,  -9.74012013,  -9.76005511,
        -9.77758746,  -9.79266518,  -9.80524168,  -9.81527612,
        -9.82273358,  -9.82758528,  -9.82980875,  -9.82938801,
        -9.82631365,  -9.82058297,  -9.8122    ,  -9.80117559,
        -9.78752735,  -9.77127966,  -9.7524636 ,  -9.73111683,
        -9.70728351,  -9.68101412,  -9.65236524,  -9.62139941,
        -9.58818484,  -9.55279516,  -9.51530913,  -9.47581033,
        -9.43438687,  -9.39113099,  -9.34613877,  -9.29950971,
        -9.2513464 ,  -9.20175412,  -9.15084047,  -9.09871498,
        -9.04548876,  -8.99127406,  -8.93618397,  -8.88033203,
        -8.82383187,  -8.76679689,  -8.70933993,  -8.65157296,
        -8.59360677,  -8.53555071,  -8.47751242,  -8.41959763,
        -8.36190985,  -8.30455024,  -8.24761743,  -8.19120728,
        -8.13541282,  -8.08032406,  -8.02602794,  -7.97260817,
        -7.92014522,  -7.86871623,  -7.81839495,  -7.76925176,
        -7.72135363,  -7.67476411,  -7.62954336,  -7.58574817,
        -7.54343201,  -7.50264504,  -7.46343416,  -7.42584312,
        -7.38991253,  -7.35567993,  -7.32317994,  -7.29244422,
        -7.26350165,  -7.23637837,  -7.21109787,  -7.18768108,
        -7.16614644,  -7.14651   ,  -7.12878551,  -7.11298448,
        -7.09911626,  -7.08718814,  -7.0772054 ,  -7.06917139,
        -7.06308761,  -7.05895371,  -7.05676764,  -7.05652563,
        -7.05822227,  -7.06185052,  -7.06740181,  -7.074866  ,
        -7.08423146,  -7.09548506,  -7.10861221,  -7.12359683,
        -7.14042141,  -7.15906697,  -7.17951306,  -7.20173779,
        -7.22571773,  -7.25142798,  -7.27884209,  -7.30793203,
        -7.33866821,  -7.37101938,  -7.40495263,  -7.44043333,
        -7.47742507,  -7.51588964,  -7.55578697,  -7.59707507,
        -7.63970996,  -7.68364566,  -7.7288341 ,  -7.77522508,
        -7.8227662 ,  -7.87140286,  -7.92107814,  -7.97173282,
        -8.02330531,  -8.0757316 ,  -8.12894528,  -8.18287747,
        -8.23745682,  -8.29260952,  -8.34825927,  -8.40432733,
        -8.4607325 ,  -8.51739122,  -8.57421755,  -8.63112326,
        -8.68801793,  -8.74480899,  -8.80140189,  -8.85770016,
        -8.91360559,  -8.96901838,  -9.02383735,  -9.07796004,
        -9.13128301,  -9.18370202,  -9.23511231,  -9.28540887,
        -9.33448665,  -9.38224096,  -9.4285677 ,  -9.47336372,
        -9.51652715,  -9.55795775,  -9.59755729,  -9.63522988,
        -9.67088235,  -9.70442464,  -9.73577017,  -9.7648362 ,
        -9.7915442 ,  -9.81582025,  -9.83759532,  -9.85680568,
        -9.87339318,  -9.88730558,  -9.89849682,  -9.90692728,
        -9.91256405,  -9.91538109,  -9.91535945,  -9.91248739,
        -9.9067605 ,  -9.89818181,  -9.88676179,  -9.87251837,
        -9.85547694,  -9.83567026,  -9.81313835,  -9.78792838,
        -9.76009448,  -9.72969753,  -9.69680496,  -9.66149043,
        -9.62383356,  -9.58391963,  -9.54183922,  -9.49768782,
        -9.45156549,  -9.40357644,  -9.35382863,  -9.30243335,
        -9.24950481,  -9.19515967,  -9.13951667,  -9.08269616,
        -9.02481973,  -8.96600976,  -8.906389  ,  -8.84608025,
        -8.78520594,  -8.72388775,  -8.66224633,  -8.60040093,
        -8.53846909,  -8.47656641,  -8.41480622,  -8.3532994 ,
        -8.29215411,  -8.23147566,  -8.17136625,  -8.11192489,
        -8.05324724,  -7.99542548,  -7.93854826,  -7.88270061,
        -7.82796386,  -7.77441566,  -7.7221299 ,  -7.67117676,
        -7.62162269,  -7.57353044,  -7.52695908,  -7.48196409,
        -7.43859737,  -7.39690734,  -7.35693897,  -7.31873393,
        -7.28233059,  -7.24776419,  -7.21506688,  -7.18426783,
        -7.15539333,  -7.1284669 ,  -7.10350937,  -7.08053899,
        -7.05957154,  -7.04062039,  -7.02369663,  -7.00880914,
        -6.99596468,  -6.98516798,  -6.97642181,  -6.96972707,
        -6.96508285,  -6.96248648,  -6.96193361,  -6.96341826,
        -6.96693288,  -6.97246834,  -6.98001403,  -6.98955785,
        -7.00108626,  -7.01458426,  -7.03003544,  -7.04742197,
        -7.0667246 ,  -7.08792264,  -7.11099396,  -7.13591499,
        -7.16266065,  -7.19120437,  -7.22151803,  -7.25357191,
        -7.28733467,  -7.3227733 ,  -7.35985307,  -7.39853742,
        -7.43878801,  -7.48056456,  -7.52382484,  -7.56852456,
        -7.61461735,  -7.66205469,  -7.71078583,  -7.76075771,
        -7.81191489,  -7.86419956,  -7.9175514 ,  -7.97190756,
        -8.02720259,  -8.08336844,  -8.14033438,  -8.19802698,
        -8.25637008,  -8.31528482,  -8.3746896 ,  -8.43450009,
        -8.49462925,  -8.5549874 ,  -8.61548226,  -8.67601899,
        -8.73650028,  -8.79682649,  -8.85689572,  -8.91660399,
        -8.97584536,  -9.03451215,  -9.09249507,  -9.14968354,
        -9.20596583,  -9.26122936,  -9.315361  ,  -9.36824736])

In [5]:
assert True # leave this to grade solve_lorenz

Write a function plot_lorentz that:

  • Solves the Lorenz system for N different initial conditions. To generate your initial conditions, draw uniform random samples for x, y and z in the range $[-15,15]$. Call np.random.seed(1) a single time at the top of your function to use the same seed each time.
  • Plot $[x(t),z(t)]$ using a line to show each trajectory.
  • Color each line using the hot colormap from Matplotlib.
  • Label your plot and choose an appropriate x and y limit.

The following cell shows how to generate colors that can be used for the lines:


In [20]:
N = 5
colors = plt.cm.hot(np.linspace(0,1,N))
for i in range(N):
    # To use these colors with plt.plot, pass them as the color argument
    print(colors[i])


[ 0.0416  0.      0.      1.    ]
[ 0.70047002  0.          0.          1.        ]
[ 1.         0.3593141  0.         1.       ]
[ 1.          1.          0.02720491  1.        ]
[ 1.  1.  1.  1.]

In [25]:
plt.plot?

In [20]:
def plot_lorentz(N=10, max_time=4.0, sigma=10.0, rho=28.0, beta=8.0/3.0):
    """Plot [x(t),z(t)] for the Lorenz system.
    
    Parameters
    ----------
    N : int
        Number of initial conditions and trajectories to plot.
    max_time: float
        Maximum time to use.
    sigma, rho, beta: float
        Parameters of the differential equation.
    """
    np.random.seed(1)
    colors = plt.cm.hot(np.linspace(0, 1, N))
    
    for i in range(N):
        xrand = np.random.uniform(-15.0, 15.0)
        yrand = np.random.uniform(-15.0, 15.0)
        zrand = np.random.uniform(-15.0, 15.0)
        
        res, t = solve_lorentz((xrand, yrand, zrand), max_time, sigma, rho, beta)
        
        plt.plot(res[:,0], res[:,2], color = colors[i])

    
    
        
    #raise NotImplementedError()

In [21]:
plot_lorentz()



In [ ]:
assert True # leave this to grade the plot_lorenz function

Use interact to explore your plot_lorenz function with:

  • max_time an integer slider over the interval $[1,10]$.
  • N an integer slider over the interval $[1,50]$.
  • sigma a float slider over the interval $[0.0,50.0]$.
  • rho a float slider over the interval $[0.0,50.0]$.
  • beta fixed at a value of $8/3$.

In [22]:
interact(plot_lorentz, max_time = (1, 10), N = (1, 50), sigma = (0.0, 50.0), rho = (0.0, 50.0), beta = fixed(8.3))
#raise NotImplementedError()


Describe the different behaviors you observe as you vary the parameters $\sigma$, $\rho$ and $\beta$ of the system:

YOUR ANSWER HERE