radau5ode_vanderpol.py

assimulo.examples.radau5ode_vanderpol.run_example(with_plots=True)[source]

Example for the use of the implicit Euler method to solve Van der Pol’s equation

\[\begin{split}\dot y_1 &= y_2 \\ \dot y_2 &= \mu ((1.-y_1^2) y_2-y_1)\end{split}\]

with \(\mu= 10^6\).

on return:

  • exp_mod problem instance
  • exp_sim solver instance

Final Run Statistics: Van der Pol (explicit) 

 Number of steps                                 : 241
 Number of function evaluations                  : 2233
 Number of Jacobian evaluations                  : 160
 Number of function eval. due to Jacobian eval.  : 320
 Number of error test failures                   : 7
 Number of LU decompositions                     : 251

Solver options:

 Solver                  : Radau5 (explicit)
 Tolerances (absolute)   : 0.0001
 Tolerances (relative)   : 0.0001

Simulation interval    : 0.0 - 2.0 seconds.
Elapsed simulation time: 0.027811050415 seconds.
[[  2.00000000e+00  -6.00000000e-01]
 [  2.00000000e+00  -6.00000000e-01]
 [  1.99999994e+00  -6.17278784e-01]
 [  1.99999988e+00  -6.30079232e-01]
 [  1.99999963e+00  -6.55259070e-01]
 [  1.99999937e+00  -6.63110060e-01]
 [  1.99999893e+00  -6.66184062e-01]
 [  1.99999824e+00  -6.66643419e-01]
 [  1.99999689e+00  -6.66667566e-01]
 [  1.99999283e+00  -6.66670497e-01]
 [  1.99997053e+00  -6.66682947e-01]
 [  1.99979211e+00  -6.66782107e-01]
 [  1.99836381e+00  -6.67576631e-01]
 [  1.98687544e+00  -6.74048240e-01]
 [  1.92233919e+00  -7.13232695e-01]
 [  1.73960894e+00  -8.58528199e-01]
 [  1.61050739e+00  -1.01051806e+00]
 [  1.49788205e+00  -1.20441372e+00]
 [  1.40980462e+00  -1.42756821e+00]
 [  1.33626809e+00  -1.70090772e+00]
 [  1.27704197e+00  -2.02433478e+00]
 [  1.22813753e+00  -2.41600825e+00]
 [  1.18790992e+00  -2.88926803e+00]
 [  1.15463079e+00  -3.46533748e+00]
 [  1.12709274e+00  -4.16870687e+00]
 [  1.10432395e+00  -5.02930366e+00]
 [  1.08550490e+00  -6.08502752e+00]
 [  1.06994594e+00  -7.38473414e+00]
 [  1.05734623e+00  -8.95056382e+00]
 [  1.04432804e+00  -1.14925706e+01]
 [  1.03636338e+00  -1.39262782e+01]
 [  1.02985870e+00  -1.68420948e+01]
 [  1.02357666e+00  -2.10852692e+01]
 [  1.01852177e+00  -2.63425309e+01]
 [  1.01502994e+00  -3.16436978e+01]
 [  1.01229321e+00  -3.73168440e+01]
 [  1.00973871e+00  -4.43764823e+01]
 [  1.00736526e+00  -5.30718588e+01]
 [  1.00518058e+00  -6.35326466e+01]
 [  1.00307946e+00  -7.64802537e+01]
 [  1.00101279e+00  -9.26676543e+01]
 [  9.98938022e-01  -1.13078556e+02]
 [  9.96817242e-01  -1.38983310e+02]
 [  9.94613986e-01  -1.72033009e+02]
 [  9.92291486e-01  -2.14377153e+02]
 [  9.89811555e-01  -2.68812257e+02]
 [  9.87133497e-01  -3.38976853e+02]
 [  9.84213085e-01  -4.29605773e+02]
 [  9.81001569e-01  -5.46861183e+02]
 [  9.77444642e-01  -6.98764248e+02]
 [  9.73481321e-01  -8.95758542e+02]
 [  9.69042709e-01  -1.15144602e+03]
 [  9.64050573e-01  -1.48354952e+03]
 [  9.58415702e-01  -1.91517307e+03]
 [  9.52035979e-01  -2.47645429e+03]
 [  9.44794091e-01  -3.20673481e+03]
 [  9.36554779e-01  -4.15741641e+03]
 [  9.27161512e-01  -5.39572881e+03]
 [  9.16432413e-01  -7.00971420e+03]
 [  9.04155203e-01  -9.11484400e+03]
 [  8.90080870e-01  -1.18628429e+04]
 [  8.73915573e-01  -1.54535182e+04]
 [  8.55310173e-01  -2.01507242e+04]
 [  8.33846320e-01  -2.63041059e+04]
 [  8.09017580e-01  -3.43790426e+04]
 [  7.80203021e-01  -4.49985143e+04]
 [  7.46628906e-01  -5.90028416e+04]
 [  7.07310670e-01  -7.75373266e+04]
 [  6.60960046e-01  -1.02185996e+05]
 [  6.05825754e-01  -1.35187465e+05]
 [  5.39393449e-01  -1.79813615e+05]
 [  4.57743406e-01  -2.41122657e+05]
 [  3.53882661e-01  -3.27785871e+05]
 [  2.15398083e-01  -4.54828957e+05]
 [  3.50845030e-03  -6.63386272e+05]
 [ -1.66547398e-01  -8.31902080e+05]
 [ -3.32737341e-01  -9.87341725e+05]
 [ -5.27970620e-01  -1.14579712e+06]
 [ -7.79605852e-01  -1.28854660e+06]
 [ -1.04150721e+00  -1.33180557e+06]
 [ -1.28576414e+00  -1.24411034e+06]
 [ -1.46555156e+00  -1.08317652e+06]
 [ -1.64501104e+00  -8.28058910e+05]
 [ -1.76322050e+00  -6.02849415e+05]
 [ -1.83144103e+00  -4.50663868e+05]
 [ -1.89303026e+00  -2.98646770e+05]
 [ -1.93605375e+00  -1.83961916e+05]
 [ -1.96797286e+00  -9.42545835e+04]
 [ -1.98171781e+00  -5.43934218e+04]
 [ -1.98848930e+00  -3.44806025e+04]
 [ -1.99303212e+00  -2.10193149e+04]
 [ -1.99579106e+00  -1.28037452e+04]
 [ -1.99744499e+00  -7.86399061e+03]
 [ -1.99844983e+00  -4.85737169e+03]
 [ -1.99906661e+00  -3.00979150e+03]
 [ -1.99944728e+00  -1.86858750e+03]
 [ -1.99968304e+00  -1.16139410e+03]
 [ -1.99982936e+00  -7.22283273e+02]
 [ -1.99992026e+00  -4.49300043e+02]
 [ -1.99997677e+00  -2.79467401e+02]
 [ -2.00001190e+00  -1.73759814e+02]
 [ -2.00003373e+00  -1.07946316e+02]
 [ -2.00004729e+00  -6.69644152e+01]
 [ -2.00005569e+00  -4.14455430e+01]
 [ -2.00006088e+00  -2.55554646e+01]
 [ -2.00006407e+00  -1.56611066e+01]
 [ -2.00006602e+00  -9.50016140e+00]
 [ -2.00006719e+00  -5.66391990e+00]
 [ -2.00006788e+00  -3.27520768e+00]
 [ -2.00006827e+00  -1.78782985e+00]
 [ -2.00006848e+00  -8.61685836e-01]
 [ -2.00006856e+00  -2.85004887e-01]
 [ -2.00006858e+00   7.40762688e-02]
 [ -2.00006855e+00   2.97664841e-01]
 [ -2.00006849e+00   4.36884370e-01]
 [ -2.00006837e+00   5.51504770e-01]
 [ -2.00006822e+00   6.13953708e-01]
 [ -2.00006802e+00   6.46550686e-01]
 [ -2.00006773e+00   6.61200137e-01]
 [ -2.00006734e+00   6.65713289e-01]
 [ -2.00006674e+00   6.66564573e-01]
 [ -2.00006566e+00   6.66628437e-01]
 [ -2.00006288e+00   6.66631515e-01]
 [ -2.00005042e+00   6.66638548e-01]
 [ -1.99995077e+00   6.66693975e-01]
 [ -1.99915321e+00   6.67137342e-01]
 [ -1.99275356e+00   6.70715038e-01]
 [ -1.94025778e+00   7.01819296e-01]
 [ -1.79138156e+00   8.10918324e-01]
 [ -1.63394869e+00   9.78524216e-01]
 [ -1.52522258e+00   1.14997297e+00]
 [ -1.42812793e+00   1.37378309e+00]
 [ -1.35260347e+00   1.63053879e+00]
 [ -1.28970358e+00   1.94424493e+00]
 [ -1.23881908e+00   2.31692039e+00]
 [ -1.19681185e+00   2.76800744e+00]
 [ -1.16199165e+00   3.31765509e+00]
 [ -1.13318499e+00   3.98815924e+00]
 [ -1.10936299e+00   4.80808423e+00]
 [ -1.08967014e+00   5.81332608e+00]
 [ -1.07339099e+00   7.04968424e+00]
 [ -1.06022506e+00   8.53546962e+00]
 [ -1.04646864e+00   1.09780961e+01]
 [ -1.03823513e+00   1.32653467e+01]
 [ -1.03136498e+00   1.60637967e+01]
 [ -1.02462686e+00   2.02371109e+01]
 [ -1.01929581e+00   2.53836971e+01]
 [ -1.01569347e+00   3.04931333e+01]
 [ -1.01289106e+00   3.59333254e+01]
 [ -1.01025531e+00   4.27803767e+01]
 [ -1.00782688e+00   5.11864446e+01]
 [ -1.00562066e+00   6.12027490e+01]
 [ -1.00352141e+00   7.34871738e+01]
 [ -1.00144517e+00   8.89627474e+01]
 [ -9.99373361e-01   1.08414979e+02]
 [ -9.97265963e-01   1.33041918e+02]
 [ -9.95083094e-01   1.64437395e+02]
 [ -9.92788537e-01   2.04633288e+02]
 [ -9.90344766e-01   2.56272456e+02]
 [ -9.87711638e-01   3.22799450e+02]
 [ -9.84845735e-01   4.08695794e+02]
 [ -9.81699340e-01   5.19793359e+02]
 [ -9.78219394e-01   6.63683184e+02]
 [ -9.74346410e-01   8.50248254e+02]
 [ -9.70013253e-01   1.09235942e+03]
 [ -9.65143770e-01   1.40678538e+03]
 [ -9.59651193e-01   1.81538374e+03]
 [ -9.53436276e-01   2.34666234e+03]
 [ -9.46385094e-01   3.03782910e+03]
 [ -9.38366390e-01   3.93748850e+03]
 [ -9.29228390e-01   5.10919652e+03]
 [ -9.18794892e-01   6.63616084e+03]
 [ -9.06860447e-01   8.62747541e+03]
 [ -8.93184318e-01   1.12264260e+04]
 [ -8.77482811e-01   1.46216097e+04]
 [ -8.59419359e-01   1.90619218e+04]
 [ -8.38591437e-01   2.48769232e+04]
 [ -8.14512900e-01   3.25048152e+04]
 [ -7.86589429e-01   4.25314150e+04]
 [ -7.54083195e-01   5.57455107e+04]
 [ -7.16059887e-01   7.32195276e+04]
 [ -6.71304974e-01   9.64314752e+04]
 [ -6.18182296e-01   1.27459157e+05]
 [ -5.54373692e-01   1.69313928e+05]
 [ -4.76338152e-01   2.26584440e+05]
 [ -3.77973849e-01   3.06921740e+05]
 [ -2.48091061e-01   4.23894739e+05]
 [ -5.94829348e-02   6.07482428e+05]
 [  9.84991217e-02   7.65075677e+05]
 [  2.44796328e-01   9.06801555e+05]
 [  4.50193120e-01   1.08667404e+06]
 [  6.85949477e-01   1.24525914e+06]
 [  9.68772708e-01   1.33259891e+06]
 [  1.18567789e+00   1.29695321e+06]
 [  1.35799683e+00   1.19010723e+06]
 [  1.54662931e+00   9.80312960e+05]
 [  1.72738387e+00   6.76190849e+05]
 [  1.82941386e+00   4.55442461e+05]
 [  1.88944212e+00   3.07906445e+05]
 [  1.93350664e+00   1.90963452e+05]
 [  1.96588506e+00   1.00257967e+05]
 [  1.98066400e+00   5.74898146e+04]
 [  1.98778385e+00   3.65774660e+04]
 [  1.99259093e+00   2.23440985e+04]
 [  1.99553048e+00   1.35948270e+04]
 [  1.99728961e+00   8.34235948e+03]
 [  1.99835667e+00   5.15013856e+03]
 [  1.99901102e+00   3.19020953e+03]
 [  1.99941466e+00   1.98024278e+03]
 [  1.99966457e+00   1.23067066e+03]
 [  1.99981963e+00   7.65332566e+02]
 [  1.99991596e+00   4.76076799e+02]
 [  1.99997584e+00   2.96132354e+02]
 [  2.00001307e+00   1.84135280e+02]
 [  2.00003620e+00   1.14407450e+02]
 [  2.00005057e+00   7.09878785e+01]
 [  2.00005948e+00   4.39509906e+01]
 [  2.00006498e+00   2.71156165e+01]
 [  2.00006837e+00   1.66326144e+01]
 [  2.00007044e+00   1.01051183e+01]
 [  2.00007169e+00   6.04062557e+00]
 [  2.00007243e+00   3.50978175e+00]
 [  2.00007285e+00   1.93389903e+00]
 [  2.00007307e+00   9.52643386e-01]
 [  2.00007317e+00   3.41644672e-01]
 [  2.00007319e+00  -3.88059907e-02]
 [  2.00007316e+00  -2.75701248e-01]
 [  2.00007311e+00  -4.23206527e-01]
 [  2.00007300e+00  -5.43071184e-01]
 [  2.00007285e+00  -6.09238261e-01]
 [  2.00007265e+00  -6.44288933e-01]
 [  2.00007237e+00  -6.60379978e-01]
 [  2.00007199e+00  -6.65510548e-01]
 [  2.00007142e+00  -6.66538800e-01]
 [  2.00007041e+00  -6.66625181e-01]
 [  2.00006793e+00  -6.66628681e-01]
 [  2.00005740e+00  -6.66634670e-01]
 [  1.99997666e+00  -6.66679580e-01]
 [  1.99933057e+00  -6.67038682e-01]
 [  1.99414924e+00  -6.69931466e-01]
 [  1.95185675e+00  -6.94658146e-01]
 [  1.81534967e+00  -7.90818914e-01]
 [  1.70616260e+00  -8.92799206e-01]]
_images/radau5ode_vanderpol.png

Note

Press [source] (to the top right) to view the example.