tomleslie

4908 Reputation

15 Badges

9 years, 183 days

MaplePrimes Activity


These are answers submitted by tomleslie

but my original comment about not really understanding teh problem still stands.

However at least this answer is vaguely(?) appropriate for this question

restart:
Severity:=[1,2,3]:
Likelihood:=[1,2,3]:
Impact:=LinearAlgebra:-OuterProductMatrix(Severity, Likelihood);
Outcome:=Matrix( op(1, Impact),
                 (i,j)-> if Impact[i,j] <= 3
                         then "minor"
                         elif Impact[i,j] <= 6
                         then "moderate"
                         else "serious"
                         fi
               );

Matrix(3, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (2, 1) = 2, (2, 2) = 4, (2, 3) = 6, (3, 1) = 3, (3, 2) = 6, (3, 3) = 9})

 

Matrix(%id = 18446744074381287422)

(1)

 


 

Download outcomeMatrix.mw

 

I'm not really sure what you are trying to achieve.

The attached will

  1. Plot five more or less random graphs
  2. Extract the data from these plots and build them into a matrix where the first column contains x-values: subsequent five columns contain y-values for each of the five graphs in (1) above
  3. Export this matrix (in csv format - many other formats are possible)

  restart;
  with(plots):
  with(plottools):
#
# Define five more or less random functions to plot
#
  v:= Vector
      ( 5,
        [1.1*t, 1.2*t, 1.3*t, 1.4*t, 1.5*t]
      ):
#
# Plot the five functions above
#
  g11:= plot
        ( [ seq
            ( v[j],
              j=1..5
            )
          ],
          t = 1 .. 2.9,
          color = [red, green, blue, black, purple],
          numpoints = 200
        );
#
# Extract the plot data from the above in the form of
# a matrix.
#
# First column is x-values: subsequent columns are the
# y-values associated with each of the individual plots
#

  M1:= Matrix
       ( [ getdata(g11)[1][3][..,1],
           seq
           ( getdata(g11)[j][3][..,2],
             j=1..5
           )
         ],
         scan=rows
       );
#
# Export this matrix to a csv file on my desktop.
#
# 1. Obviously the OP will have to change the
#    location of the output file to something
#    appropriate for his/her machine/OS
# 2. Output will be in plain vanilla 'csv' format.
#    Many other output formats are possible.
#
  ExportMatrix
  ( "C:/Users/TomLeslie/Desktop/plotData.csv",
    M1,
    target=csv
  );

 

_rtable[18446744074404266942]

 

28800

(1)

 

 

 Download exportPlots.mw

You have to dra a distinction between whether a function is "undefined" or "discontinuous"

The simple Heaviside function, ie Heaviside(x) has the value 0, for x<0, and the value 1, for x>0. Note that

  1. It is disconcinuous at x=0
  2. It is undefined at x=0

However consider the "simple" piecewise function

f:=piecewise(x<0,0,
                     x=0, 1/2,
                     x>0, 1
                   )

  1. It is discontinuous at x=0
  2. It is defined for all x - including x=0. Note that the value at x=0 given in the above is "arbitrary". Other "quite sensible" values would be 0 or 1. In fact, even 100: this would still mean that the function is "defined" for all x - just "discontinuous" at x=0

In the attached I have shown what happens when you replace your "Heaviside" definitions with "piecewise" definitions.

Basically fsolve() never gives an answer, even although the piecewise function is everywhere defined.

On the other hand DirectSearch:SolveEquations() always gives an answer - althugh you may want to think about these carefully, given the reported value of the "residual"

 

restart:

with(DirectSearch):

F:=x*(Heaviside(x-(S0))/(1-DD)+Heaviside(-x+S0)/(1-HH*DD));

x*(Heaviside(x-S0)/(1-DD)+Heaviside(-x+S0)/(-DD*HH+1))

(1)

EQ:=F-E*Y;

-E*Y+x*(Heaviside(x-S0)/(1-DD)+Heaviside(-x+S0)/(-DD*HH+1))

(2)

HH:=0.2;
DD:=0.579350262599427;
S0:=1e8;
E:=70e9;
Y:=0.001668993263529;

.2

 

.579350262599427

 

0.1e9

 

0.70e11

 

0.1668993263529e-2

(3)

EQ;

-116829528.5+x*(2.377274752*Heaviside(x-0.1e9)+1.131055455*Heaviside(-x+0.1e9))

(4)

plot(EQ, x=0..10^9, discont=true);

 

fsolve(EQ)

fsolve(-116829528.5+x*(2.377274752*Heaviside(x-0.1e9)+1.131055455*Heaviside(-x+0.1e9)), x)

(5)

SolveEquations(EQ)

Warning, complex or non-numeric value encountered; trying to find a feasible point

 

[1.3868049384289111*10^13, Vector(1, {(1) = -3723983.000}), [x = 9.999999999999999*10^7], 231]

(6)

eval(EQ,x = 1.00000000000000*10^8)

Float(undefined)

(7)

G:=[ piecewise( x<S0, x/(1-HH*DD)-E*Y,
                x=S0, 0,
                x>S0, x/(1-DD)-E*Y
              ),
     piecewise( x<S0, x/(1-HH*DD)-E*Y,
                x=S0, 1/2,
                x>S0, x/(1-DD)-E*Y
              ),
     piecewise( x<S0, x/(1-HH*DD)-E*Y,
                x=S0, 1,
                x>S0, x/(1-DD)-E*Y
              )
   ]:
plot(G, x=0..10^9, discont=true);
fsolve~(G);
SolveEquations~(G);

 

[fsolve(piecewise(x < 1.*10^8, 1.131055455*x-1.168295285*10^8, x = 1.*10^8, 0, 1.*10^8 < x, 2.377274752*x-1.168295285*10^8), x), fsolve(piecewise(x < 1.*10^8, 1.131055455*x-1.168295285*10^8, x = 1.*10^8, 1/2, 1.*10^8 < x, 2.377274752*x-1.168295285*10^8), x), fsolve(piecewise(x < 1.*10^8, 1.131055455*x-1.168295285*10^8, x = 1.*10^8, 1, 1.*10^8 < x, 2.377274752*x-1.168295285*10^8), x)]

 

[[HFloat(0.0), Vector[column](%id = 18446744074449565686), [x = HFloat(1.0e8)], 114], [HFloat(0.25), Vector[column](%id = 18446744074449557494), [x = HFloat(1.0e8)], 114], [HFloat(1.0), Vector[column](%id = 18446744074449549302), [x = HFloat(1.0e8)], 114]]

(8)

 

Download solveIssue.mw

I'm not really sure what you are trying to achieve.

The attached will

  1. Plot five more or less random graphs
  2. Extract the data from these plots and build them into a matrix where the first column contains x-values: subsequent five columns contain y-values for each of the five graphs in (1) above
  3. Export this matrix (in csv format - many other formats are possible)

  restart;
  with(plots):
  with(plottools):
#
# Define five more or less random functions to plot
#
  v:= Vector
      ( 5,
        [1.1*t, 1.2*t, 1.3*t, 1.4*t, 1.5*t]
      ):
#
# Plot the five functions above
#
  g11:= plot
        ( [ seq
            ( v[j],
              j=1..5
            )
          ],
          t = 1 .. 2.9,
          color = [red, green, blue, black, purple],
          numpoints = 200
        );
#
# Extract the plot data from the above in the form of
# a matrix.
#
# First column is x-values: subsequent columns are the
# y-values associated with each of the individual plots
#

  M1:= Matrix
       ( [ getdata(g11)[1][3][..,1],
           seq
           ( getdata(g11)[j][3][..,2],
             j=1..5
           )
         ],
         scan=rows
       );
#
# Export this matrix to a csv file on my desktop.
#
# 1. Obviously the OP will have to change the
#    location of the output file to something
#    appropriate for his/her machine/OS
# 2. Output will be in plain vanilla 'csv' format.
#    Many other output formats are possible.
#
  ExportMatrix
  ( "C:/Users/TomLeslie/Desktop/plotData.csv",
    M1,
    target=csv
  );

 

_rtable[18446744074404266942]

 

28800

(1)

 

 


 

Download exportPlots.mw

The following works just fine in Maple 2019.1

  restart;
  interface(version);
  with(Maplets[Elements]):
  maplet1 := Maplet(["Hello World!", Button("OK", Shutdown())]):
  Maplets[Display](maplet1);

 

on why the PDE system in the worksheet Test_1.mw has got problems

  1. Wrong number of BCs/ICs - you need five but you supply eight! This is simple to fix.
  2. One of the PDEs in the system is diff(svt1(x, t), t) = 0. This means that svt1() cannot be a function of 't'. This can be fixed by removing this pde from the system, deleting the associated initial condition, and substituing svt1(x) for svt1(x,t) in the remaining equations
  3. However one of the other PDEs in the system is diff(svt1(x, t), x) = 6342.941220/Lt1(x, t). Item (2) above shows that the left-hand-side of this equation is a function of 'x' only. Hence the right-hand-side must be a function of 'x' only. Hence Lt1(x,t) cannot be a function of 't'
  4. Is this really what you expect????

