MaplePrimes Questions

Hi,

I am designing a power transformer using Maple, and I am trying to solve for the minimum number of turns around my core for the desired effect. The equations to solve include numbers of turns (must be positive integers) and other constraints (positive floats).

To validate my worksheet, I am beta-testing it on an existing transformer, so I know of at least one solution that works. But when I submit the equations to Maple, it can't find the solution I know with integer solutions.

 

The equation is :

SOL := `assuming`([solve({N__2/N__1 = m__t, k__c*L__L(g__ap*Unit('m'), N__1)*I__M__pk = (1/2)*V__sec*T__res/m__t, g__ap <= 2*10^(-3), B__max(g__ap*Unit('m'), N__1, I__M__pk) <= B__max__core}, {N__1, N__2, g__ap, I__M__pk}, UseAssumptions)], [N__1::posint, N__2::posint, g__ap::positive])

 

And Maple's answer : 

{N__1 = 7.701193685, N__2 = 12.50000000*N__1, I__M__pk = (-1.855203719*10^9*g__ap^2+1.523613883*10^11*g__ap+5.590656409*10^6)*Unit('A')/(5.000000*10^6+2.43902439*10^8*g__ap), I__M__pk = (-1.100291349*10^11*g__ap^2+9.036307746*10^12*g__ap+3.315727980*10^8)*Unit('A')/(N__1^2*(5.000000*10^6+2.43902439*10^8*g__ap)), g__ap <= 0.2000000000e-2, 0. < g__ap}

 

Except I know there is a solution with N__1 = 6 and N_82 = 75. If I force n__1:=75 and solve again for the other variables, the solution is OK : 

X := `assuming`([solve({N__2/N__1 = m__t, k__c*L__L(g__ap*Unit('m'), N__1)*I__M__pk = (1/2)*V__sec*T__res/m__t, g__ap <= 2*10^(-3), B__max(g__ap*Unit('m'), N__1, I__M__pk) <= B__max__core}, {N__2, g__ap, I__M__pk}, UseAssumptions)], [N__2::posint, g__ap::positive])

And the answer :

X := {N__2 = 75., I__M__pk = -0.3759328777e-1*Unit('Wb')*(8.130081300*10^10*g__ap^2-6.676951220*10^12*g__ap-2.45000000*10^8)/(Unit('H')*(5.000000*10^6+2.43902439*10^8*g__ap)), g__ap <= 0.2000000000e-2, 0. < g__ap}

 

I am a bit puzzled about why Maple doesn't find this solution...

 

Thank you very much for your help.

 

Hello there,

I want to simplify this for a given rule in Maple

(-(1/2)*ib-(1/2)*ia+ic)*vc+(-(1/2)*ia-(1/2)*ic+ib)*vb+(-(1/2)*ic-(1/2)*ib+ia)*va

rule :  ia+ib+ic=0

A desired result should be 

3/2*ic*vc+3/2*ib*vb+3/2*ia*va 

but I can't apply this rule in Maple...  it seems like recursive and goes back again and again.

 

Can it break the recursive routine and make it as a desired result?

 

 Thank you

Hey guys,

 

I want to fit experimental data and I was wondering if there is a special PolynomialFit function for a surface.

My data consist of a X,Y, Matrix of densities and I want to have a function describing the surface of the values. On matlab the following code will do so:

[x, y, z] = prepareSurfaceData(temps, concs, densities);
ft = fittype('poly33');
fitresult = fit([x, y], z, ft);

Maybe that gives you a better view of what I want.

Best regards

I want to plot the position of Spherical pendulum. there are differential equation for spherical pendulum in spherical coordinates

sys := {((D@@2)(phi))(t) = -2*(D(phi))(t)*(D(theta))(t)*cos(theta(t))/sin(phi(t)),
((D@@2)(theta))(t) = (D(phi))(t)^2*cos(theta(t))*sin(theta(t))-9.8*sin(theta(t))}

 

with initial conditions

theta(0) = (1/2)*Pi, (D(theta))(0) = 0, phi(0) = (1/2)*Pi, (D(phi))(0) = 1

I tried:

