abcd

45 Reputation

6 Badges

9 years, 317 days

MaplePrimes Activity


These are questions asked by abcd

I found useful to use the email address of a relative I live with, to create my own account on Maple Primes.
But I have just realized that his own account has disappeared.

Is there a way to have two differents accounts with the same email address ??? 

If not I will create my own account on my private email addresss

Sorry for the mess

Hi all, 

Is it possible, and how, to disable the automatic completion in the "Advanced Search / keyword" field ?

Underlying this question is my looking for informations about cmaple (beyond what the help page displays : if I can't find any I will ask some specific ones later). But every time I type "cmaple" in the keyword textfield, it is replaced by "campée" (which is a french word ... I guess english people will obtain something different)

I would like to remove from a table, the index that verifies some constraint.

For example :

restart:
a := table([1=c, 2=g, 3=y]);

for k in [indices(a, `nolist`)] do
  if is(k, even) then
    a[k] := 'a[k]':
  end if:
end do:

# This does not work as expected 
eval(a);


I have found this workaround 

b := map(u -> if `not`(is(u, even)) then u=a[u] end if, [indices(a, `nolist`)]);
eval(b);

But is there a way to force Maple to evaluate k to 2 before it "unevaluate"  'a[k]' ?

 

Hi,
I would like to present you a recurring problem of mine.

Context:

It is very common, in Modeling and Simulation activities, to account for Uncertainties.

In order to set these ideas down, consider a computational code F (typically a code that solves a set of PDEs in space (M) and time (t) ) and its response Y = F(M,t) (here Y is a short for Y(M,t)).

This response Y usually depends also on some set P of parameters (each of them considered as a scalar quantity) .
A more convenient way to note Y  is Y(M, t | P) where the "|" character is used here to express that Y is considered as a function of M and t for each given value of P.
Generally one does not consider Y as a whole but more often one focuses on some quantity of interest (Q) derived from Y through applying it some operator G (for example the operator max(Y) over some space and time domain).

Applying G generally makes  Q to appear as a function of P alone.
In Uncertainty Quantification activities, a major concern is to understand how uncertainties about P modify the values of Q ?
The classical framework is to consider P as a (multi-dimensionnal) random variable. 
One of the most common problems is then to assess some basic characteristics of Q, where Q is considered as a function of P (a quick and notional notation is Q = H(P) = (G°F)(X, t | P)).

The simpler and faster method to do this is based on a Taylor expansion of H (provided some conditions hold) arround some particular point p* (p* could be the mean of the multi-dimensional distribution of P)
One writes, for every value p of P :

Q = H(p) = H(p*) + (H')t (p-p*) + 1/2 (p-p*)t H" (p-p*) ...

where
  H'  is the gradient vector of H according to P at point P = p*
  H" is the hessian matrix of H according to P at point P = p*
  (p-p*) is the vector of differences, assumed to be "small"

Let E the usual "mathematical expectation" operator.
Let us assume  p* denotes the mean of P.
Then, applying E to  the previous formula gives :

E(Q) = E(H(p*)) + E(...) + ....

Assuming some conditions hold, the first order mathematical expectation E(Q) of Q is simply E(H(p*)) = H(p*) = H(E(P))

Some little algebra gives the first order approximation of the variance V(Q) = E(Q^2)-(E(Q))^2 of Q : 

V(Q) = (H')V(P) H'  where V(P) is the variance matrix of P

-----------------------------------------------------------------------------------------------------------------------

Problem

I would like to define the operator E so that I could derive automatically approximations of the first 4 moments of Q, up to any desired order.
In particular, order 2 is often necessary as soon as (G°F) is highly non linear regarding P ; and estimations of the 3rd and 4th moments is of great help to determine how much symetric or flat is the distribution of Q.

The idea is to define an operator E with suitable properties and to apply it to a multivariate taylor expansion of Q^n where n is any positive integer

I tried to do this by my own (look to the supplied .mw file) but I do not have sufficient skill in Maple to complete the job.

Could someone help me ?

Even if I am not qualified in saying this, I believe that this type of approximation of the different moments of Q could be included in a future release of Maple ?


Thanks in advance 

 

Download MathematicalExpectation.mw








 

 

# CAN WE TRUST MAPLE ?
#
# I want to solve numerically systems of ordinary differential equations (ODE)
#
# File "MC.m" below contains an example of one of them (a second degree ODE
# reduced to a couple of 2 first order ODEs ; details about these equations
# are of no importane here).
#
# I am going to show you a very disturbing behaviour of MAPLE ...
#




restart:
with(plots):

read "/Users/marcsancandi/Desktop/MAPLE++SCILAB/BUG-LSODE/MC.m":

# A very quick look to the ODE system
#
# (0.2345... is the mass of the "moving mass" ; some of you will
# probably recognize the structure of a mass-spring-damper system)
#
# Here again, the detailed expression of the 2 RHSs does not matter
#

map(u -> if is(rhs(u), numeric) then u else lhs(u)=RHS end if, convert(MC, list));

[.2345666667*(diff(V[1](t), t)) = RHS, diff(X[1](t), t) = RHS, V[1](0) = 0., X[1](0) = HFloat(9.875869562154457e-4)]

(1)

 

SOLVER = LSODE[ADAMSFULL]

 

sol := dsolve(MC, numeric, method=lsode[adamsfull]);

display(
  odeplot(sol, [t, X[1](t)], 0..9, color=red, gridlines=true, labels=["", "t"], title="X (red), V (blue)"),
  odeplot(sol, [t, V[1](t)], 0..9, color=blue)
);

proc (x_lsode) local _res, _dat, _vars, _solnproc, _xout, _ndsol, _pars, _n, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](x_lsode) else _xout := evalf(x_lsode) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _n, _y0, _ctl, _octl, _reinit, _errcd, _fcn, _i, _yini, _pars, _ini, _par; option `Copyright (c) 2002 by the University of Waterloo. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _ctl := array( 1 .. 34, [( 1 ) = (2), ( 2 ) = (0.), ( 3 ) = (0.), ( 4 ) = (1), ( 5 ) = (1), ( 6 ) = (12), ( 7 ) = (0), ( 9 ) = (HFloat(9.875869562154457e-4)), ( 8 ) = (0.), ( 11 ) = (0.1e-6), ( 10 ) = (0.1e-6), ( 13 ) = (0), ( 12 ) = (0), ( 15 ) = (0), ( 14 ) = (0), ( 18 ) = (0), ( 19 ) = (0), ( 16 ) = (0), ( 17 ) = (0), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = (0), ( 21 ) = (0), ( 27 ) = (0), ( 26 ) = (0), ( 25 ) = (0), ( 24 ) = (0), ( 31 ) = (0), ( 30 ) = (0), ( 29 ) = (0), ( 28 ) = (0), ( 32 ) = (0), ( 33 ) = (-1), ( 34 ) = (0)  ] ); _octl := array( 1 .. 34, [( 1 ) = (2), ( 2 ) = (0.), ( 3 ) = (0.), ( 4 ) = (1), ( 5 ) = (1), ( 6 ) = (12), ( 7 ) = (0), ( 9 ) = (HFloat(9.875869562154457e-4)), ( 8 ) = (0.), ( 11 ) = (0.1e-6), ( 10 ) = (0.1e-6), ( 13 ) = (0), ( 12 ) = (0), ( 15 ) = (0), ( 14 ) = (0), ( 18 ) = (0), ( 19 ) = (0), ( 16 ) = (0), ( 17 ) = (0), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = (0), ( 21 ) = (0), ( 27 ) = (0), ( 26 ) = (0), ( 25 ) = (0), ( 24 ) = (0), ( 31 ) = (0), ( 30 ) = (0), ( 29 ) = (0), ( 28 ) = (0), ( 32 ) = (0), ( 33 ) = (-1), ( 34 ) = (0)  ] ); _n := trunc(_ctl[1]); _yini := Array(0..2, {(1) = 0., (2) = 0.}); _y0 := Array(0..2, {(1) = 0., (2) = 0.}); _fcn := proc (N, X, Y, YP) option `[Y[1] = V[1](t), Y[2] = X[1](t)]`; YP[1] := 4.2631803319222423857*(-5.860656250+(1/2)*(piecewise(0.598600e-2 <= Y[2] and Y[2] < 0.600800e-2, -10636.36364*Y[2]+62.32127275)+piecewise(0.594900e-2 <= Y[2] and Y[2] < 0.598600e-2, -3891.891892*Y[2]+21.94886487)+piecewise(0.581900e-2 <= Y[2] and Y[2] < 0.594900e-2, -953.8461538*Y[2]+4.470430769)+piecewise(0.391800e-2 <= Y[2] and Y[2] < 0.581900e-2, -16.83324566*Y[2]-.9820473435)+piecewise(0.230100e-2 <= Y[2] and Y[2] < 0.391800e-2, -39.57946815*Y[2]-.8929276438)-piecewise(0.668500e-2 <= Y[2] and Y[2] <= 0.689400e-2, 2574.162679*Y[2]-17.10627751)+piecewise(0.452000e-3 <= Y[2] and Y[2] < 0.230100e-2, -49.21579232*Y[2]-.8707544619)+piecewise(0.760000e-4 <= Y[2] and Y[2] < 0.452000e-3, -513.2978723*Y[2]-.6609893617)+piecewise(0.300000e-4 <= Y[2] and Y[2] < 0.760000e-4, -2521.739130*Y[2]-.5083478261)-piecewise(0.594900e-2 <= Y[2] and Y[2] <= 0.598600e-2, -3891.891892*Y[2]+24.10886487)-piecewise(0.757900e-2 <= Y[2] and Y[2] <= 0.758000e-2, 722000.0000*Y[2]-5463.521000)-piecewise(0.615100e-2 <= Y[2] and Y[2] <= 0.622600e-2, -1560.000000*Y[2]+9.836560000)-piecewise(0.605200e-2 <= Y[2] and Y[2] <= 0.615100e-2, -2242.424242*Y[2]+14.03415151)-piecewise(0.600800e-2 <= Y[2] and Y[2] <= 0.605200e-2, -2613.636364*Y[2]+16.28072727)-piecewise(0.598600e-2 <= Y[2] and Y[2] <= 0.600800e-2, -10636.36364*Y[2]+64.48127275)-piecewise(0.719600e-2 <= Y[2] and Y[2] <= 0.743900e-2, 4263.374486*Y[2]-29.30024280)-piecewise(0.709200e-2 <= Y[2] and Y[2] <= 0.719600e-2, 1778.846154*Y[2]-11.42157692)+piecewise(0.757900e-2 <= Y[2] and Y[2] < 0.758000e-2, 722000.0000*Y[2]-5465.681000)+piecewise(0.757200e-2 <= Y[2] and Y[2] < 0.757900e-2, 187714.2857*Y[2]-1416.329571)+piecewise(0.754100e-2 <= Y[2] and Y[2] < 0.757200e-2, 38225.80645*Y[2]-284.4028064)+piecewise(0.753300e-2 <= Y[2] and Y[2] < 0.754100e-2, 333375.0000*Y[2]-2510.122875)-piecewise(0.708200e-2 <= Y[2] and Y[2] <= 0.709200e-2, 400.0000000*Y[2]-1.642800000)+piecewise(0.747300e-2 <= Y[2] and Y[2] < 0.753300e-2, 11516.66667*Y[2]-85.56405002)+piecewise(0.746900e-2 <= Y[2] and Y[2] < 0.747300e-2, 59000.00000*Y[2]-440.4070000)+piecewise(0.743900e-2 <= Y[2] and Y[2] < 0.746900e-2, 300.0000000*Y[2]-1.976700000)+piecewise(0.719600e-2 <= Y[2] and Y[2] < 0.743900e-2, 4263.374486*Y[2]-31.46024280)+piecewise(0.709200e-2 <= Y[2] and Y[2] < 0.719600e-2, 1778.846154*Y[2]-13.58157692)+piecewise(0.708200e-2 <= Y[2] and Y[2] < 0.709200e-2, 400.0000000*Y[2]-3.802800000)+piecewise(0.689400e-2 <= Y[2] and Y[2] < 0.708200e-2, 2925.531915*Y[2]-21.68861702)+piecewise(0.668500e-2 <= Y[2] and Y[2] < 0.689400e-2, 2574.162679*Y[2]-19.26627751)+piecewise(0.659000e-2 <= Y[2] and Y[2] < 0.668500e-2, 1305.263158*Y[2]-10.78368421)-piecewise(0.659000e-2 <= Y[2] and Y[2] <= 0.668500e-2, 1305.263158*Y[2]-8.623684211)-piecewise(0.652200e-2 <= Y[2] and Y[2] <= 0.659000e-2, 2205.882353*Y[2]-14.55876471)-piecewise(0.651100e-2 <= Y[2] and Y[2] <= 0.652200e-2, -5181.818182*Y[2]+33.62381818)-piecewise(0.647000e-2 <= Y[2] and Y[2] <= 0.651100e-2, 121.9512195*Y[2]-.9090243902)-piecewise(0.644200e-2 <= Y[2] and Y[2] <= 0.647000e-2, 1000.000000*Y[2]-6.590000000)-piecewise(0.637600e-2 <= Y[2] and Y[2] <= 0.644200e-2, -106.0606061*Y[2]+.5352424245)-piecewise(0.636600e-2 <= Y[2] and Y[2] <= 0.637600e-2, -7400.000000*Y[2]+47.04140000)-piecewise(0.622600e-2 <= Y[2] and Y[2] <= 0.636600e-2, -1364.285714*Y[2]+8.618042855)-piecewise(0. <= Y[2] and Y[2] <= 0.300000e-4, 19466.66667*Y[2])+piecewise(0. <= Y[2] and Y[2] < 0.300000e-4, -19466.66667*Y[2])-piecewise(0.581900e-2 <= Y[2] and Y[2] <= 0.594900e-2, -953.8461538*Y[2]+6.630430769)-piecewise(0.757200e-2 <= Y[2] and Y[2] <= 0.757900e-2, 187714.2857*Y[2]-1414.169571)-piecewise(0.391800e-2 <= Y[2] and Y[2] <= 0.581900e-2, 16.83324566*Y[2]+.9820473435)-piecewise(0.754100e-2 <= Y[2] and Y[2] <= 0.757200e-2, 38225.80645*Y[2]-282.2428064)-piecewise(0.753300e-2 <= Y[2] and Y[2] <= 0.754100e-2, 333375.0000*Y[2]-2507.962875)-piecewise(0.230100e-2 <= Y[2] and Y[2] <= 0.391800e-2, 39.57946815*Y[2]+.8929276438)-piecewise(0.747300e-2 <= Y[2] and Y[2] <= 0.753300e-2, 11516.66667*Y[2]-83.40405002)-piecewise(0.452000e-3 <= Y[2] and Y[2] <= 0.230100e-2, 49.21579232*Y[2]+.8707544619)-piecewise(0.746900e-2 <= Y[2] and Y[2] <= 0.747300e-2, 59000.00000*Y[2]-438.2470000)-piecewise(0.760000e-4 <= Y[2] and Y[2] <= 0.452000e-3, 513.2978723*Y[2]+.6609893617)-piecewise(0.743900e-2 <= Y[2] and Y[2] <= 0.746900e-2, 300.0000000*Y[2]+.183300000)-piecewise(0.300000e-4 <= Y[2] and Y[2] <= 0.760000e-4, 2521.739130*Y[2]+.5083478261)+piecewise(0.652200e-2 <= Y[2] and Y[2] < 0.659000e-2, 2205.882353*Y[2]-16.71876471)+piecewise(0.651100e-2 <= Y[2] and Y[2] < 0.652200e-2, -5181.818182*Y[2]+31.46381818)-piecewise(0.689400e-2 <= Y[2] and Y[2] <= 0.708200e-2, 2925.531915*Y[2]-19.52861702)+piecewise(0.647000e-2 <= Y[2] and Y[2] < 0.651100e-2, 121.9512195*Y[2]-3.069024390)+piecewise(0.644200e-2 <= Y[2] and Y[2] < 0.647000e-2, 1000.000000*Y[2]-8.750000000)+piecewise(0.637600e-2 <= Y[2] and Y[2] < 0.644200e-2, -106.0606061*Y[2]-1.624757576)+piecewise(0.636600e-2 <= Y[2] and Y[2] < 0.637600e-2, -7400.000000*Y[2]+44.88140000)+piecewise(0.622600e-2 <= Y[2] and Y[2] < 0.636600e-2, -1364.285714*Y[2]+6.458042855)+piecewise(0.615100e-2 <= Y[2] and Y[2] < 0.622600e-2, -1560.000000*Y[2]+7.676560000)+piecewise(0.605200e-2 <= Y[2] and Y[2] < 0.615100e-2, -2242.424242*Y[2]+11.87415151)+piecewise(0.600800e-2 <= Y[2] and Y[2] < 0.605200e-2, -2613.636364*Y[2]+14.12072727))*tanh(26466.52412*Y[1])+(1/2)*piecewise(0.598600e-2 <= Y[2] and Y[2] < 0.600800e-2, -10636.36364*Y[2]+62.32127275)+(1/2)*piecewise(0.594900e-2 <= Y[2] and Y[2] < 0.598600e-2, -3891.891892*Y[2]+21.94886487)+(1/2)*piecewise(0.581900e-2 <= Y[2] and Y[2] < 0.594900e-2, -953.8461538*Y[2]+4.470430769)+(1/2)*piecewise(0.391800e-2 <= Y[2] and Y[2] < 0.581900e-2, -16.83324566*Y[2]-.9820473435)+(1/2)*piecewise(0.230100e-2 <= Y[2] and Y[2] < 0.391800e-2, -39.57946815*Y[2]-.8929276438)+(1/2)*piecewise(0.668500e-2 <= Y[2] and Y[2] <= 0.689400e-2, 2574.162679*Y[2]-17.10627751)+(1/2)*piecewise(0.452000e-3 <= Y[2] and Y[2] < 0.230100e-2, -49.21579232*Y[2]-.8707544619)+(1/2)*piecewise(0.760000e-4 <= Y[2] and Y[2] < 0.452000e-3, -513.2978723*Y[2]-.6609893617)+(1/2)*piecewise(0.300000e-4 <= Y[2] and Y[2] < 0.760000e-4, -2521.739130*Y[2]-.5083478261)+(1/2)*piecewise(0.594900e-2 <= Y[2] and Y[2] <= 0.598600e-2, -3891.891892*Y[2]+24.10886487)+(1/2)*piecewise(0.757900e-2 <= Y[2] and Y[2] <= 0.758000e-2, 722000.0000*Y[2]-5463.521000)+(1/2)*piecewise(0.615100e-2 <= Y[2] and Y[2] <= 0.622600e-2, -1560.000000*Y[2]+9.836560000)+(1/2)*piecewise(0.605200e-2 <= Y[2] and Y[2] <= 0.615100e-2, -2242.424242*Y[2]+14.03415151)+(1/2)*piecewise(0.600800e-2 <= Y[2] and Y[2] <= 0.605200e-2, -2613.636364*Y[2]+16.28072727)+(1/2)*piecewise(0.598600e-2 <= Y[2] and Y[2] <= 0.600800e-2, -10636.36364*Y[2]+64.48127275)+(1/2)*piecewise(0.719600e-2 <= Y[2] and Y[2] <= 0.743900e-2, 4263.374486*Y[2]-29.30024280)+(1/2)*piecewise(0.709200e-2 <= Y[2] and Y[2] <= 0.719600e-2, 1778.846154*Y[2]-11.42157692)+(1/2)*piecewise(0.757900e-2 <= Y[2] and Y[2] < 0.758000e-2, 722000.0000*Y[2]-5465.681000)+(1/2)*piecewise(0.757200e-2 <= Y[2] and Y[2] < 0.757900e-2, 187714.2857*Y[2]-1416.329571)+(1/2)*piecewise(0.754100e-2 <= Y[2] and Y[2] < 0.757200e-2, 38225.80645*Y[2]-284.4028064)+(1/2)*piecewise(0.753300e-2 <= Y[2] and Y[2] < 0.754100e-2, 333375.0000*Y[2]-2510.122875)+(1/2)*piecewise(0.708200e-2 <= Y[2] and Y[2] <= 0.709200e-2, 400.0000000*Y[2]-1.642800000)+(1/2)*piecewise(0.747300e-2 <= Y[2] and Y[2] < 0.753300e-2, 11516.66667*Y[2]-85.56405002)+(1/2)*piecewise(0.746900e-2 <= Y[2] and Y[2] < 0.747300e-2, 59000.00000*Y[2]-440.4070000)+(1/2)*piecewise(0.743900e-2 <= Y[2] and Y[2] < 0.746900e-2, 300.0000000*Y[2]-1.976700000)+(1/2)*piecewise(0.719600e-2 <= Y[2] and Y[2] < 0.743900e-2, 4263.374486*Y[2]-31.46024280)+(1/2)*piecewise(0.709200e-2 <= Y[2] and Y[2] < 0.719600e-2, 1778.846154*Y[2]-13.58157692)+(1/2)*piecewise(0.708200e-2 <= Y[2] and Y[2] < 0.709200e-2, 400.0000000*Y[2]-3.802800000)+(1/2)*piecewise(0.689400e-2 <= Y[2] and Y[2] < 0.708200e-2, 2925.531915*Y[2]-21.68861702)+(1/2)*piecewise(0.668500e-2 <= Y[2] and Y[2] < 0.689400e-2, 2574.162679*Y[2]-19.26627751)+(1/2)*piecewise(0.659000e-2 <= Y[2] and Y[2] < 0.668500e-2, 1305.263158*Y[2]-10.78368421)+(1/2)*piecewise(0.659000e-2 <= Y[2] and Y[2] <= 0.668500e-2, 1305.263158*Y[2]-8.623684211)+(1/2)*piecewise(0.652200e-2 <= Y[2] and Y[2] <= 0.659000e-2, 2205.882353*Y[2]-14.55876471)+(1/2)*piecewise(0.651100e-2 <= Y[2] and Y[2] <= 0.652200e-2, -5181.818182*Y[2]+33.62381818)+(1/2)*piecewise(0.647000e-2 <= Y[2] and Y[2] <= 0.651100e-2, 121.9512195*Y[2]-.9090243902)+(1/2)*piecewise(0.644200e-2 <= Y[2] and Y[2] <= 0.647000e-2, 1000.000000*Y[2]-6.590000000)+(1/2)*piecewise(0.637600e-2 <= Y[2] and Y[2] <= 0.644200e-2, -106.0606061*Y[2]+.5352424245)+(1/2)*piecewise(0.636600e-2 <= Y[2] and Y[2] <= 0.637600e-2, -7400.000000*Y[2]+47.04140000)+(1/2)*piecewise(0.622600e-2 <= Y[2] and Y[2] <= 0.636600e-2, -1364.285714*Y[2]+8.618042855)+(1/2)*piecewise(0. <= Y[2] and Y[2] <= 0.300000e-4, 19466.66667*Y[2])+piecewise(Y[1] < 0, HFloat(60.22353335250315)*abs(Y[1])+HFloat(11322.011918013375)*abs(Y[1])*Y[2]+HFloat(2211.801459998933)*evalf(abs(Y[1])^(3/2))+HFloat(133745.6732874636)*evalf(abs(Y[1])^(3/2))*Y[2]+HFloat(268619.00766055053)*abs(Y[1])^2-HFloat(2061016.308532005)*abs(Y[1])^2*Y[2]+HFloat(150751.03532735075)*evalf(abs(Y[1])^(5/2))+HFloat(9360854.911991587)*evalf(abs(Y[1])^(5/2))*Y[2], -HFloat(93.20933633186229)*abs(Y[1])-HFloat(17119.399226077283)*abs(Y[1])*Y[2]-HFloat(527.9199512820593)*evalf(abs(Y[1])^(3/2))+HFloat(132509.09343956804)*evalf(abs(Y[1])^(3/2))*Y[2]-HFloat(295176.0878003018)*abs(Y[1])^2-HFloat(1808560.9221036755)*abs(Y[1])^2*Y[2]-HFloat(67565.79316544208)*evalf(abs(Y[1])^(5/2))+HFloat(8702690.483040193)*evalf(abs(Y[1])^(5/2))*Y[2])-.2108934567*piecewise(X < 0, 0, X < 0.500000e-1, -367.8000000*X, X < .700000, -17.02230769-27.35384615*X, X < 1.90000, -29.01250000-10.22500000*X, X < 2.10000, -95.08500000+24.55000000*X, X < 2.15000, -1459.770000+674.4000000*X, X < 3.00000, -9.81000, X < 10.0000, 20.27142858-10.02714286*X, 10.0000 <= X, 0)+(1/2)*piecewise(0. <= Y[2] and Y[2] < 0.300000e-4, -19466.66667*Y[2])+(1/2)*piecewise(0.581900e-2 <= Y[2] and Y[2] <= 0.594900e-2, -953.8461538*Y[2]+6.630430769)+(1/2)*piecewise(0.757200e-2 <= Y[2] and Y[2] <= 0.757900e-2, 187714.2857*Y[2]-1414.169571)+(1/2)*piecewise(0.391800e-2 <= Y[2] and Y[2] <= 0.581900e-2, 16.83324566*Y[2]+.9820473435)+(1/2)*piecewise(0.754100e-2 <= Y[2] and Y[2] <= 0.757200e-2, 38225.80645*Y[2]-282.2428064)+(1/2)*piecewise(0.753300e-2 <= Y[2] and Y[2] <= 0.754100e-2, 333375.0000*Y[2]-2507.962875)+(1/2)*piecewise(0.230100e-2 <= Y[2] and Y[2] <= 0.391800e-2, 39.57946815*Y[2]+.8929276438)+(1/2)*piecewise(0.747300e-2 <= Y[2] and Y[2] <= 0.753300e-2, 11516.66667*Y[2]-83.40405002)+(1/2)*piecewise(0.452000e-3 <= Y[2] and Y[2] <= 0.230100e-2, 49.21579232*Y[2]+.8707544619)+(1/2)*piecewise(0.746900e-2 <= Y[2] and Y[2] <= 0.747300e-2, 59000.00000*Y[2]-438.2470000)+(1/2)*piecewise(0.760000e-4 <= Y[2] and Y[2] <= 0.452000e-3, 513.2978723*Y[2]+.6609893617)+(1/2)*piecewise(0.743900e-2 <= Y[2] and Y[2] <= 0.746900e-2, 300.0000000*Y[2]+.183300000)+(1/2)*piecewise(0.300000e-4 <= Y[2] and Y[2] <= 0.760000e-4, 2521.739130*Y[2]+.5083478261)+(1/2)*piecewise(0.652200e-2 <= Y[2] and Y[2] < 0.659000e-2, 2205.882353*Y[2]-16.71876471)+(1/2)*piecewise(0.651100e-2 <= Y[2] and Y[2] < 0.652200e-2, -5181.818182*Y[2]+31.46381818)+(1/2)*piecewise(0.689400e-2 <= Y[2] and Y[2] <= 0.708200e-2, 2925.531915*Y[2]-19.52861702)+(1/2)*piecewise(0.647000e-2 <= Y[2] and Y[2] < 0.651100e-2, 121.9512195*Y[2]-3.069024390)+(1/2)*piecewise(0.644200e-2 <= Y[2] and Y[2] < 0.647000e-2, 1000.000000*Y[2]-8.750000000)+(1/2)*piecewise(0.637600e-2 <= Y[2] and Y[2] < 0.644200e-2, -106.0606061*Y[2]-1.624757576)+(1/2)*piecewise(0.636600e-2 <= Y[2] and Y[2] < 0.637600e-2, -7400.000000*Y[2]+44.88140000)+(1/2)*piecewise(0.622600e-2 <= Y[2] and Y[2] < 0.636600e-2, -1364.285714*Y[2]+6.458042855)+(1/2)*piecewise(0.615100e-2 <= Y[2] and Y[2] < 0.622600e-2, -1560.000000*Y[2]+7.676560000)+(1/2)*piecewise(0.605200e-2 <= Y[2] and Y[2] < 0.615100e-2, -2242.424242*Y[2]+11.87415151)+(1/2)*piecewise(0.600800e-2 <= Y[2] and Y[2] < 0.605200e-2, -2613.636364*Y[2]+14.12072727)-193.7500000*Y[2])*piecewise((1/2)*(piecewise(0.598600e-2 <= Y[2] and Y[2] < 0.600800e-2, -10636.36364*Y[2]+62.32127275)+piecewise(0.594900e-2 <= Y[2] and Y[2] < 0.598600e-2, -3891.891892*Y[2]+21.94886487)+piecewise(0.581900e-2 <= Y[2] and Y[2] < 0.594900e-2, -953.8461538*Y[2]+4.470430769)+piecewise(0.391800e-2 <= Y[2] and Y[2] < 0.581900e-2, -16.83324566*Y[2]-.9820473435)+piecewise(0.230100e-2 <= Y[2] and Y[2] < 0.391800e-2, -39.57946815*Y[2]-.8929276438)-piecewise(0.668500e-2 <= Y[2] and Y[2] <= 0.689400e-2, 2574.162679*Y[2]-17.10627751)+piecewise(0.452000e-3 <= Y[2] and Y[2] < 0.230100e-2, -49.21579232*Y[2]-.8707544619)+piecewise(0.760000e-4 <= Y[2] and Y[2] < 0.452000e-3, -513.2978723*Y[2]-.6609893617)+piecewise(0.300000e-4 <= Y[2] and Y[2] < 0.760000e-4, -2521.739130*Y[2]-.5083478261)-piecewise(0.594900e-2 <= Y[2] and Y[2] <= 0.598600e-2, -3891.891892*Y[2]+24.10886487)-piecewise(0.757900e-2 <= Y[2] and Y[2] <= 0.758000e-2, 722000.0000*Y[2]-5463.521000)-piecewise(0.615100e-2 <= Y[2] and Y[2] <= 0.622600e-2, -1560.000000*Y[2]+9.836560000)-piecewise(0.605200e-2 <= Y[2] and Y[2] <= 0.615100e-2, -2242.424242*Y[2]+14.03415151)-piecewise(0.600800e-2 <= Y[2] and Y[2] <= 0.605200e-2, -2613.636364*Y[2]+16.28072727)-piecewise(0.598600e-2 <= Y[2] and Y[2] <= 0.600800e-2, -10636.36364*Y[2]+64.48127275)-piecewise(0.719600e-2 <= Y[2] and Y[2] <= 0.743900e-2, 4263.374486*Y[2]-29.30024280)-piecewise(0.709200e-2 <= Y[2] and Y[2] <= 0.719600e-2, 1778.846154*Y[2]-11.42157692)+piecewise(0.757900e-2 <= Y[2] and Y[2] < 0.758000e-2, 722000.0000*Y[2]-5465.681000)+piecewise(0.757200e-2 <= Y[2] and Y[2] < 0.757900e-2, 187714.2857*Y[2]-1416.329571)+piecewise(0.754100e-2 <= Y[2] and Y[2] < 0.757200e-2, 38225.80645*Y[2]-284.4028064)+piecewise(0.753300e-2 <= Y[2] and Y[2] < 0.754100e-2, 333375.0000*Y[2]-2510.122875)-piecewise(0.708200e-2 <= Y[2] and Y[2] <= 0.709200e-2, 400.0000000*Y[2]-1.642800000)+piecewise(0.747300e-2 <= Y[2] and Y[2] < 0.753300e-2, 11516.66667*Y[2]-85.56405002)+piecewise(0.746900e-2 <= Y[2] and Y[2] < 0.747300e-2, 59000.00000*Y[2]-440.4070000)+piecewise(0.743900e-2 <= Y[2] and Y[2] < 0.746900e-2, 300.0000000*Y[2]-1.976700000)+piecewise(0.719600e-2 <= Y[2] and Y[2] < 0.743900e-2, 4263.374486*Y[2]-31.46024280)+piecewise(0.709200e-2 <= Y[2] and Y[2] < 0.719600e-2, 1778.846154*Y[2]-13.58157692)+piecewise(0.708200e-2 <= Y[2] and Y[2] < 0.709200e-2, 400.0000000*Y[2]-3.802800000)+piecewise(0.689400e-2 <= Y[2] and Y[2] < 0.708200e-2, 2925.531915*Y[2]-21.68861702)+piecewise(0.668500e-2 <= Y[2] and Y[2] < 0.689400e-2, 2574.162679*Y[2]-19.26627751)+piecewise(0.659000e-2 <= Y[2] and Y[2] < 0.668500e-2, 1305.263158*Y[2]-10.78368421)-piecewise(0.659000e-2 <= Y[2] and Y[2] <= 0.668500e-2, 1305.263158*Y[2]-8.623684211)-piecewise(0.652200e-2 <= Y[2] and Y[2] <= 0.659000e-2, 2205.882353*Y[2]-14.55876471)-piecewise(0.651100e-2 <= Y[2] and Y[2] <= 0.652200e-2, -5181.818182*Y[2]+33.62381818)-piecewise(0.647000e-2 <= Y[2] and Y[2] <= 0.651100e-2, 121.9512195*Y[2]-.9090243902)-piecewise(0.644200e-2 <= Y[2] and Y[2] <= 0.647000e-2, 1000.000000*Y[2]-6.590000000)-piecewise(0.637600e-2 <= Y[2] and Y[2] <= 0.644200e-2, -106.0606061*Y[2]+.5352424245)-piecewise(0.636600e-2 <= Y[2] and Y[2] <= 0.637600e-2, -7400.000000*Y[2]+47.04140000)-piecewise(0.622600e-2 <= Y[2] and Y[2] <= 0.636600e-2, -1364.285714*Y[2]+8.618042855)-piecewise(0. <= Y[2] and Y[2] <= 0.300000e-4, 19466.66667*Y[2])+piecewise(0. <= Y[2] and Y[2] < 0.300000e-4, -19466.66667*Y[2])-piecewise(0.581900e-2 <= Y[2] and Y[2] <= 0.594900e-2, -953.8461538*Y[2]+6.630430769)-piecewise(0.757200e-2 <= Y[2] and Y[2] <= 0.757900e-2, 187714.2857*Y[2]-1414.169571)-piecewise(0.391800e-2 <= Y[2] and Y[2] <= 0.581900e-2, 16.83324566*Y[2]+.9820473435)-piecewise(0.754100e-2 <= Y[2] and Y[2] <= 0.757200e-2, 38225.80645*Y[2]-282.2428064)-piecewise(0.753300e-2 <= Y[2] and Y[2] <= 0.754100e-2, 333375.0000*Y[2]-2507.962875)-piecewise(0.230100e-2 <= Y[2] and Y[2] <= 0.391800e-2, 39.57946815*Y[2]+.8929276438)-piecewise(0.747300e-2 <= Y[2] and Y[2] <= 0.753300e-2, 11516.66667*Y[2]-83.40405002)-piecewise(0.452000e-3 <= Y[2] and Y[2] <= 0.230100e-2, 49.21579232*Y[2]+.8707544619)-piecewise(0.746900e-2 <= Y[2] and Y[2] <= 0.747300e-2, 59000.00000*Y[2]-438.2470000)-piecewise(0.760000e-4 <= Y[2] and Y[2] <= 0.452000e-3, 513.2978723*Y[2]+.6609893617)-piecewise(0.743900e-2 <= Y[2] and Y[2] <= 0.746900e-2, 300.0000000*Y[2]+.183300000)-piecewise(0.300000e-4 <= Y[2] and Y[2] <= 0.760000e-4, 2521.739130*Y[2]+.5083478261)+piecewise(0.652200e-2 <= Y[2] and Y[2] < 0.659000e-2, 2205.882353*Y[2]-16.71876471)+piecewise(0.651100e-2 <= Y[2] and Y[2] < 0.652200e-2, -5181.818182*Y[2]+31.46381818)-piecewise(0.689400e-2 <= Y[2] and Y[2] <= 0.708200e-2, 2925.531915*Y[2]-19.52861702)+piecewise(0.647000e-2 <= Y[2] and Y[2] < 0.651100e-2, 121.9512195*Y[2]-3.069024390)+piecewise(0.644200e-2 <= Y[2] and Y[2] < 0.647000e-2, 1000.000000*Y[2]-8.750000000)+piecewise(0.637600e-2 <= Y[2] and Y[2] < 0.644200e-2, -106.0606061*Y[2]-1.624757576)+piecewise(0.636600e-2 <= Y[2] and Y[2] < 0.637600e-2, -7400.000000*Y[2]+44.88140000)+piecewise(0.622600e-2 <= Y[2] and Y[2] < 0.636600e-2, -1364.285714*Y[2]+6.458042855)+piecewise(0.615100e-2 <= Y[2] and Y[2] < 0.622600e-2, -1560.000000*Y[2]+7.676560000)+piecewise(0.605200e-2 <= Y[2] and Y[2] < 0.615100e-2, -2242.424242*Y[2]+11.87415151)+piecewise(0.600800e-2 <= Y[2] and Y[2] < 0.605200e-2, -2613.636364*Y[2]+14.12072727))*tanh(26466.52412*Y[1])+(1/2)*piecewise(0.598600e-2 <= Y[2] and Y[2] < 0.600800e-2, -10636.36364*Y[2]+62.32127275)+(1/2)*piecewise(0.594900e-2 <= Y[2] and Y[2] < 0.598600e-2, -3891.891892*Y[2]+21.94886487)+(1/2)*piecewise(0.581900e-2 <= Y[2] and Y[2] < 0.594900e-2, -953.8461538*Y[2]+4.470430769)+(1/2)*piecewise(0.391800e-2 <= Y[2] and Y[2] < 0.581900e-2, -16.83324566*Y[2]-.9820473435)+(1/2)*piecewise(0.230100e-2 <= Y[2] and Y[2] < 0.391800e-2, -39.57946815*Y[2]-.8929276438)+(1/2)*piecewise(0.668500e-2 <= Y[2] and Y[2] <= 0.689400e-2, 2574.162679*Y[2]-17.10627751)+(1/2)*piecewise(0.452000e-3 <= Y[2] and Y[2] < 0.230100e-2, -49.21579232*Y[2]-.8707544619)+(1/2)*piecewise(0.760000e-4 <= Y[2] and Y[2] < 0.452000e-3, -513.2978723*Y[2]-.6609893617)+(1/2)*piecewise(0.300000e-4 <= Y[2] and Y[2] < 0.760000e-4, -2521.739130*Y[2]-.5083478261)+(1/2)*piecewise(0.594900e-2 <= Y[2] and Y[2] <= 0.598600e-2, -3891.891892*Y[2]+24.10886487)+(1/2)*piecewise(0.757900e-2 <= Y[2] and Y[2] <= 0.758000e-2, 722000.0000*Y[2]-5463.521000)+(1/2)*piecewise(0.615100e-2 <= Y[2] and Y[2] <= 0.622600e-2, -1560.000000*Y[2]+9.836560000)+(1/2)*piecewise(0.605200e-2 <= Y[2] and Y[2] <= 0.615100e-2, -2242.424242*Y[2]+14.03415151)+(1/2)*piecewise(0.600800e-2 <= Y[2] and Y[2] <= 0.605200e-2, -2613.636364*Y[2]+16.28072727)+(1/2)*piecewise(0.598600e-2 <= Y[2] and Y[2] <= 0.600800e-2, -10636.36364*Y[2]+64.48127275)+(1/2)*piecewise(0.719600e-2 <= Y[2] and Y[2] <= 0.743900e-2, 4263.374486*Y[2]-29.30024280)+(1/2)*piecewise(0.709200e-2 <= Y[2] and Y[2] <= 0.719600e-2, 1778.846154*Y[2]-11.42157692)+(1/2)*piecewise(0.757900e-2 <= Y[2] and Y[2] < 0.758000e-2, 722000.0000*Y[2]-5465.681000)+(1/2)*piecewise(0.757200e-2 <= Y[2] and Y[2] < 0.757900e-2, 187714.2857*Y[2]-1416.329571)+(1/2)*piecewise(0.754100e-2 <= Y[2] and Y[2] < 0.757200e-2, 38225.80645*Y[2]-284.4028064)+(1/2)*piecewise(0.753300e-2 <= Y[2] and Y[2] < 0.754100e-2, 333375.0000*Y[2]-2510.122875)+(1/2)*piecewise(0.708200e-2 <= Y[2] and Y[2] <= 0.709200e-2, 400.0000000*Y[2]-1.642800000)+(1/2)*piecewise(0.747300e-2 <= Y[2] and Y[2] < 0.753300e-2, 11516.66667*Y[2]-85.56405002)+(1/2)*piecewise(0.746900e-2 <= Y[2] and Y[2] < 0.747300e-2, 59000.00000*Y[2]-440.4070000)+(1/2)*piecewise(0.743900e-2 <= Y[2] and Y[2] < 0.746900e-2, 300.0000000*Y[2]-1.976700000)+(1/2)*piecewise(0.719600e-2 <= Y[2] and Y[2] < 0.743900e-2, 4263.374486*Y[2]-31.46024280)+(1/2)*piecewise(0.709200e-2 <= Y[2] and Y[2] < 0.719600e-2, 1778.846154*Y[2]-13.58157692)+(1/2)*piecewise(0.708200e-2 <= Y[2] and Y[2] < 0.709200e-2, 400.0000000*Y[2]-3.802800000)+(1/2)*piecewise(0.689400e-2 <= Y[2] and Y[2] < 0.708200e-2, 2925.531915*Y[2]-21.68861702)+(1/2)*piecewise(0.668500e-2 <= Y[2] and Y[2] < 0.689400e-2, 2574.162679*Y[2]-19.26627751)+(1/2)*piecewise(0.659000e-2 <= Y[2] and Y[2] < 0.668500e-2, 1305.263158*Y[2]-10.78368421)+(1/2)*piecewise(0.659000e-2 <= Y[2] and Y[2] <= 0.668500e-2, 1305.263158*Y[2]-8.623684211)+(1/2)*piecewise(0.652200e-2 <= Y[2] and Y[2] <= 0.659000e-2, 2205.882353*Y[2]-14.55876471)+(1/2)*piecewise(0.651100e-2 <= Y[2] and Y[2] <= 0.652200e-2, -5181.818182*Y[2]+33.62381818)+(1/2)*piecewise(0.647000e-2 <= Y[2] and Y[2] <= 0.651100e-2, 121.9512195*Y[2]-.9090243902)+(1/2)*piecewise(0.644200e-2 <= Y[2] and Y[2] <= 0.647000e-2, 1000.000000*Y[2]-6.590000000)+(1/2)*piecewise(0.637600e-2 <= Y[2] and Y[2] <= 0.644200e-2, -106.0606061*Y[2]+.5352424245)+(1/2)*piecewise(0.636600e-2 <= Y[2] and Y[2] <= 0.637600e-2, -7400.000000*Y[2]+47.04140000)+(1/2)*piecewise(0.622600e-2 <= Y[2] and Y[2] <= 0.636600e-2, -1364.285714*Y[2]+8.618042855)+(1/2)*piecewise(0. <= Y[2] and Y[2] <= 0.300000e-4, 19466.66667*Y[2])+piecewise(Y[1] < 0, HFloat(60.22353335250315)*abs(Y[1])+HFloat(11322.011918013375)*abs(Y[1])*Y[2]+HFloat(2211.801459998933)*evalf(abs(Y[1])^(3/2))+HFloat(133745.6732874636)*evalf(abs(Y[1])^(3/2))*Y[2]+HFloat(268619.00766055053)*abs(Y[1])^2-HFloat(2061016.308532005)*abs(Y[1])^2*Y[2]+HFloat(150751.03532735075)*evalf(abs(Y[1])^(5/2))+HFloat(9360854.911991587)*evalf(abs(Y[1])^(5/2))*Y[2], -HFloat(93.20933633186229)*abs(Y[1])-HFloat(17119.399226077283)*abs(Y[1])*Y[2]-HFloat(527.9199512820593)*evalf(abs(Y[1])^(3/2))+HFloat(132509.09343956804)*evalf(abs(Y[1])^(3/2))*Y[2]-HFloat(295176.0878003018)*abs(Y[1])^2-HFloat(1808560.9221036755)*abs(Y[1])^2*Y[2]-HFloat(67565.79316544208)*evalf(abs(Y[1])^(5/2))+HFloat(8702690.483040193)*evalf(abs(Y[1])^(5/2))*Y[2])-.2108934567*piecewise(X < 0, 0, X < 0.500000e-1, -367.8000000*X, X < .700000, -17.02230769-27.35384615*X, X < 1.90000, -29.01250000-10.22500000*X, X < 2.10000, -95.08500000+24.55000000*X, X < 2.15000, -1459.770000+674.4000000*X, X < 3.00000, -9.81000, X < 10.0000, 20.27142858-10.02714286*X, 10.0000 <= X, 0)+(1/2)*piecewise(0. <= Y[2] and Y[2] < 0.300000e-4, -19466.66667*Y[2])+(1/2)*piecewise(0.581900e-2 <= Y[2] and Y[2] <= 0.594900e-2, -953.8461538*Y[2]+6.630430769)+(1/2)*piecewise(0.757200e-2 <= Y[2] and Y[2] <= 0.757900e-2, 187714.2857*Y[2]-1414.169571)+(1/2)*piecewise(0.391800e-2 <= Y[2] and Y[2] <= 0.581900e-2, 16.83324566*Y[2]+.9820473435)+(1/2)*piecewise(0.754100e-2 <= Y[2] and Y[2] <= 0.757200e-2, 38225.80645*Y[2]-282.2428064)+(1/2)*piecewise(0.753300e-2 <= Y[2] and Y[2] <= 0.754100e-2, 333375.0000*Y[2]-2507.962875)+(1/2)*piecewise(0.230100e-2 <= Y[2] and Y[2] <= 0.391800e-2, 39.57946815*Y[2]+.8929276438)+(1/2)*piecewise(0.747300e-2 <= Y[2] and Y[2] <= 0.753300e-2, 11516.66667*Y[2]-83.40405002)+(1/2)*piecewise(0.452000e-3 <= Y[2] and Y[2] <= 0.230100e-2, 49.21579232*Y[2]+.8707544619)+(1/2)*piecewise(0.746900e-2 <= Y[2] and Y[2] <= 0.747300e-2, 59000.00000*Y[2]-438.2470000)+(1/2)*piecewise(0.760000e-4 <= Y[2] and Y[2] <= 0.452000e-3, 513.2978723*Y[2]+.6609893617)+(1/2)*piecewise(0.743900e-2 <= Y[2] and Y[2] <= 0.746900e-2, 300.0000000*Y[2]+.183300000)+(1/2)*piecewise(0.300000e-4 <= Y[2] and Y[2] <= 0.760000e-4, 2521.739130*Y[2]+.5083478261)+(1/2)*piecewise(0.652200e-2 <= Y[2] and Y[2] < 0.659000e-2, 2205.882353*Y[2]-16.71876471)+(1/2)*piecewise(0.651100e-2 <= Y[2] and Y[2] < 0.652200e-2, -5181.818182*Y[2]+31.46381818)+(1/2)*piecewise(0.689400e-2 <= Y[2] and Y[2] <= 0.708200e-2, 2925.531915*Y[2]-19.52861702)+(1/2)*piecewise(0.647000e-2 <= Y[2] and Y[2] < 0.651100e-2, 121.9512195*Y[2]-3.069024390)+(1/2)*piecewise(0.644200e-2 <= Y[2] and Y[2] < 0.647000e-2, 1000.000000*Y[2]-8.750000000)+(1/2)*piecewise(0.637600e-2 <= Y[2] and Y[2] < 0.644200e-2, -106.0606061*Y[2]-1.624757576)+(1/2)*piecewise(0.636600e-2 <= Y[2] and Y[2] < 0.637600e-2, -7400.000000*Y[2]+44.88140000)+(1/2)*piecewise(0.622600e-2 <= Y[2] and Y[2] < 0.636600e-2, -1364.285714*Y[2]+6.458042855)+(1/2)*piecewise(0.615100e-2 <= Y[2] and Y[2] < 0.622600e-2, -1560.000000*Y[2]+7.676560000)+(1/2)*piecewise(0.605200e-2 <= Y[2] and Y[2] < 0.615100e-2, -2242.424242*Y[2]+11.87415151)+(1/2)*piecewise(0.600800e-2 <= Y[2] and Y[2] < 0.605200e-2, -2613.636364*Y[2]+14.12072727)-193.7500000*Y[2] <= 5.860656250, piecewise(Y[2] <= HFloat(9.875869562154457e-4), 0, 1), 1)+4.2631803319222423857*piecewise(abs(Y[2]-HFloat(9.875869562154457e-4)) < 1/1000000 and Y[1] <= -1/100000000, 1, 0); YP[2] := Y[1]*piecewise(Y[1] <= 0, piecewise(Y[2] <= HFloat(9.875869562154457e-4), 0, 1), 1); 0 end proc; _pars := []; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then return _y0[0] elif _xout = "method" then return "lsode" elif _xout = "numfun" then return trunc(_ctl[24+trunc(_ctl[1])]) elif _xout = "initial" then return [seq(_yini[_i], _i = 0 .. _n)] elif _xout = "parameters" then return [seq(_yini[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return [seq(_yini[_i], _i = 0 .. _n)], [seq(_yini[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _ctl[2]-_y0[0] = 0. then error "no information is available on last computed point" else _xout := _ctl[2] end if elif _xout = "enginedata" then return eval(_octl, 1) elif _xout = "function" then return eval(_fcn, 1) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _yini) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n, _ini, _yini, _pars) end if; if _pars <> [] then _par := {seq(rhs(_pars[_i]) = _yini[_n+_i], _i = 1 .. nops(_pars))}; for _i from 0 to _n do _y0[_i] := subs(_par, _yini[_i]) end do; for _i from _n+1 to _n+nops(_pars) do _y0[_i] := _yini[_i] end do else for _i from 0 to _n do _y0[_i] := _yini[_i] end do end if; _octl[2] := _y0[0]; _octl[3] := _y0[0]; for _i to _n do _octl[_i+7] := _y0[_i] end do; for _i to nops(_pars) do _octl[2*_n+30+_i] := _y0[_n+_i] end do; for _i to 34 do _ctl[_i] := _octl[_i] end do; if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [seq(_yini[_i], _i = 0 .. _n)] elif _xout = "parameters" then return [seq(_yini[_n+_i], _i = 1 .. nops(_pars))] else return [seq(_yini[_i], _i = 0 .. _n)], [seq(_yini[_n+_i], _i = 1 .. nops(_pars))] end if else return "procname" end if end if; if _xout-_y0[0] = 0. then return [seq(_y0[_i], _i = 0 .. _n)] end if; _reinit := false; if _xin <> "last" then if 0 < 0 and `dsolve/numeric/checkglobals`(0, table( [ ] ), _pars, _n, _yini) then _reinit := true; if _pars <> [] then _par := {seq(rhs(_pars[_i]) = _yini[_n+_i], _i = 1 .. nops(_pars))}; for _i from 0 to _n do _y0[_i] := subs(_par, _yini[_i]) end do; for _i from _n+1 to _n+nops(_pars) do _y0[_i] := _yini[_i] end do else for _i from 0 to _n do _y0[_i] := _yini[_i] end do end if; for _i to _n do _octl[_i+7] := _y0[_i] end do; for _i to nops(_pars) do _octl[2*_n+30+_i] := _y0[_n+_i] end do end if; if _pars <> [] and select(type, {seq(_yini[_n+_i], _i = 1 .. nops(_pars))}, 'undefined') <> {} then error "parameters must be initialized before solution can be computed" end if end if; if not _reinit and _xout-_ctl[2] = 0 then [_ctl[2], seq(_ctl[_i], _i = 8 .. 7+_n)] else if sign(_xout-_ctl[2]) <> sign(_ctl[2]-_y0[0]) or abs(_xout-_y0[0]) < abs(_xout-_ctl[2]) or _reinit then for _i to 34 do _ctl[_i] := _octl[_i] end do end if; _ctl[3] := _xout; if Digits <= evalhf(Digits) then try _errcd := evalhf(`dsolve/numeric/lsode`(_fcn, var(_ctl))) catch: userinfo(2, `dsolve/debug`, print(`Exception in lsode:`, [lastexception])); if searchtext('evalhf', lastexception[2]) <> 0 or searchtext('real', lastexception[2]) <> 0 or searchtext('hardware', lastexception[2]) <> 0 then _errcd := `dsolve/numeric/lsode`(_fcn, _ctl) else error  end if end try else _errcd := `dsolve/numeric/lsode`(_fcn, _ctl) end if; if _errcd < 0 then userinfo(2, {dsolve, `dsolve/lsode`}, `Last values returned:`); userinfo(2, {dsolve, `dsolve/lsode`}, ` t =`, _ctl[2]); _i := 8; userinfo(2, {dsolve, `dsolve/lsode`}, ` y =`, _ctl[_i]); for _i from _i+1 to 7+_n do userinfo(2, {dsolve, `dsolve/lsode`}, `	 `, _ctl[_i]) end do; if _errcd+1. = 0. then if _ctl[14+trunc(_ctl[1])] <> 0 then error "an excessive amount of work was done, maxstep may be too small" else error "an excessive amount of work (greater than mxstep) was done" end if elif _errcd+2. = 0. then error "too much accuracy was requested for the machine being used" elif _errcd+3. = 0. then error "illegal input was detected" elif _errcd+4. = 0. then error "repeated error test failures on the attempted step" elif _errcd+5. = 0. then error "repeated convergence test failures on the attempted step" elif _errcd+6. = 0. then error "pure relative error control requested for a variable that has vanished" elif _errcd+7. = 0. then error "cannot evaluate the solution past %1, maxfun limit exceeded (see <a href='http://www.maplesoft.com/support/help/search.aspx?term=dsolve,maxfun' target='_new'>?dsolve,maxfun</a> for details)", evalf[8](_ctl[2]) else error "unknown error code returned from lsode %1", trunc(_errcd) end if end if; if _Env_smart_dsolve_numeric = true then if _y0[0] < _xout and procname("right") < _xout then procname("right") := _xout elif _xout < _y0[0] and _xout < procname("left") then procname("left") := _xout end if end if; [_xout, seq(_ctl[_i], _i = 8 .. 7+_n)] end if end proc, (2) = Array(0..0, {}), (3) = [t, V[1](t), X[1](t)], (4) = []}); _vars := _dat[3]; _pars := map(rhs, _dat[4]); _n := nops(_vars)-1; _solnproc := _dat[1]; if not type(_xout, 'numeric') then if member(x_lsode, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(x_lsode, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(x_lsode, ["last", 'last', "initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(x_lsode, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return [seq(_vars[_i+1] = [_res][1][_i+1], _i = 0 .. _n), seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] else return [seq(_vars[_i+1] = _res[_i+1], _i = 0 .. _n)] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(x_lsode), 'string') = rhs(x_lsode); if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else error "initial and/or parameter values must be specified in a list" end if; if lhs(_xout) = "initial" then return [seq(_vars[_i+1] = _res[_i+1], _i = 0 .. _n)] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [seq(_vars[_i+1] = [_res][1][_i+1], _i = 0 .. _n), seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(x_lsode), 'string') = rhs(x_lsode)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _vars end if; if procname <> unknown then return ('procname')(x_lsode) else _ndsol; _ndsol := pointto(_dat[2][0]); return ('_ndsol')(x_lsode) end if end if; try _res := _solnproc(_xout); [seq(_vars[_i+1] = _res[_i+1], _i = 0 .. _n)] catch: error  end try end proc

 

 

# Now, for reasons detailled at the end of the worksheet, I do the
# following "four stages program"
#
#
# 1/ : capture de list of points odeplot returns

aux          := plots:-odeplot(sol, [t, V[1](t), X[1](t)], 0..9):
ListOfPoints := op(1, op(1, aux));
N            := LinearAlgebra:-Dimensions(ListOfPoints)[1];

ListOfPoints := Vector(4, {(1) = ` 1..201 x 1..3 `*Array, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*C_order})

 

201

(2)

# 2/ : Extract from ListOfPoints the ones close to t=8 seconds

AllTheTimes := convert(ListOfPoints[..,1], list):
GoodRows    := zip((u,v)-> if verify(u, 7.8..8.2, `interval`) then v end if, AllTheTimes, [seq(1..N)]);

[175, 176, 177, 178, 179, 180, 181, 182, 183]

(3)

# 3/ : print the extract of ListOfPoints for GoodRows only


printf("\n What odeplot gives\n");
printf("------------------------------------------------\n");
printf("        t               V(t)           X(t)\n");
printf("------------------------------------------------\n");

for k in GoodRows do
   printf("%-15.12f  %-15.12f  %-15.12f\n", seq(ListOfPoints[k,n], n=1..3))
end do;
print():


 What odeplot gives
------------------------------------------------
        t               V(t)           X(t)

------------------------------------------------
7.830000000000   0.002817384181   0.006597587127
7.875000000000   0.002964569411   0.006727757784
7.920000000000   0.003166704318   0.006865745263
7.965000000000   0.003385619552   0.007013165777
8.010000000000   0.003558854571   0.007170093728
8.055000000000   0.003842118974   0.007336171867
8.100000000000   0.004302831211   0.007517231266
8.145000000000   0.003951552171   0.007708525735
8.190000000000   0.003970924524   0.007886798955

 

(4)

# 4/ Now evaluate "pointwise" sol(t) for the times retained

print();
printf("\n What sol(t) gives for the same values of t\n");
printf("------------------------------------------------\n");
printf("        t               V(t)           X(t)\n");
printf("------------------------------------------------\n");

for MyTime in ListOfPoints[GoodRows, 1] do
   MySol := map(u -> rhs(u), sol(MyTime)):
   printf("%-15.12f  %-15.12f  %-15.12f\n", seq(MySol[n], n=1..3))
end do:
print():

 


 What sol(t) gives for the same values of t
------------------------------------------------
        t               V(t)           X(t)
------------------------------------------------
7.830000000000   0.000000000000   0.000987586956
7.875000000000   0.004000359093   0.001166940047
7.920000000000   0.004016468258   0.001347371362
7.965000000000   0.004032379719   0.001528593353
8.010000000000   0.004048109517   0.001710597919
8.055000000000   0.004063691706   0.001893215210
8.100000000000   0.004079090715   0.002076599938
8.145000000000   0.004094338959   0.002260632651
8.190000000000   0.004109918301   0.002445352658

 

(5)

# observe the differences between this table and the previous one !!!

# So ... what does the completely reconstructed "pointwise curve" look like ?
# ... case of X alone

PointwiseCurve := []:
for MyTime in ListOfPoints[.., 1] do
   MySol          := map(u -> rhs(u), sol(MyTime))[[1,3]]:
   PointwiseCurve := [op(PointwiseCurve), MySol];
end do:

display(
  odeplot(sol, [t, X[1](t)], 0..9, color=red, gridlines=true),
  PLOT(POINTS(PointwiseCurve))
);

 

# Astonishing : the odeplot and the pointwise ona are exactly the same !
#
# Let's make a zoom around t=8
display(
  odeplot(sol, [t, X[1](t)], 0..9, color=red, gridlines=true, view=[7.5..8.5, 0.006..0.009]),
  PLOT(POINTS(PointwiseCurve), VIEW(7.5..8.5, 0.006..0.009))
);

 

# Do you see that X(8.1) is close to 0.0075 ?
# Yes ?
# Are you sure ?
# Let's ask for a confirmation ...

sol(8.1);

[t = 8.1, V[1](t) = HFloat(0.0), X[1](t) = HFloat(9.875869562154457e-4)]

(6)

# Conclusion :
#
# MAPLE is MAGIC !!!
#
# REMARK : Have you seen the answer for X[1](t) is the initial value of X[1](0) ?
#          (see top of worksheet)
#
#
# You don't believe me ... ABRACABADRA
# ... and look to the values of sol(8.1) left to the stars
#


ListOfTimes := [1.0, 8.1, 10.0, 8.1, 1.0, 8.1, 10.0, 8.1]:
printf("------------------------------------------------\n");
printf("   t          V(t)            X(t)\n");
printf("------------------------------------------------\n");


k := 0:
for MyTime in ListOfTimes do
   k     := k+1:
   MySol := map(u -> rhs(u), sol(MyTime)):
   if is(k, odd) then
      printf("%6.3f  %-15.12f  %-15.12f\n", MyTime, seq(MySol[n], n=2..3))
   else
      printf("%6.3f  %-15.12f  %-15.12f  ***\n", MyTime, seq(MySol[n], n=2..3))
   end if:
end do:

------------------------------------------------

   t          V(t)            X(t)
------------------------------------------------
 1.000  0.000000000000   0.000987586956
 8.100  0.004283834684   0.007512460823   ***

10.000  0.004613814863   0.015687722648
 8.100  0.000000000000   0.000987586956   ***
 1.000  0.000000000000   0.000987586956

 8.100  0.004283834684   0.007512460823   ***
10.000  0.004613814863   0.015687722648
 8.100  0.000000000000   0.000987586956   ***

 

# In fact the value of sol(8.1) depends on the value T had during
# the previous evaluation sol(T).
# Which suggests that, maybe, some global variable has not been
# properly erased when sol(..) is evaluated (?)

 

SOLVER = RKF45   (slower)

 


# Let's do the same operations after replacing lsode by rkf45
#


restart:
with(plots):

read "/Users/marcsancandi/Desktop/MAPLE++SCILAB/BUG-LSODE/MC.m":
sol := dsolve(MC, numeric, method=rkf45, maxfun=500000);

display(
  odeplot(sol, [t, X[1](t)], 0..9, color=red, gridlines=true, labels=["", "t"], title="X (red), V (blue)"),
  odeplot(sol, [t, V[1](t)], 0..9, color=blue)
);

proc (x_rkf45) local _res, _dat, _vars, _solnproc, _xout, _ndsol, _pars, _n, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](x_rkf45) else _xout := evalf(x_rkf45) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 24, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..54, {(1) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 29, (19) = 500000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0, (54) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.10e-5, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .0, (2) = 0.9875869562154457e-3}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..2, {(1) = .0, (2) = 0.9875869562154457e-3}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = V[1](t), Y[2] = X[1](t)]`; YP[1] := 4.2631803319222423857*(-5.860656250+(1/2)*piecewise(0.605200e-2 <= Y[2] and Y[2] <= 0.615100e-2, -2242.424242*Y[2]+14.03415151)+(1/2)*piecewise(0.600800e-2 <= Y[2] and Y[2] <= 0.605200e-2, -2613.636364*Y[2]+16.28072727)+(1/2)*piecewise(0.598600e-2 <= Y[2] and Y[2] <= 0.600800e-2, -10636.36364*Y[2]+64.48127275)+(1/2)*piecewise(0.594900e-2 <= Y[2] and Y[2] <= 0.598600e-2, -3891.891892*Y[2]+24.10886487)+(1/2)*piecewise(0.757900e-2 <= Y[2] and Y[2] <= 0.758000e-2, 722000.0000*Y[2]-5463.521000)+(1/2)*piecewise(0.581900e-2 <= Y[2] and Y[2] <= 0.594900e-2, -953.8461538*Y[2]+6.630430769)+(1/2)*piecewise(0.652200e-2 <= Y[2] and Y[2] < 0.659000e-2, 2205.882353*Y[2]-16.71876471)+(1/2)*piecewise(0.651100e-2 <= Y[2] and Y[2] < 0.652200e-2, -5181.818182*Y[2]+31.46381818)+(1/2)*piecewise(0.647000e-2 <= Y[2] and Y[2] < 0.651100e-2, 121.9512195*Y[2]-3.069024390)+(1/2)*piecewise(0.644200e-2 <= Y[2] and Y[2] < 0.647000e-2, 1000.000000*Y[2]-8.750000000)+(1/2)*piecewise(0.637600e-2 <= Y[2] and Y[2] < 0.644200e-2, -106.0606061*Y[2]-1.624757576)+(1/2)*piecewise(0.636600e-2 <= Y[2] and Y[2] < 0.637600e-2, -7400.000000*Y[2]+44.88140000)+(1/2)*piecewise(0.622600e-2 <= Y[2] and Y[2] < 0.636600e-2, -1364.285714*Y[2]+6.458042855)+(1/2)*piecewise(0.615100e-2 <= Y[2] and Y[2] < 0.622600e-2, -1560.000000*Y[2]+7.676560000)+(1/2)*piecewise(0.605200e-2 <= Y[2] and Y[2] < 0.615100e-2, -2242.424242*Y[2]+11.87415151)+(1/2)*piecewise(0.600800e-2 <= Y[2] and Y[2] < 0.605200e-2, -2613.636364*Y[2]+14.12072727)+(1/2)*piecewise(0.598600e-2 <= Y[2] and Y[2] < 0.600800e-2, -10636.36364*Y[2]+62.32127275)+(1/2)*piecewise(0.594900e-2 <= Y[2] and Y[2] < 0.598600e-2, -3891.891892*Y[2]+21.94886487)+(1/2)*piecewise(0.581900e-2 <= Y[2] and Y[2] < 0.594900e-2, -953.8461538*Y[2]+4.470430769)+(1/2)*piecewise(0.689400e-2 <= Y[2] and Y[2] <= 0.708200e-2, 2925.531915*Y[2]-19.52861702)-.2108934567*piecewise(X < 0, 0, X < 0.500000e-1, -367.8000000*X, X < .700000, -17.02230769-27.35384615*X, X < 1.90000, -29.01250000-10.22500000*X, X < 2.10000, -95.08500000+24.55000000*X, X < 2.15000, -1459.770000+674.4000000*X, X < 3.00000, -9.81000, X < 10.0000, 20.27142858-10.02714286*X, 10.0000 <= X, 0)+(1/2)*piecewise(0. <= Y[2] and Y[2] <= 0.300000e-4, 19466.66667*Y[2])+(1/2)*piecewise(0. <= Y[2] and Y[2] < 0.300000e-4, -19466.66667*Y[2])+piecewise(Y[1] < 0, HFloat(60.22353335250315)*abs(Y[1])+HFloat(11322.011918013375)*abs(Y[1])*Y[2]+HFloat(2211.801459998933)*evalf(abs(Y[1])^(3/2))+HFloat(133745.6732874636)*evalf(abs(Y[1])^(3/2))*Y[2]+HFloat(268619.00766055053)*abs(Y[1])^2-HFloat(2061016.308532005)*abs(Y[1])^2*Y[2]+HFloat(150751.03532735075)*evalf(abs(Y[1])^(5/2))+HFloat(9360854.911991587)*evalf(abs(Y[1])^(5/2))*Y[2], -HFloat(93.20933633186229)*abs(Y[1])-HFloat(17119.399226077283)*abs(Y[1])*Y[2]-HFloat(527.9199512820593)*evalf(abs(Y[1])^(3/2))+HFloat(132509.09343956804)*evalf(abs(Y[1])^(3/2))*Y[2]-HFloat(295176.0878003018)*abs(Y[1])^2-HFloat(1808560.9221036755)*abs(Y[1])^2*Y[2]-HFloat(67565.79316544208)*evalf(abs(Y[1])^(5/2))+HFloat(8702690.483040193)*evalf(abs(Y[1])^(5/2))*Y[2])+(1/2)*piecewise(0.719600e-2 <= Y[2] and Y[2] < 0.743900e-2, 4263.374486*Y[2]-31.46024280)+(1/2)*piecewise(0.709200e-2 <= Y[2] and Y[2] < 0.719600e-2, 1778.846154*Y[2]-13.58157692)+(1/2)*piecewise(0.708200e-2 <= Y[2] and Y[2] < 0.709200e-2, 400.0000000*Y[2]-3.802800000)+(1/2)*piecewise(0.689400e-2 <= Y[2] and Y[2] < 0.708200e-2, 2925.531915*Y[2]-21.68861702)+(1/2)*piecewise(0.668500e-2 <= Y[2] and Y[2] < 0.689400e-2, 2574.162679*Y[2]-19.26627751)+(1/2)*piecewise(0.659000e-2 <= Y[2] and Y[2] < 0.668500e-2, 1305.263158*Y[2]-10.78368421)+(1/2)*piecewise(0.708200e-2 <= Y[2] and Y[2] <= 0.709200e-2, 400.0000000*Y[2]-1.642800000)+(1/2)*piecewise(0.615100e-2 <= Y[2] and Y[2] <= 0.622600e-2, -1560.000000*Y[2]+9.836560000)+(1/2)*piecewise(0.757200e-2 <= Y[2] and Y[2] <= 0.757900e-2, 187714.2857*Y[2]-1414.169571)+(1/2)*piecewise(0.391800e-2 <= Y[2] and Y[2] <= 0.581900e-2, 16.83324566*Y[2]+.9820473435)+(1/2)*piecewise(0.754100e-2 <= Y[2] and Y[2] <= 0.757200e-2, 38225.80645*Y[2]-282.2428064)+(1/2)*piecewise(0.230100e-2 <= Y[2] and Y[2] <= 0.391800e-2, 39.57946815*Y[2]+.8929276438)+(1/2)*piecewise(0.753300e-2 <= Y[2] and Y[2] <= 0.754100e-2, 333375.0000*Y[2]-2507.962875)+(1/2)*piecewise(0.452000e-3 <= Y[2] and Y[2] <= 0.230100e-2, 49.21579232*Y[2]+.8707544619)+(1/2)*piecewise(0.747300e-2 <= Y[2] and Y[2] <= 0.753300e-2, 11516.66667*Y[2]-83.40405002)+(1/2)*piecewise(0.760000e-4 <= Y[2] and Y[2] <= 0.452000e-3, 513.2978723*Y[2]+.6609893617)+(1/2)*piecewise(0.746900e-2 <= Y[2] and Y[2] <= 0.747300e-2, 59000.00000*Y[2]-438.2470000)+(1/2)*piecewise(0.743900e-2 <= Y[2] and Y[2] <= 0.746900e-2, 300.0000000*Y[2]+.183300000)+(1/2)*piecewise(0.300000e-4 <= Y[2] and Y[2] <= 0.760000e-4, 2521.739130*Y[2]+.5083478261)+(1/2)*piecewise(0.719600e-2 <= Y[2] and Y[2] <= 0.743900e-2, 4263.374486*Y[2]-29.30024280)+(1/2)*piecewise(0.709200e-2 <= Y[2] and Y[2] <= 0.719600e-2, 1778.846154*Y[2]-11.42157692)+(1/2)*piecewise(0.757900e-2 <= Y[2] and Y[2] < 0.758000e-2, 722000.0000*Y[2]-5465.681000)+(1/2)*piecewise(0.757200e-2 <= Y[2] and Y[2] < 0.757900e-2, 187714.2857*Y[2]-1416.329571)+(1/2)*piecewise(0.754100e-2 <= Y[2] and Y[2] < 0.757200e-2, 38225.80645*Y[2]-284.4028064)+(1/2)*piecewise(0.753300e-2 <= Y[2] and Y[2] < 0.754100e-2, 333375.0000*Y[2]-2510.122875)+(1/2)*piecewise(0.747300e-2 <= Y[2] and Y[2] < 0.753300e-2, 11516.66667*Y[2]-85.56405002)+(1/2)*piecewise(0.746900e-2 <= Y[2] and Y[2] < 0.747300e-2, 59000.00000*Y[2]-440.4070000)+(1/2)*piecewise(0.743900e-2 <= Y[2] and Y[2] < 0.746900e-2, 300.0000000*Y[2]-1.976700000)+(1/2)*piecewise(0.391800e-2 <= Y[2] and Y[2] < 0.581900e-2, -16.83324566*Y[2]-.9820473435)+(1/2)*piecewise(0.230100e-2 <= Y[2] and Y[2] < 0.391800e-2, -39.57946815*Y[2]-.8929276438)+(1/2)*piecewise(0.452000e-3 <= Y[2] and Y[2] < 0.230100e-2, -49.21579232*Y[2]-.8707544619)+(1/2)*piecewise(0.760000e-4 <= Y[2] and Y[2] < 0.452000e-3, -513.2978723*Y[2]-.6609893617)+(1/2)*piecewise(0.300000e-4 <= Y[2] and Y[2] < 0.760000e-4, -2521.739130*Y[2]-.5083478261)+(1/2)*piecewise(0.668500e-2 <= Y[2] and Y[2] <= 0.689400e-2, 2574.162679*Y[2]-17.10627751)+(1/2)*piecewise(0.659000e-2 <= Y[2] and Y[2] <= 0.668500e-2, 1305.263158*Y[2]-8.623684211)+(1/2)*piecewise(0.652200e-2 <= Y[2] and Y[2] <= 0.659000e-2, 2205.882353*Y[2]-14.55876471)+(1/2)*piecewise(0.651100e-2 <= Y[2] and Y[2] <= 0.652200e-2, -5181.818182*Y[2]+33.62381818)+(1/2)*piecewise(0.647000e-2 <= Y[2] and Y[2] <= 0.651100e-2, 121.9512195*Y[2]-.9090243902)+(1/2)*piecewise(0.644200e-2 <= Y[2] and Y[2] <= 0.647000e-2, 1000.000000*Y[2]-6.590000000)+(1/2)*piecewise(0.637600e-2 <= Y[2] and Y[2] <= 0.644200e-2, -106.0606061*Y[2]+.5352424245)+(1/2)*piecewise(0.636600e-2 <= Y[2] and Y[2] <= 0.637600e-2, -7400.000000*Y[2]+47.04140000)+(1/2)*piecewise(0.622600e-2 <= Y[2] and Y[2] <= 0.636600e-2, -1364.285714*Y[2]+8.618042855)-193.7500000*Y[2]+(1/2)*(-piecewise(0.605200e-2 <= Y[2] and Y[2] <= 0.615100e-2, -2242.424242*Y[2]+14.03415151)-piecewise(0.600800e-2 <= Y[2] and Y[2] <= 0.605200e-2, -2613.636364*Y[2]+16.28072727)-piecewise(0.598600e-2 <= Y[2] and Y[2] <= 0.600800e-2, -10636.36364*Y[2]+64.48127275)-piecewise(0.594900e-2 <= Y[2] and Y[2] <= 0.598600e-2, -3891.891892*Y[2]+24.10886487)-piecewise(0.757900e-2 <= Y[2] and Y[2] <= 0.758000e-2, 722000.0000*Y[2]-5463.521000)-piecewise(0.581900e-2 <= Y[2] and Y[2] <= 0.594900e-2, -953.8461538*Y[2]+6.630430769)+piecewise(0.652200e-2 <= Y[2] and Y[2] < 0.659000e-2, 2205.882353*Y[2]-16.71876471)+piecewise(0.651100e-2 <= Y[2] and Y[2] < 0.652200e-2, -5181.818182*Y[2]+31.46381818)+piecewise(0.647000e-2 <= Y[2] and Y[2] < 0.651100e-2, 121.9512195*Y[2]-3.069024390)+piecewise(0.644200e-2 <= Y[2] and Y[2] < 0.647000e-2, 1000.000000*Y[2]-8.750000000)+piecewise(0.637600e-2 <= Y[2] and Y[2] < 0.644200e-2, -106.0606061*Y[2]-1.624757576)+piecewise(0.636600e-2 <= Y[2] and Y[2] < 0.637600e-2, -7400.000000*Y[2]+44.88140000)+piecewise(0.622600e-2 <= Y[2] and Y[2] < 0.636600e-2, -1364.285714*Y[2]+6.458042855)+piecewise(0.615100e-2 <= Y[2] and Y[2] < 0.622600e-2, -1560.000000*Y[2]+7.676560000)+piecewise(0.605200e-2 <= Y[2] and Y[2] < 0.615100e-2, -2242.424242*Y[2]+11.87415151)+piecewise(0.600800e-2 <= Y[2] and Y[2] < 0.605200e-2, -2613.636364*Y[2]+14.12072727)+piecewise(0.598600e-2 <= Y[2] and Y[2] < 0.600800e-2, -10636.36364*Y[2]+62.32127275)+piecewise(0.594900e-2 <= Y[2] and Y[2] < 0.598600e-2, -3891.891892*Y[2]+21.94886487)+piecewise(0.581900e-2 <= Y[2] and Y[2] < 0.594900e-2, -953.8461538*Y[2]+4.470430769)-piecewise(0.689400e-2 <= Y[2] and Y[2] <= 0.708200e-2, 2925.531915*Y[2]-19.52861702)-piecewise(0. <= Y[2] and Y[2] <= 0.300000e-4, 19466.66667*Y[2])+piecewise(0. <= Y[2] and Y[2] < 0.300000e-4, -19466.66667*Y[2])+piecewise(0.719600e-2 <= Y[2] and Y[2] < 0.743900e-2, 4263.374486*Y[2]-31.46024280)+piecewise(0.709200e-2 <= Y[2] and Y[2] < 0.719600e-2, 1778.846154*Y[2]-13.58157692)+piecewise(0.708200e-2 <= Y[2] and Y[2] < 0.709200e-2, 400.0000000*Y[2]-3.802800000)+piecewise(0.689400e-2 <= Y[2] and Y[2] < 0.708200e-2, 2925.531915*Y[2]-21.68861702)+piecewise(0.668500e-2 <= Y[2] and Y[2] < 0.689400e-2, 2574.162679*Y[2]-19.26627751)+piecewise(0.659000e-2 <= Y[2] and Y[2] < 0.668500e-2, 1305.263158*Y[2]-10.78368421)-piecewise(0.708200e-2 <= Y[2] and Y[2] <= 0.709200e-2, 400.0000000*Y[2]-1.642800000)-piecewise(0.615100e-2 <= Y[2] and Y[2] <= 0.622600e-2, -1560.000000*Y[2]+9.836560000)-piecewise(0.757200e-2 <= Y[2] and Y[2] <= 0.757900e-2, 187714.2857*Y[2]-1414.169571)-piecewise(0.391800e-2 <= Y[2] and Y[2] <= 0.581900e-2, 16.83324566*Y[2]+.9820473435)-piecewise(0.754100e-2 <= Y[2] and Y[2] <= 0.757200e-2, 38225.80645*Y[2]-282.2428064)-piecewise(0.230100e-2 <= Y[2] and Y[2] <= 0.391800e-2, 39.57946815*Y[2]+.8929276438)-piecewise(0.753300e-2 <= Y[2] and Y[2] <= 0.754100e-2, 333375.0000*Y[2]-2507.962875)-piecewise(0.452000e-3 <= Y[2] and Y[2] <= 0.230100e-2, 49.21579232*Y[2]+.8707544619)-piecewise(0.747300e-2 <= Y[2] and Y[2] <= 0.753300e-2, 11516.66667*Y[2]-83.40405002)-piecewise(0.760000e-4 <= Y[2] and Y[2] <= 0.452000e-3, 513.2978723*Y[2]+.6609893617)-piecewise(0.746900e-2 <= Y[2] and Y[2] <= 0.747300e-2, 59000.00000*Y[2]-438.2470000)-piecewise(0.743900e-2 <= Y[2] and Y[2] <= 0.746900e-2, 300.0000000*Y[2]+.183300000)-piecewise(0.300000e-4 <= Y[2] and Y[2] <= 0.760000e-4, 2521.739130*Y[2]+.5083478261)-piecewise(0.719600e-2 <= Y[2] and Y[2] <= 0.743900e-2, 4263.374486*Y[2]-29.30024280)-piecewise(0.709200e-2 <= Y[2] and Y[2] <= 0.719600e-2, 1778.846154*Y[2]-11.42157692)+piecewise(0.757900e-2 <= Y[2] and Y[2] < 0.758000e-2, 722000.0000*Y[2]-5465.681000)+piecewise(0.757200e-2 <= Y[2] and Y[2] < 0.757900e-2, 187714.2857*Y[2]-1416.329571)+piecewise(0.754100e-2 <= Y[2] and Y[2] < 0.757200e-2, 38225.80645*Y[2]-284.4028064)+piecewise(0.753300e-2 <= Y[2] and Y[2] < 0.754100e-2, 333375.0000*Y[2]-2510.122875)+piecewise(0.747300e-2 <= Y[2] and Y[2] < 0.753300e-2, 11516.66667*Y[2]-85.56405002)+piecewise(0.746900e-2 <= Y[2] and Y[2] < 0.747300e-2, 59000.00000*Y[2]-440.4070000)+piecewise(0.743900e-2 <= Y[2] and Y[2] < 0.746900e-2, 300.0000000*Y[2]-1.976700000)+piecewise(0.391800e-2 <= Y[2] and Y[2] < 0.581900e-2, -16.83324566*Y[2]-.9820473435)+piecewise(0.230100e-2 <= Y[2] and Y[2] < 0.391800e-2, -39.57946815*Y[2]-.8929276438)+piecewise(0.452000e-3 <= Y[2] and Y[2] < 0.230100e-2, -49.21579232*Y[2]-.8707544619)+piecewise(0.760000e-4 <= Y[2] and Y[2] < 0.452000e-3, -513.2978723*Y[2]-.6609893617)+piecewise(0.300000e-4 <= Y[2] and Y[2] < 0.760000e-4, -2521.739130*Y[2]-.5083478261)-piecewise(0.668500e-2 <= Y[2] and Y[2] <= 0.689400e-2, 2574.162679*Y[2]-17.10627751)-piecewise(0.659000e-2 <= Y[2] and Y[2] <= 0.668500e-2, 1305.263158*Y[2]-8.623684211)-piecewise(0.652200e-2 <= Y[2] and Y[2] <= 0.659000e-2, 2205.882353*Y[2]-14.55876471)-piecewise(0.651100e-2 <= Y[2] and Y[2] <= 0.652200e-2, -5181.818182*Y[2]+33.62381818)-piecewise(0.647000e-2 <= Y[2] and Y[2] <= 0.651100e-2, 121.9512195*Y[2]-.9090243902)-piecewise(0.644200e-2 <= Y[2] and Y[2] <= 0.647000e-2, 1000.000000*Y[2]-6.590000000)-piecewise(0.637600e-2 <= Y[2] and Y[2] <= 0.644200e-2, -106.0606061*Y[2]+.5352424245)-piecewise(0.636600e-2 <= Y[2] and Y[2] <= 0.637600e-2, -7400.000000*Y[2]+47.04140000)-piecewise(0.622600e-2 <= Y[2] and Y[2] <= 0.636600e-2, -1364.285714*Y[2]+8.618042855))*tanh(26466.52412*Y[1]))*piecewise((1/2)*piecewise(0.605200e-2 <= Y[2] and Y[2] <= 0.615100e-2, -2242.424242*Y[2]+14.03415151)+(1/2)*piecewise(0.600800e-2 <= Y[2] and Y[2] <= 0.605200e-2, -2613.636364*Y[2]+16.28072727)+(1/2)*piecewise(0.598600e-2 <= Y[2] and Y[2] <= 0.600800e-2, -10636.36364*Y[2]+64.48127275)+(1/2)*piecewise(0.594900e-2 <= Y[2] and Y[2] <= 0.598600e-2, -3891.891892*Y[2]+24.10886487)+(1/2)*piecewise(0.757900e-2 <= Y[2] and Y[2] <= 0.758000e-2, 722000.0000*Y[2]-5463.521000)+(1/2)*piecewise(0.581900e-2 <= Y[2] and Y[2] <= 0.594900e-2, -953.8461538*Y[2]+6.630430769)+(1/2)*piecewise(0.652200e-2 <= Y[2] and Y[2] < 0.659000e-2, 2205.882353*Y[2]-16.71876471)+(1/2)*piecewise(0.651100e-2 <= Y[2] and Y[2] < 0.652200e-2, -5181.818182*Y[2]+31.46381818)+(1/2)*piecewise(0.647000e-2 <= Y[2] and Y[2] < 0.651100e-2, 121.9512195*Y[2]-3.069024390)+(1/2)*piecewise(0.644200e-2 <= Y[2] and Y[2] < 0.647000e-2, 1000.000000*Y[2]-8.750000000)+(1/2)*piecewise(0.637600e-2 <= Y[2] and Y[2] < 0.644200e-2, -106.0606061*Y[2]-1.624757576)+(1/2)*piecewise(0.636600e-2 <= Y[2] and Y[2] < 0.637600e-2, -7400.000000*Y[2]+44.88140000)+(1/2)*piecewise(0.622600e-2 <= Y[2] and Y[2] < 0.636600e-2, -1364.285714*Y[2]+6.458042855)+(1/2)*piecewise(0.615100e-2 <= Y[2] and Y[2] < 0.622600e-2, -1560.000000*Y[2]+7.676560000)+(1/2)*piecewise(0.605200e-2 <= Y[2] and Y[2] < 0.615100e-2, -2242.424242*Y[2]+11.87415151)+(1/2)*piecewise(0.600800e-2 <= Y[2] and Y[2] < 0.605200e-2, -2613.636364*Y[2]+14.12072727)+(1/2)*piecewise(0.598600e-2 <= Y[2] and Y[2] < 0.600800e-2, -10636.36364*Y[2]+62.32127275)+(1/2)*piecewise(0.594900e-2 <= Y[2] and Y[2] < 0.598600e-2, -3891.891892*Y[2]+21.94886487)+(1/2)*piecewise(0.581900e-2 <= Y[2] and Y[2] < 0.594900e-2, -953.8461538*Y[2]+4.470430769)+(1/2)*piecewise(0.689400e-2 <= Y[2] and Y[2] <= 0.708200e-2, 2925.531915*Y[2]-19.52861702)-.2108934567*piecewise(X < 0, 0, X < 0.500000e-1, -367.8000000*X, X < .700000, -17.02230769-27.35384615*X, X < 1.90000, -29.01250000-10.22500000*X, X < 2.10000, -95.08500000+24.55000000*X, X < 2.15000, -1459.770000+674.4000000*X, X < 3.00000, -9.81000, X < 10.0000, 20.27142858-10.02714286*X, 10.0000 <= X, 0)+(1/2)*piecewise(0. <= Y[2] and Y[2] <= 0.300000e-4, 19466.66667*Y[2])+(1/2)*piecewise(0. <= Y[2] and Y[2] < 0.300000e-4, -19466.66667*Y[2])+piecewise(Y[1] < 0, HFloat(60.22353335250315)*abs(Y[1])+HFloat(11322.011918013375)*abs(Y[1])*Y[2]+HFloat(2211.801459998933)*evalf(abs(Y[1])^(3/2))+HFloat(133745.6732874636)*evalf(abs(Y[1])^(3/2))*Y[2]+HFloat(268619.00766055053)*abs(Y[1])^2-HFloat(2061016.308532005)*abs(Y[1])^2*Y[2]+HFloat(150751.03532735075)*evalf(abs(Y[1])^(5/2))+HFloat(9360854.911991587)*evalf(abs(Y[1])^(5/2))*Y[2], -HFloat(93.20933633186229)*abs(Y[1])-HFloat(17119.399226077283)*abs(Y[1])*Y[2]-HFloat(527.9199512820593)*evalf(abs(Y[1])^(3/2))+HFloat(132509.09343956804)*evalf(abs(Y[1])^(3/2))*Y[2]-HFloat(295176.0878003018)*abs(Y[1])^2-HFloat(1808560.9221036755)*abs(Y[1])^2*Y[2]-HFloat(67565.79316544208)*evalf(abs(Y[1])^(5/2))+HFloat(8702690.483040193)*evalf(abs(Y[1])^(5/2))*Y[2])+(1/2)*piecewise(0.719600e-2 <= Y[2] and Y[2] < 0.743900e-2, 4263.374486*Y[2]-31.46024280)+(1/2)*piecewise(0.709200e-2 <= Y[2] and Y[2] < 0.719600e-2, 1778.846154*Y[2]-13.58157692)+(1/2)*piecewise(0.708200e-2 <= Y[2] and Y[2] < 0.709200e-2, 400.0000000*Y[2]-3.802800000)+(1/2)*piecewise(0.689400e-2 <= Y[2] and Y[2] < 0.708200e-2, 2925.531915*Y[2]-21.68861702)+(1/2)*piecewise(0.668500e-2 <= Y[2] and Y[2] < 0.689400e-2, 2574.162679*Y[2]-19.26627751)+(1/2)*piecewise(0.659000e-2 <= Y[2] and Y[2] < 0.668500e-2, 1305.263158*Y[2]-10.78368421)+(1/2)*piecewise(0.708200e-2 <= Y[2] and Y[2] <= 0.709200e-2, 400.0000000*Y[2]-1.642800000)+(1/2)*piecewise(0.615100e-2 <= Y[2] and Y[2] <= 0.622600e-2, -1560.000000*Y[2]+9.836560000)+(1/2)*piecewise(0.757200e-2 <= Y[2] and Y[2] <= 0.757900e-2, 187714.2857*Y[2]-1414.169571)+(1/2)*piecewise(0.391800e-2 <= Y[2] and Y[2] <= 0.581900e-2, 16.83324566*Y[2]+.9820473435)+(1/2)*piecewise(0.754100e-2 <= Y[2] and Y[2] <= 0.757200e-2, 38225.80645*Y[2]-282.2428064)+(1/2)*piecewise(0.230100e-2 <= Y[2] and Y[2] <= 0.391800e-2, 39.57946815*Y[2]+.8929276438)+(1/2)*piecewise(0.753300e-2 <= Y[2] and Y[2] <= 0.754100e-2, 333375.0000*Y[2]-2507.962875)+(1/2)*piecewise(0.452000e-3 <= Y[2] and Y[2] <= 0.230100e-2, 49.21579232*Y[2]+.8707544619)+(1/2)*piecewise(0.747300e-2 <= Y[2] and Y[2] <= 0.753300e-2, 11516.66667*Y[2]-83.40405002)+(1/2)*piecewise(0.760000e-4 <= Y[2] and Y[2] <= 0.452000e-3, 513.2978723*Y[2]+.6609893617)+(1/2)*piecewise(0.746900e-2 <= Y[2] and Y[2] <= 0.747300e-2, 59000.00000*Y[2]-438.2470000)+(1/2)*piecewise(0.743900e-2 <= Y[2] and Y[2] <= 0.746900e-2, 300.0000000*Y[2]+.183300000)+(1/2)*piecewise(0.300000e-4 <= Y[2] and Y[2] <= 0.760000e-4, 2521.739130*Y[2]+.5083478261)+(1/2)*piecewise(0.719600e-2 <= Y[2] and Y[2] <= 0.743900e-2, 4263.374486*Y[2]-29.30024280)+(1/2)*piecewise(0.709200e-2 <= Y[2] and Y[2] <= 0.719600e-2, 1778.846154*Y[2]-11.42157692)+(1/2)*piecewise(0.757900e-2 <= Y[2] and Y[2] < 0.758000e-2, 722000.0000*Y[2]-5465.681000)+(1/2)*piecewise(0.757200e-2 <= Y[2] and Y[2] < 0.757900e-2, 187714.2857*Y[2]-1416.329571)+(1/2)*piecewise(0.754100e-2 <= Y[2] and Y[2] < 0.757200e-2, 38225.80645*Y[2]-284.4028064)+(1/2)*piecewise(0.753300e-2 <= Y[2] and Y[2] < 0.754100e-2, 333375.0000*Y[2]-2510.122875)+(1/2)*piecewise(0.747300e-2 <= Y[2] and Y[2] < 0.753300e-2, 11516.66667*Y[2]-85.56405002)+(1/2)*piecewise(0.746900e-2 <= Y[2] and Y[2] < 0.747300e-2, 59000.00000*Y[2]-440.4070000)+(1/2)*piecewise(0.743900e-2 <= Y[2] and Y[2] < 0.746900e-2, 300.0000000*Y[2]-1.976700000)+(1/2)*piecewise(0.391800e-2 <= Y[2] and Y[2] < 0.581900e-2, -16.83324566*Y[2]-.9820473435)+(1/2)*piecewise(0.230100e-2 <= Y[2] and Y[2] < 0.391800e-2, -39.57946815*Y[2]-.8929276438)+(1/2)*piecewise(0.452000e-3 <= Y[2] and Y[2] < 0.230100e-2, -49.21579232*Y[2]-.8707544619)+(1/2)*piecewise(0.760000e-4 <= Y[2] and Y[2] < 0.452000e-3, -513.2978723*Y[2]-.6609893617)+(1/2)*piecewise(0.300000e-4 <= Y[2] and Y[2] < 0.760000e-4, -2521.739130*Y[2]-.5083478261)+(1/2)*piecewise(0.668500e-2 <= Y[2] and Y[2] <= 0.689400e-2, 2574.162679*Y[2]-17.10627751)+(1/2)*piecewise(0.659000e-2 <= Y[2] and Y[2] <= 0.668500e-2, 1305.263158*Y[2]-8.623684211)+(1/2)*piecewise(0.652200e-2 <= Y[2] and Y[2] <= 0.659000e-2, 2205.882353*Y[2]-14.55876471)+(1/2)*piecewise(0.651100e-2 <= Y[2] and Y[2] <= 0.652200e-2, -5181.818182*Y[2]+33.62381818)+(1/2)*piecewise(0.647000e-2 <= Y[2] and Y[2] <= 0.651100e-2, 121.9512195*Y[2]-.9090243902)+(1/2)*piecewise(0.644200e-2 <= Y[2] and Y[2] <= 0.647000e-2, 1000.000000*Y[2]-6.590000000)+(1/2)*piecewise(0.637600e-2 <= Y[2] and Y[2] <= 0.644200e-2, -106.0606061*Y[2]+.5352424245)+(1/2)*piecewise(0.636600e-2 <= Y[2] and Y[2] <= 0.637600e-2, -7400.000000*Y[2]+47.04140000)+(1/2)*piecewise(0.622600e-2 <= Y[2] and Y[2] <= 0.636600e-2, -1364.285714*Y[2]+8.618042855)-193.7500000*Y[2]+(1/2)*(-piecewise(0.605200e-2 <= Y[2] and Y[2] <= 0.615100e-2, -2242.424242*Y[2]+14.03415151)-piecewise(0.600800e-2 <= Y[2] and Y[2] <= 0.605200e-2, -2613.636364*Y[2]+16.28072727)-piecewise(0.598600e-2 <= Y[2] and Y[2] <= 0.600800e-2, -10636.36364*Y[2]+64.48127275)-piecewise(0.594900e-2 <= Y[2] and Y[2] <= 0.598600e-2, -3891.891892*Y[2]+24.10886487)-piecewise(0.757900e-2 <= Y[2] and Y[2] <= 0.758000e-2, 722000.0000*Y[2]-5463.521000)-piecewise(0.581900e-2 <= Y[2] and Y[2] <= 0.594900e-2, -953.8461538*Y[2]+6.630430769)+piecewise(0.652200e-2 <= Y[2] and Y[2] < 0.659000e-2, 2205.882353*Y[2]-16.71876471)+piecewise(0.651100e-2 <= Y[2] and Y[2] < 0.652200e-2, -5181.818182*Y[2]+31.46381818)+piecewise(0.647000e-2 <= Y[2] and Y[2] < 0.651100e-2, 121.9512195*Y[2]-3.069024390)+piecewise(0.644200e-2 <= Y[2] and Y[2] < 0.647000e-2, 1000.000000*Y[2]-8.750000000)+piecewise(0.637600e-2 <= Y[2] and Y[2] < 0.644200e-2, -106.0606061*Y[2]-1.624757576)+piecewise(0.636600e-2 <= Y[2] and Y[2] < 0.637600e-2, -7400.000000*Y[2]+44.88140000)+piecewise(0.622600e-2 <= Y[2] and Y[2] < 0.636600e-2, -1364.285714*Y[2]+6.458042855)+piecewise(0.615100e-2 <= Y[2] and Y[2] < 0.622600e-2, -1560.000000*Y[2]+7.676560000)+piecewise(0.605200e-2 <= Y[2] and Y[2] < 0.615100e-2, -2242.424242*Y[2]+11.87415151)+piecewise(0.600800e-2 <= Y[2] and Y[2] < 0.605200e-2, -2613.636364*Y[2]+14.12072727)+piecewise(0.598600e-2 <= Y[2] and Y[2] < 0.600800e-2, -10636.36364*Y[2]+62.32127275)+piecewise(0.594900e-2 <= Y[2] and Y[2] < 0.598600e-2, -3891.891892*Y[2]+21.94886487)+piecewise(0.581900e-2 <= Y[2] and Y[2] < 0.594900e-2, -953.8461538*Y[2]+4.470430769)-piecewise(0.689400e-2 <= Y[2] and Y[2] <= 0.708200e-2, 2925.531915*Y[2]-19.52861702)-piecewise(0. <= Y[2] and Y[2] <= 0.300000e-4, 19466.66667*Y[2])+piecewise(0. <= Y[2] and Y[2] < 0.300000e-4, -19466.66667*Y[2])+piecewise(0.719600e-2 <= Y[2] and Y[2] < 0.743900e-2, 4263.374486*Y[2]-31.46024280)+piecewise(0.709200e-2 <= Y[2] and Y[2] < 0.719600e-2, 1778.846154*Y[2]-13.58157692)+piecewise(0.708200e-2 <= Y[2] and Y[2] < 0.709200e-2, 400.0000000*Y[2]-3.802800000)+piecewise(0.689400e-2 <= Y[2] and Y[2] < 0.708200e-2, 2925.531915*Y[2]-21.68861702)+piecewise(0.668500e-2 <= Y[2] and Y[2] < 0.689400e-2, 2574.162679*Y[2]-19.26627751)+piecewise(0.659000e-2 <= Y[2] and Y[2] < 0.668500e-2, 1305.263158*Y[2]-10.78368421)-piecewise(0.708200e-2 <= Y[2] and Y[2] <= 0.709200e-2, 400.0000000*Y[2]-1.642800000)-piecewise(0.615100e-2 <= Y[2] and Y[2] <= 0.622600e-2, -1560.000000*Y[2]+9.836560000)-piecewise(0.757200e-2 <= Y[2] and Y[2] <= 0.757900e-2, 187714.2857*Y[2]-1414.169571)-piecewise(0.391800e-2 <= Y[2] and Y[2] <= 0.581900e-2, 16.83324566*Y[2]+.9820473435)-piecewise(0.754100e-2 <= Y[2] and Y[2] <= 0.757200e-2, 38225.80645*Y[2]-282.2428064)-piecewise(0.230100e-2 <= Y[2] and Y[2] <= 0.391800e-2, 39.57946815*Y[2]+.8929276438)-piecewise(0.753300e-2 <= Y[2] and Y[2] <= 0.754100e-2, 333375.0000*Y[2]-2507.962875)-piecewise(0.452000e-3 <= Y[2] and Y[2] <= 0.230100e-2, 49.21579232*Y[2]+.8707544619)-piecewise(0.747300e-2 <= Y[2] and Y[2] <= 0.753300e-2, 11516.66667*Y[2]-83.40405002)-piecewise(0.760000e-4 <= Y[2] and Y[2] <= 0.452000e-3, 513.2978723*Y[2]+.6609893617)-piecewise(0.746900e-2 <= Y[2] and Y[2] <= 0.747300e-2, 59000.00000*Y[2]-438.2470000)-piecewise(0.743900e-2 <= Y[2] and Y[2] <= 0.746900e-2, 300.0000000*Y[2]+.183300000)-piecewise(0.300000e-4 <= Y[2] and Y[2] <= 0.760000e-4, 2521.739130*Y[2]+.5083478261)-piecewise(0.719600e-2 <= Y[2] and Y[2] <= 0.743900e-2, 4263.374486*Y[2]-29.30024280)-piecewise(0.709200e-2 <= Y[2] and Y[2] <= 0.719600e-2, 1778.846154*Y[2]-11.42157692)+piecewise(0.757900e-2 <= Y[2] and Y[2] < 0.758000e-2, 722000.0000*Y[2]-5465.681000)+piecewise(0.757200e-2 <= Y[2] and Y[2] < 0.757900e-2, 187714.2857*Y[2]-1416.329571)+piecewise(0.754100e-2 <= Y[2] and Y[2] < 0.757200e-2, 38225.80645*Y[2]-284.4028064)+piecewise(0.753300e-2 <= Y[2] and Y[2] < 0.754100e-2, 333375.0000*Y[2]-2510.122875)+piecewise(0.747300e-2 <= Y[2] and Y[2] < 0.753300e-2, 11516.66667*Y[2]-85.56405002)+piecewise(0.746900e-2 <= Y[2] and Y[2] < 0.747300e-2, 59000.00000*Y[2]-440.4070000)+piecewise(0.743900e-2 <= Y[2] and Y[2] < 0.746900e-2, 300.0000000*Y[2]-1.976700000)+piecewise(0.391800e-2 <= Y[2] and Y[2] < 0.581900e-2, -16.83324566*Y[2]-.9820473435)+piecewise(0.230100e-2 <= Y[2] and Y[2] < 0.391800e-2, -39.57946815*Y[2]-.8929276438)+piecewise(0.452000e-3 <= Y[2] and Y[2] < 0.230100e-2, -49.21579232*Y[2]-.8707544619)+piecewise(0.760000e-4 <= Y[2] and Y[2] < 0.452000e-3, -513.2978723*Y[2]-.6609893617)+piecewise(0.300000e-4 <= Y[2] and Y[2] < 0.760000e-4, -2521.739130*Y[2]-.5083478261)-piecewise(0.668500e-2 <= Y[2] and Y[2] <= 0.689400e-2, 2574.162679*Y[2]-17.10627751)-piecewise(0.659000e-2 <= Y[2] and Y[2] <= 0.668500e-2, 1305.263158*Y[2]-8.623684211)-piecewise(0.652200e-2 <= Y[2] and Y[2] <= 0.659000e-2, 2205.882353*Y[2]-14.55876471)-piecewise(0.651100e-2 <= Y[2] and Y[2] <= 0.652200e-2, -5181.818182*Y[2]+33.62381818)-piecewise(0.647000e-2 <= Y[2] and Y[2] <= 0.651100e-2, 121.9512195*Y[2]-.9090243902)-piecewise(0.644200e-2 <= Y[2] and Y[2] <= 0.647000e-2, 1000.000000*Y[2]-6.590000000)-piecewise(0.637600e-2 <= Y[2] and Y[2] <= 0.644200e-2, -106.0606061*Y[2]+.5352424245)-piecewise(0.636600e-2 <= Y[2] and Y[2] <= 0.637600e-2, -7400.000000*Y[2]+47.04140000)-piecewise(0.622600e-2 <= Y[2] and Y[2] <= 0.636600e-2, -1364.285714*Y[2]+8.618042855))*tanh(26466.52412*Y[1]) <= 5.860656250, piecewise(Y[2] <= HFloat(9.875869562154457e-4), 0, 1), 1)+4.2631803319222423857*piecewise(abs(Y[2]-HFloat(9.875869562154457e-4)) < 1/1000000 and Y[1] <= -1/100000000, 1, 0); YP[2] := Y[1]*piecewise(Y[1] <= 0, piecewise(Y[2] <= HFloat(9.875869562154457e-4), 0, 1), 1); 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = V[1](t), Y[2] = X[1](t)]`; YP[1] := 4.2631803319222423857*(-5.860656250+(1/2)*piecewise(0.605200e-2 <= Y[2] and Y[2] <= 0.615100e-2, -2242.424242*Y[2]+14.03415151)+(1/2)*piecewise(0.600800e-2 <= Y[2] and Y[2] <= 0.605200e-2, -2613.636364*Y[2]+16.28072727)+(1/2)*piecewise(0.598600e-2 <= Y[2] and Y[2] <= 0.600800e-2, -10636.36364*Y[2]+64.48127275)+(1/2)*piecewise(0.594900e-2 <= Y[2] and Y[2] <= 0.598600e-2, -3891.891892*Y[2]+24.10886487)+(1/2)*piecewise(0.757900e-2 <= Y[2] and Y[2] <= 0.758000e-2, 722000.0000*Y[2]-5463.521000)+(1/2)*piecewise(0.581900e-2 <= Y[2] and Y[2] <= 0.594900e-2, -953.8461538*Y[2]+6.630430769)+(1/2)*piecewise(0.652200e-2 <= Y[2] and Y[2] < 0.659000e-2, 2205.882353*Y[2]-16.71876471)+(1/2)*piecewise(0.651100e-2 <= Y[2] and Y[2] < 0.652200e-2, -5181.818182*Y[2]+31.46381818)+(1/2)*piecewise(0.647000e-2 <= Y[2] and Y[2] < 0.651100e-2, 121.9512195*Y[2]-3.069024390)+(1/2)*piecewise(0.644200e-2 <= Y[2] and Y[2] < 0.647000e-2, 1000.000000*Y[2]-8.750000000)+(1/2)*piecewise(0.637600e-2 <= Y[2] and Y[2] < 0.644200e-2, -106.0606061*Y[2]-1.624757576)+(1/2)*piecewise(0.636600e-2 <= Y[2] and Y[2] < 0.637600e-2, -7400.000000*Y[2]+44.88140000)+(1/2)*piecewise(0.622600e-2 <= Y[2] and Y[2] < 0.636600e-2, -1364.285714*Y[2]+6.458042855)+(1/2)*piecewise(0.615100e-2 <= Y[2] and Y[2] < 0.622600e-2, -1560.000000*Y[2]+7.676560000)+(1/2)*piecewise(0.605200e-2 <= Y[2] and Y[2] < 0.615100e-2, -2242.424242*Y[2]+11.87415151)+(1/2)*piecewise(0.600800e-2 <= Y[2] and Y[2] < 0.605200e-2, -2613.636364*Y[2]+14.12072727)+(1/2)*piecewise(0.598600e-2 <= Y[2] and Y[2] < 0.600800e-2, -10636.36364*Y[2]+62.32127275)+(1/2)*piecewise(0.594900e-2 <= Y[2] and Y[2] < 0.598600e-2, -3891.891892*Y[2]+21.94886487)+(1/2)*piecewise(0.581900e-2 <= Y[2] and Y[2] < 0.594900e-2, -953.8461538*Y[2]+4.470430769)+(1/2)*piecewise(0.689400e-2 <= Y[2] and Y[2] <= 0.708200e-2, 2925.531915*Y[2]-19.52861702)-.2108934567*piecewise(X < 0, 0, X < 0.500000e-1, -367.8000000*X, X < .700000, -17.02230769-27.35384615*X, X < 1.90000, -29.01250000-10.22500000*X, X < 2.10000, -95.08500000+24.55000000*X, X < 2.15000, -1459.770000+674.4000000*X, X < 3.00000, -9.81000, X < 10.0000, 20.27142858-10.02714286*X, 10.0000 <= X, 0)+(1/2)*piecewise(0. <= Y[2] and Y[2] <= 0.300000e-4, 19466.66667*Y[2])+(1/2)*piecewise(0. <= Y[2] and Y[2] < 0.300000e-4, -19466.66667*Y[2])+piecewise(Y[1] < 0, HFloat(60.22353335250315)*abs(Y[1])+HFloat(11322.011918013375)*abs(Y[1])*Y[2]+HFloat(2211.801459998933)*evalf(abs(Y[1])^(3/2))+HFloat(133745.6732874636)*evalf(abs(Y[1])^(3/2))*Y[2]+HFloat(268619.00766055053)*abs(Y[1])^2-HFloat(2061016.308532005)*abs(Y[1])^2*Y[2]+HFloat(150751.03532735075)*evalf(abs(Y[1])^(5/2))+HFloat(9360854.911991587)*evalf(abs(Y[1])^(5/2))*Y[2], -HFloat(93.20933633186229)*abs(Y[1])-HFloat(17119.399226077283)*abs(Y[1])*Y[2]-HFloat(527.9199512820593)*evalf(abs(Y[1])^(3/2))+HFloat(132509.09343956804)*evalf(abs(Y[1])^(3/2))*Y[2]-HFloat(295176.0878003018)*abs(Y[1])^2-HFloat(1808560.9221036755)*abs(Y[1])^2*Y[2]-HFloat(67565.79316544208)*evalf(abs(Y[1])^(5/2))+HFloat(8702690.483040193)*evalf(abs(Y[1])^(5/2))*Y[2])+(1/2)*piecewise(0.719600e-2 <= Y[2] and Y[2] < 0.743900e-2, 4263.374486*Y[2]-31.46024280)+(1/2)*piecewise(0.709200e-2 <= Y[2] and Y[2] < 0.719600e-2, 1778.846154*Y[2]-13.58157692)+(1/2)*piecewise(0.708200e-2 <= Y[2] and Y[2] < 0.709200e-2, 400.0000000*Y[2]-3.802800000)+(1/2)*piecewise(0.689400e-2 <= Y[2] and Y[2] < 0.708200e-2, 2925.531915*Y[2]-21.68861702)+(1/2)*piecewise(0.668500e-2 <= Y[2] and Y[2] < 0.689400e-2, 2574.162679*Y[2]-19.26627751)+(1/2)*piecewise(0.659000e-2 <= Y[2] and Y[2] < 0.668500e-2, 1305.263158*Y[2]-10.78368421)+(1/2)*piecewise(0.708200e-2 <= Y[2] and Y[2] <= 0.709200e-2, 400.0000000*Y[2]-1.642800000)+(1/2)*piecewise(0.615100e-2 <= Y[2] and Y[2] <= 0.622600e-2, -1560.000000*Y[2]+9.836560000)+(1/2)*piecewise(0.757200e-2 <= Y[2] and Y[2] <= 0.757900e-2, 187714.2857*Y[2]-1414.169571)+(1/2)*piecewise(0.391800e-2 <= Y[2] and Y[2] <= 0.581900e-2, 16.83324566*Y[2]+.9820473435)+(1/2)*piecewise(0.754100e-2 <= Y[2] and Y[2] <= 0.757200e-2, 38225.80645*Y[2]-282.2428064)+(1/2)*piecewise(0.230100e-2 <= Y[2] and Y[2] <= 0.391800e-2, 39.57946815*Y[2]+.8929276438)+(1/2)*piecewise(0.753300e-2 <= Y[2] and Y[2] <= 0.754100e-2, 333375.0000*Y[2]-2507.962875)+(1/2)*piecewise(0.452000e-3 <= Y[2] and Y[2] <= 0.230100e-2, 49.21579232*Y[2]+.8707544619)+(1/2)*piecewise(0.747300e-2 <= Y[2] and Y[2] <= 0.753300e-2, 11516.66667*Y[2]-83.40405002)+(1/2)*piecewise(0.760000e-4 <= Y[2] and Y[2] <= 0.452000e-3, 513.2978723*Y[2]+.6609893617)+(1/2)*piecewise(0.746900e-2 <= Y[2] and Y[2] <= 0.747300e-2, 59000.00000*Y[2]-438.2470000)+(1/2)*piecewise(0.743900e-2 <= Y[2] and Y[2] <= 0.746900e-2, 300.0000000*Y[2]+.183300000)+(1/2)*piecewise(0.300000e-4 <= Y[2] and Y[2] <= 0.760000e-4, 2521.739130*Y[2]+.5083478261)+(1/2)*piecewise(0.719600e-2 <= Y[2] and Y[2] <= 0.743900e-2, 4263.374486*Y[2]-29.30024280)+(1/2)*piecewise(0.709200e-2 <= Y[2] and Y[2] <= 0.719600e-2, 1778.846154*Y[2]-11.42157692)+(1/2)*piecewise(0.757900e-2 <= Y[2] and Y[2] < 0.758000e-2, 722000.0000*Y[2]-5465.681000)+(1/2)*piecewise(0.757200e-2 <= Y[2] and Y[2] < 0.757900e-2, 187714.2857*Y[2]-1416.329571)+(1/2)*piecewise(0.754100e-2 <= Y[2] and Y[2] < 0.757200e-2, 38225.80645*Y[2]-284.4028064)+(1/2)*piecewise(0.753300e-2 <= Y[2] and Y[2] < 0.754100e-2, 333375.0000*Y[2]-2510.122875)+(1/2)*piecewise(0.747300e-2 <= Y[2] and Y[2] < 0.753300e-2, 11516.66667*Y[2]-85.56405002)+(1/2)*piecewise(0.746900e-2 <= Y[2] and Y[2] < 0.747300e-2, 59000.00000*Y[2]-440.4070000)+(1/2)*piecewise(0.743900e-2 <= Y[2] and Y[2] < 0.746900e-2, 300.0000000*Y[2]-1.976700000)+(1/2)*piecewise(0.391800e-2 <= Y[2] and Y[2] < 0.581900e-2, -16.83324566*Y[2]-.9820473435)+(1/2)*piecewise(0.230100e-2 <= Y[2] and Y[2] < 0.391800e-2, -39.57946815*Y[2]-.8929276438)+(1/2)*piecewise(0.452000e-3 <= Y[2] and Y[2] < 0.230100e-2, -49.21579232*Y[2]-.8707544619)+(1/2)*piecewise(0.760000e-4 <= Y[2] and Y[2] < 0.452000e-3, -513.2978723*Y[2]-.6609893617)+(1/2)*piecewise(0.300000e-4 <= Y[2] and Y[2] < 0.760000e-4, -2521.739130*Y[2]-.5083478261)+(1/2)*piecewise(0.668500e-2 <= Y[2] and Y[2] <= 0.689400e-2, 2574.162679*Y[2]-17.10627751)+(1/2)*piecewise(0.659000e-2 <= Y[2] and Y[2] <= 0.668500e-2, 1305.263158*Y[2]-8.623684211)+(1/2)*piecewise(0.652200e-2 <= Y[2] and Y[2] <= 0.659000e-2, 2205.882353*Y[2]-14.55876471)+(1/2)*piecewise(0.651100e-2 <= Y[2] and Y[2] <= 0.652200e-2, -5181.818182*Y[2]+33.62381818)+(1/2)*piecewise(0.647000e-2 <= Y[2] and Y[2] <= 0.651100e-2, 121.9512195*Y[2]-.9090243902)+(1/2)*piecewise(0.644200e-2 <= Y[2] and Y[2] <= 0.647000e-2, 1000.000000*Y[2]-6.590000000)+(1/2)*piecewise(0.637600e-2 <= Y[2] and Y[2] <= 0.644200e-2, -106.0606061*Y[2]+.5352424245)+(1/2)*piecewise(0.636600e-2 <= Y[2] and Y[2] <= 0.637600e-2, -7400.000000*Y[2]+47.04140000)+(1/2)*piecewise(0.622600e-2 <= Y[2] and Y[2] <= 0.636600e-2, -1364.285714*Y[2]+8.618042855)-193.7500000*Y[2]+(1/2)*(-piecewise(0.605200e-2 <= Y[2] and Y[2] <= 0.615100e-2, -2242.424242*Y[2]+14.03415151)-piecewise(0.600800e-2 <= Y[2] and Y[2] <= 0.605200e-2, -2613.636364*Y[2]+16.28072727)-piecewise(0.598600e-2 <= Y[2] and Y[2] <= 0.600800e-2, -10636.36364*Y[2]+64.48127275)-piecewise(0.594900e-2 <= Y[2] and Y[2] <= 0.598600e-2, -3891.891892*Y[2]+24.10886487)-piecewise(0.757900e-2 <= Y[2] and Y[2] <= 0.758000e-2, 722000.0000*Y[2]-5463.521000)-piecewise(0.581900e-2 <= Y[2] and Y[2] <= 0.594900e-2, -953.8461538*Y[2]+6.630430769)+piecewise(0.652200e-2 <= Y[2] and Y[2] < 0.659000e-2, 2205.882353*Y[2]-16.71876471)+piecewise(0.651100e-2 <= Y[2] and Y[2] < 0.652200e-2, -5181.818182*Y[2]+31.46381818)+piecewise(0.647000e-2 <= Y[2] and Y[2] < 0.651100e-2, 121.9512195*Y[2]-3.069024390)+piecewise(0.644200e-2 <= Y[2] and Y[2] < 0.647000e-2, 1000.000000*Y[2]-8.750000000)+piecewise(0.637600e-2 <= Y[2] and Y[2] < 0.644200e-2, -106.0606061*Y[2]-1.624757576)+piecewise(0.636600e-2 <= Y[2] and Y[2] < 0.637600e-2, -7400.000000*Y[2]+44.88140000)+piecewise(0.622600e-2 <= Y[2] and Y[2] < 0.636600e-2, -1364.285714*Y[2]+6.458042855)+piecewise(0.615100e-2 <= Y[2] and Y[2] < 0.622600e-2, -1560.000000*Y[2]+7.676560000)+piecewise(0.605200e-2 <= Y[2] and Y[2] < 0.615100e-2, -2242.424242*Y[2]+11.87415151)+piecewise(0.600800e-2 <= Y[2] and Y[2] < 0.605200e-2, -2613.636364*Y[2]+14.12072727)+piecewise(0.598600e-2 <= Y[2] and Y[2] < 0.600800e-2, -10636.36364*Y[2]+62.32127275)+piecewise(0.594900e-2 <= Y[2] and Y[2] < 0.598600e-2, -3891.891892*Y[2]+21.94886487)+piecewise(0.581900e-2 <= Y[2] and Y[2] < 0.594900e-2, -953.8461538*Y[2]+4.470430769)-piecewise(0.689400e-2 <= Y[2] and Y[2] <= 0.708200e-2, 2925.531915*Y[2]-19.52861702)-piecewise(0. <= Y[2] and Y[2] <= 0.300000e-4, 19466.66667*Y[2])+piecewise(0. <= Y[2] and Y[2] < 0.300000e-4, -19466.66667*Y[2])+piecewise(0.719600e-2 <= Y[2] and Y[2] < 0.743900e-2, 4263.374486*Y[2]-31.46024280)+piecewise(0.709200e-2 <= Y[2] and Y[2] < 0.719600e-2, 1778.846154*Y[2]-13.58157692)+piecewise(0.708200e-2 <= Y[2] and Y[2] < 0.709200e-2, 400.0000000*Y[2]-3.802800000)+piecewise(0.689400e-2 <= Y[2] and Y[2] < 0.708200e-2, 2925.531915*Y[2]-21.68861702)+piecewise(0.668500e-2 <= Y[2] and Y[2] < 0.689400e-2, 2574.162679*Y[2]-19.26627751)+piecewise(0.659000e-2 <= Y[2] and Y[2] < 0.668500e-2, 1305.263158*Y[2]-10.78368421)-piecewise(0.708200e-2 <= Y[2] and Y[2] <= 0.709200e-2, 400.0000000*Y[2]-1.642800000)-piecewise(0.615100e-2 <= Y[2] and Y[2] <= 0.622600e-2, -1560.000000*Y[2]+9.836560000)-piecewise(0.757200e-2 <= Y[2] and Y[2] <= 0.757900e-2, 187714.2857*Y[2]-1414.169571)-piecewise(0.391800e-2 <= Y[2] and Y[2] <= 0.581900e-2, 16.83324566*Y[2]+.9820473435)-piecewise(0.754100e-2 <= Y[2] and Y[2] <= 0.757200e-2, 38225.80645*Y[2]-282.2428064)-piecewise(0.230100e-2 <= Y[2] and Y[2] <= 0.391800e-2, 39.57946815*Y[2]+.8929276438)-piecewise(0.753300e-2 <= Y[2] and Y[2] <= 0.754100e-2, 333375.0000*Y[2]-2507.962875)-piecewise(0.452000e-3 <= Y[2] and Y[2] <= 0.230100e-2, 49.21579232*Y[2]+.8707544619)-piecewise(0.747300e-2 <= Y[2] and Y[2] <= 0.753300e-2, 11516.66667*Y[2]-83.40405002)-piecewise(0.760000e-4 <= Y[2] and Y[2] <= 0.452000e-3, 513.2978723*Y[2]+.6609893617)-piecewise(0.746900e-2 <= Y[2] and Y[2] <= 0.747300e-2, 59000.00000*Y[2]-438.2470000)-piecewise(0.743900e-2 <= Y[2] and Y[2] <= 0.746900e-2, 300.0000000*Y[2]+.183300000)-piecewise(0.300000e-4 <= Y[2] and Y[2] <= 0.760000e-4, 2521.739130*Y[2]+.5083478261)-piecewise(0.719600e-2 <= Y[2] and Y[2] <= 0.743900e-2, 4263.374486*Y[2]-29.30024280)-piecewise(0.709200e-2 <= Y[2] and Y[2] <= 0.719600e-2, 1778.846154*Y[2]-11.42157692)+piecewise(0.757900e-2 <= Y[2] and Y[2] < 0.758000e-2, 722000.0000*Y[2]-5465.681000)+piecewise(0.757200e-2 <= Y[2] and Y[2] < 0.757900e-2, 187714.2857*Y[2]-1416.329571)+piecewise(0.754100e-2 <= Y[2] and Y[2] < 0.757200e-2, 38225.80645*Y[2]-284.4028064)+piecewise(0.753300e-2 <= Y[2] and Y[2] < 0.754100e-2, 333375.0000*Y[2]-2510.122875)+piecewise(0.747300e-2 <= Y[2] and Y[2] < 0.753300e-2, 11516.66667*Y[2]-85.56405002)+piecewise(0.746900e-2 <= Y[2] and Y[2] < 0.747300e-2, 59000.00000*Y[2]-440.4070000)+piecewise(0.743900e-2 <= Y[2] and Y[2] < 0.746900e-2, 300.0000000*Y[2]-1.976700000)+piecewise(0.391800e-2 <= Y[2] and Y[2] < 0.581900e-2, -16.83324566*Y[2]-.9820473435)+piecewise(0.230100e-2 <= Y[2] and Y[2] < 0.391800e-2, -39.57946815*Y[2]-.8929276438)+piecewise(0.452000e-3 <= Y[2] and Y[2] < 0.230100e-2, -49.21579232*Y[2]-.8707544619)+piecewise(0.760000e-4 <= Y[2] and Y[2] < 0.452000e-3, -513.2978723*Y[2]-.6609893617)+piecewise(0.300000e-4 <= Y[2] and Y[2] < 0.760000e-4, -2521.739130*Y[2]-.5083478261)-piecewise(0.668500e-2 <= Y[2] and Y[2] <= 0.689400e-2, 2574.162679*Y[2]-17.10627751)-piecewise(0.659000e-2 <= Y[2] and Y[2] <= 0.668500e-2, 1305.263158*Y[2]-8.623684211)-piecewise(0.652200e-2 <= Y[2] and Y[2] <= 0.659000e-2, 2205.882353*Y[2]-14.55876471)-piecewise(0.651100e-2 <= Y[2] and Y[2] <= 0.652200e-2, -5181.818182*Y[2]+33.62381818)-piecewise(0.647000e-2 <= Y[2] and Y[2] <= 0.651100e-2, 121.9512195*Y[2]-.9090243902)-piecewise(0.644200e-2 <= Y[2] and Y[2] <= 0.647000e-2, 1000.000000*Y[2]-6.590000000)-piecewise(0.637600e-2 <= Y[2] and Y[2] <= 0.644200e-2, -106.0606061*Y[2]+.5352424245)-piecewise(0.636600e-2 <= Y[2] and Y[2] <= 0.637600e-2, -7400.000000*Y[2]+47.04140000)-piecewise(0.622600e-2 <= Y[2] and Y[2] <= 0.636600e-2, -1364.285714*Y[2]+8.618042855))*tanh(26466.52412*Y[1]))*piecewise((1/2)*piecewise(0.605200e-2 <= Y[2] and Y[2] <= 0.615100e-2, -2242.424242*Y[2]+14.03415151)+(1/2)*piecewise(0.600800e-2 <= Y[2] and Y[2] <= 0.605200e-2, -2613.636364*Y[2]+16.28072727)+(1/2)*piecewise(0.598600e-2 <= Y[2] and Y[2] <= 0.600800e-2, -10636.36364*Y[2]+64.48127275)+(1/2)*piecewise(0.594900e-2 <= Y[2] and Y[2] <= 0.598600e-2, -3891.891892*Y[2]+24.10886487)+(1/2)*piecewise(0.757900e-2 <= Y[2] and Y[2] <= 0.758000e-2, 722000.0000*Y[2]-5463.521000)+(1/2)*piecewise(0.581900e-2 <= Y[2] and Y[2] <= 0.594900e-2, -953.8461538*Y[2]+6.630430769)+(1/2)*piecewise(0.652200e-2 <= Y[2] and Y[2] < 0.659000e-2, 2205.882353*Y[2]-16.71876471)+(1/2)*piecewise(0.651100e-2 <= Y[2] and Y[2] < 0.652200e-2, -5181.818182*Y[2]+31.46381818)+(1/2)*piecewise(0.647000e-2 <= Y[2] and Y[2] < 0.651100e-2, 121.9512195*Y[2]-3.069024390)+(1/2)*piecewise(0.644200e-2 <= Y[2] and Y[2] < 0.647000e-2, 1000.000000*Y[2]-8.750000000)+(1/2)*piecewise(0.637600e-2 <= Y[2] and Y[2] < 0.644200e-2, -106.0606061*Y[2]-1.624757576)+(1/2)*piecewise(0.636600e-2 <= Y[2] and Y[2] < 0.637600e-2, -7400.000000*Y[2]+44.88140000)+(1/2)*piecewise(0.622600e-2 <= Y[2] and Y[2] < 0.636600e-2, -1364.285714*Y[2]+6.458042855)+(1/2)*piecewise(0.615100e-2 <= Y[2] and Y[2] < 0.622600e-2, -1560.000000*Y[2]+7.676560000)+(1/2)*piecewise(0.605200e-2 <= Y[2] and Y[2] < 0.615100e-2, -2242.424242*Y[2]+11.87415151)+(1/2)*piecewise(0.600800e-2 <= Y[2] and Y[2] < 0.605200e-2, -2613.636364*Y[2]+14.12072727)+(1/2)*piecewise(0.598600e-2 <= Y[2] and Y[2] < 0.600800e-2, -10636.36364*Y[2]+62.32127275)+(1/2)*piecewise(0.594900e-2 <= Y[2] and Y[2] < 0.598600e-2, -3891.891892*Y[2]+21.94886487)+(1/2)*piecewise(0.581900e-2 <= Y[2] and Y[2] < 0.594900e-2, -953.8461538*Y[2]+4.470430769)+(1/2)*piecewise(0.689400e-2 <= Y[2] and Y[2] <= 0.708200e-2, 2925.531915*Y[2]-19.52861702)-.2108934567*piecewise(X < 0, 0, X < 0.500000e-1, -367.8000000*X, X < .700000, -17.02230769-27.35384615*X, X < 1.90000, -29.01250000-10.22500000*X, X < 2.10000, -95.08500000+24.55000000*X, X < 2.15000, -1459.770000+674.4000000*X, X < 3.00000, -9.81000, X < 10.0000, 20.27142858-10.02714286*X, 10.0000 <= X, 0)+(1/2)*piecewise(0. <= Y[2] and Y[2] <= 0.300000e-4, 19466.66667*Y[2])+(1/2)*piecewise(0. <= Y[2] and Y[2] < 0.300000e-4, -19466.66667*Y[2])+piecewise(Y[1] < 0, HFloat(60.22353335250315)*abs(Y[1])+HFloat(11322.011918013375)*abs(Y[1])*Y[2]+HFloat(2211.801459998933)*evalf(abs(Y[1])^(3/2))+HFloat(133745.6732874636)*evalf(abs(Y[1])^(3/2))*Y[2]+HFloat(268619.00766055053)*abs(Y[1])^2-HFloat(2061016.308532005)*abs(Y[1])^2*Y[2]+HFloat(150751.03532735075)*evalf(abs(Y[1])^(5/2))+HFloat(9360854.911991587)*evalf(abs(Y[1])^(5/2))*Y[2], -HFloat(93.20933633186229)*abs(Y[1])-HFloat(17119.399226077283)*abs(Y[1])*Y[2]-HFloat(527.9199512820593)*evalf(abs(Y[1])^(3/2))+HFloat(132509.09343956804)*evalf(abs(Y[1])^(3/2))*Y[2]-HFloat(295176.0878003018)*abs(Y[1])^2-HFloat(1808560.9221036755)*abs(Y[1])^2*Y[2]-HFloat(67565.79316544208)*evalf(abs(Y[1])^(5/2))+HFloat(8702690.483040193)*evalf(abs(Y[1])^(5/2))*Y[2])+(1/2)*piecewise(0.719600e-2 <= Y[2] and Y[2] < 0.743900e-2, 4263.374486*Y[2]-31.46024280)+(1/2)*piecewise(0.709200e-2 <= Y[2] and Y[2] < 0.719600e-2, 1778.846154*Y[2]-13.58157692)+(1/2)*piecewise(0.708200e-2 <= Y[2] and Y[2] < 0.709200e-2, 400.0000000*Y[2]-3.802800000)+(1/2)*piecewise(0.689400e-2 <= Y[2] and Y[2] < 0.708200e-2, 2925.531915*Y[2]-21.68861702)+(1/2)*piecewise(0.668500e-2 <= Y[2] and Y[2] < 0.689400e-2, 2574.162679*Y[2]-19.26627751)+(1/2)*piecewise(0.659000e-2 <= Y[2] and Y[2] < 0.668500e-2, 1305.263158*Y[2]-10.78368421)+(1/2)*piecewise(0.708200e-2 <= Y[2] and Y[2] <= 0.709200e-2, 400.0000000*Y[2]-1.642800000)+(1/2)*piecewise(0.615100e-2 <= Y[2] and Y[2] <= 0.622600e-2, -1560.000000*Y[2]+9.836560000)+(1/2)*piecewise(0.757200e-2 <= Y[2] and Y[2] <= 0.757900e-2, 187714.2857*Y[2]-1414.169571)+(1/2)*piecewise(0.391800e-2 <= Y[2] and Y[2] <= 0.581900e-2, 16.83324566*Y[2]+.9820473435)+(1/2)*piecewise(0.754100e-2 <= Y[2] and Y[2] <= 0.757200e-2, 38225.80645*Y[2]-282.2428064)+(1/2)*piecewise(0.230100e-2 <= Y[2] and Y[2] <= 0.391800e-2, 39.57946815*Y[2]+.8929276438)+(1/2)*piecewise(0.753300e-2 <= Y[2] and Y[2] <= 0.754100e-2, 333375.0000*Y[2]-2507.962875)+(1/2)*piecewise(0.452000e-3 <= Y[2] and Y[2] <= 0.230100e-2, 49.21579232*Y[2]+.8707544619)+(1/2)*piecewise(0.747300e-2 <= Y[2] and Y[2] <= 0.753300e-2, 11516.66667*Y[2]-83.40405002)+(1/2)*piecewise(0.760000e-4 <= Y[2] and Y[2] <= 0.452000e-3, 513.2978723*Y[2]+.6609893617)+(1/2)*piecewise(0.746900e-2 <= Y[2] and Y[2] <= 0.747300e-2, 59000.00000*Y[2]-438.2470000)+(1/2)*piecewise(0.743900e-2 <= Y[2] and Y[2] <= 0.746900e-2, 300.0000000*Y[2]+.183300000)+(1/2)*piecewise(0.300000e-4 <= Y[2] and Y[2] <= 0.760000e-4, 2521.739130*Y[2]+.5083478261)+(1/2)*piecewise(0.719600e-2 <= Y[2] and Y[2] <= 0.743900e-2, 4263.374486*Y[2]-29.30024280)+(1/2)*piecewise(0.709200e-2 <= Y[2] and Y[2] <= 0.719600e-2, 1778.846154*Y[2]-11.42157692)+(1/2)*piecewise(0.757900e-2 <= Y[2] and Y[2] < 0.758000e-2, 722000.0000*Y[2]-5465.681000)+(1/2)*piecewise(0.757200e-2 <= Y[2] and Y[2] < 0.757900e-2, 187714.2857*Y[2]-1416.329571)+(1/2)*piecewise(0.754100e-2 <= Y[2] and Y[2] < 0.757200e-2, 38225.80645*Y[2]-284.4028064)+(1/2)*piecewise(0.753300e-2 <= Y[2] and Y[2] < 0.754100e-2, 333375.0000*Y[2]-2510.122875)+(1/2)*piecewise(0.747300e-2 <= Y[2] and Y[2] < 0.753300e-2, 11516.66667*Y[2]-85.56405002)+(1/2)*piecewise(0.746900e-2 <= Y[2] and Y[2] < 0.747300e-2, 59000.00000*Y[2]-440.4070000)+(1/2)*piecewise(0.743900e-2 <= Y[2] and Y[2] < 0.746900e-2, 300.0000000*Y[2]-1.976700000)+(1/2)*piecewise(0.391800e-2 <= Y[2] and Y[2] < 0.581900e-2, -16.83324566*Y[2]-.9820473435)+(1/2)*piecewise(0.230100e-2 <= Y[2] and Y[2] < 0.391800e-2, -39.57946815*Y[2]-.8929276438)+(1/2)*piecewise(0.452000e-3 <= Y[2] and Y[2] < 0.230100e-2, -49.21579232*Y[2]-.8707544619)+(1/2)*piecewise(0.760000e-4 <= Y[2] and Y[2] < 0.452000e-3, -513.2978723*Y[2]-.6609893617)+(1/2)*piecewise(0.300000e-4 <= Y[2] and Y[2] < 0.760000e-4, -2521.739130*Y[2]-.5083478261)+(1/2)*piecewise(0.668500e-2 <= Y[2] and Y[2] <= 0.689400e-2, 2574.162679*Y[2]-17.10627751)+(1/2)*piecewise(0.659000e-2 <= Y[2] and Y[2] <= 0.668500e-2, 1305.263158*Y[2]-8.623684211)+(1/2)*piecewise(0.652200e-2 <= Y[2] and Y[2] <= 0.659000e-2, 2205.882353*Y[2]-14.55876471)+(1/2)*piecewise(0.651100e-2 <= Y[2] and Y[2] <= 0.652200e-2, -5181.818182*Y[2]+33.62381818)+(1/2)*piecewise(0.647000e-2 <= Y[2] and Y[2] <= 0.651100e-2, 121.9512195*Y[2]-.9090243902)+(1/2)*piecewise(0.644200e-2 <= Y[2] and Y[2] <= 0.647000e-2, 1000.000000*Y[2]-6.590000000)+(1/2)*piecewise(0.637600e-2 <= Y[2] and Y[2] <= 0.644200e-2, -106.0606061*Y[2]+.5352424245)+(1/2)*piecewise(0.636600e-2 <= Y[2] and Y[2] <= 0.637600e-2, -7400.000000*Y[2]+47.04140000)+(1/2)*piecewise(0.622600e-2 <= Y[2] and Y[2] <= 0.636600e-2, -1364.285714*Y[2]+8.618042855)-193.7500000*Y[2]+(1/2)*(-piecewise(0.605200e-2 <= Y[2] and Y[2] <= 0.615100e-2, -2242.424242*Y[2]+14.03415151)-piecewise(0.600800e-2 <= Y[2] and Y[2] <= 0.605200e-2, -2613.636364*Y[2]+16.28072727)-piecewise(0.598600e-2 <= Y[2] and Y[2] <= 0.600800e-2, -10636.36364*Y[2]+64.48127275)-piecewise(0.594900e-2 <= Y[2] and Y[2] <= 0.598600e-2, -3891.891892*Y[2]+24.10886487)-piecewise(0.757900e-2 <= Y[2] and Y[2] <= 0.758000e-2, 722000.0000*Y[2]-5463.521000)-piecewise(0.581900e-2 <= Y[2] and Y[2] <= 0.594900e-2, -953.8461538*Y[2]+6.630430769)+piecewise(0.652200e-2 <= Y[2] and Y[2] < 0.659000e-2, 2205.882353*Y[2]-16.71876471)+piecewise(0.651100e-2 <= Y[2] and Y[2] < 0.652200e-2, -5181.818182*Y[2]+31.46381818)+piecewise(0.647000e-2 <= Y[2] and Y[2] < 0.651100e-2, 121.9512195*Y[2]-3.069024390)+piecewise(0.644200e-2 <= Y[2] and Y[2] < 0.647000e-2, 1000.000000*Y[2]-8.750000000)+piecewise(0.637600e-2 <= Y[2] and Y[2] < 0.644200e-2, -106.0606061*Y[2]-1.624757576)+piecewise(0.636600e-2 <= Y[2] and Y[2] < 0.637600e-2, -7400.000000*Y[2]+44.88140000)+piecewise(0.622600e-2 <= Y[2] and Y[2] < 0.636600e-2, -1364.285714*Y[2]+6.458042855)+piecewise(0.615100e-2 <= Y[2] and Y[2] < 0.622600e-2, -1560.000000*Y[2]+7.676560000)+piecewise(0.605200e-2 <= Y[2] and Y[2] < 0.615100e-2, -2242.424242*Y[2]+11.87415151)+piecewise(0.600800e-2 <= Y[2] and Y[2] < 0.605200e-2, -2613.636364*Y[2]+14.12072727)+piecewise(0.598600e-2 <= Y[2] and Y[2] < 0.600800e-2, -10636.36364*Y[2]+62.32127275)+piecewise(0.594900e-2 <= Y[2] and Y[2] < 0.598600e-2, -3891.891892*Y[2]+21.94886487)+piecewise(0.581900e-2 <= Y[2] and Y[2] < 0.594900e-2, -953.8461538*Y[2]+4.470430769)-piecewise(0.689400e-2 <= Y[2] and Y[2] <= 0.708200e-2, 2925.531915*Y[2]-19.52861702)-piecewise(0. <= Y[2] and Y[2] <= 0.300000e-4, 19466.66667*Y[2])+piecewise(0. <= Y[2] and Y[2] < 0.300000e-4, -19466.66667*Y[2])+piecewise(0.719600e-2 <= Y[2] and Y[2] < 0.743900e-2, 4263.374486*Y[2]-31.46024280)+piecewise(0.709200e-2 <= Y[2] and Y[2] < 0.719600e-2, 1778.846154*Y[2]-13.58157692)+piecewise(0.708200e-2 <= Y[2] and Y[2] < 0.709200e-2, 400.0000000*Y[2]-3.802800000)+piecewise(0.689400e-2 <= Y[2] and Y[2] < 0.708200e-2, 2925.531915*Y[2]-21.68861702)+piecewise(0.668500e-2 <= Y[2] and Y[2] < 0.689400e-2, 2574.162679*Y[2]-19.26627751)+piecewise(0.659000e-2 <= Y[2] and Y[2] < 0.668500e-2, 1305.263158*Y[2]-10.78368421)-piecewise(0.708200e-2 <= Y[2] and Y[2] <= 0.709200e-2, 400.0000000*Y[2]-1.642800000)-piecewise(0.615100e-2 <= Y[2] and Y[2] <= 0.622600e-2, -1560.000000*Y[2]+9.836560000)-piecewise(0.757200e-2 <= Y[2] and Y[2] <= 0.757900e-2, 187714.2857*Y[2]-1414.169571)-piecewise(0.391800e-2 <= Y[2] and Y[2] <= 0.581900e-2, 16.83324566*Y[2]+.9820473435)-piecewise(0.754100e-2 <= Y[2] and Y[2] <= 0.757200e-2, 38225.80645*Y[2]-282.2428064)-piecewise(0.230100e-2 <= Y[2] and Y[2] <= 0.391800e-2, 39.57946815*Y[2]+.8929276438)-piecewise(0.753300e-2 <= Y[2] and Y[2] <= 0.754100e-2, 333375.0000*Y[2]-2507.962875)-piecewise(0.452000e-3 <= Y[2] and Y[2] <= 0.230100e-2, 49.21579232*Y[2]+.8707544619)-piecewise(0.747300e-2 <= Y[2] and Y[2] <= 0.753300e-2, 11516.66667*Y[2]-83.40405002)-piecewise(0.760000e-4 <= Y[2] and Y[2] <= 0.452000e-3, 513.2978723*Y[2]+.6609893617)-piecewise(0.746900e-2 <= Y[2] and Y[2] <= 0.747300e-2, 59000.00000*Y[2]-438.2470000)-piecewise(0.743900e-2 <= Y[2] and Y[2] <= 0.746900e-2, 300.0000000*Y[2]+.183300000)-piecewise(0.300000e-4 <= Y[2] and Y[2] <= 0.760000e-4, 2521.739130*Y[2]+.5083478261)-piecewise(0.719600e-2 <= Y[2] and Y[2] <= 0.743900e-2, 4263.374486*Y[2]-29.30024280)-piecewise(0.709200e-2 <= Y[2] and Y[2] <= 0.719600e-2, 1778.846154*Y[2]-11.42157692)+piecewise(0.757900e-2 <= Y[2] and Y[2] < 0.758000e-2, 722000.0000*Y[2]-5465.681000)+piecewise(0.757200e-2 <= Y[2] and Y[2] < 0.757900e-2, 187714.2857*Y[2]-1416.329571)+piecewise(0.754100e-2 <= Y[2] and Y[2] < 0.757200e-2, 38225.80645*Y[2]-284.4028064)+piecewise(0.753300e-2 <= Y[2] and Y[2] < 0.754100e-2, 333375.0000*Y[2]-2510.122875)+piecewise(0.747300e-2 <= Y[2] and Y[2] < 0.753300e-2, 11516.66667*Y[2]-85.56405002)+piecewise(0.746900e-2 <= Y[2] and Y[2] < 0.747300e-2, 59000.00000*Y[2]-440.4070000)+piecewise(0.743900e-2 <= Y[2] and Y[2] < 0.746900e-2, 300.0000000*Y[2]-1.976700000)+piecewise(0.391800e-2 <= Y[2] and Y[2] < 0.581900e-2, -16.83324566*Y[2]-.9820473435)+piecewise(0.230100e-2 <= Y[2] and Y[2] < 0.391800e-2, -39.57946815*Y[2]-.8929276438)+piecewise(0.452000e-3 <= Y[2] and Y[2] < 0.230100e-2, -49.21579232*Y[2]-.8707544619)+piecewise(0.760000e-4 <= Y[2] and Y[2] < 0.452000e-3, -513.2978723*Y[2]-.6609893617)+piecewise(0.300000e-4 <= Y[2] and Y[2] < 0.760000e-4, -2521.739130*Y[2]-.5083478261)-piecewise(0.668500e-2 <= Y[2] and Y[2] <= 0.689400e-2, 2574.162679*Y[2]-17.10627751)-piecewise(0.659000e-2 <= Y[2] and Y[2] <= 0.668500e-2, 1305.263158*Y[2]-8.623684211)-piecewise(0.652200e-2 <= Y[2] and Y[2] <= 0.659000e-2, 2205.882353*Y[2]-14.55876471)-piecewise(0.651100e-2 <= Y[2] and Y[2] <= 0.652200e-2, -5181.818182*Y[2]+33.62381818)-piecewise(0.647000e-2 <= Y[2] and Y[2] <= 0.651100e-2, 121.9512195*Y[2]-.9090243902)-piecewise(0.644200e-2 <= Y[2] and Y[2] <= 0.647000e-2, 1000.000000*Y[2]-6.590000000)-piecewise(0.637600e-2 <= Y[2] and Y[2] <= 0.644200e-2, -106.0606061*Y[2]+.5352424245)-piecewise(0.636600e-2 <= Y[2] and Y[2] <= 0.637600e-2, -7400.000000*Y[2]+47.04140000)-piecewise(0.622600e-2 <= Y[2] and Y[2] <= 0.636600e-2, -1364.285714*Y[2]+8.618042855))*tanh(26466.52412*Y[1]) <= 5.860656250, piecewise(Y[2] <= HFloat(9.875869562154457e-4), 0, 1), 1)+4.2631803319222423857*piecewise(abs(Y[2]-HFloat(9.875869562154457e-4)) < 1/1000000 and Y[1] <= -1/100000000, 1, 0); YP[2] := Y[1]*piecewise(Y[1] <= 0, piecewise(Y[2] <= HFloat(9.875869562154457e-4), 0, 1), 1); 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 24 ) = (0)  ] ))  ] ); _y0 := Array(0..2, {(1) = 0., (2) = 0.}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 100 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 100 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see <a href='http://www.maplesoft.com/support/help/search.aspx?term=dsolve,maxfun' target='_new'>?dsolve,maxfun</a> for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see <a href='http://www.maplesoft.com/support/help/search.aspx?term=dsolve,maxfun' target='_new'>?dsolve,maxfun</a> for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(0..0, {}), (3) = [t, V[1](t), X[1](t)], (4) = []}); _vars := _dat[3]; _pars := map(rhs, _dat[4]); _n := nops(_vars)-1; _solnproc := _dat[1]; if not type(_xout, 'numeric') then if member(x_rkf45, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(x_rkf45, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(x_rkf45, ["last", 'last', "initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(x_rkf45, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return [seq(_vars[_i+1] = [_res][1][_i+1], _i = 0 .. _n), seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] else return [seq(_vars[_i+1] = _res[_i+1], _i = 0 .. _n)] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(x_rkf45), 'string') = rhs(x_rkf45); if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else error "initial and/or parameter values must be specified in a list" end if; if lhs(_xout) = "initial" then return [seq(_vars[_i+1] = _res[_i+1], _i = 0 .. _n)] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [seq(_vars[_i+1] = [_res][1][_i+1], _i = 0 .. _n), seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(x_rkf45), 'string') = rhs(x_rkf45)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _vars end if; if procname <> unknown then return ('procname')(x_rkf45) else _ndsol; _ndsol := pointto(_dat[2][0]); return ('_ndsol')(x_rkf45) end if end if; try _res := _solnproc(_xout); [seq(_vars[_i+1] = _res[_i+1], _i = 0 .. _n)] catch: error  end try end proc

 

 

# (Visual) comparison with the previous curves provides a very good agreement

# 1/ : capture de list of points odeplot returns

aux          := plots:-odeplot(sol, [t, V[1](t), X[1](t)], 0..9):
ListOfPoints := op(1, op(1, aux)):
N            := LinearAlgebra:-Dimensions(ListOfPoints)[1]:



# 2/ : Extract from LisrOfPoints the ones close to t=8 seconds

AllTheTimes := convert(ListOfPoints[..,1], list):
GoodRows    := zip((u,v)-> if verify(u, 7.8..8.2, `interval`) then v end if, AllTheTimes, [seq(1..N)]):




# 3/ : print the extract of ListOfPoints for GoodRows only


printf("\n What odeplot gives\n");
printf("------------------------------------------------\n");
printf("        t               V(t)           X(t)\n");
printf("------------------------------------------------\n");

for k in GoodRows do
   printf("%-15.12f  %-15.12f  %-15.12f\n", seq(ListOfPoints[k,n], n=1..3))
end do;
print():


 What odeplot gives
------------------------------------------------
        t               V(t)           X(t)
------------------------------------------------
7.830000000000   0.002815865032   0.006594922503
7.875000000000   0.002960849581   0.006724509859
7.920000000000   0.003162952386   0.006862303055
7.965000000000   0.003381243400   0.007009462432
8.010000000000   0.003556187082   0.007165994538
8.055000000000   0.003835074137   0.007331726709
8.100000000000   0.004281464768   0.007511890647
8.145000000000   0.003952037325   0.007703617600
8.190000000000   0.003971371977   0.007881895231

 

(7)

# Observe these results are very similar to those obtained with lsode
#
# But what are the results I obtaine by pointwise evaluations of
# sol(t) for t in 7.8..8.2 ???
#
# 4/ Now evaluate "pointwise" sol(t) for the times retained

print();
printf("\n What sol(t) gives for the same values of t\n");
printf("------------------------------------------------\n");
printf("        t               V(t)           X(t)\n");
printf("------------------------------------------------\n");

for MyTime in ListOfPoints[GoodRows, 1] do
   MySol := map(u -> rhs(u), sol(MyTime)):
   printf("%-15.12f  %-15.12f  %-15.12f\n", seq(MySol[n], n=1..3))
end do:
print():

 


 What sol(t) gives for the same values of t
------------------------------------------------
        t               V(t)           X(t)
------------------------------------------------

7.830000000000   0.002815850376   0.006594922415
7.875000000000   0.002960860137   0.006724509763
7.920000000000   0.003162950433   0.006862302956
7.965000000000   0.003381213356   0.007009462330
8.010000000000   0.003556219238   0.007165994431
8.055000000000   0.003835077964   0.007331726592

8.100000000000   0.004281482695   0.007511890548
8.145000000000   0.003952038054   0.007703617628
8.190000000000   0.003971371542   0.007881895259

 

(8)

ListOfTimes := [1.0, 8.1, 10.0, 8.1, 1.0, 8.1, 10.0, 8.1]:

printf("------------------------------------------------\n");
printf("   t          V(t)            X(t)\n");
printf("------------------------------------------------\n");


k := 0:
for MyTime in ListOfTimes do
   k     := k+1:
   MySol := map(u -> rhs(u), sol(MyTime)):
   if is(k, odd) then
      printf("%6.3f  %-15.12f  %-15.12f\n", MyTime, seq(MySol[n], n=2..3))
   else
      printf("%6.3f  %-15.12f  %-15.12f  ***\n", MyTime, seq(MySol[n], n=2..3))
   end if:
end do:

------------------------------------------------
   t          V(t)            X(t)
------------------------------------------------

 1.000  0.001763825587   0.001540242179

 8.100  0.004281482695   0.007511890548   ***

10.000  0.004614016677   0.015687242808

 8.100  0.004281482695   0.007511890548   ***

 1.000  0.001763825587   0.001540242179

 8.100  0.004281482695   0.007511890548   ***

10.000  0.004614016677   0.015687242808

 8.100  0.004281482695   0.007511890548   ***

 


# Wow, these two tables give very close results (at least if you don't look
# farther than the tenth decimal position ... which could probably change
# by fixing Digits to 15 or 20 (?) ... even if this hypothesis is not
# fully satisfactory ?)
#
# Here pointwise evaluations of sol(t) always give the correct answer (up to
# the decimal representation induced by the default value of Digits).
#
#
#------------------------------------------------------------------------
#
# Question : why the "magics" no longer operate with rkf45 ?
#            (of course it is humor at the second degree !)
#
#------------------------------------------------------------------------
#
#
# It could be funny to play with "Magic MAPLE".
#
# But I have to solve serious problems, and among them, what interests me
# in the solution of the "MC" system, is "events capturing".
# Example of such an event "event" E_n is "the moving mass has reached the
# position X = S_n where S_n is a given stroke (for exemple S_N = 0.006).
# And "capturing E_n" then means "find the time T_n such that X(T_n) = S_n".
#
# I thus wrote a fixed-point method to do this, that is a procédure that
# repeatedly asks for evaluations of procedure "sol".
# But, for the behaviour depicted above, it doesn't work correctly with lsode.
# So, despite the funny magical behaviour of MAPLE, I have a serious problem !
#
# A problem I can sum up while saying
#
#     "I CANNOT TRUST MAPLE WHEN IT SAYS ME sol(t) = xxx"
#
#
# Has anyone already been faced with these kind of behaviour ?
#
# Maplesoft support seems to beat around the bush with me, asking for the
# ODEs equations, or criticizing the expressions of their RHSs ..., wanting
# to see where these equations come from (they come from a more than 10.000
# lines application I have developped, but it's not the point here given
# rkf45 proceeds correctly).
#
# If anyone is interested to investigate this problem, I can provide
# her the "MC.m" file that contains the ODE system used here
#
# Thanks a lot for the time you spent to reading me
#
#

 

 

 

 

Download BUG__LSODE_MaplePrimes.mw

Page 1 of 1