See detailed diagnostics in the attached


 

restart:Digits:=30:

Ts:=60*10^6*365*24*60*60:
Tf:=2*Ts:
phi0:=0.72:
rho0:=646.8:
E0:=1*10^9:
nu0:=0.33:
pc0:=4.0*10^6:
mp:=1.0:
pv0:=5.0*10^6:
mvp:=0.8:
g:=9.80665:
Mp:=(6000*rho0)/Ts:
lambda0:=E0*nu0/((1+nu0)*(1-2*nu0)):
mu0:=E0/(2*(1+nu0)):
K0:=lambda0+2/3*mu0:
mus:=(1/16)*(-6*sqrt((K0-2*mu0)^2*phi0^2-(3*(K0-(8/9)*mu0))*(K0+2*mu0)*phi0+(9/4)*(K0+(8/9)*mu0)^2)-(6*(K0+2*mu0))*phi0+9*(K0-(8/9)*mu0))/(phi0-1):
ks:=K0/(1-(1+3*K0/(4*mus))*phi0):
eta:=1*10^9*10^6*365*24*60*60:
a:=1.1545:
A:=evalf(-2/3+a*sqrt(3)/3):
B:=evalf(-1/3-a*sqrt(3)/3):

Md:=t->Mp*t:
phi:=1-(1-phi0)/Jir(x):

pc:=pc0*(ln(phi)/ln(phi0))^mp:
hp:=-(mp*(1-phi0)*pc)/(Jir(x)*phi*ln(phi)):

pv:=pv0*(ln(phi)/ln(phi0))^mvp:
hvp:=-(mvp*(1-phi0)*pv)/(Jir(x)*phi*ln(phi)):

K:=4*ks*mus*(1-phi)/(3*ks*phi+4*mus):
Kb:=-(1/3)*(3*ks+4*mus)/(Jir(x)*(3*ks+4*mus)-3*ks*(1-phi0)):

mu:=mus*(1-phi)*(9*ks+8*mus)/(ks*(9+6*phi)+mus*(8+12*phi)):
mub:=(-5/3)*(3*ks+4*mus)/(3*ks*(5*Jir(x)-2*(1-phi0))+4*mus*(5*Jir(x)-3*(1-phi0))):

Gp1:=-(K+2*sqrt(3)/3*mu*a)/(K+a^2*mu+hp):
Gp2:=-((sv(x)+2*sh(x))*Kb+a*sqrt(3)*(sv(x)-sh(x))*mub)/(K+a^2*mu+hp):

Gvp1:=-(K+2*sqrt(3)/3*mu*a)/(K+a^2*mu+hp):
Gvp2:=-((sv(x)+2*sh(x))*Kb+a*sqrt(3)*(sv(x)-sh(x))*mub)/(K+a^2*mu+hp):

Gv1:=-(K+2*sqrt(3)/3*mu*a)/(K+a^2*mu+hvp):
Gv2:=-((sv(x)+2*sh(x))*Kb+a*sqrt(3)*(sv(x)-sh(x))*mub)/(K+a^2*mu+hvp):

Fhe:=K-2/3*mu:
Fve:=K+4/3*mu:

Fh:=((sv(x)+2*sh(x))*Kb-(sv(x)-sh(x))*mub):
Fv:=((sv(x)+2*sh(x))*Kb+2*(sv(x)-sh(x))*mub):

Fhp1:=Fhe+(K-sqrt(3)/3*mu*a)*Gp1:
Fhp2:=(K-sqrt(3)/3*mu*a)*Gp2+Fh:
Fvp1:=Fve+(K+2*sqrt(3)/3*mu*a)*Gp1:
Fvp2:=(K+2*sqrt(3)/3*mu*a)*Gp2+Fv:

Fhvp1:=Fhe+(K-sqrt(3)/3*mu*a)*Gvp1:
Fhvp2:=(K-sqrt(3)/3*mu*a)*Gvp2+Fh:
Fvvp1:=Fve+(K+2*sqrt(3)/3*mu*a)*Gvp1:
Fvvp2:=(K+2*sqrt(3)/3*mu*a)*Gvp2+Fv:

Fhv1:=Fhe+(K-sqrt(3)/3*mu*a)*Gv1:
Fhv2:=(K-sqrt(3)/3*mu*a)*Gv2+Fh:
Fvv1:=Fve+(K+2*sqrt(3)/3*mu*a)*Gv1:
Fvv2:=(K+2*sqrt(3)/3*mu*a)*Gv2+Fv:

He:=629.81:
Hp:=1412.21:
Hvp:=2403.25:
Hs:=2798.10:

Le:=0.997303781223145045267439740594:
Lp:=0.446364534701243987:
Lvp:=0.305960439144176588:

Jire:=1:
Jirp:=0.447352635989884784:
Jirvp:=0.306391087534055584:

she:=-1.97026501562798356531403389299*10^6:
shp:=-7.27091982399678383000000*10^6:
shvp:=-2.42633766270405289000000*10^7:

sve:=-4.00023503172954239018303851002*10^6:
svp:=-1.19729258539294481000000*10^7:
svvp:=-2.98552061557406603000000*10^7:

uh:=-2.25710511476647640150403675387*10^(-12):
ue:=-8.54965365567908020218245625954*10^(-15):
up:=-1.74701689029014799084132788157*10^(-12):
uvp:=-4.45218466378321332440604021849*10^(-13):

# x to [Hs-He..Hs]
unassign(sv,sh,L,Jir,u):
sys_ode:=
diff(sv(x),x)=rho0*g/L(x),
diff(sh(x),x)=(K0-2/3*mu0)*diff(L(x),x)/L(x),
diff(L(x),x)=rho0*g/(K0+4/3*mu0),
diff(Jir(x),x)=0,
diff(u(x),x)=-Mp*g/(K0+4/3*mu0):
dvars:=indets({sys_ode},specfunc(anything,diff)):
SYS:=solve({sys_ode},dvars):
ics:=sv(Hs)=0,sh(Hs)=0,L(Hs)=1,Jir(Hs)=1,u(Hs)=uh:
sol:=dsolve(SYS union {ics},numeric,output=listprocedure):
sv1,sh1,L1,Jir1,u1:=op(subs(sol,[sv(x),sh(x),L(x),Jir(x),u(x)])):
phi1:=x->1-(1-phi0)/Jir1(x):
pc1:=x->pc0*(ln(phi1(x))/ln(phi0))^mp:
pv1:=x->pv0*(ln(phi1(x))/ln(phi0))^mvp:
rho1:=x->rho0/L1(x):

# x to [Hs-Hp..Hs-He]
unassign(sv,sh,L,Jir,u):
sys_ode:=
diff(sv(x),x)=rho0*g/L(x),
diff(sh(x),x)=Fhp1*diff(L(x),x)/L(x)+Fhp2*diff(Jir(x),x),
Fvp1*diff(L(x),x)+Fvp2*L(x)*diff(Jir(x),x)=rho0*g,
diff(Jir(x),x)/Jir(x)=-Gp1*diff(L(x),x)/L(x)-Gp2*diff(Jir(x),x),
diff(u(x),x)=-Mp*g/(Fvp1+Fvp2*L(x)*diff(Jir(x),x)/diff(L(x),x)):
dvars:=indets({sys_ode},specfunc(anything,diff)):
SYS:=solve({sys_ode},dvars):
ics:=sv(Hs-He)=sve,sh(Hs-He)=she,L(Hs-He)=Le,Jir(Hs-He)=Jire,u(Hs-He)=uh-ue:
sol:=dsolve(SYS union {ics},numeric,output=listprocedure):
sv2,sh2,L2,Jir2,u2:=op(subs(sol,[sv(x),sh(x),L(x),Jir(x),u(x)])):
phi2:=x->1-(1-phi0)/Jir2(x):
pc2:=x->pc0*(ln(phi2(x))/ln(phi0))^mp:
pv2:=x->pv0*(ln(phi2(x))/ln(phi0))^mvp:
rho2:=x->rho0/L2(x):

# x to [Hs-Hvp..Hs-Hp]
unassign(sv,sh,L,Jir,u):
sys_ode:=
diff(sv(x),x)=rho0*g/L(x),
diff(sh(x),x)=Fhvp1*diff(L(x),x)/L(x)+Fhvp2*diff(Jir(x),x),
Fvvp1*diff(L(x),x)+Fvvp2*L(x)*diff(Jir(x),x)=rho0*g,
diff(Jir(x),x)/Jir(x)=-Gvp1*diff(L(x),x)/L(x)-Gvp2*diff(Jir(x),x),
diff(u(x),x)=-Mp*g/(Fvvp1+Fvvp2*L(x)*diff(Jir(x),x)/diff(L(x),x)):
dvars:=indets({sys_ode},specfunc(anything,diff)):
SYS:=solve({sys_ode},dvars):
ics:=sv(Hs-Hp)=svp,sh(Hs-Hp)=shp,L(Hs-Hp)=Lp,Jir(Hs-Hp)=Jirp,u(Hs-Hp)=uh-ue-up:
sol:=dsolve(SYS union {ics},numeric,output=listprocedure):
sv3,sh3,L3,Jir3,u3:=op(subs(sol,[sv(x),sh(x),L(x),Jir(x),u(x)]));
phi3:=x->1-(1-phi0)/Jir3(x):
pc3:=x->pc0*(ln(phi3(x))/ln(phi0))^mp:
pv3:=x->pv0*(ln(phi3(x))/ln(phi0))^mvp:
rho3:=x->rho0/L3(x):