eq := dsolve([((D@@2)(theta))(t) = (D(phi))(t)^2*cos(theta(t))-9.8*sin(theta(t)),
((D@@2)(phi))(t) = -2*(D(phi))(t)*(D(theta))(t)*cos(theta(t))/sin(phi(t)),
theta(0) = (1/2)*Pi, (D(theta))(0) = 0, phi(0) = (1/2)*Pi, (D(phi))(0) = 1],numeric)

how to change coordinates

x(t) = sin(theta(t))*cos(phi(t))
y(t) = sin(theta(t))*sin(phi(t))
z(t) = cos(theta(t))

and how to plot it from t=0 to 10?

Dear All

Please see following query:

 

 

 For following Algeraic expression

 

(3*a[1]+5*a[2])*U[1]+(-6*a[1]+2*a[2])*U[2]

 

How one can construct a matrix of the following form:

 

Matrix([[3, 5], [-6, 2]])

Matrix(2, 2, {(1, 1) = 3, (1, 2) = 5, (2, 1) = -6, (2, 2) = 2})

(1)

 

Where first row corresponds to U[1]and second row corresponds to U[2] and the entries of matrix are coefficients of a[1]and a[2]

 

 

Download Constructing_matrix_from_algebraic_expression.mw

Regards

 

 

NULL

SYSTEMATIC APPROACH TO LIFTING EYE DESIGN

Moses

 

restart

with(Optimization)

with(LinearAlgebra)

with(Plots)

Nomenclature

 

Ab  = Required bearing area, sq in. (mm2)

As  = Required shear area at hole, sq in. (mm2)

Aw = Required cheek plate weld area, sq in. (mm2)

b     = Distance from center of eye to the cross section, in. (mm)

C    = Percentage distance of element from neutral axis

D    = Diameter of lifting pin, in. (mm)

e     = Distance between edge of cheek plate and edge of main plate, in. (mm)

Fa   = Allowable normal stress, ksi (kN/mm2)

Fv   = Allowable shear stress, ksi (kN/mm2)

Fw  = Allowable shear stress for weld electrodes, ksi (kN/mm2)

Fy   = Yield stress, ksi (kN/mm2)

fa   =  Computed axial stress, ksi (kN/mm2)

fb   =  Computed bending stress, ksi (kN/mm2)

fmax = Maximum principal stress, ksi(kN/mm2)

fv    = Computed shear stress, ksi (kN/mm2)

g     = Distance between edge of cheek plate and main structure, in. (mm)

h    = Length of lifting eye at any cross section between A-A and C-C, in. (mm)

n   = Total number of lifting eyes used during the lift

P  = Design load per lifting eye, kips (kN)

R  = Radius to edge of lifting eye, in. (mm)

Rh  = Radius of hole, in. (mm)

r    = Radius of cheek plate, in. (mm)

S   = Safety factor with respect to allowable stresses

s  = Cheek plate weld size, in. (mm)

T  = Total plate thickness, in. (mm)

Tp  = Main plate thickness, in (mm)

t    = Thickness of each cheek plate, in (mm)

te  = Cheek plate weld throat, in. (mm)

W  = Total lift weight of structure, kips (kN)

α  =  Angle of taper, deg.

β  =  Angle between vertical and lifting sling, deg.

θ  =  Angle between attaching weldment and lifting sling, deg.

NULL

NULL

The design load for each lifting eye is given by:

restart

P := W*S/(n*cos(beta));

In the above equation, n refers to number of lifting eyes to used for the lift, S is the safety factor with respect to allowable stresses, W is the total weight to be lifted, and β is the angle between the vertical direction and the lifting sling.This analysis applies only to lifting eyes shaped like the one in Fig. 1. For other shapes, the designer should re-evaluate the equations.

Radius of liftimg eye hole will depend upon the diameter of the pin, D, used in the lifting shackle. It is recommeded that the hole diameter not greater than 1 / 16 in. (2 mm) larger than tha pin diameter. The required bearing area for the pin is

A__b >= P/(.9*F__y);

where Fy is the yield stress. This equation is based on allowable stresses as definde in Ref. 1, which considers stress concentrations in the vicinity of the hole. The designer may choose to use a technique which determines the stresses at the hole and should appropriately adjust the allowable stresses. The total plate thickness is then given by

T >= A__b/D;

At this point, if the thickness, T, is too large to be economically feasible, it may be desirable to use cheek plates (Fig.2) around the hole in order to sustain the bearing stresses. In this case, the above thickness, T, is divided into a main plate of thickness Tp and two cheek plates each of thickness t:

eqn1 := T = T__p+2*t;

It is recommended that t be less than Tp to avoid excessive welding. The radius to the edge of lifting eye plate and the radii of the cheek plates, if they are used, are governed by the condition that the pin cannot shear through these plates. The required area for shear is

A__s >= P/(.4*F__y);

It is possible to compute the required radii by equating the shaering area of the cheek plates plus the shearing area of the main plate to the total shear area. Theis a degree of uncertianty in choosing the appropriate shearing area. Minimum areas are used in the following equation, therefore, leading to conservative values for the radius of the main plate, R, and the radius of the cheek plate, r,

equ2 := (4*(r-R__h))*t+(2*(R-R__h))*T__p = A__s;

equ3 := R = r+e__cheek;

where Rh is the radius of the hole and e is the distance between the edge of the cheek plate and the edge of the main plate (Fig. 2). This difference should be large enough to allow space for welding the cheet plate to the main plate. A reasonable value for e is 1.5*t. It should be noted that the above equations assume there are two cheek plates. If cheek plates are not used, then simply let t equal zero and use Eq. 6 to determine R.

It is not necessary to check tension on this net section, since the allowable stress for shear is 0.4*Fy (Eq. 5); whereas the allowable stress for tension on a net section at a pin hole is given as 0.45*Fy (Ref. 1) which is greater than for shear. Size of weld between the cheek plates and the main plate can be determined as follows. The necessary weld area per cheek plate is

equ4 := A__w = P*t/(F__w*T);

where Fw is the allowable shear stress for the welding electrodes. The weld thickness, te is given by

equ5 := t__e = A__w/(2*Pi*r);

For a manual weld the size, s is given by

s := t__e*sqrt(2);

To assure that this weld size is large enough to insure fusion and minimize distortion, it should be greater than the AISC suggested Minimum Fillet Weld Sizes (Ref. 1).

The axial stress due to uniform tension along a section is

equ6 := f__a = P*sin(theta)/(T__p*h);

where h is the length of the section. The elemental bending stress which is distributed linearly along the section may be expressed as

equ7 := f__b = 12*P*C*(b*cos(theta)-.5*h*sin(theta)+R*sin(theta))/(T__p*h^2);

where C represents the distance of an element from the neutral axis and b is the distance from the center of the eye to the cross section. The shearing stress varies parabolically for section between A-A and B-B and is given as

equ8 := f__v = 1.5*P*cos(theta)*(-4*C^2+1)/(T__p*h);

It is felt that Eq. 13 (i.e., parabolic shear stress distribution) is applicable to the cross sections between A-A and B-B and does not apply to the cross sections between B-B and C-C in the area of the taper. The taper creates discontinuities on the shear plane, which result in significantly large shear stress concentratons along the edge of the taper coincident to point of maximum bending stress. This problem will be addressed ina subsequent section of this article.

The maximum principal stress that exists on an element is given by

f__max := .5*(f__a+f__b)+(((f__a+f__b)*(1/2))^.5+f__v^2)^.5;

or after dividing by the maximum allowable normal (i.e., tension) stress, Fa, gives a ratio that must be less than unity, where Fa has been taken as 0.6*Fy. A similar analysis for the maximum shear stress on the element yields

f__vmax := ((f__a+f__b)*(1/2))^2+f__v^2;

F__a := .6*F__y;

F__v := .4*F__y;

Ratio__tension := f__max/F__a;

Ratio__shear := f__vmax/F__v;

The designer should now select several critical elements throughout the plate and apply the restrains of Eq. 16 and 17 to obtain a required minimum length for the selected cross section. Eq 18 through 21 apply for an element at the neutral axis of the section. C will be zero and Eq. 11, 13 and 16 reduce to

P*sin(theta)/(.6*F__y*h*T__p)+(1.5*P*cos(theta)/(.6*F__y*h*T__p))^2 <= 1.0;

h >= P*(sin(theta)+(1+8*cos(theta)^2)^.5)/(1.2*F__y*T__p);

An element at the end of the section will be subjected to bending stresses but not shearing stresses.

For this case C = 0.5 and Eq. 16  becomes

P*sin(theta)/(.6*F__y*h*T__p)+6*P*(b*cos(theta)-.5*h*sin(theta)+R*sin(theta)) <= 1.0;

Using the quadratic formular to solve for h yields

h >= .5*(-2*P*sin(theta)/(.6*F__y*T__p)+(2*P*sin(theta)^2/(.6*F__y*T__p)+24*P*(b*cos(theta)+R*sin(theta))/(2*P*sin(theta)/(.6*F__y*T__p)))^.5);

The largest value of h predicted by Eqs. 19, 21 and 23 can be used as a first estimate for the length of the cross section; however, intermediate elements, that is, between the edge and the center of the cross section, should also be checked to determine the appropriate length, h, of the section under consideration.

Cross sections A-A and B-B should be analyzed using the above approach. The designer should use his own discretion to select other cross sections for analysis.At cross section A-A, the lifting eye is assumed to be welded with complete penetration to the support structure. Once length, h, is determined, the angle of taper, α, should be investigated. It can be shown that normal stress and shear stress are related by

equ9 := f__a+f__b = f__v*tan(alpha);

Minimum required length, h, for cross sections between B-B and C-C can be computed by calculating the maximum shear stress for the most critical element of the cross section, which occurs at the tapered surface. It can be shown that the maximum principal stress would not control the required length, h. Using Eqs. 11 and 12 in conjunction with Eq 24, the maximum shear stress yields the following:

(P*sin(theta)/(.4*F__y*h*T__p)+6*P*(b*cos(theta)-.5*h*sin(theta)+R*sin(theta))/(.4*F__y*T__p*h^2))*(.5^2+cot(alpha)^2)^.5 <= 1.0;

 

If the above inequality is not satisfied, the angle of the taper, α, must be adjusted.

The adequacy of the structure to which the lifting eye is to be attached should be checked to verify that it is capable of sustaining the loads from the lifting eye.

In some instances, it may be justifiable to use a more sophisticated technique for analyzing the lifting eye as well as the supporting structure.

 

NULL

Input Variables

 

W := 120;

n := 6;

P := W/n;

S := 3;

F__y := 300;

F__w := 450;

R := 90;

R__h := 89;

alpha := evalf(convert(45*degrees, radians));

beta := evalf(convert(30*degrees, radians));

theta := evalf(convert(20*degrees, radians));

d__pin := 100;

b := 200;

g := 50;

NULL

NULL

Output

 

solve({equ1, equ2, equ3, equ4, equ5, equ7, equ8, equ9}, {A__s, A__w, C, T, T__p, h, r, t, e__cheek});

NULL

``

NULL

NULL

NULL

NULL

NULL

NULL

NULL

 

Download Lifting_Eye_Design.mw

Good Evening Everybody,

Could any one help me with the attached file. I'm trying to solve 9 equations with 9 unknowns with many constraints, I'm getting no output from Maple. Please help.

 

Regards,

 

Moses

I have an equation eq := diff(y(x), x$3)+3*diff(y(x), x$2)+12*y(x);

dsolve(eq, y(x)); gave me a general solution.