proc (x) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _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) else _xout := evalf(x) 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 .. 26, [( 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..63, {(1) = 5, (2) = 5, (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) = 41, (19) = 30000, (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, (55) = 0, (56) = 0, (57) = 0, (58) = 0, (59) = 10000, (60) = 0, (61) = 1000, (62) = 0, (63) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = 1385.89, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = 1385.89, (6) = 15.01490396858208, (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..5, {(1) = .447352635989885, (2) = .446364534701244, (3) = -7270919.82399678, (4) = -11972925.8539294, (5) = -0.501538571e-12}, 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..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, 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, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..10, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..5, {(1) = .447352635989885, (2) = .446364534701244, (3) = -7270919.82399678, (4) = -11972925.8539294, (5) = -0.501538571e-12}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0.31202937062114886e-3, (2) = 0.31098478712698093e-3, (3) = 11153.13013624623, (4) = 14210.22667996101, (5) = -0.9861262912292407e-15}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = Jir(x), Y[2] = L(x), Y[3] = sh(x), Y[4] = sv(x), Y[5] = u(x)]`; YP[1] := 12685.88244*(0.1126435866e92*Y[1]^3-0.6392128424e91*Y[1]^2+0.1129722923e91*Y[1]-0.6245475121e89)*Y[1]/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[2] := 0.2537176488e-5*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); YP[3] := 6342.941220*(0.9616866942e91*Y[1]^3*Y[4]-0.2252760373e92*Y[1]^3*Y[3]-0.3793385288e91*Y[1]^2*Y[4]+0.8886041690e91*Y[1]^2*Y[3]+0.3081855125e90*Y[1]*Y[4]-0.7219275407e90*Y[1]*Y[3]+0.3118180160e98*Y[1]^2-0.4621652064e97*Y[1]+0.1205006464e96)/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[4] := 6342.941220/Y[2]; YP[5] := -0.8045333868e-17*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = Jir(x), Y[2] = L(x), Y[3] = sh(x), Y[4] = sv(x), Y[5] = u(x)]`; YP[1] := 12685.88244*(0.1126435866e92*Y[1]^3-0.6392128424e91*Y[1]^2+0.1129722923e91*Y[1]-0.6245475121e89)*Y[1]/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[2] := 0.2537176488e-5*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); YP[3] := 6342.941220*(0.9616866942e91*Y[1]^3*Y[4]-0.2252760373e92*Y[1]^3*Y[3]-0.3793385288e91*Y[1]^2*Y[4]+0.8886041690e91*Y[1]^2*Y[3]+0.3081855125e90*Y[1]*Y[4]-0.7219275407e90*Y[1]*Y[3]+0.3118180160e98*Y[1]^2-0.4621652064e97*Y[1]+0.1205006464e96)/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[4] := 6342.941220/Y[2]; YP[5] := -0.8045333868e-17*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 1385.89, (2) = .447352635989885, (3) = .446364534701244, (4) = -7270919.82399678, (5) = -11972925.8539294}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _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); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `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 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 _dat[17] <> _dtbl[1][17] then _dtbl[1][17] := _dat[17]; _dtbl[1][10] := _dat[10] end if; 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 ?dsolve,maxfun 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 ?dsolve,maxfun 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]; if type(_EnvDSNumericSaveDigits, 'posint') then _dat[4][26] := _EnvDSNumericSaveDigits else _dat[4][26] := Digits end if; _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(1..6, {(1) = 18446744074383183206, (2) = 18446744074383183382, (3) = 18446744074383183558, (4) = 18446744074383183734, (5) = 18446744074383175766, (6) = 18446744074383175942}), (3) = [x, Jir(x), L(x), sh(x), sv(x), u(x)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(x, ["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, '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, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(x, 'string')); if type(_res, 'list') then return _res[5] else return NULL end if elif member(x, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(x, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[5], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] 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), 'string') = rhs(x); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 5, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 5, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[5] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[5], 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), 'string') = rhs(x)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(x) else _ndsol := 1; _ndsol := `tools/gensym`("sv(x)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][5])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(x)))) end if end if; try _res := _solnproc(_xout); _res[5] catch: error  end try end proc, proc (x) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _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) else _xout := evalf(x) 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 .. 26, [( 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..63, {(1) = 5, (2) = 5, (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) = 41, (19) = 30000, (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, (55) = 0, (56) = 0, (57) = 0, (58) = 0, (59) = 10000, (60) = 0, (61) = 1000, (62) = 0, (63) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = 1385.89, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = 1385.89, (6) = 15.01490396858208, (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..5, {(1) = .447352635989885, (2) = .446364534701244, (3) = -7270919.82399678, (4) = -11972925.8539294, (5) = -0.501538571e-12}, 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..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, 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, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..10, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..5, {(1) = .447352635989885, (2) = .446364534701244, (3) = -7270919.82399678, (4) = -11972925.8539294, (5) = -0.501538571e-12}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0.31202937062114886e-3, (2) = 0.31098478712698093e-3, (3) = 11153.13013624623, (4) = 14210.22667996101, (5) = -0.9861262912292407e-15}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = Jir(x), Y[2] = L(x), Y[3] = sh(x), Y[4] = sv(x), Y[5] = u(x)]`; YP[1] := 12685.88244*(0.1126435866e92*Y[1]^3-0.6392128424e91*Y[1]^2+0.1129722923e91*Y[1]-0.6245475121e89)*Y[1]/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[2] := 0.2537176488e-5*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); YP[3] := 6342.941220*(0.9616866942e91*Y[1]^3*Y[4]-0.2252760373e92*Y[1]^3*Y[3]-0.3793385288e91*Y[1]^2*Y[4]+0.8886041690e91*Y[1]^2*Y[3]+0.3081855125e90*Y[1]*Y[4]-0.7219275407e90*Y[1]*Y[3]+0.3118180160e98*Y[1]^2-0.4621652064e97*Y[1]+0.1205006464e96)/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[4] := 6342.941220/Y[2]; YP[5] := -0.8045333868e-17*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = Jir(x), Y[2] = L(x), Y[3] = sh(x), Y[4] = sv(x), Y[5] = u(x)]`; YP[1] := 12685.88244*(0.1126435866e92*Y[1]^3-0.6392128424e91*Y[1]^2+0.1129722923e91*Y[1]-0.6245475121e89)*Y[1]/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[2] := 0.2537176488e-5*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); YP[3] := 6342.941220*(0.9616866942e91*Y[1]^3*Y[4]-0.2252760373e92*Y[1]^3*Y[3]-0.3793385288e91*Y[1]^2*Y[4]+0.8886041690e91*Y[1]^2*Y[3]+0.3081855125e90*Y[1]*Y[4]-0.7219275407e90*Y[1]*Y[3]+0.3118180160e98*Y[1]^2-0.4621652064e97*Y[1]+0.1205006464e96)/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[4] := 6342.941220/Y[2]; YP[5] := -0.8045333868e-17*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 1385.89, (2) = .447352635989885, (3) = .446364534701244, (4) = -7270919.82399678, (5) = -11972925.8539294}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _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); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `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 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 _dat[17] <> _dtbl[1][17] then _dtbl[1][17] := _dat[17]; _dtbl[1][10] := _dat[10] end if; 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 ?dsolve,maxfun 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 ?dsolve,maxfun 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]; if type(_EnvDSNumericSaveDigits, 'posint') then _dat[4][26] := _EnvDSNumericSaveDigits else _dat[4][26] := Digits end if; _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(1..6, {(1) = 18446744074383183206, (2) = 18446744074383183382, (3) = 18446744074383183558, (4) = 18446744074383183734, (5) = 18446744074383175766, (6) = 18446744074383175942}), (3) = [x, Jir(x), L(x), sh(x), sv(x), u(x)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(x, ["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, '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, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(x, 'string')); if type(_res, 'list') then return _res[4] else return NULL end if elif member(x, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(x, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[4], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] 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), 'string') = rhs(x); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 4, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 4, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[4] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[4], 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), 'string') = rhs(x)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(x) else _ndsol := 1; _ndsol := `tools/gensym`("sh(x)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][4])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(x)))) end if end if; try _res := _solnproc(_xout); _res[4] catch: error  end try end proc, proc (x) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _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) else _xout := evalf(x) 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 .. 26, [( 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..63, {(1) = 5, (2) = 5, (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) = 41, (19) = 30000, (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, (55) = 0, (56) = 0, (57) = 0, (58) = 0, (59) = 10000, (60) = 0, (61) = 1000, (62) = 0, (63) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = 1385.89, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = 1385.89, (6) = 15.01490396858208, (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..5, {(1) = .447352635989885, (2) = .446364534701244, (3) = -7270919.82399678, (4) = -11972925.8539294, (5) = -0.501538571e-12}, 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..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, 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, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..10, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..5, {(1) = .447352635989885, (2) = .446364534701244, (3) = -7270919.82399678, (4) = -11972925.8539294, (5) = -0.501538571e-12}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0.31202937062114886e-3, (2) = 0.31098478712698093e-3, (3) = 11153.13013624623, (4) = 14210.22667996101, (5) = -0.9861262912292407e-15}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = Jir(x), Y[2] = L(x), Y[3] = sh(x), Y[4] = sv(x), Y[5] = u(x)]`; YP[1] := 12685.88244*(0.1126435866e92*Y[1]^3-0.6392128424e91*Y[1]^2+0.1129722923e91*Y[1]-0.6245475121e89)*Y[1]/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[2] := 0.2537176488e-5*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); YP[3] := 6342.941220*(0.9616866942e91*Y[1]^3*Y[4]-0.2252760373e92*Y[1]^3*Y[3]-0.3793385288e91*Y[1]^2*Y[4]+0.8886041690e91*Y[1]^2*Y[3]+0.3081855125e90*Y[1]*Y[4]-0.7219275407e90*Y[1]*Y[3]+0.3118180160e98*Y[1]^2-0.4621652064e97*Y[1]+0.1205006464e96)/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[4] := 6342.941220/Y[2]; YP[5] := -0.8045333868e-17*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = Jir(x), Y[2] = L(x), Y[3] = sh(x), Y[4] = sv(x), Y[5] = u(x)]`; YP[1] := 12685.88244*(0.1126435866e92*Y[1]^3-0.6392128424e91*Y[1]^2+0.1129722923e91*Y[1]-0.6245475121e89)*Y[1]/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[2] := 0.2537176488e-5*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); YP[3] := 6342.941220*(0.9616866942e91*Y[1]^3*Y[4]-0.2252760373e92*Y[1]^3*Y[3]-0.3793385288e91*Y[1]^2*Y[4]+0.8886041690e91*Y[1]^2*Y[3]+0.3081855125e90*Y[1]*Y[4]-0.7219275407e90*Y[1]*Y[3]+0.3118180160e98*Y[1]^2-0.4621652064e97*Y[1]+0.1205006464e96)/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[4] := 6342.941220/Y[2]; YP[5] := -0.8045333868e-17*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 1385.89, (2) = .447352635989885, (3) = .446364534701244, (4) = -7270919.82399678, (5) = -11972925.8539294}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _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); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `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 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 _dat[17] <> _dtbl[1][17] then _dtbl[1][17] := _dat[17]; _dtbl[1][10] := _dat[10] end if; 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 ?dsolve,maxfun 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 ?dsolve,maxfun 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]; if type(_EnvDSNumericSaveDigits, 'posint') then _dat[4][26] := _EnvDSNumericSaveDigits else _dat[4][26] := Digits end if; _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(1..6, {(1) = 18446744074383183206, (2) = 18446744074383183382, (3) = 18446744074383183558, (4) = 18446744074383183734, (5) = 18446744074383175766, (6) = 18446744074383175942}), (3) = [x, Jir(x), L(x), sh(x), sv(x), u(x)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(x, ["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, '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, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(x, 'string')); if type(_res, 'list') then return _res[3] else return NULL end if elif member(x, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(x, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[3], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] 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), 'string') = rhs(x); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 3, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 3, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[3] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[3], 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), 'string') = rhs(x)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(x) else _ndsol := 1; _ndsol := `tools/gensym`("L(x)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][3])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(x)))) end if end if; try _res := _solnproc(_xout); _res[3] catch: error  end try end proc, proc (x) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _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) else _xout := evalf(x) 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 .. 26, [( 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..63, {(1) = 5, (2) = 5, (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) = 41, (19) = 30000, (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, (55) = 0, (56) = 0, (57) = 0, (58) = 0, (59) = 10000, (60) = 0, (61) = 1000, (62) = 0, (63) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = 1385.89, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = 1385.89, (6) = 15.01490396858208, (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..5, {(1) = .447352635989885, (2) = .446364534701244, (3) = -7270919.82399678, (4) = -11972925.8539294, (5) = -0.501538571e-12}, 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..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, 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, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..10, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..5, {(1) = .447352635989885, (2) = .446364534701244, (3) = -7270919.82399678, (4) = -11972925.8539294, (5) = -0.501538571e-12}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0.31202937062114886e-3, (2) = 0.31098478712698093e-3, (3) = 11153.13013624623, (4) = 14210.22667996101, (5) = -0.9861262912292407e-15}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = Jir(x), Y[2] = L(x), Y[3] = sh(x), Y[4] = sv(x), Y[5] = u(x)]`; YP[1] := 12685.88244*(0.1126435866e92*Y[1]^3-0.6392128424e91*Y[1]^2+0.1129722923e91*Y[1]-0.6245475121e89)*Y[1]/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[2] := 0.2537176488e-5*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); YP[3] := 6342.941220*(0.9616866942e91*Y[1]^3*Y[4]-0.2252760373e92*Y[1]^3*Y[3]-0.3793385288e91*Y[1]^2*Y[4]+0.8886041690e91*Y[1]^2*Y[3]+0.3081855125e90*Y[1]*Y[4]-0.7219275407e90*Y[1]*Y[3]+0.3118180160e98*Y[1]^2-0.4621652064e97*Y[1]+0.1205006464e96)/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[4] := 6342.941220/Y[2]; YP[5] := -0.8045333868e-17*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = Jir(x), Y[2] = L(x), Y[3] = sh(x), Y[4] = sv(x), Y[5] = u(x)]`; YP[1] := 12685.88244*(0.1126435866e92*Y[1]^3-0.6392128424e91*Y[1]^2+0.1129722923e91*Y[1]-0.6245475121e89)*Y[1]/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[2] := 0.2537176488e-5*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); YP[3] := 6342.941220*(0.9616866942e91*Y[1]^3*Y[4]-0.2252760373e92*Y[1]^3*Y[3]-0.3793385288e91*Y[1]^2*Y[4]+0.8886041690e91*Y[1]^2*Y[3]+0.3081855125e90*Y[1]*Y[4]-0.7219275407e90*Y[1]*Y[3]+0.3118180160e98*Y[1]^2-0.4621652064e97*Y[1]+0.1205006464e96)/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[4] := 6342.941220/Y[2]; YP[5] := -0.8045333868e-17*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 1385.89, (2) = .447352635989885, (3) = .446364534701244, (4) = -7270919.82399678, (5) = -11972925.8539294}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _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); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `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 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 _dat[17] <> _dtbl[1][17] then _dtbl[1][17] := _dat[17]; _dtbl[1][10] := _dat[10] end if; 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 ?dsolve,maxfun 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 ?dsolve,maxfun 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]; if type(_EnvDSNumericSaveDigits, 'posint') then _dat[4][26] := _EnvDSNumericSaveDigits else _dat[4][26] := Digits end if; _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(1..6, {(1) = 18446744074383183206, (2) = 18446744074383183382, (3) = 18446744074383183558, (4) = 18446744074383183734, (5) = 18446744074383175766, (6) = 18446744074383175942}), (3) = [x, Jir(x), L(x), sh(x), sv(x), u(x)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(x, ["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, '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, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(x, 'string')); if type(_res, 'list') then return _res[2] else return NULL end if elif member(x, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(x, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[2], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] 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), 'string') = rhs(x); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 2, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 2, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[2] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[2], 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), 'string') = rhs(x)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(x) else _ndsol := 1; _ndsol := `tools/gensym`("Jir(x)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][2])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(x)))) end if end if; try _res := _solnproc(_xout); _res[2] catch: error  end try end proc, proc (x) local _res, _dat, _solnproc, _xout, _ndsol, _pars, _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) else _xout := evalf(x) 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 .. 26, [( 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..63, {(1) = 5, (2) = 5, (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) = 41, (19) = 30000, (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, (55) = 0, (56) = 0, (57) = 0, (58) = 0, (59) = 10000, (60) = 0, (61) = 1000, (62) = 0, (63) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = 1385.89, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = 1385.89, (6) = 15.01490396858208, (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..5, {(1) = .447352635989885, (2) = .446364534701244, (3) = -7270919.82399678, (4) = -11972925.8539294, (5) = -0.501538571e-12}, 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..5, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0}, datatype = float[8], order = C_order), Array(1..5, 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, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0}, datatype = integer[8]), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..10, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..5, {(1) = .447352635989885, (2) = .446364534701244, (3) = -7270919.82399678, (4) = -11972925.8539294, (5) = -0.501538571e-12}, datatype = float[8], order = C_order), Array(1..5, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0}, datatype = float[8], order = C_order), Array(1..5, {(1) = 0.31202937062114886e-3, (2) = 0.31098478712698093e-3, (3) = 11153.13013624623, (4) = 14210.22667996101, (5) = -0.9861262912292407e-15}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = Jir(x), Y[2] = L(x), Y[3] = sh(x), Y[4] = sv(x), Y[5] = u(x)]`; YP[1] := 12685.88244*(0.1126435866e92*Y[1]^3-0.6392128424e91*Y[1]^2+0.1129722923e91*Y[1]-0.6245475121e89)*Y[1]/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[2] := 0.2537176488e-5*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); YP[3] := 6342.941220*(0.9616866942e91*Y[1]^3*Y[4]-0.2252760373e92*Y[1]^3*Y[3]-0.3793385288e91*Y[1]^2*Y[4]+0.8886041690e91*Y[1]^2*Y[3]+0.3081855125e90*Y[1]*Y[4]-0.7219275407e90*Y[1]*Y[3]+0.3118180160e98*Y[1]^2-0.4621652064e97*Y[1]+0.1205006464e96)/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[4] := 6342.941220/Y[2]; YP[5] := -0.8045333868e-17*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = Jir(x), Y[2] = L(x), Y[3] = sh(x), Y[4] = sv(x), Y[5] = u(x)]`; YP[1] := 12685.88244*(0.1126435866e92*Y[1]^3-0.6392128424e91*Y[1]^2+0.1129722923e91*Y[1]-0.6245475121e89)*Y[1]/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[2] := 0.2537176488e-5*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); YP[3] := 6342.941220*(0.9616866942e91*Y[1]^3*Y[4]-0.2252760373e92*Y[1]^3*Y[3]-0.3793385288e91*Y[1]^2*Y[4]+0.8886041690e91*Y[1]^2*Y[3]+0.3081855125e90*Y[1]*Y[4]-0.7219275407e90*Y[1]*Y[3]+0.3118180160e98*Y[1]^2-0.4621652064e97*Y[1]+0.1205006464e96)/((-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97)*Y[2]); YP[4] := 6342.941220/Y[2]; YP[5] := -0.8045333868e-17*(0.4847638297e92*Y[1]^4*Y[4]+0.5613288542e88*Y[1]^4*Y[3]-0.2962350859e92*Y[1]^3*Y[4]+0.4950898460e91*Y[1]^3*Y[3]+0.5695994047e91*Y[1]^2*Y[4]-0.1953581635e91*Y[1]^2*Y[3]-0.3365488189e90*Y[1]*Y[4]+0.1587291956e90*Y[1]*Y[3]+0.5648335071e101*Y[1]^3-0.3204026038e101*Y[1]^2+0.5660395838e100*Y[1]-0.3128214132e99)/(-0.1113578318e88*Y[1]^3*Y[4]+0.2608567970e88*Y[1]^3*Y[3]+0.4392523714e87*Y[1]^2*Y[4]-0.1028952924e88*Y[1]^2*Y[3]-0.3568612384e86*Y[1]*Y[4]+0.8359508990e86*Y[1]*Y[3]+0.7681457109e98*Y[1]^2-0.2208199759e98*Y[1]+0.1521111400e97); 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] ))  ] ); _y0 := Array(0..5, {(1) = 1385.89, (2) = .447352635989885, (3) = .446364534701244, (4) = -7270919.82399678, (5) = -11972925.8539294}); _vmap := array( 1 .. 5, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5)  ] ); _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); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `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 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 _dat[17] <> _dtbl[1][17] then _dtbl[1][17] := _dat[17]; _dtbl[1][10] := _dat[10] end if; 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 ?dsolve,maxfun 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 ?dsolve,maxfun 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]; if type(_EnvDSNumericSaveDigits, 'posint') then _dat[4][26] := _EnvDSNumericSaveDigits else _dat[4][26] := Digits end if; _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(1..6, {(1) = 18446744074383183206, (2) = 18446744074383183382, (3) = 18446744074383183558, (4) = 18446744074383183734, (5) = 18446744074383175766, (6) = 18446744074383175942}), (3) = [x, Jir(x), L(x), sh(x), sv(x), u(x)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(x, ["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, '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, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(x, 'string')); if type(_res, 'list') then return _res[6] else return NULL end if elif member(x, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(x, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[6], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] 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), 'string') = rhs(x); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 6, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 6, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[6] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[6], 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), 'string') = rhs(x)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(x) else _ndsol := 1; _ndsol := `tools/gensym`("u(x)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][6])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(x)))) end if end if; try _res := _solnproc(_xout); _res[6] catch: error  end try end proc

(1)

# x to [0..Hs-Hvp]
unassign(sv,sh,L,Jir,u):
sys_ode:=
diff(sv(x),x)=rho0*g/L(x),
diff(sh(x),x)=Fhv1*diff(L(x),x)/L(x)+Fhv2*diff(Jir(x),x),
Fvv1*diff(L(x),x)+Fvv2*L(x)*diff(Jir(x),x)=rho0*g,
diff(Jir(x),x)/Jir(x)=-Gv1*diff(L(x),x)/L(x)-Gv2*diff(Jir(x),x),
diff(u(x),x)=-Mp*g/(Fvv1+Fvv2*L(x)*diff(Jir(x),x)/diff(L(x),x)):
dvars:=indets({sys_ode},specfunc(anything,diff)):
SYS:=solve({sys_ode},dvars):
ics:=sv(Hs-Hvp)=svvp,sh(Hs-Hvp)=shvp,L(Hs-Hvp)=Lvp,Jir(Hs-Hvp)=Jirvp,u(Hs-Hvp)=uh-ue-up-uvp:
sol:=dsolve(SYS union {ics},numeric,output=listprocedure):
sv4,sh4,L4,Jir4,u4:=op(subs(sol,[sv(x),sh(x),L(x),Jir(x),u(x)])):
phi4:=x->1-(1-phi0)/Jir4(x):
pc4:=x->pc0*(ln(phi4(x))/ln(phi0))^mp:
pv4:=x->pv0*(ln(phi4(x))/ln(phi0))^mvp:
rho4:=x->rho0/L4(x):

unassign('x','t'):
Xp:=Hs-Hp:
Xvp:=Hs-Hvp:

phit1:=(x,t)->1-(1-phi0)/Jirt1(x,t):
pvt1:=(x,t)->pv0*(ln(phit1(x,t))/ln(phi0))^mvp:
fvpt1:=(x,t)->A*sht1(x,t)+B*svt1(x,t)-pvt1(x,t):

Kt1:=(x,t)->4*ks*mus*(1-phit1(x,t))/(3*ks*phit1(x,t)+4*mus):
Kbt1:=(x,t)->-(1/3)*(3*ks+4*mus)/(Jirt1(x,t)*(3*ks+4*mus)-3*ks*(1-phi0)):
mut1:=(x,t)->mus*(1-phit1(x,t))*(9*ks+8*mus)/(ks*(9+6*phit1(x,t))+mus*(8+12*phit1(x,t))):
mubt1:=(x,t)->(-5/3)*(3*ks+4*mus)/(3*ks*(5*Jirt1(x,t)-2*(1-phi0))+4*mus*(5*Jirt1(x,t)-3*(1-phi0))):

Fhet1:=(x,t)->Kt1(x,t)-2/3*mut1(x,t):
Fvet1:=(x,t)->Kt1(x,t)+4/3*mut1(x,t):

Fht1:=(x,t)->((svt1(x,t)+2*sht1(x,t))*Kbt1(x,t)-(svt1(x,t)-sht1(x,t))*mubt1(x,t)):
Fvt1:=(x,t)->((svt1(x,t)+2*sht1(x,t))*Kbt1(x,t)+2*(svt1(x,t)-sht1(x,t))*mubt1(x,t)):

pde_sys_t1:={diff(Jirt1(x,t),[t])/Jirt1(x,t)=-fvpt1(x,t)/eta,
diff(svt1(x,t),[t])=0,
diff(svt1(x,t),[x])=rho0*g/Lt1(x,t),
diff(sht1(x,t),[t])=Fhet1(x,t)*diff(Lt1(x,t),[t])/Lt1(x,t)-(Kt1(x,t)-sqrt(3)/3*mut1(x,t)*a)*diff(Jirt1(x,t),[t])/Jirt1(x,t)+Fht1(x,t)*diff(Lt1(x,t),[t])}:

ics_t1:={Lt1(x,Ts)=L3(x),Lt1(Xp,t)=Lp,Jirt1(x,Ts)=Jir3(x),Jirt1(Xp,t)=Jirp,sht1(x,Ts)=sh3(x),sht1(Xp,t)=shp,svt1(x,Ts)=sv3(x),svt1(Xp,t)=svp}:

#
# Check OP's code
#
  pds_t1:=pdsolve(pde_sys_t1,ics_t1,numeric,time=t,range=Xvp..Xp,output=listprocedure);

Error, (in pdsolve/numeric/par_hyp) Incorrect number of boundary conditions, expected 1, got 4

 

##############################################
#                                            #
#     Diagnostic process                     #
#                                            #
##############################################
#
# Eyeball how many derivatives of
# what kind exist in the PDE system
#
  indets(pde_sys_t1, specfunc(diff));

{diff(Jirt1(x, t), t), diff(Lt1(x, t), t), diff(sht1(x, t), t), diff(svt1(x, t), t), diff(svt1(x, t), x)}

(2)

#
# Output from the above command indicates that
# the system needs *exactly* FIVE BCs/ICs.
#
# How many BCS/ICS is OP providing
#
  numelems(ics_t1);

8

(3)

#
# Need five BCs/ICs, and OP is providing eight.
# So this isn't going to work. Might be able
# to select five appropriate conditions from the
# OP's eight???
#
# The following will select the correct number of
# of BCs/ICs of the correct type. From the output
# of the indets() command above, the PDE system
# needs the following conditions
#
#  1. Jirt1(x,t): IC (ie fixed t)
#  2. Lt1(x,t):   IC (ie fixed t)
#  3. sht1(x,t):  IC (ie fixed t)
#  4. svt1(x,t):  IC (ie fixed t)
#  5. svt1(x,t):  BC (ie fixed x)
#
  myIcs:=[ ics_t1[2], ics_t1[4], ics_t1[6], ics_t1[7], ics_t1[8]];

[Jirt1(x, 1892160000000000) = Jir3(x), Lt1(x, 1892160000000000) = L3(x), sht1(x, 1892160000000000) = sh3(x), svt1(1385.89, t) = -11972925.8539294481000000000000, svt1(x, 1892160000000000) = sv3(x)]

(4)

#
# Try for a solution with this reduced set of ICs/BCs
#
  pds_t1:=pdsolve(pde_sys_t1,myIcs,numeric,time=t,range=Xvp..Xp,output=listprocedure);

Error, (in pdsolve/numeric/match_PDEs_BCs) cannot handle systems with multiple PDE describing the time dependence of the same dependent variable, or having no time dependence

 

#
# Never seen that error message before! - now what's wrong?
# Examine the PDEs individually, for anything "anomalous".
#
# The third entry in the PDE system is interesting
#
   pde_sys_t1[3];

diff(svt1(x, t), t) = 0

(5)

#
# If the derivative of svt1(x,t) with respect to 't'
# is zero, then svt1(x,t) DOES NOT DEPEND on 't', which
# can be illustrated by looking at the solution for
# this equation on its own - which shows that it must be
# a function only of 'x'
#
  pdsolve( pde_sys_t1[3]);

svt1(x, t) = _F1(x)

(6)

#
# One could(?) delete this PDE from the system, and maybe
# substitute svt1(x) for svt1(x,t) in the remaining equations,
# as well as removing the associated initial condition.
#
# But check out the fourth entry in the PDE system
#
   pde_sys_t1[4];

diff(svt1(x, t), x) = 6342.941220/Lt1(x, t)

(7)

#
# Since svt1(x,t) is a function ONLY of 'x', the left-hand-side
# of the above PDE is a function ONLY of 'x', and hence the
# right-hand-side of this PDE is also a function ONLY of 'x',
# and therefore Lt1(x,t) is a function ONLY of 'x'.
#
# This can be illustrated by producing general solutions for
# the pair of equations formed by entries 3 and 4 in the PDE
# system
#
# As I thought, both Lt1(x,t) and svt1(x, t) are functions
# only of 'x'
#
  pdsolve( pde_sys_t1[3..4]);

{Lt1(x, t) = 6342.941220/(diff(_F1(x), x)), svt1(x, t) = _F1(x)}

(8)

#
# Again one ?could? substitute Lt1(x) for Lt1(x,t) everywhere
# in the PDE system, but at least one of the remaining PDEs
# depends on the derivative of Lt1() with respect to 't', so
# quite a few terms in the remaining PDE system are now going
# to be identically zero
#
# Probably not worth it - more likely that OP has some logical/
# conceptual problem with this PDE system

 

NULL


 

Download pdeProb.mw

 

you are interested in "playing" with random number generators, it is relatively easy to write your own package which will replicate the bahaviour of the in-built generators, at least for simple cases. In the attached I have provided a very simple package for dice-rolling (ie producing the numbers 1..6) which uses the same algorithm as the RandomTools[LinearCongruence] sub-package.

The worksheet shows that this simple package replicates the behaviour of the RandomTools[LinearCongruence] for the dice-rolling problem

NB Although it "works" - it is pretty basic, but it is only about 15 lines long! You could add *lots* of "bells and whistles" if you want

  restart;
  with(RandomTools[LinearCongruence]):
  M1:=NewGenerator(range=1..6):
#
# Produce 100 numbers from this generator
#
  randInt1:=[seq( M1(), j=1..100)];
#
# Get the state of the generator after the
# above numbers have been produced
#
  GetState();

[4, 3, 4, 6, 5, 3, 6, 3, 2, 2, 2, 4, 4, 3, 3, 2, 1, 4, 4, 6, 1, 1, 1, 2, 4, 2, 1, 3, 6, 3, 6, 4, 3, 6, 1, 6, 3, 1, 4, 6, 4, 3, 2, 5, 1, 5, 4, 4, 2, 6, 6, 1, 2, 2, 4, 2, 4, 4, 2, 6, 1, 1, 4, 4, 2, 4, 1, 4, 5, 3, 4, 3, 4, 4, 3, 6, 6, 5, 6, 1, 3, 2, 2, 5, 1, 5, 2, 5, 6, 5, 4, 4, 6, 4, 6, 2, 3, 2, 1, 2]

 

140810856859

(1)

#
# Re-initialise the above random number generator
#
  SetState(state=1):
#
# Define another generator
#
  N1:=NewGenerator(range=1..6):
#
# Produce 100 numbers by alternating between the
# two generators - just to see how "independent"
# they actually are
#
  randInt2:=[seq( [M1(),N1()][], j=1..50)];
#
# Verify that producing 100 numbers from a single
# generator will give the same sequence as
# alternating between two generators. Check the
# state after the numbers have been produced: thi
# should also be the same as before
#
  evalb(randInt1=randInt2);
  GetState();

[4, 3, 4, 6, 5, 3, 6, 3, 2, 2, 2, 4, 4, 3, 3, 2, 1, 4, 4, 6, 1, 1, 1, 2, 4, 2, 1, 3, 6, 3, 6, 4, 3, 6, 1, 6, 3, 1, 4, 6, 4, 3, 2, 5, 1, 5, 4, 4, 2, 6, 6, 1, 2, 2, 4, 2, 4, 4, 2, 6, 1, 1, 4, 4, 2, 4, 1, 4, 5, 3, 4, 3, 4, 4, 3, 6, 6, 5, 6, 1, 3, 2, 2, 5, 1, 5, 2, 5, 6, 5, 4, 4, 6, 4, 6, 2, 3, 2, 1, 2]

 

true

 

140810856859

(2)

#
# Unload the above in-built PRNG
#
  unwith(RandomTools[LinearCongruence]):

#
# Write code for a really simple package which replicates
# the behaviour of the above "simple-case" PRNG
#
  myRand:= module()
                 local mySeed, myGen:
                 export NewGen, getSeed, setSeed:
                 option package:
                 mySeed:=1:
                 NewGen:= proc()
                               return(myGen):
                          end proc:
                 myGen:=proc()
                             mySeed:=irem(427419669081*mySeed, 999999999989);
                             return irem(mySeed, 6) + 1;
                       end proc;
                 getSeed:=proc()
                               return mySeed;
                          end proc;
                 setSeed:=proc(n)
                              mySeed:=n:
                          end proc;
           end module:
  with(myRand):

  

#
# Produce the first 100 numbers from this
# "homebrew" PRNG
#
  M2:=NewGen():
  randInt3:=[seq( M2(), j=1..100)];
#
# Check that this sequences of random numbers is
# exactly the same as that produced by the
# "internal" generator above. Check the state
# of the "homebrew" generator - should be the same
# as that above
#
   evalb(randInt3=randInt1);
   getSeed();

[4, 3, 4, 6, 5, 3, 6, 3, 2, 2, 2, 4, 4, 3, 3, 2, 1, 4, 4, 6, 1, 1, 1, 2, 4, 2, 1, 3, 6, 3, 6, 4, 3, 6, 1, 6, 3, 1, 4, 6, 4, 3, 2, 5, 1, 5, 4, 4, 2, 6, 6, 1, 2, 2, 4, 2, 4, 4, 2, 6, 1, 1, 4, 4, 2, 4, 1, 4, 5, 3, 4, 3, 4, 4, 3, 6, 6, 5, 6, 1, 3, 2, 2, 5, 1, 5, 2, 5, 6, 5, 4, 4, 6, 4, 6, 2, 3, 2, 1, 2]

 

true

 

140810856859

(3)

#
# Re-initialise the homebrew random number generator
#
  setSeed(1):
#
# Define another generator
#
  N2:=NewGen():
#
# Produce 100 numbers by alternating between the
# two generators - just to see how "independent"
# they actually are
#
  randInt4:=[seq( [M2(),N2()][], j=1..50)];
#
# Verify that produing 100 numbers from a single
# generator will give the same sequence as
# alternating between two generators. Check the
# state after the numbers have been produced
#
  evalb(randInt3=randInt4);
  getSeed();

[4, 3, 4, 6, 5, 3, 6, 3, 2, 2, 2, 4, 4, 3, 3, 2, 1, 4, 4, 6, 1, 1, 1, 2, 4, 2, 1, 3, 6, 3, 6, 4, 3, 6, 1, 6, 3, 1, 4, 6, 4, 3, 2, 5, 1, 5, 4, 4, 2, 6, 6, 1, 2, 2, 4, 2, 4, 4, 2, 6, 1, 1, 4, 4, 2, 4, 1, 4, 5, 3, 4, 3, 4, 4, 3, 6, 6, 5, 6, 1, 3, 2, 2, 5, 1, 5, 2, 5, 6, 5, 4, 4, 6, 4, 6, 2, 3, 2, 1, 2]

 

true

 

140810856859

(4)

 


 

Download myrand.mw

 

would't it be easier to use the geometry pacjkage for this?

As in the attached

with(geometry):
point(A, [-5, 6]):
point(B, [7, -3]):
MakeSquare(sqr, [A, B, diagonal]):
draw(sqr, axes=none);

A

 

B

 

sqr

 

 

detail(sqr);;

GeometryDetail(["name of the object", sqr], ["form of the object", square2d], ["the four vertices of the square", [[-5, 6], [-7/2, -9/2], [7, -3], [11/2, 15/2]]], ["the length of the diagonal", sqrt(225)])

(1)

 


 

Download bsquare.mw

 

because the following works.


 

restart;
interface(version);
car_2som_opp := proc (U::list, V::list)  #construction d'un carré connaissant 2 sommets opposés
                     local dist, eqCerU, eqCerV, r, sol, X, Y;
                     dist := proc (M, N)
                                  sqrt(add((M[i]-N[i])^2, i = 1 .. 2))
                             end proc;
                     r := dist(U, V)/sqrt(2);
                     eqCerU := (x-U[1])^2+(y-U[2])^2 = r^2;
                     eqCerV := (x-V[1])^2+(y-V[2])^2 = r^2;
                     sol := solve([eqCerU, eqCerV], [x, y],allsolutions,explicit);  
                     map(allvalues,sol):
                     X := [subs(op(sol[1]), x), subs(op(sol[1]), y)];
                     Y := [subs(op(sol[2]), x), subs(op(sol[2]), y)];
                     plots:-display(plot([U, X, V, Y, U],scaling = constrained, axes = none))
                 end proc:

car_2som_opp([-5,6],[7,-3]);

`Standard Worksheet Interface, Maple 2018.2, Windows 7, November 16 2018 Build ID 1362973`

 

 

 


 

Download asquare.mw

and you will need at keast one boundary condition (which I have "guessed"), but maybe something in the attached will cover your requirement


 

  restart;
#
# Define ODE using piecewise()
#
  ode:= diff(B[1](t),t)= piecewise
                         ( t<=1000,
                           kaC*(R-B[1](t))-kd1*B[1](t),
                           -kd1*B[1](t)
                         );
#
# Add a "guesswork" boundary condition and
# solve the ODE
#
  sol:=dsolve([ode, B[1](0)=1]);
#
# Plot the ODE solutions for values of
# kd1 fromm 7e-03 to 7e-02
#
  plot( [ seq
          ( eval
            ( rhs(sol),
              [kaC=6e-02, kd1=j, R=1]
            ),
            j=7e-03..7e-02, 1e-03
          )
        ],
        t=0..2000
      );
#
# Plot the ODE solutions for values of
# kaC from 6e-02 to 6e-01
#
  plot( [ seq
          ( eval
            ( rhs(sol),
              [kaC=j, kd1=7e-03, R=1]
            ),
            j=6e-02..6e-01, 1e-02
          )
        ],
        t=0..2000
      );
#
# Plot B[1](t) versus t and kd1, with kaC
# as a parameter (produces mulitple surfaces)
#
  colors:=[red, green, blue, brown, black, yellow]:
  plots:-display
         ( [ seq
             ( plot3d
               ( eval
                 ( rhs(sol),
                   [kaC=6e-02+(j-1)*2e-02, R=1]
                 ),
                 t=0..2000,
                 kd1=7e-03..7e-02,
                 color=colors[j]
               ),
               j=1..6
             )
           ]
         );

ode := diff(B[1](t), t) = piecewise(t <= 1000, kaC*(R-B[1](t))-kd1*B[1](t), -kd1*B[1](t))

 

B[1](t) = piecewise(t < 1000, exp(-kaC*t-kd1*t)*(1-kaC*R/(kaC+kd1))+kaC*R*exp((kaC+kd1)*t)*exp(-kaC*t-kd1*t)/(kaC+kd1), 1000 <= t, kaC*R*exp(1000*kaC+1000*kd1)*exp(-kd1*t-1000*kaC)/(kaC+kd1)+exp(-kd1*t-1000*kaC)*(1-kaC*R/(kaC+kd1)))

 

 

 

 

 


 

Download plotODE.mw

numbers := [random[empirical[0.5, 0.5]](N)]

uses the 'stats' package, which has been 'deprecated' since Maple version 9.5 in 2004. You cannot access these commands using 'with(Statistics)'. You have to use 'with(stats)' , as shown in the attached - which actually "works".

Note that you really shouldn't be using such deprecated packages without a very very good reason. Since all this command actually does is produce a list containing the integers 1,2 at random - there really doesn't seem to be any sensible reason for continuing to use it!

Also

  1. in the final for loop: when you are just adding a finite list of "known" numbers, it is much more efficient to use add() rather than sum()
  2. the procedure Wpath() is defined but never used - deliberate?


 

restart

with(stats)

Wpath := proc (steps, t) local walk, i, N, ww; N := nops(steps); walk[0] := 0; for i from 0 to N-1 do walk[i+1] := walk[i]+steps[i+1]*sqrt(t/N) end do; ww := seq(plot(walk[i], t*i/N .. t*(i+1)/N), i = 0 .. N-1); plots[display]([ww]) end proc

N := 400

numbers := [random[empirical[.5, .5]](N)]

st1 := map(proc (x) options operator, arrow; 2*x-3 end proc, numbers)

list_of_k := [40, 20, 10, 5, 2, 1]

for j to nops(list_of_k) do k := list_of_k[j]; st[k] := [seq((sum(st1[p], p = i*k-k+1 .. i*k))/sqrt(k), i = 1 .. N/k)] end do

40

 

[(1/10)*10^(1/2), -(1/5)*10^(1/2), (2/5)*10^(1/2), -(1/10)*10^(1/2), (2/5)*10^(1/2), -(2/5)*10^(1/2), -(3/10)*10^(1/2), 0, 0, (1/5)*10^(1/2)]

 

20

 

[-(1/5)*5^(1/2), (2/5)*5^(1/2), 0, -(2/5)*5^(1/2), (1/5)*5^(1/2), (3/5)*5^(1/2), -(3/5)*5^(1/2), (2/5)*5^(1/2), -(1/5)*5^(1/2), 5^(1/2), -(4/5)*5^(1/2), 0, 0, -(3/5)*5^(1/2), -(1/5)*5^(1/2), (1/5)*5^(1/2), (2/5)*5^(1/2), -(2/5)*5^(1/2), (2/5)*5^(1/2), 0]

 

10

 

[-(1/5)*10^(1/2), 0, 0, (2/5)*10^(1/2), 0, 0, -(1/5)*10^(1/2), -(1/5)*10^(1/2), (1/5)*10^(1/2), 0, 0, (3/5)*10^(1/2), -(2/5)*10^(1/2), -(1/5)*10^(1/2), 0, (2/5)*10^(1/2), -(1/5)*10^(1/2), 0, (2/5)*10^(1/2), (3/5)*10^(1/2), -(3/5)*10^(1/2), -(1/5)*10^(1/2), (2/5)*10^(1/2), -(2/5)*10^(1/2), (1/5)*10^(1/2), -(1/5)*10^(1/2), -(3/5)*10^(1/2), 0, -(2/5)*10^(1/2), (1/5)*10^(1/2), (2/5)*10^(1/2), -(1/5)*10^(1/2), 0, (2/5)*10^(1/2), -(2/5)*10^(1/2), 0, (2/5)*10^(1/2), 0, (1/5)*10^(1/2), -(1/5)*10^(1/2)]

 

5

 

[-(3/5)*5^(1/2), (1/5)*5^(1/2), (1/5)*5^(1/2), -(1/5)*5^(1/2), (1/5)*5^(1/2), -(1/5)*5^(1/2), (3/5)*5^(1/2), (1/5)*5^(1/2), -(1/5)*5^(1/2), (1/5)*5^(1/2), -(1/5)*5^(1/2), (1/5)*5^(1/2), -(1/5)*5^(1/2), -(1/5)*5^(1/2), -(1/5)*5^(1/2), -(1/5)*5^(1/2), (1/5)*5^(1/2), (1/5)*5^(1/2), (1/5)*5^(1/2), -(1/5)*5^(1/2), (1/5)*5^(1/2), -(1/5)*5^(1/2), (1/5)*5^(1/2), 5^(1/2), (1/5)*5^(1/2), -5^(1/2), -(1/5)*5^(1/2), -(1/5)*5^(1/2), -(1/5)*5^(1/2), (1/5)*5^(1/2), (1/5)*5^(1/2), (3/5)*5^(1/2), (1/5)*5^(1/2), -(3/5)*5^(1/2), (1/5)*5^(1/2), -(1/5)*5^(1/2), (3/5)*5^(1/2), (1/5)*5^(1/2), (3/5)*5^(1/2), (3/5)*5^(1/2), -(1/5)*5^(1/2), -5^(1/2), (1/5)*5^(1/2), -(3/5)*5^(1/2), -(1/5)*5^(1/2), 5^(1/2), -(1/5)*5^(1/2), -(3/5)*5^(1/2), (1/5)*5^(1/2), (1/5)*5^(1/2), -(1/5)*5^(1/2), -(1/5)*5^(1/2), -5^(1/2), -(1/5)*5^(1/2), -(1/5)*5^(1/2), (1/5)*5^(1/2), -(1/5)*5^(1/2), -(3/5)*5^(1/2), (1/5)*5^(1/2), (1/5)*5^(1/2), 5^(1/2), -(1/5)*5^(1/2), (1/5)*5^(1/2), -(3/5)*5^(1/2), -(1/5)*5^(1/2), (1/5)*5^(1/2), -(1/5)*5^(1/2), 5^(1/2), -5^(1/2), (1/5)*5^(1/2), -(1/5)*5^(1/2), (1/5)*5^(1/2), (1/5)*5^(1/2), (3/5)*5^(1/2), (3/5)*5^(1/2), -(3/5)*5^(1/2), -(3/5)*5^(1/2), 5^(1/2), -(3/5)*5^(1/2), (1/5)*5^(1/2)]

 

2

 

[-2^(1/2), 0, 0, 0, 0, 2^(1/2), -2^(1/2), 0, 0, 0, 2^(1/2), -2^(1/2), 0, -2^(1/2), 2^(1/2), 0, 2^(1/2), 0, 0, 2^(1/2), 2^(1/2), -2^(1/2), -2^(1/2), 2^(1/2), 0, 0, 0, 0, 2^(1/2), -2^(1/2), -2^(1/2), 0, 2^(1/2), -2^(1/2), 0, 0, 0, 0, -2^(1/2), 0, 2^(1/2), -2^(1/2), 2^(1/2), 0, 0, 0, 2^(1/2), 0, 0, -2^(1/2), 2^(1/2), 0, -2^(1/2), 2^(1/2), -2^(1/2), 2^(1/2), 0, 0, 2^(1/2), 2^(1/2), 0, 2^(1/2), -2^(1/2), -2^(1/2), -2^(1/2), 0, -2^(1/2), 0, 0, 0, -2^(1/2), 0, 0, 2^(1/2), 0, 0, 2^(1/2), -2^(1/2), 2^(1/2), 2^(1/2), 0, 2^(1/2), -2^(1/2), -2^(1/2), 0, 2^(1/2), 0, -2^(1/2), 0, 0, 2^(1/2), 0, 2^(1/2), 0, 0, 2^(1/2), 0, 2^(1/2), 2^(1/2), 0, 0, -2^(1/2), 0, -2^(1/2), -2^(1/2), 0, 2^(1/2), -2^(1/2), -2^(1/2), 0, -2^(1/2), 2^(1/2), 0, 2^(1/2), 2^(1/2), -2^(1/2), 2^(1/2), -2^(1/2), -2^(1/2), 0, 0, 0, 0, 2^(1/2), 0, 0, -2^(1/2), 2^(1/2), -2^(1/2), 0, -2^(1/2), -2^(1/2), -2^(1/2), 2^(1/2), -2^(1/2), -2^(1/2), 0, 2^(1/2), 2^(1/2), -2^(1/2), 0, -2^(1/2), 0, -2^(1/2), 0, 0, 0, 0, 2^(1/2), 0, 2^(1/2), 2^(1/2), 2^(1/2), 0, -2^(1/2), 0, 0, 0, -2^(1/2), 0, 0, 0, 0, 0, 0, -2^(1/2), 2^(1/2), 0, 2^(1/2), 2^(1/2), -2^(1/2), -2^(1/2), 0, -2^(1/2), 2^(1/2), -2^(1/2), 0, 2^(1/2), -2^(1/2), 2^(1/2), 0, 2^(1/2), -2^(1/2), 2^(1/2), 2^(1/2), 0, 2^(1/2), 0, -2^(1/2), 0, -2^(1/2), -2^(1/2), 2^(1/2), 2^(1/2), 2^(1/2), -2^(1/2), 0, -2^(1/2), 2^(1/2), 0]

 

1

 

[-1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1]

(1)

``


 

Download walk.mw

 

 

Somehow, the "code" in your file Matrix.mw appears to be "Maple Output" which is odd

If I convert everything to 1-D Maple Input, then everything seems to execute correctly - see the attached

  restart;
  interface(rtablesize = 10);

  with(LinearAlgebra);

  A := 8:
  B := 5:
  q := 0.4:
  p := 0.2:
  r := 1 - p - q:
  dimP := A + B + 1:

  P := Matrix(dimP, dimP, [0 $ dimP*dimP]):
  P[1, 1] := 1:
  P[1, 2] := 0:
  P[dimP, dimP] := 1:
  P[dimP, dimP - 1] := 0:
  for i from 2 to dimP - 1 do
      P[i, i - 1] := q;
      P[i, i] := r;
      P[i, i + 1] := p;
  end do:

  p0 := Matrix(dimP, 1, [0 $ dimP]):
  p0[A + 1, 1] := 1:
  pV[0] := p0:
  PT := Transpose(P):

  for n to 200 do
      pV[n] := PT . (pV[n - 1]):
  end do:

  map(x -> evalf(x, 3), Transpose(pV[5]));

_rtable[18446744074332538990]

(1)

 

NULL

Download mat2.mw

what you are getting wrong unless you upload the relevant worksheet using the big green up-arrow in the toolbar.

The attached will produce the plot you want

plot(x^2-9, x=-10..10);

 

 

Download simplePlot.mw

is to get rid of the integral term, by differentiating the pde with respect to 't'.

The drawback with this approach is hte at it increases the degree of the PDE (with respect to 't') so an additional initial condition is needed. I tried a few possibilities for D[2](u)(x,0). These didn't make a huge difference to the overall "form" of the solution, whihc always gets *seriously* huge for t>~1.
You might want to experiment with the following, and in particular with the "extra" initial condition D[2](u)(x,0=1, which I inserted. (Changing the rhs of this initial condition doesn't make a huge difference to the overall form!)

interface(rtablesize=10):
f:=(x^3+t^2*x^2-t^2*x+4*t*x-2*t+1)*exp(x*t)-x+1;
pde:=diff(u(x,t),t)+diff(u(x,t),x,x)+u(x,t)+int(u(x,tau),tau=0..t)=f;
pde:=diff(pde,t);
bounds:= u(0,t)=0, u(1,t)=0, u(x,0)=x*(x-1), D[2](u)(x,0)=1;
psol:=pdsolve(pde, [bounds], numeric);
psol:-plot3d( u(x,t), x=0..1, t=0..0.1);

(t^2*x^2-t^2*x+x^3+4*t*x-2*t+1)*exp(t*x)-x+1

 

diff(u(x, t), t)+diff(diff(u(x, t), x), x)+u(x, t)+int(u(x, tau), tau = 0 .. t) = (t^2*x^2-t^2*x+x^3+4*t*x-2*t+1)*exp(t*x)-x+1

 

diff(diff(u(x, t), t), t)+diff(diff(diff(u(x, t), t), x), x)+diff(u(x, t), t)+u(x, t) = (2*t*x^2-2*t*x+4*x-2)*exp(t*x)+(t^2*x^2-t^2*x+x^3+4*t*x-2*t+1)*x*exp(t*x)

 

u(0, t) = 0, u(1, t) = 0, u(x, 0) = x*(x-1), (D[2](u))(x, 0) = 1

 

_m906819456

 

 

 

Download pdeSol2.mw

the attached -maybe?

  restart;
  interface(rtablesize=12);
  M2:=Matrix(2, 12, (i,j)->`if`( i=1,
                                 `if`(type(j, odd), U[(j+1)/2],0),
                                 `if`(type(j, even), U[j/2], 0)
                               )
            );
  Matrix( [ [seq( D[1](M2[1,j])(x,y) + 0*M2[2,j],          j =1..12)],
            [seq( 0*(M2[1,j])(x,y)   + D[2](M2[2,j])(x,y), j =1..12)],
            [seq( D[2](M2[1,j])(x,y) + D[1](M2[2,j])(x,y), j =1..12)]
          ]
        ):
  convert~([%], diff);

[10, 10]

 

Matrix(2, 12, {(1, 1) = U[1], (1, 2) = 0, (1, 3) = U[2], (1, 4) = 0, (1, 5) = U[3], (1, 6) = 0, (1, 7) = U[4], (1, 8) = 0, (1, 9) = U[5], (1, 10) = 0, (1, 11) = U[6], (1, 12) = 0, (2, 1) = 0, (2, 2) = U[1], (2, 3) = 0, (2, 4) = U[2], (2, 5) = 0, (2, 6) = U[3], (2, 7) = 0, (2, 8) = U[4], (2, 9) = 0, (2, 10) = U[5], (2, 11) = 0, (2, 12) = U[6]})

 

[Matrix(%id = 18446744074423018070)]

(1)

 


 

Download doDiffs.mw

2 3 4 5 6 7 8 Last Page 4 of 110