I tried to get a particular solution using dsolve({eq, y(0) = a, y'(0)=0, y"(0) = 0}, y(x));

But I got Error, (in dsolve) not a system with respect to the unknowns [y(x)].

Thank you for any help.

Heather

Hi everyone,

 

I converted a code from Maple 18 to Fortran 77 but the code is badly cut, for instance:

cg = -(F * h * p ** 2 - F * h * q ** 2 + 0.2D1 * F * k * p * q + c
     #os(F) * sqrt(-e ** 2 + 0.1D1) * p ** 2 - cos(F) * sqrt(-e ** 2 + 0.

Is there an option which can force the line cut to be done in an optimized way?

Thank you very much for your help!

Dear All,

 

 We have a long equation , we need to find a laplace transform for that eq. I found the command as ilaplace.  But its not getting executed.

 

 Any specific comments../ help..

 

regards

when the kummerM function equal to 0?????

or

-(((beta*eta^2-(1/2)*beta+1)*p^2-(1/2)*beta^3)*KummerM((1/4)*((-beta+2)*p^2-beta^3)/p^2, 1, beta*eta^2)+(1/2)*KummerM((1/4)*((-beta+6)*p^2-beta^3)/p^2, 1, beta*eta^2)*((beta-2)*p^2+beta^3))*exp(-(1/2)*beta*eta^2)/(p^2*beta)=0

how solve this equation unitage beta?

I'm trying to solve a system of 4 ODE's.

 

 

however I have 4 equations and six unknowns. I dont know how else to describe the functions a,b,c,d

 

cause these just represent vector valued functions at points (x1,y1) and (x2,y2) where i have chosing (x1,y1)=(-1,0) and (x2,y2) = (1,0)

 

I have that

 

dx1/dt = (u,v)

dx2/dt=(f,g)

I know that if i graph these functions I should get vertical lines, but I keep getting circles if I instead consider a(t) to be x(t) and b(t) to be y(t)...

 

I need to solve this system and plot it but i am misinterpreting something somewhere..

I have the system:

 

Update:

{-1/2 < 2*f*(1/53)+7*g*(1/53), 3/106 < 7*f*(1/53)-2*g*(1/53), 2*f*(1/53)+7*g*(1/53) < -37/106, 7*f*(1/53)-2*g*(1/53) < 1/2}

 

which I wish to solve over integers but isolve() gives me "Warning, solutions may have been lost and no solutions". The solutions exist and are {[f =0, g = -3] || [f = 1, g = -4], [f = 1, g = -3] || [f = 2, g = -4]}, but I cannot obtain them with Maple. Could you tell me what is wrong and how I should treat this kind of problems in the future, please.

Mathematica 10.0

Reduce[{-1/2 < 2*f*(1/53) + 7*g*(1/53), 3/106 < 7*f*(1/53) - 2*g*(1/53), 2*f*(1/53) + 7*g*(1/53) < -37/106, 7*f*(1/53) - 2*g*(1/53) < 1/2}, {f, g}, Integers]

(f == 0 && g == -3) || (f == 1 && g == -4) || (f == 1 &&
   g == -3) || (f == 2 && g == -4)

 

Maple

isolve({-1/2 < 2*f*(1/53)+7*g*(1/53), 3/106 < 7*f*(1/53)-2*g*(1/53), 2*f*(1/53)+7*g*(1/53) < -37/106, 7*f*(1/53)-2*g*(1/53) < 1/2});
Warning, solutions may have been lost

 

Gentlemen

As seen on tv.

Having issues with animating the movement of two fielders, (25m apart on a straight line) when a baseball is struck towards them. they're on the y axis when they should be on the x.... and they should be green and brown dots, not lines.....

BaseballBallistics.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

Hello!

I am calculating the temperature of a rod which has one end at the temperature T1 and the other end at T2 and it's evolution. We were already given the formula for the numeric calculation and after a short while I managed to obtain a small program that would calculate the temperature of each segment of the T(x,t) grid:

>restart: with(plots): nx:=20: tmax:=50: T1:=1: T2:=10: L:=1: k:=1: rho:=1: cp:=1: chi:=k/rho/cp: h:=L/(nx-1): t:=1e-3:
>for k from 0 to nx do T(k,0):=T1 od:
for w from 1 to tmax do
T(0,w):=T1: T(nx,w):=T2:
for q from 1 to nx-1 do
T(q,w):=T(q,w-1)+chi*t/h^2*(T(q+1,w-1)+T(q-1,w-1)-2*T(q,w-1));
od: od:

With L the Length of the rod, t and h the time and space increment [h=L/(nx-1), where nx is the number of intervals we divide the x-axis, although I'm not quite sure the '-1' should be there], chi a constant different for each rod and tmax total time we want to calculate. The formula from the 5th line was given to us, so in that part there is no mistake.

Up until here everything works perfectly fine.

Now I want to be able to draw this and here is where all the problems appear. I want to draw this in a 2D graph with position in the x-axis and time in the y-axis. I have tried "densityplot(T(x,y),x=0..nx,y=0..tmax)" which would seem to be the logical whay to continue this. As I understand it, this plot would draw an nx times tmax grid and colour the whole plpot black-white acording to the maximum and the minimum value (as shown in the maple help page of this plot).

However, when I do this a black square appears (or red if I add colorstyle=HUE). I have tried a lot of things and none seemed to work.

I would also like to be able to draw the isotherms on the plot but that is secondary.

 

I am pretty new to Maple. I have studied the most basic things but don't really understand the whole complexity of this program. Thanks a lot in advance and forgive my faulty english,

Enrique

First 885 886 887 888 889 890 891 Last Page 887 of 2174