Rouben Rostamian

MaplePrimes Activity


These are answers submitted by Rouben Rostamian

The hill is "y=f(x).  "We assume that the conditions are such that

the particle continues pressing against the hill with a positive force

during the motion, that is, it does not jump away or separate

from the surface.

 

Here is the particle's position vector:

r := <x(t),f(x(t))>;

Vector(2, {(1) = x(t), (2) = f(x(t))})

and the velocity vector:

v := diff(r,t);

Vector(2, {(1) = diff(x(t), t), (2) = (D(f))(x(t))*(diff(x(t), t))})

The unit tangent vector to the path:

v / sqrt(v^+ . v):
T := simplify(%) assuming D(x)(t)>0;

Vector(2, {(1) = 1/sqrt(1+(D(f))(x(t))^2), (2) = (D(f))(x(t))/sqrt(1+(D(f))(x(t))^2)})

The upward unit normal vector to the path:

N := < -T[2], T[1] >;

Vector(2, {(1) = -(D(f))(x(t))/sqrt(1+(D(f))(x(t))^2), (2) = 1/sqrt(1+(D(f))(x(t))^2)})

Forces acting on the particle are:
1. The force of gravity (that is, its weight) `<,>`(0, -mg)
2. The reaction force of the surface in the normal direction, of (yet unknown) magnitude n 
3. The friction force exerted by the surface in the tangential direction, of magnitude mu*n

F := <0,-m*g> + n*N - mu*n*T;

Vector(2, {(1) = -n*(D(f))(x(t))/sqrt(1+(D(f))(x(t))^2)-mu*n/sqrt(1+(D(f))(x(t))^2), (2) = -m*g+n/sqrt(1+(D(f))(x(t))^2)-mu*n*(D(f))(x(t))/sqrt(1+(D(f))(x(t))^2)})

Newton's law of motion:

m*diff(v,t) =~ F:
DE := convert(%, list);

[m*(diff(diff(x(t), t), t)) = -n*(D(f))(x(t))/(1+(D(f))(x(t))^2)^(1/2)-mu*n/(1+(D(f))(x(t))^2)^(1/2), m*(((D@@2)(f))(x(t))*(diff(x(t), t))^2+(D(f))(x(t))*(diff(diff(x(t), t), t))) = -m*g+n/(1+(D(f))(x(t))^2)^(1/2)-mu*n*(D(f))(x(t))/(1+(D(f))(x(t))^2)^(1/2)]

Eliminate the unknown n between the equations:

solve(DE, {diff(x(t),t,t), n}):
select(has, %, diff(x(t),t,t)):
de := %[];

diff(diff(x(t), t), t) = -((D(f))(x(t))+mu)*(((D@@2)(f))(x(t))*(diff(x(t), t))^2+g)/(1+(D(f))(x(t))^2)

Here I am taking the hill to be a parabola for the sake of illustration.  Change as needed.

myde := eval(de, {f = (x -> x^2), m=1, g=1, mu=1/10});

diff(diff(x(t), t), t) = -(2*x(t)+1/10)*(2*(diff(x(t), t))^2+1)/(1+4*x(t)^2)

ic := x(0)=0, D(x)(0)=1;

x(0) = 0, (D(x))(0) = 1

tmax := 2;

2

dsol := dsolve({myde, ic}, numeric, output=listprocedure,
    events=[[diff(x(t),t), halt]], range=0..tmax);

Warning, cannot evaluate the solution further right of 1.3669169, event #1 triggered a halt

[t = proc (t) 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](t) else _xout := evalf(t) 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( [( "right" ) = 2., ( "complex" ) = false, ( "left" ) = 0. ] ) _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 ) = ([Array(1..2, 1..21, {(1, 1) = 1.0, (1, 2) = .0, (1, 3) = 1.0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (1, 7) = 1.0, (1, 8) = undefined, (1, 9) = 1.0, (1, 10) = 1.0, (1, 11) = undefined, (1, 12) = undefined, (1, 13) = undefined, (1, 14) = undefined, (1, 15) = undefined, (1, 16) = undefined, (1, 17) = undefined, (1, 18) = undefined, (1, 19) = undefined, (1, 20) = undefined, (1, 21) = undefined, (2, 1) = 1.0, (2, 2) = .0, (2, 3) = 100.0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (2, 7) = .0, (2, 8) = undefined, (2, 9) = undefined, (2, 10) = 0.10e-6, (2, 11) = undefined, (2, 12) = .0, (2, 13) = undefined, (2, 14) = .0, (2, 15) = .0, (2, 16) = undefined, (2, 17) = undefined, (2, 18) = undefined, (2, 19) = undefined, (2, 20) = undefined, (2, 21) = undefined}, datatype = float[8], order = C_order), proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, Array(1..1, 1..2, {(1, 1) = undefined, (1, 2) = undefined}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..63, {(1) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 1, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 1, (17) = 0, (18) = 1, (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) = 1.3669169355851036, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.5047658755841546e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .0, (2) = 1.0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147743234702063, (2) = 0.2991930934853681e-2}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0.8131516293641283e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = 0.8131516293641283e-18, (1, 2) = 0.621069386685652e-2, (1, 3) = 0.5061177989226274e-2, (1, 4) = 0.2074229473918686e-4, (1, 5) = -0.6867609773327892e-3, (1, 6) = 0.3911625181543737e-2, (2, 1) = -.5293211659792734, (2, 2) = -.5293695532186686, (2, 3) = -.5293540956591186, (2, 4) = -.5293211649406641, (2, 5) = -.5293217682677498, (2, 6) = -.529340836479271}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = -0.6746146851020917e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..2, {(1) = .0, (2) = 1.0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 1.0, (2) = -.30000000000000004}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = x(t), Y[2] = diff(x(t),t)]`; YP[2] := -(2*Y[1]+1/10)*(2*Y[2]^2+1)/(4*Y[1]^2+1); YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = x(t), Y[2] = diff(x(t),t)]`; YP[2] := -(2*Y[1]+1/10)*(2*Y[2]^2+1)/(4*Y[1]^2+1); YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] )), ( 3 ) = (array( 1 .. 26, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([Array(1..2, 1..21, {(1, 1) = 1.0, (1, 2) = .0, (1, 3) = 1.0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (1, 7) = 1.0, (1, 8) = 1.3669169355851036, (1, 9) = 0.8131516293641283e-18, (1, 10) = 1.0, (1, 11) = 0.6210793285754164e-2, (1, 12) = 1.0, (1, 13) = 0.3911583444438467e-2, (1, 14) = 1.0, (1, 15) = 0.16124740349516638e-2, (1, 16) = 1.0, (1, 17) = -0.6865939756831342e-3, (1, 18) = 1.0, (1, 19) = 0.8131516293641283e-18, (1, 20) = 1.0, (1, 21) = 1.3669169355851036, (2, 1) = 1.0, (2, 2) = .0, (2, 3) = 100.0, (2, 4) = 1.0, (2, 5) = .0, (2, 6) = .0, (2, 7) = .0, (2, 8) = 1.3669169355851036, (2, 9) = undefined, (2, 10) = 0.10e-6, (2, 11) = undefined, (2, 12) = 1.0, (2, 13) = undefined, (2, 14) = .0, (2, 15) = .0, (2, 16) = undefined, (2, 17) = undefined, (2, 18) = undefined, (2, 19) = undefined, (2, 20) = undefined, (2, 21) = 1.3669169355851036}, datatype = float[8], order = C_order), proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, Array(1..1, 1..2, {(1, 1) = undefined, (1, 2) = undefined}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..63, {(1) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 101, (10) = 1, (11) = 73, (12) = 73, (13) = 0, (14) = 0, (15) = 0, (16) = 1, (17) = 1, (18) = 150, (19) = 30000, (20) = 1, (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) = 1, (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) = 1.3669169355851036, (2) = 0.10e-5, (3) = .13898945305267607, (4) = 0.500001e-14, (5) = .0, (6) = 0.5047658755841546e-2, (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) = 1.368214056799521, (20) = .13898945305267607, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .0, (2) = 1.0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147743234702063, (2) = 0.2991930934853681e-2}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0.8131516293641283e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = 0.8131516293641283e-18, (1, 2) = 0.621069386685652e-2, (1, 3) = 0.5061177989226274e-2, (1, 4) = 0.2074229473918686e-4, (1, 5) = -0.6867609773327892e-3, (1, 6) = 0.3911625181543737e-2, (2, 1) = -.5293211659792734, (2, 2) = -.5293695532186686, (2, 3) = -.5293540956591186, (2, 4) = -.5293211649406641, (2, 5) = -.5293217682677498, (2, 6) = -.529340836479271}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = -0.6746146851020917e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0.8131516293641283e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = 1.3669169355851036, (1, 2) = .6147827791621344, (2, 0) = .6147827791621344, (2, 1) = 0.8131516293641283e-18, (2, 2) = 1.3548595152722285, (3, 0) = 1.3548595152722285, (3, 1) = .6147443018057324, (3, 2) = 0.6382458243185191e-2, (4, 0) = 0.6382458243185191e-2, (4, 1) = 1.3588786553765202, (4, 2) = .6147656782714874, (5, 0) = .6147656782714874, (5, 1) = 0.4254894210261457e-2, (5, 2) = 1.362897795480812, (6, 0) = 1.362897795480812, (6, 1) = .6147785039629641, (6, 2) = 0.21274237207199744e-2}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = x(t), Y[2] = diff(x(t),t)]`; YP[2] := -(2*Y[1]+1/10)*(2*Y[2]^2+1)/(4*Y[1]^2+1); YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, 0, 0]), ( 13 ) = (), ( 12 ) = (Array(1..73, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = 1.0, (2, 2) = 0.12619146889603864e-2, (3, 0) = 0.12619146889603864e-2, (3, 1) = 0.12616738565258015e-2, (3, 2) = .999616747674144, (4, 0) = .999616747674144, (4, 1) = 0.2523829377920773e-2, (4, 2) = 0.25228581853900807e-2, (5, 0) = 0.25228581853900807e-2, (5, 1) = .9992241550571287, (5, 2) = 0.3785744066881159e-2, (6, 0) = 0.3785744066881159e-2, (6, 1) = 0.3783541215197853e-2, (6, 2) = .9988222460393802, (7, 0) = .9988222460393802, (7, 1) = 0.5047658755841546e-2, (7, 2) = 0.50437112049455295e-2, (8, 0) = 0.50437112049455295e-2, (8, 1) = .9984110452708771, (8, 2) = 0.18763802331930052e-1, (9, 0) = 0.18763802331930052e-1, (9, 1) = 0.18704577647715742e-1, (9, 2) = .9933495274250951, (10, 0) = .9933495274250951, (10, 1) = 0.3247994590801856e-1, (10, 2) = 0.322887163034234e-1, (11, 0) = 0.322887163034234e-1, (11, 1) = .9872324441502379, (11, 2) = 0.4619608948410706e-1, (12, 0) = 0.4619608948410706e-1, (12, 1) = 0.45781993330414834e-1, (12, 2) = .9801071832230382, (13, 0) = .9801071832230382, (13, 1) = 0.5991223306019557e-1, (13, 2) = 0.5917095413048571e-1, (14, 0) = 0.5917095413048571e-1, (14, 1) = .9720288765894416, (14, 2) = 0.7381107438037338e-1, (15, 0) = 0.7381107438037338e-1, (15, 1) = 0.7261884846451132e-1, (15, 2) = .9629343860138744, (16, 0) = .9629343860138744, (16, 1) = 0.8770991570055119e-1, (16, 2) = 0.8593438366127532e-1, (17, 0) = 0.8593438366127532e-1, (17, 1) = .9529955124167255, (17, 2) = .101608757020729, (18, 0) = .101608757020729, (18, 1) = 0.991063381801608e-1, (18, 2) = .942285847212391, (19, 0) = .942285847212391, (19, 1) = .11550759834090679, (19, 2) = .11212452357963143, (20, 0) = .11212452357963143, (20, 1) = .930880687771534, (20, 2) = .12911041713752863, (21, 0) = .12911041713752863, (21, 1) = .12470775841384893, (21, 2) = .9191183803284062, (22, 0) = .9191183803284062, (22, 1) = .14271323593415047, (22, 2) = .13712736702863793, (23, 0) = .13712736702863793, (23, 1) = .9068341213390221, (23, 2) = .1563160547307723, (24, 0) = .1563160547307723, (24, 1) = .14937671005622677, (24, 2) = .8940969700702323, (25, 0) = .8940969700702323, (25, 1) = .16991887352739418, (25, 2) = .16145008214608492, (26, 0) = .16145008214608492, (26, 1) = .8809731660006399, (26, 2) = .18481947726674444, (27, 0) = .18481947726674444, (27, 1) = .17446769615560365, (27, 2) = .8662282265594617, (28, 0) = .8662282265594617, (28, 1) = .1997200810060947, (28, 2) = .18726320795918514, (29, 0) = .18726320795918514, (29, 1) = .8511729487888557, (29, 2) = .21462068474544496, (30, 0) = .21462068474544496, (30, 1) = .19983250697428967, (30, 2) = .8358790958175935, (31, 0) = .8358790958175935, (31, 1) = .22952128848479522, (31, 2) = .2121725340853015, (32, 0) = .2121725340853015, (32, 1) = .820412013790285, (32, 2) = .24837218484015872, (33, 0) = .24837218484015872, (33, 1) = .22745233675019605, (33, 2) = .8006877235547174, (34, 0) = .8006877235547174, (34, 1) = .26722308119552224, (34, 2) = .24235946122442423, (35, 0) = .24235946122442423, (35, 1) = .780885071168912, (35, 2) = .2860739775508857, (36, 0) = .2860739775508857, (36, 1) = .2568932179397224, (36, 2) = .7610938541966088, (37, 0) = .7610938541966088, (37, 1) = .3049248739062492, (37, 2) = .27105455758176383, (38, 0) = .27105455758176383, (38, 1) = .741389576424313, (38, 2) = .32542910786936313, (39, 0) = .32542910786936313, (39, 1) = .2860378583922345, (39, 2) = .7201281678128157, (40, 0) = .7201281678128157, (40, 1) = .345933341832477, (40, 2) = .3005876063294246, (41, 0) = .3005876063294246, (41, 1) = .6991068667220606, (41, 2) = .3664375757955909, (42, 0) = .3664375757955909, (42, 1) = .3147091854767417, (42, 2) = .6783760072448012, (43, 0) = .6783760072448012, (43, 1) = .38694180975870474, (43, 2) = .3284089663526416, (44, 0) = .3284089663526416, (44, 1) = .6579739520810868, (44, 2) = .4065414225285592, (45, 0) = .4065414225285592, (45, 1) = .34111660423193696, (45, 2) = .638804735691326, (46, 0) = .638804735691326, (46, 1) = .4261410352984136, (46, 2) = .3534518749113766, (47, 0) = .3534518749113766, (47, 1) = .6199775559733585, (47, 2) = .44574064806826796, (48, 0) = .44574064806826796, (48, 1) = .36542156553547334, (48, 2) = .6015032198715705, (49, 0) = .6015032198715705, (49, 1) = .4653402608381224, (49, 2) = .37703265999788976, (50, 0) = .37703265999788976, (50, 1) = .5833877264659292, (50, 2) = .4861038471180183, (51, 0) = .4861038471180183, (51, 1) = .3889500280274702, (51, 2) = .5645896631901811, (52, 0) = .5645896631901811, (52, 1) = .5068674333979142, (52, 2) = .40048127245045556, (53, 0) = .40048127245045556, (53, 1) = .5461941135019355, (53, 2) = .5276310196778101, (54, 0) = .5276310196778101, (54, 1) = .41163468487144356, (54, 2) = .5281960056213145, (55, 0) = .5281960056213145, (55, 1) = .5483946059577061, (55, 2) = .4224184461269099, (56, 0) = .4224184461269099, (56, 1) = .510587852370767, (56, 2) = .5715560421860593, (57, 0) = .5715560421860593, (57, 1) = .4340212259474543, (57, 2) = .4913945640539472, (58, 0) = .4913945640539472, (58, 1) = .5947174784144125, (58, 2) = .44518479748080964, (59, 0) = .44518479748080964, (59, 1) = .4726591014184522, (59, 2) = .6178789146427658, (60, 0) = .6178789146427658, (60, 1) = .45591956238957404, (60, 2) = .45436467531410396, (61, 0) = .45436467531410396, (61, 1) = .641040350871119, (61, 2) = .4662355351497357, (62, 0) = .4662355351497357, (62, 1) = .43649357268675487, (62, 2) = .668014310470611, (63, 0) = .668014310470611, (63, 1) = .47773446062014113, (63, 2) = .4161898468531338, (64, 0) = .4161898468531338, (64, 1) = .694988270070103, (64, 2) = .4886927869713786, (65, 0) = .4886927869713786, (65, 1) = .3964057566008038, (65, 2) = .721962229669595, (66, 0) = .721962229669595, (66, 1) = .4991241330659119, (66, 2) = .37711193448594366, (67, 0) = .37711193448594366, (67, 1) = .748936189269087, (67, 2) = .509041336389085, (68, 0) = .509041336389085, (68, 1) = .3582794628036873, (68, 2) = .7828850893623454, (69, 0) = .7828850893623454, (69, 1) = .5208107275815067, (69, 2) = .3351893200132816, (70, 0) = .3351893200132816, (70, 1) = .8168339894556036, (70, 2) = .5318070908068122, (71, 0) = .5318070908068122, (71, 1) = .3127305955221361, (71, 2) = .8507828895488619, (72, 0) = .8507828895488619, (72, 1) = .5420509886013407, (72, 2) = .29085117783652864, (73, 0) = .29085117783652864, (73, 1) = .8847317896421203, (73, 2) = .5515612461677152}, datatype = float[8], order = C_order)), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = x(t), Y[2] = diff(x(t),t)]`; YP[2] := -(2*Y[1]+1/10)*(2*Y[2]^2+1)/(4*Y[1]^2+1); YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] )), ( 4 ) = (3)  ] ); _y0 := Array(0..2, {(1) = 0., (2) = 0.}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 100 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _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..3, {(1) = 18446884205156097822, (2) = 18446884205156085758, (3) = 18446884205156085934}), (3) = [t, x(t), diff(x(t), t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["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(t, '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(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[1] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[1], 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(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 1, 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", 1, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[1] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[1], 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(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := 1; _ndsol := `tools/gensym`("t"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][1])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[1] catch: error  end try end proc, x(t) = proc (t) 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](t) else _xout := evalf(t) 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( [( "right" ) = 2., ( "complex" ) = false, ( "left" ) = 0. ] ) _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 ) = ([Array(1..2, 1..21, {(1, 1) = 1.0, (1, 2) = .0, (1, 3) = 1.0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (1, 7) = 1.0, (1, 8) = undefined, (1, 9) = 1.0, (1, 10) = 1.0, (1, 11) = undefined, (1, 12) = undefined, (1, 13) = undefined, (1, 14) = undefined, (1, 15) = undefined, (1, 16) = undefined, (1, 17) = undefined, (1, 18) = undefined, (1, 19) = undefined, (1, 20) = undefined, (1, 21) = undefined, (2, 1) = 1.0, (2, 2) = .0, (2, 3) = 100.0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (2, 7) = .0, (2, 8) = undefined, (2, 9) = undefined, (2, 10) = 0.10e-6, (2, 11) = undefined, (2, 12) = .0, (2, 13) = undefined, (2, 14) = .0, (2, 15) = .0, (2, 16) = undefined, (2, 17) = undefined, (2, 18) = undefined, (2, 19) = undefined, (2, 20) = undefined, (2, 21) = undefined}, datatype = float[8], order = C_order), proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, Array(1..1, 1..2, {(1, 1) = undefined, (1, 2) = undefined}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..63, {(1) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 1, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 1, (17) = 0, (18) = 1, (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) = 1.3669169355851036, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.5047658755841546e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .0, (2) = 1.0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147743234702063, (2) = 0.2991930934853681e-2}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0.8131516293641283e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = 0.8131516293641283e-18, (1, 2) = 0.621069386685652e-2, (1, 3) = 0.5061177989226274e-2, (1, 4) = 0.2074229473918686e-4, (1, 5) = -0.6867609773327892e-3, (1, 6) = 0.3911625181543737e-2, (2, 1) = -.5293211659792734, (2, 2) = -.5293695532186686, (2, 3) = -.5293540956591186, (2, 4) = -.5293211649406641, (2, 5) = -.5293217682677498, (2, 6) = -.529340836479271}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = -0.6746146851020917e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..2, {(1) = .0, (2) = 1.0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 1.0, (2) = -.30000000000000004}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = x(t), Y[2] = diff(x(t),t)]`; YP[2] := -(2*Y[1]+1/10)*(2*Y[2]^2+1)/(4*Y[1]^2+1); YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = x(t), Y[2] = diff(x(t),t)]`; YP[2] := -(2*Y[1]+1/10)*(2*Y[2]^2+1)/(4*Y[1]^2+1); YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] )), ( 3 ) = (array( 1 .. 26, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([Array(1..2, 1..21, {(1, 1) = 1.0, (1, 2) = .0, (1, 3) = 1.0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (1, 7) = 1.0, (1, 8) = 1.3669169355851036, (1, 9) = 0.8131516293641283e-18, (1, 10) = 1.0, (1, 11) = 0.6210793285754164e-2, (1, 12) = 1.0, (1, 13) = 0.3911583444438467e-2, (1, 14) = 1.0, (1, 15) = 0.16124740349516638e-2, (1, 16) = 1.0, (1, 17) = -0.6865939756831342e-3, (1, 18) = 1.0, (1, 19) = 0.8131516293641283e-18, (1, 20) = 1.0, (1, 21) = 1.3669169355851036, (2, 1) = 1.0, (2, 2) = .0, (2, 3) = 100.0, (2, 4) = 1.0, (2, 5) = .0, (2, 6) = .0, (2, 7) = .0, (2, 8) = 1.3669169355851036, (2, 9) = undefined, (2, 10) = 0.10e-6, (2, 11) = undefined, (2, 12) = 1.0, (2, 13) = undefined, (2, 14) = .0, (2, 15) = .0, (2, 16) = undefined, (2, 17) = undefined, (2, 18) = undefined, (2, 19) = undefined, (2, 20) = undefined, (2, 21) = 1.3669169355851036}, datatype = float[8], order = C_order), proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, Array(1..1, 1..2, {(1, 1) = undefined, (1, 2) = undefined}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..63, {(1) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 101, (10) = 1, (11) = 73, (12) = 73, (13) = 0, (14) = 0, (15) = 0, (16) = 1, (17) = 1, (18) = 150, (19) = 30000, (20) = 1, (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) = 1, (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) = 1.3669169355851036, (2) = 0.10e-5, (3) = .13898945305267607, (4) = 0.500001e-14, (5) = .0, (6) = 0.5047658755841546e-2, (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) = 1.368214056799521, (20) = .13898945305267607, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .0, (2) = 1.0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147743234702063, (2) = 0.2991930934853681e-2}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0.8131516293641283e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = 0.8131516293641283e-18, (1, 2) = 0.621069386685652e-2, (1, 3) = 0.5061177989226274e-2, (1, 4) = 0.2074229473918686e-4, (1, 5) = -0.6867609773327892e-3, (1, 6) = 0.3911625181543737e-2, (2, 1) = -.5293211659792734, (2, 2) = -.5293695532186686, (2, 3) = -.5293540956591186, (2, 4) = -.5293211649406641, (2, 5) = -.5293217682677498, (2, 6) = -.529340836479271}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = -0.6746146851020917e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0.8131516293641283e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = 1.3669169355851036, (1, 2) = .6147827791621344, (2, 0) = .6147827791621344, (2, 1) = 0.8131516293641283e-18, (2, 2) = 1.3548595152722285, (3, 0) = 1.3548595152722285, (3, 1) = .6147443018057324, (3, 2) = 0.6382458243185191e-2, (4, 0) = 0.6382458243185191e-2, (4, 1) = 1.3588786553765202, (4, 2) = .6147656782714874, (5, 0) = .6147656782714874, (5, 1) = 0.4254894210261457e-2, (5, 2) = 1.362897795480812, (6, 0) = 1.362897795480812, (6, 1) = .6147785039629641, (6, 2) = 0.21274237207199744e-2}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = x(t), Y[2] = diff(x(t),t)]`; YP[2] := -(2*Y[1]+1/10)*(2*Y[2]^2+1)/(4*Y[1]^2+1); YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, 0, 0]), ( 13 ) = (), ( 12 ) = (Array(1..73, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = 1.0, (2, 2) = 0.12619146889603864e-2, (3, 0) = 0.12619146889603864e-2, (3, 1) = 0.12616738565258015e-2, (3, 2) = .999616747674144, (4, 0) = .999616747674144, (4, 1) = 0.2523829377920773e-2, (4, 2) = 0.25228581853900807e-2, (5, 0) = 0.25228581853900807e-2, (5, 1) = .9992241550571287, (5, 2) = 0.3785744066881159e-2, (6, 0) = 0.3785744066881159e-2, (6, 1) = 0.3783541215197853e-2, (6, 2) = .9988222460393802, (7, 0) = .9988222460393802, (7, 1) = 0.5047658755841546e-2, (7, 2) = 0.50437112049455295e-2, (8, 0) = 0.50437112049455295e-2, (8, 1) = .9984110452708771, (8, 2) = 0.18763802331930052e-1, (9, 0) = 0.18763802331930052e-1, (9, 1) = 0.18704577647715742e-1, (9, 2) = .9933495274250951, (10, 0) = .9933495274250951, (10, 1) = 0.3247994590801856e-1, (10, 2) = 0.322887163034234e-1, (11, 0) = 0.322887163034234e-1, (11, 1) = .9872324441502379, (11, 2) = 0.4619608948410706e-1, (12, 0) = 0.4619608948410706e-1, (12, 1) = 0.45781993330414834e-1, (12, 2) = .9801071832230382, (13, 0) = .9801071832230382, (13, 1) = 0.5991223306019557e-1, (13, 2) = 0.5917095413048571e-1, (14, 0) = 0.5917095413048571e-1, (14, 1) = .9720288765894416, (14, 2) = 0.7381107438037338e-1, (15, 0) = 0.7381107438037338e-1, (15, 1) = 0.7261884846451132e-1, (15, 2) = .9629343860138744, (16, 0) = .9629343860138744, (16, 1) = 0.8770991570055119e-1, (16, 2) = 0.8593438366127532e-1, (17, 0) = 0.8593438366127532e-1, (17, 1) = .9529955124167255, (17, 2) = .101608757020729, (18, 0) = .101608757020729, (18, 1) = 0.991063381801608e-1, (18, 2) = .942285847212391, (19, 0) = .942285847212391, (19, 1) = .11550759834090679, (19, 2) = .11212452357963143, (20, 0) = .11212452357963143, (20, 1) = .930880687771534, (20, 2) = .12911041713752863, (21, 0) = .12911041713752863, (21, 1) = .12470775841384893, (21, 2) = .9191183803284062, (22, 0) = .9191183803284062, (22, 1) = .14271323593415047, (22, 2) = .13712736702863793, (23, 0) = .13712736702863793, (23, 1) = .9068341213390221, (23, 2) = .1563160547307723, (24, 0) = .1563160547307723, (24, 1) = .14937671005622677, (24, 2) = .8940969700702323, (25, 0) = .8940969700702323, (25, 1) = .16991887352739418, (25, 2) = .16145008214608492, (26, 0) = .16145008214608492, (26, 1) = .8809731660006399, (26, 2) = .18481947726674444, (27, 0) = .18481947726674444, (27, 1) = .17446769615560365, (27, 2) = .8662282265594617, (28, 0) = .8662282265594617, (28, 1) = .1997200810060947, (28, 2) = .18726320795918514, (29, 0) = .18726320795918514, (29, 1) = .8511729487888557, (29, 2) = .21462068474544496, (30, 0) = .21462068474544496, (30, 1) = .19983250697428967, (30, 2) = .8358790958175935, (31, 0) = .8358790958175935, (31, 1) = .22952128848479522, (31, 2) = .2121725340853015, (32, 0) = .2121725340853015, (32, 1) = .820412013790285, (32, 2) = .24837218484015872, (33, 0) = .24837218484015872, (33, 1) = .22745233675019605, (33, 2) = .8006877235547174, (34, 0) = .8006877235547174, (34, 1) = .26722308119552224, (34, 2) = .24235946122442423, (35, 0) = .24235946122442423, (35, 1) = .780885071168912, (35, 2) = .2860739775508857, (36, 0) = .2860739775508857, (36, 1) = .2568932179397224, (36, 2) = .7610938541966088, (37, 0) = .7610938541966088, (37, 1) = .3049248739062492, (37, 2) = .27105455758176383, (38, 0) = .27105455758176383, (38, 1) = .741389576424313, (38, 2) = .32542910786936313, (39, 0) = .32542910786936313, (39, 1) = .2860378583922345, (39, 2) = .7201281678128157, (40, 0) = .7201281678128157, (40, 1) = .345933341832477, (40, 2) = .3005876063294246, (41, 0) = .3005876063294246, (41, 1) = .6991068667220606, (41, 2) = .3664375757955909, (42, 0) = .3664375757955909, (42, 1) = .3147091854767417, (42, 2) = .6783760072448012, (43, 0) = .6783760072448012, (43, 1) = .38694180975870474, (43, 2) = .3284089663526416, (44, 0) = .3284089663526416, (44, 1) = .6579739520810868, (44, 2) = .4065414225285592, (45, 0) = .4065414225285592, (45, 1) = .34111660423193696, (45, 2) = .638804735691326, (46, 0) = .638804735691326, (46, 1) = .4261410352984136, (46, 2) = .3534518749113766, (47, 0) = .3534518749113766, (47, 1) = .6199775559733585, (47, 2) = .44574064806826796, (48, 0) = .44574064806826796, (48, 1) = .36542156553547334, (48, 2) = .6015032198715705, (49, 0) = .6015032198715705, (49, 1) = .4653402608381224, (49, 2) = .37703265999788976, (50, 0) = .37703265999788976, (50, 1) = .5833877264659292, (50, 2) = .4861038471180183, (51, 0) = .4861038471180183, (51, 1) = .3889500280274702, (51, 2) = .5645896631901811, (52, 0) = .5645896631901811, (52, 1) = .5068674333979142, (52, 2) = .40048127245045556, (53, 0) = .40048127245045556, (53, 1) = .5461941135019355, (53, 2) = .5276310196778101, (54, 0) = .5276310196778101, (54, 1) = .41163468487144356, (54, 2) = .5281960056213145, (55, 0) = .5281960056213145, (55, 1) = .5483946059577061, (55, 2) = .4224184461269099, (56, 0) = .4224184461269099, (56, 1) = .510587852370767, (56, 2) = .5715560421860593, (57, 0) = .5715560421860593, (57, 1) = .4340212259474543, (57, 2) = .4913945640539472, (58, 0) = .4913945640539472, (58, 1) = .5947174784144125, (58, 2) = .44518479748080964, (59, 0) = .44518479748080964, (59, 1) = .4726591014184522, (59, 2) = .6178789146427658, (60, 0) = .6178789146427658, (60, 1) = .45591956238957404, (60, 2) = .45436467531410396, (61, 0) = .45436467531410396, (61, 1) = .641040350871119, (61, 2) = .4662355351497357, (62, 0) = .4662355351497357, (62, 1) = .43649357268675487, (62, 2) = .668014310470611, (63, 0) = .668014310470611, (63, 1) = .47773446062014113, (63, 2) = .4161898468531338, (64, 0) = .4161898468531338, (64, 1) = .694988270070103, (64, 2) = .4886927869713786, (65, 0) = .4886927869713786, (65, 1) = .3964057566008038, (65, 2) = .721962229669595, (66, 0) = .721962229669595, (66, 1) = .4991241330659119, (66, 2) = .37711193448594366, (67, 0) = .37711193448594366, (67, 1) = .748936189269087, (67, 2) = .509041336389085, (68, 0) = .509041336389085, (68, 1) = .3582794628036873, (68, 2) = .7828850893623454, (69, 0) = .7828850893623454, (69, 1) = .5208107275815067, (69, 2) = .3351893200132816, (70, 0) = .3351893200132816, (70, 1) = .8168339894556036, (70, 2) = .5318070908068122, (71, 0) = .5318070908068122, (71, 1) = .3127305955221361, (71, 2) = .8507828895488619, (72, 0) = .8507828895488619, (72, 1) = .5420509886013407, (72, 2) = .29085117783652864, (73, 0) = .29085117783652864, (73, 1) = .8847317896421203, (73, 2) = .5515612461677152}, datatype = float[8], order = C_order)), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = x(t), Y[2] = diff(x(t),t)]`; YP[2] := -(2*Y[1]+1/10)*(2*Y[2]^2+1)/(4*Y[1]^2+1); YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] )), ( 4 ) = (3)  ] ); _y0 := Array(0..2, {(1) = 0., (2) = 0.}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 100 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _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..3, {(1) = 18446884205156097822, (2) = 18446884205156085758, (3) = 18446884205156085934}), (3) = [t, x(t), diff(x(t), t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["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(t, '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(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[2] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, '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(t), 'string') = rhs(t); 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(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := 1; _ndsol := `tools/gensym`("x(t)"); 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(t)))) end if end if; try _res := _solnproc(_xout); _res[2] catch: error  end try end proc, diff(x(t), t) = proc (t) 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](t) else _xout := evalf(t) 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( [( "right" ) = 2., ( "complex" ) = false, ( "left" ) = 0. ] ) _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 ) = ([Array(1..2, 1..21, {(1, 1) = 1.0, (1, 2) = .0, (1, 3) = 1.0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (1, 7) = 1.0, (1, 8) = undefined, (1, 9) = 1.0, (1, 10) = 1.0, (1, 11) = undefined, (1, 12) = undefined, (1, 13) = undefined, (1, 14) = undefined, (1, 15) = undefined, (1, 16) = undefined, (1, 17) = undefined, (1, 18) = undefined, (1, 19) = undefined, (1, 20) = undefined, (1, 21) = undefined, (2, 1) = 1.0, (2, 2) = .0, (2, 3) = 100.0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (2, 7) = .0, (2, 8) = undefined, (2, 9) = undefined, (2, 10) = 0.10e-6, (2, 11) = undefined, (2, 12) = .0, (2, 13) = undefined, (2, 14) = .0, (2, 15) = .0, (2, 16) = undefined, (2, 17) = undefined, (2, 18) = undefined, (2, 19) = undefined, (2, 20) = undefined, (2, 21) = undefined}, datatype = float[8], order = C_order), proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, Array(1..1, 1..2, {(1, 1) = undefined, (1, 2) = undefined}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..63, {(1) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 1, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 1, (17) = 0, (18) = 1, (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) = 1.3669169355851036, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.5047658755841546e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .0, (2) = 1.0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147743234702063, (2) = 0.2991930934853681e-2}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0.8131516293641283e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = 0.8131516293641283e-18, (1, 2) = 0.621069386685652e-2, (1, 3) = 0.5061177989226274e-2, (1, 4) = 0.2074229473918686e-4, (1, 5) = -0.6867609773327892e-3, (1, 6) = 0.3911625181543737e-2, (2, 1) = -.5293211659792734, (2, 2) = -.5293695532186686, (2, 3) = -.5293540956591186, (2, 4) = -.5293211649406641, (2, 5) = -.5293217682677498, (2, 6) = -.529340836479271}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = -0.6746146851020917e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..2, {(1) = .0, (2) = 1.0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 1.0, (2) = -.30000000000000004}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = x(t), Y[2] = diff(x(t),t)]`; YP[2] := -(2*Y[1]+1/10)*(2*Y[2]^2+1)/(4*Y[1]^2+1); YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = x(t), Y[2] = diff(x(t),t)]`; YP[2] := -(2*Y[1]+1/10)*(2*Y[2]^2+1)/(4*Y[1]^2+1); YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] )), ( 3 ) = (array( 1 .. 26, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([Array(1..2, 1..21, {(1, 1) = 1.0, (1, 2) = .0, (1, 3) = 1.0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (1, 7) = 1.0, (1, 8) = 1.3669169355851036, (1, 9) = 0.8131516293641283e-18, (1, 10) = 1.0, (1, 11) = 0.6210793285754164e-2, (1, 12) = 1.0, (1, 13) = 0.3911583444438467e-2, (1, 14) = 1.0, (1, 15) = 0.16124740349516638e-2, (1, 16) = 1.0, (1, 17) = -0.6865939756831342e-3, (1, 18) = 1.0, (1, 19) = 0.8131516293641283e-18, (1, 20) = 1.0, (1, 21) = 1.3669169355851036, (2, 1) = 1.0, (2, 2) = .0, (2, 3) = 100.0, (2, 4) = 1.0, (2, 5) = .0, (2, 6) = .0, (2, 7) = .0, (2, 8) = 1.3669169355851036, (2, 9) = undefined, (2, 10) = 0.10e-6, (2, 11) = undefined, (2, 12) = 1.0, (2, 13) = undefined, (2, 14) = .0, (2, 15) = .0, (2, 16) = undefined, (2, 17) = undefined, (2, 18) = undefined, (2, 19) = undefined, (2, 20) = undefined, (2, 21) = 1.3669169355851036}, datatype = float[8], order = C_order), proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, Array(1..1, 1..2, {(1, 1) = undefined, (1, 2) = undefined}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..63, {(1) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 101, (10) = 1, (11) = 73, (12) = 73, (13) = 0, (14) = 0, (15) = 0, (16) = 1, (17) = 1, (18) = 150, (19) = 30000, (20) = 1, (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) = 1, (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) = 1.3669169355851036, (2) = 0.10e-5, (3) = .13898945305267607, (4) = 0.500001e-14, (5) = .0, (6) = 0.5047658755841546e-2, (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) = 1.368214056799521, (20) = .13898945305267607, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .0, (2) = 1.0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147743234702063, (2) = 0.2991930934853681e-2}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0.8131516293641283e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = 0.8131516293641283e-18, (1, 2) = 0.621069386685652e-2, (1, 3) = 0.5061177989226274e-2, (1, 4) = 0.2074229473918686e-4, (1, 5) = -0.6867609773327892e-3, (1, 6) = 0.3911625181543737e-2, (2, 1) = -.5293211659792734, (2, 2) = -.5293695532186686, (2, 3) = -.5293540956591186, (2, 4) = -.5293211649406641, (2, 5) = -.5293217682677498, (2, 6) = -.529340836479271}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = -0.6746146851020917e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = .6147827791621344, (2) = 0.8131516293641283e-18}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0.8131516293641283e-18, (2) = -.5293211659792734}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = 1.3669169355851036, (1, 2) = .6147827791621344, (2, 0) = .6147827791621344, (2, 1) = 0.8131516293641283e-18, (2, 2) = 1.3548595152722285, (3, 0) = 1.3548595152722285, (3, 1) = .6147443018057324, (3, 2) = 0.6382458243185191e-2, (4, 0) = 0.6382458243185191e-2, (4, 1) = 1.3588786553765202, (4, 2) = .6147656782714874, (5, 0) = .6147656782714874, (5, 1) = 0.4254894210261457e-2, (5, 2) = 1.362897795480812, (6, 0) = 1.362897795480812, (6, 1) = .6147785039629641, (6, 2) = 0.21274237207199744e-2}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = x(t), Y[2] = diff(x(t),t)]`; YP[2] := -(2*Y[1]+1/10)*(2*Y[2]^2+1)/(4*Y[1]^2+1); YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, 0, 0]), ( 13 ) = (), ( 12 ) = (Array(1..73, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = 1.0, (2, 2) = 0.12619146889603864e-2, (3, 0) = 0.12619146889603864e-2, (3, 1) = 0.12616738565258015e-2, (3, 2) = .999616747674144, (4, 0) = .999616747674144, (4, 1) = 0.2523829377920773e-2, (4, 2) = 0.25228581853900807e-2, (5, 0) = 0.25228581853900807e-2, (5, 1) = .9992241550571287, (5, 2) = 0.3785744066881159e-2, (6, 0) = 0.3785744066881159e-2, (6, 1) = 0.3783541215197853e-2, (6, 2) = .9988222460393802, (7, 0) = .9988222460393802, (7, 1) = 0.5047658755841546e-2, (7, 2) = 0.50437112049455295e-2, (8, 0) = 0.50437112049455295e-2, (8, 1) = .9984110452708771, (8, 2) = 0.18763802331930052e-1, (9, 0) = 0.18763802331930052e-1, (9, 1) = 0.18704577647715742e-1, (9, 2) = .9933495274250951, (10, 0) = .9933495274250951, (10, 1) = 0.3247994590801856e-1, (10, 2) = 0.322887163034234e-1, (11, 0) = 0.322887163034234e-1, (11, 1) = .9872324441502379, (11, 2) = 0.4619608948410706e-1, (12, 0) = 0.4619608948410706e-1, (12, 1) = 0.45781993330414834e-1, (12, 2) = .9801071832230382, (13, 0) = .9801071832230382, (13, 1) = 0.5991223306019557e-1, (13, 2) = 0.5917095413048571e-1, (14, 0) = 0.5917095413048571e-1, (14, 1) = .9720288765894416, (14, 2) = 0.7381107438037338e-1, (15, 0) = 0.7381107438037338e-1, (15, 1) = 0.7261884846451132e-1, (15, 2) = .9629343860138744, (16, 0) = .9629343860138744, (16, 1) = 0.8770991570055119e-1, (16, 2) = 0.8593438366127532e-1, (17, 0) = 0.8593438366127532e-1, (17, 1) = .9529955124167255, (17, 2) = .101608757020729, (18, 0) = .101608757020729, (18, 1) = 0.991063381801608e-1, (18, 2) = .942285847212391, (19, 0) = .942285847212391, (19, 1) = .11550759834090679, (19, 2) = .11212452357963143, (20, 0) = .11212452357963143, (20, 1) = .930880687771534, (20, 2) = .12911041713752863, (21, 0) = .12911041713752863, (21, 1) = .12470775841384893, (21, 2) = .9191183803284062, (22, 0) = .9191183803284062, (22, 1) = .14271323593415047, (22, 2) = .13712736702863793, (23, 0) = .13712736702863793, (23, 1) = .9068341213390221, (23, 2) = .1563160547307723, (24, 0) = .1563160547307723, (24, 1) = .14937671005622677, (24, 2) = .8940969700702323, (25, 0) = .8940969700702323, (25, 1) = .16991887352739418, (25, 2) = .16145008214608492, (26, 0) = .16145008214608492, (26, 1) = .8809731660006399, (26, 2) = .18481947726674444, (27, 0) = .18481947726674444, (27, 1) = .17446769615560365, (27, 2) = .8662282265594617, (28, 0) = .8662282265594617, (28, 1) = .1997200810060947, (28, 2) = .18726320795918514, (29, 0) = .18726320795918514, (29, 1) = .8511729487888557, (29, 2) = .21462068474544496, (30, 0) = .21462068474544496, (30, 1) = .19983250697428967, (30, 2) = .8358790958175935, (31, 0) = .8358790958175935, (31, 1) = .22952128848479522, (31, 2) = .2121725340853015, (32, 0) = .2121725340853015, (32, 1) = .820412013790285, (32, 2) = .24837218484015872, (33, 0) = .24837218484015872, (33, 1) = .22745233675019605, (33, 2) = .8006877235547174, (34, 0) = .8006877235547174, (34, 1) = .26722308119552224, (34, 2) = .24235946122442423, (35, 0) = .24235946122442423, (35, 1) = .780885071168912, (35, 2) = .2860739775508857, (36, 0) = .2860739775508857, (36, 1) = .2568932179397224, (36, 2) = .7610938541966088, (37, 0) = .7610938541966088, (37, 1) = .3049248739062492, (37, 2) = .27105455758176383, (38, 0) = .27105455758176383, (38, 1) = .741389576424313, (38, 2) = .32542910786936313, (39, 0) = .32542910786936313, (39, 1) = .2860378583922345, (39, 2) = .7201281678128157, (40, 0) = .7201281678128157, (40, 1) = .345933341832477, (40, 2) = .3005876063294246, (41, 0) = .3005876063294246, (41, 1) = .6991068667220606, (41, 2) = .3664375757955909, (42, 0) = .3664375757955909, (42, 1) = .3147091854767417, (42, 2) = .6783760072448012, (43, 0) = .6783760072448012, (43, 1) = .38694180975870474, (43, 2) = .3284089663526416, (44, 0) = .3284089663526416, (44, 1) = .6579739520810868, (44, 2) = .4065414225285592, (45, 0) = .4065414225285592, (45, 1) = .34111660423193696, (45, 2) = .638804735691326, (46, 0) = .638804735691326, (46, 1) = .4261410352984136, (46, 2) = .3534518749113766, (47, 0) = .3534518749113766, (47, 1) = .6199775559733585, (47, 2) = .44574064806826796, (48, 0) = .44574064806826796, (48, 1) = .36542156553547334, (48, 2) = .6015032198715705, (49, 0) = .6015032198715705, (49, 1) = .4653402608381224, (49, 2) = .37703265999788976, (50, 0) = .37703265999788976, (50, 1) = .5833877264659292, (50, 2) = .4861038471180183, (51, 0) = .4861038471180183, (51, 1) = .3889500280274702, (51, 2) = .5645896631901811, (52, 0) = .5645896631901811, (52, 1) = .5068674333979142, (52, 2) = .40048127245045556, (53, 0) = .40048127245045556, (53, 1) = .5461941135019355, (53, 2) = .5276310196778101, (54, 0) = .5276310196778101, (54, 1) = .41163468487144356, (54, 2) = .5281960056213145, (55, 0) = .5281960056213145, (55, 1) = .5483946059577061, (55, 2) = .4224184461269099, (56, 0) = .4224184461269099, (56, 1) = .510587852370767, (56, 2) = .5715560421860593, (57, 0) = .5715560421860593, (57, 1) = .4340212259474543, (57, 2) = .4913945640539472, (58, 0) = .4913945640539472, (58, 1) = .5947174784144125, (58, 2) = .44518479748080964, (59, 0) = .44518479748080964, (59, 1) = .4726591014184522, (59, 2) = .6178789146427658, (60, 0) = .6178789146427658, (60, 1) = .45591956238957404, (60, 2) = .45436467531410396, (61, 0) = .45436467531410396, (61, 1) = .641040350871119, (61, 2) = .4662355351497357, (62, 0) = .4662355351497357, (62, 1) = .43649357268675487, (62, 2) = .668014310470611, (63, 0) = .668014310470611, (63, 1) = .47773446062014113, (63, 2) = .4161898468531338, (64, 0) = .4161898468531338, (64, 1) = .694988270070103, (64, 2) = .4886927869713786, (65, 0) = .4886927869713786, (65, 1) = .3964057566008038, (65, 2) = .721962229669595, (66, 0) = .721962229669595, (66, 1) = .4991241330659119, (66, 2) = .37711193448594366, (67, 0) = .37711193448594366, (67, 1) = .748936189269087, (67, 2) = .509041336389085, (68, 0) = .509041336389085, (68, 1) = .3582794628036873, (68, 2) = .7828850893623454, (69, 0) = .7828850893623454, (69, 1) = .5208107275815067, (69, 2) = .3351893200132816, (70, 0) = .3351893200132816, (70, 1) = .8168339894556036, (70, 2) = .5318070908068122, (71, 0) = .5318070908068122, (71, 1) = .3127305955221361, (71, 2) = .8507828895488619, (72, 0) = .8507828895488619, (72, 1) = .5420509886013407, (72, 2) = .29085117783652864, (73, 0) = .29085117783652864, (73, 1) = .8847317896421203, (73, 2) = .5515612461677152}, datatype = float[8], order = C_order)), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = x(t), Y[2] = diff(x(t),t)]`; YP[2] := -(2*Y[1]+1/10)*(2*Y[2]^2+1)/(4*Y[1]^2+1); YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (t, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[2]; EA[1, 8+2*n] := 1; 0 end proc, proc (e, t, Y, Ypre) return 0 end proc, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] )), ( 4 ) = (3)  ] ); _y0 := Array(0..2, {(1) = 0., (2) = 0.}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 100 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _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..3, {(1) = 18446884205156097822, (2) = 18446884205156085758, (3) = 18446884205156085934}), (3) = [t, x(t), diff(x(t), t)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(t, ["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(t, '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(t, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(t, 'string')); if type(_res, 'list') then return _res[3] else return NULL end if elif member(t, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(t, '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(t), 'string') = rhs(t); 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(t), 'string') = rhs(t)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(t) else _ndsol := 1; _ndsol := `tools/gensym`("diff(x(t),t)"); 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(t)))) end if end if; try _res := _solnproc(_xout); _res[3] catch: error  end try end proc]

The graph of x versus t

plots:-odeplot(dsol, [t,x(t)]);

Animation:

plots:-odeplot(dsol, [x(t), x(t)^2], scaling=constrained,
    frames=100, labels=[x,y]);

Download sliding.mw

You didn't specify the PDE, so I will explain this in the context of the heat equation ∂u/∂t = ∂2u/∂x2. You plug u(x,t)=X(x) T(t) into the PDE, and after some work arrive at an ordinary differential equation for T(t), let's say something like Tn'(t) + an Tn(t) = 0, where Tn' is the derivative of Tn. You solve that ODE, and then express the solution of the PDE as u(x,t)=sum(Xn(x) Tn(t)). It follows that the derivative of u(x,t) with respect to t is sum(Xn(x) Tn'(t)). But you know Tn'(t) from the ODE, to wit, Tn'(t) = − an Tn(t). We conclude that ∂/∂t u = −sum(an Xn(t) Tn(t)).

As an alternative to Carl Love's implicitdiff approach, here is one with plain diff.  I haven't compared the results but they ought to be equivalent.

restart;

w := exp(exp(x*b)*(r-1)/(1+varphi*exp(x*b)));  # inserted "*" before (r-1)

exp(exp(x*b)*(r-1)/(1+varphi*exp(x*b)))

constraint := ln(r) = varphi*(exp(x*b))*(r-1)/(1+varphi*exp(x*b))-1;

ln(r) = varphi*exp(x*b)*(r-1)/(1+varphi*exp(x*b))-1

Rearrange the constraint equation:

my_phi := isolate(constraint, varphi);

varphi = -(ln(r)+1)/(exp(x*b)*(-r+ln(r)+2))

Eliminte varphi in w.  Call the result W (uppercase w):

W := eval(w, my_phi);

exp(exp(x*b)*(r-1)/(1-(ln(r)+1)/(-r+ln(r)+2)))

Now we may compute the derivative of W with respect to b:

simplify(diff(W, b));

exp(exp(x*b)*(r-ln(r)-2)+x*b)*x*(r-ln(r)-2)

To compute the derivative of W with respect to varphi, we note
that dW/`d&phi;` = dW/dr*(dr/`d&phi;`)

simplify(diff(W,r)/diff(rhs(my_phi),r));

-exp((r-2)*exp(x*b)+2*x*b)*(-r+ln(r)+2)^2*(r-1)*r^(-exp(x*b))/(ln(r)*r+1)

Ronan gave a link to my post from almost two years ago where I illustrated the use of quaternions in tracking rotations in space.  That motivated me to clean up the code a bit and then apply it to the phenomenon of the flipping T-handle which is the subject of the current thread.  The code, which combines Euler's equations of motion and quaternions, is sufficiently commented to let you adapt it to other situations.

Here is the worksheet T-handle-flip.mw and here is the resulting animation:

 

@ecterrab You are correct in stating that this problem has "no solution".  To be precise, this problem has no classical solution.

A great deal of effort was devoted throughout the 20th century to make sense of exactly such boundary value problems which arise in just about every application, especially in physics.  The concept of generalized derivatives and weak solutions were introduced precisely for that purpose.  If we dismiss weak solutions, we will be throwing away most of the useful applications of the PDEs.

Consider, for instance, a slender (one-dimensional) bar currently at a uniform temperature of 100 degrees.  We bring one end of it in contact with an ice cube.  We want to determine how the bar's temperature evolves in subsequent times.

The temperature, u(x,t), satisfies the PDE u_t = u_xx, where subscripts denote differentiation.  The initial condition is u(x,0)=100.  The boundary condition is u(0,t)=0.  Certainly these two conditions are incompatible but we don't want throw up our hands and say that this problem is not solvable.  True, no classical solution exists, but a weak solution does, and that's what's relevant to this question.

Mathematica's solution that was posted earlier (and is now deleted) expresses the solution of the PDE in the Fourier series.  The Fourier series solution picks up the weak solution, therefore that solution was correct in the sense that it produced the expected weak solution to the problem.  In the worksheet below I show how to reproduce Mathematica's solution with Maple's pdsolve().  The process hits a few snags but eventually we arrive at the desired solution.

P.S.: To be clear, I am not here to berate the terrific job that you have done (and continue doing) with extending Maple's capabilities in many directions.  All I want to point out is that the Fourier series picks up the weak solution, and that it should not be dismissed.

[Worksheet produced in Maple 2018.1]

restart;

pde := diff(u(x,y),x,x) + diff(u(x,y),y,y) = 0;

diff(diff(u(x, y), x), x)+diff(diff(u(x, y), y), y) = 0

bc := u(0,y)=0, u(Pi,y)=sinh(Pi)*cos(y), u(x,0)=sin(x), u(x,Pi)=-sinh(x);

u(0, y) = 0, u(Pi, y) = sinh(Pi)*cos(y), u(x, 0) = sin(x), u(x, Pi) = -sinh(x)

result := pdsolve({pde,bc});

Snag #1: pdsolve() returns empty.  I follow Robert Lopez's lead and split up

the problem into four problems, then use superposition:

bc1 := u(0,y)=0,  u(Pi,y)=0,  u(x,0)=0,  u(x,Pi)=0;

u(0, y) = 0, u(Pi, y) = 0, u(x, 0) = 0, u(x, Pi) = 0

bc2 := u(0,y)=0,  u(Pi,y)=sinh(Pi)*cos(y),  u(x,0)=0,  u(x,Pi)=0;

u(0, y) = 0, u(Pi, y) = sinh(Pi)*cos(y), u(x, 0) = 0, u(x, Pi) = 0

bc3 := u(0,y)=0,  u(Pi,y)=0,  u(x,0)=sin(x),  u(x,Pi)=0;

u(0, y) = 0, u(Pi, y) = 0, u(x, 0) = sin(x), u(x, Pi) = 0

bc4 := u(0,y)=0,  u(Pi,y)=0,  u(x,0)=0,  u(x,Pi)=-sinh(x);

u(0, y) = 0, u(Pi, y) = 0, u(x, 0) = 0, u(x, Pi) = -sinh(x)

Attempt to solve the problem with bc1:

sol1 := pdsolve({pde,bc1});

Snag #2: The exact solution of {pde,bc1} is u(x,y)=0.  Maple fails to detect that.
I don't know why.  The boundary conditions are certainly compatible.


Here I intervene and set the solution myself:

sol1 := u(x,y) = 0;

u(x, y) = 0

Atempt to solve with bc2:

sol2_tmp := pdsolve({pde,bc2});

u(x, y) = Sum(2*n*sinh(Pi)*((-1)^n+1)*sin(y*n)*(exp(2*x*n)-1)*exp(n*(Pi-x))/(Pi*(exp(2*Pi*n)-1)*(n^2-1)), n = 1 .. infinity)

Snag #3: The first term (n=1) of the summation above evaluates to 0/0.

In fact, all terms with odd n should evaluate to zero.  Here we intervene and

replace n by 2*n:

applyop(eval, [2,1], sol2_tmp, n=2*n):
sol2 := simplify(%) assuming n::posint;

u(x, y) = Sum(8*n*sinh(Pi)*sin(2*y*n)*(exp(4*x*n)-1)*exp(2*n*(Pi-x))/(Pi*(exp(4*Pi*n)-1)*(4*n^2-1)), n = 1 .. infinity)

The boundary conditions bc3 and bc4 give no problem:

sol3 := pdsolve({pde,bc3});

u(x, y) = sin(x)*(exp(2*Pi-y)-exp(y))/(exp(2*Pi)-1)

sol4 := pdsolve({pde,bc4});

u(x, y) = Sum((-1)^n*n*(exp(2*Pi)-1)*sin(x*n)*(exp(2*y*n)-1)*exp((-y+Pi)*n-Pi)/(Pi*(n^2+1)*(exp(2*Pi*n)-1)), n = 1 .. infinity)

The original problem's weak solution is obtained as a superposition

of the previously solved four sub-problems.  Ideally, Maple's pdsolve()

should obtain this solution in one shot and I am confident that at some future time it will:

sol := rhs(sol1) + rhs(sol2) + rhs(sol3) + rhs(sol4);

Sum(8*n*sinh(Pi)*sin(2*y*n)*(exp(4*x*n)-1)*exp(2*n*(Pi-x))/(Pi*(exp(4*Pi*n)-1)*(4*n^2-1)), n = 1 .. infinity)+sin(x)*(exp(2*Pi-y)-exp(y))/(exp(2*Pi)-1)+Sum((-1)^n*n*(exp(2*Pi)-1)*sin(x*n)*(exp(2*y*n)-1)*exp((-y+Pi)*n-Pi)/(Pi*(n^2+1)*(exp(2*Pi*n)-1)), n = 1 .. infinity)

We truncate the series:

my_sol := eval(sol, infinity=50);

Sum(8*n*sinh(Pi)*sin(2*y*n)*(exp(4*x*n)-1)*exp(2*n*(Pi-x))/(Pi*(exp(4*Pi*n)-1)*(4*n^2-1)), n = 1 .. 50)+sin(x)*(exp(2*Pi-y)-exp(y))/(exp(2*Pi)-1)+Sum((-1)^n*n*(exp(2*Pi)-1)*sin(x*n)*(exp(2*y*n)-1)*exp((-y+Pi)*n-Pi)/(Pi*(n^2+1)*(exp(2*Pi*n)-1)), n = 1 .. 50)

and plot the result:

plot3d(my_sol, x=0..Pi, y=0..Pi,
    style=patchcontour, contours=20);

Download pde-bc.mw

I don't quite understand what you mean by "link a worksheet written in Maple 16 into WordPress" but let me try.

WordPress can display HTML code as well as images.  In Malpe's menubar select File->Print and save your worksheet as a graphics image.  On my Maple 2018 on Linux the image is saved in the PostScript format.  In your Maple 16 it may be something else, but it does not matter much.  You may convert one image into any other image format such as PNG, which then you pass on to WordPress.

 

plot([0, sin(x)], x=0..2*Pi, axes=boxed, color=[black,blue]);

 

In the Layout palette pick the entry that consists of a green "A" on top of a red "b".  Then edit to replace the "A" with "max" and the "B" with the desired subscript.  Here is what we get:

 

This works in Maple 2018.  I don't have Maple 2015 to test.

Download worksheet: mw.mw

The answer depends on what you assume about x.

Is x itself bounded?  If yes, then cos(i*x) is bounded.

Is x imaginary and unbounded?  If yes, then i*x is real, and therefore cos(i*x) is bounded because sin(i*x)^2 + cos(i*x)^2 = 1.

Is x real and unbounded? If so, then:

convert(cos(I*x), exp) assuming x::real;

shows that cos(i*x) is 1/2 exp(x) + 1/2 exp(-x), and therefore cos(i*x) is unbounded.

 

And here is an exercise for you: Suppose x is complex.  What can you tell about the boundedness of cos((i*x)?

 

From the first differential equation, that is,

"Nb*((&DifferentialD;)^2)/((&DifferentialD;)^( )y^2)sigma(y)+Nt*((&DifferentialD;)^2)/((&DifferentialD;)^( )y^2)theta(y)=0 , "
it follows that Nb*sigma(y)+Nt*theta(y) = c__1*y+c__2. Applying the
boundary conditions we see that c__1 and c__2 are zero, and herefore
Nb*sigma(y)+Nt*theta(y) = 0.
The second equation, that is
"((&DifferentialD;)^2)/((&DifferentialD;)^( )y^2)theta(y)+Nb*(&DifferentialD;)/(&DifferentialD; y)sigma(y)*(&DifferentialD;)/(&DifferentialD; y)theta(y)+Nt*((&DifferentialD;)/(&DifferentialD; y)theta(y))^(2)=0, "
may be rearranged into

"((&DifferentialD;)^2)/((&DifferentialD;)^( )y^2)theta(y)+(Nb*(&DifferentialD;)/(&DifferentialD; y)sigma(y)+Nt*(&DifferentialD;)/(&DifferentialD; y)theta(y))*(&DifferentialD;)/(&DifferentialD; y)theta(y)=0,  "
which, in view of the red equation, reduces to
diff(theta(y), y, y) = 0.
Applying the boundary conditions we get
`&equiv;`(theta(y), 0.)
Then from the red equation we conclude that
"sigma(y)&equiv;0.  "

The purpose of phaseportrait is to plot solutions of a system of differential equations.  There is no differential equation in what you have shown.

Suggestion: Maple's help page on phaseportrait is quite limited and not very instructive.  To its credit, it refer the reader to DEplot's help page which does what phaseportrait is supposed to do, and is much better documented.  Look up the examples in DEplot's help page and come back here if you still have questions.

The abs(t) seems to confuse Maple. The following equivalent alternative works:

restart;

with(inttrans):

h := piecewise(t < -2*Pi*n, 0, t < 2*Pi*n, cos(t), 0);

h := piecewise(t < -2*Pi*n, 0, t < 2*Pi*n, cos(t), 0)

fourier(h, t, w) assuming n::posint;

2*w*sin(2*Pi*n*w)/((w+1)*(w-1))

 

Download mw.mw

restart:

eq[1]:=diff(x[1](t), t)-2*x[1](t)*(N1*N2*N3-x[1](t)*x[3](t))/(N1*N2*N6):

eq[2]:=diff(x[2](t), t)+((1-N1*N2*N6/x[1](t))*(N1*N2*N3-x[2](t)*x[3](t))/((N1*N2+x[2](t)*(1-N1*N2*N6/x[1](t)))*N1*N2)-2*x[2](t)*(1-N1*N2*N6/x[1](t))*(N1*N2*N3-x[1](t)*x[3](t))/(x[1](t)*N1*N2*(N1*N2+x[2](t)*(1-N1*N2*N6/x[1](t)))))/((1-N1*N2*N6/x[1](t))/(x[2](t)*(N1*N2+x[2](t)*(1-N1*N2*N6/x[1](t))))-ln(1+(1-N1*N2*N6/x[1](t))*x[2](t)/(N1*N2))/x[2](t)^2):

eq[3]:=diff(x[3](t), t)-(-(-2*N1*N2*N3*ln(1+(1-N1*N2*N6/x[1](t))*x[2](t)/(N1*N2))*(N1*N2*N3-x[1](t)*x[3](t))/x[1](t)-N3*(x[3](t)*N2*N1*ln(1+(1-N1*N2*N6/x[1](t))*x[2](t)/(N1*N2))/x[2](t)+N3*N2*N1*(1-N1*N2*N6/x[1](t)-N2*N1*ln(1+(1-N1*N2*N6/x[1](t))*x[2](t)/(N1*N2))/x[2](t))/x[2](t))-N5*(x[3](t)^2*N2*N1*ln(1+(1-N1*N2*N6/x[1](t))*x[2](t)/(N1*N2))/x[2](t)+2*x[3](t)*N3*N2*N1*(1-N1*N2*N6/x[1](t)-N2*N1*ln(1+(1-N1*N2*N6/x[1](t))*x[2](t)/(N1*N2))/x[2](t))/x[2](t)+N3^2*N2*N1*((1/2)*(1-N1*N2*N6/x[1](t))^2-N2*N1*(1-N1*N2*N6/x[1](t)-N2*N1*ln(1+(1-N1*N2*N6/x[1](t))*x[2](t)/(N1*N2))/x[2](t))/x[2](t))/x[2](t))-N2*N1*ln(1+(1-N1*N2*N6/x[1](t))*x[2](t)/(N1*N2))/(x[2](t)*F1)-Kin*x[3](t)^2-Kex*N1*N2*(x[3](t)+N3*(1-N1*N2*N6/x[1](t)))^2/(N1*N2+x[2](t)*(1-N1*N2*N6/x[1](t))))*x[1](t)*(N1*N2*N6*x[2](t)-N1*N2*x[1](t)-x[2](t)*x[1](t))*F1/(N1*N2)-Aol^2*Dol*F1*LR*N5*N3^2*N1^2*N2^2*N6^2+2*Aol^2*Dol*F1*LR*N5*N3^2*N1*N2*N6*x[1](t)+2*Aol^2*Dol*F1*LR*N5*N3*N1*N2*N6*x[1](t)*x[3](t)-Aol^2*Dol*F1*LR*N5*N3^2*x[1](t)^2-2*Aol^2*Dol*F1*LR*N5*N3*x[1](t)^2*x[3](t)-Aol^2*Dol*F1*LR*N5*x[1](t)^2*x[3](t)^2-2*Aol*F1*LR*N3^2*N1*N2*x[1](t)+2*Aol*F1*LR*N3*x[1](t)^2*x[3](t)-LR*x[1](t)^2+F1*N4*N1*N2*N6^2*x[3](t)^2*x[2](t)-F1*N4*N1*N2*N6*x[1](t)*x[3](t)^2-F1*N4*N6*x[1](t)*x[3](t)^2*x[2](t)+N1*N2*N6^2*x[2](t)-N1*N2*N6*x[1](t)-N6*x[1](t)*x[2](t))/(Aol*F1*LR*x[1](t)^2+F1*N6*x[1](t)*x[2](t)+F1*ln(-(N1*N2*N6*x[2](t)-N1*N2*x[1](t)-x[2](t)*x[1](t))/(N1*N2*x[1](t)))*x[1](t)^2*x[2](t)-F1*N1*N2*N6^2*x[2](t)+F1*N1*N2*N6*x[1](t)+F1*N1*N2*ln(-(N1*N2*N6*x[2](t)-N1*N2*x[1](t)-x[2](t)*x[1](t))/(N1*N2*x[1](t)))*x[1](t)^2-F1*N1*N2*N6*ln(-(N1*N2*N6*x[2](t)-N1*N2*x[1](t)-x[2](t)*x[1](t))/(N1*N2*x[1](t)))*x[1](t)*x[2](t)):

A differential equation is expected to be something of the form dx/dt = F(x(t)).  That is, one defines the function F first, and then defines the differential equation afterwards in terms of F.  In your equations the function F is hidden, so we first untangle your notation to set things straight.  This should not have been necessary if you had done things correctly in the beginning by defining the F functions first.

isolate(eq[1], diff);
eval(rhs(%), [x[1](t)=x[1], x[2](t)=x[2], x[3](t)=x[3]]);
F[1] := unapply(%, [x[1], x[2], x[3]]);  # here is F
Eq[1] := diff(x[1](t),t) = F[1](x[1](t), x[2](t), x[3](t));  # here is the DE

diff(x[1](t), t) = 2*x[1](t)*(N1*N2*N3-x[1](t)*x[3](t))/(N1*N2*N6)

 

2*x[1]*(N1*N2*N3-x[1]*x[3])/(N1*N2*N6)

 

proc (x_1, x_2, x_3) options operator, arrow; 2*x_1*(N1*N2*N3-x_1*x_3)/(N1*N2*N6) end proc

 

diff(x[1](t), t) = 2*x[1](t)*(N1*N2*N3-x[1](t)*x[3](t))/(N1*N2*N6)

(1)

Similarly, we untangle the notation for eq[2] and eq[3]:

isolate(eq[2], diff):
eval(rhs(%), [x[1](t)=x[1], x[2](t)=x[2], x[3](t)=x[3]]):
F[2] := unapply(%, [x[1], x[2], x[3]]):  # here is F
Eq[2] := diff(x[1](t),t) = F[2](x[1](t), x[2](t), x[3](t)):  # here is the DE

 

isolate(eq[3], diff):
eval(rhs(%), [x[1](t)=x[1], x[2](t)=x[2], x[3](t)=x[3]]):
F[3] := unapply(%, [x[1], x[2], x[3]]):  # here is F
Eq[3] := diff(x[1](t),t) = F[3](x[1](t), x[2](t), x[3](t)):  # here is the DE

 

Find the equilibria:

solve({F[1](x[1],x[2],x[3])=0,
       F[2](x[1],x[2],x[3])=0,
       F[3](x[1],x[2],x[3])=0}, {x[1],x[2],x[3]});

{x[1] = N1*N2*N6+N1*N2*exp(RootOf(6*LR*N6+2*F1*Kex*N3^2*(exp(_Z))^3+F1*N3^2*N5*(exp(_Z))^3-2*F1*Kex*N3^2*(exp(_Z))^2+2*F1*Kin*N3^2*(exp(_Z))^2+2*F1*N3^2*N6*(exp(_Z))^2-2*F1*Kin*N3^2*exp(_Z)-F1*N3^2*N5*exp(_Z)-2*F1*N3^2*N6*exp(_Z)+2*F1*Kin*N3^2*N6*exp(_Z)+2*F1*N3^2*N4*N6*exp(_Z)+2*F1*Kex*N3^2*N6*(exp(_Z))^2-2*LR+2*Aol^2*Dol*F1*LR*N3^2*N5*(exp(_Z))^3-2*Aol^2*Dol*F1*LR*N3^2*N5*(exp(_Z))^2+2*(exp(_Z))^3*_Z-4*(exp(_Z))^2*_Z+2*_Z*exp(_Z)+2*N6*(exp(_Z))^3-6*LR*(exp(_Z))^2-4*N6^2*exp(_Z)-4*N6*(exp(_Z))^2+6*LR*exp(_Z)+2*N6*exp(_Z)+2*LR*(exp(_Z))^3+2*N6^3*exp(_Z)+4*N6^2*(exp(_Z))^2+2*Aol^2*Dol*F1*LR*N3^2*N5*N6*(exp(_Z))^2+2*LR*N6^3-6*LR*N6^2+2*F1*N3^2*(exp(_Z))^3-4*F1*N3^2*(exp(_Z))^2+2*F1*N3^2*exp(_Z)+6*LR*N6^2*exp(_Z)+6*LR*N6*(exp(_Z))^2-12*LR*N6*exp(_Z)+2*N6^2*exp(_Z)*_Z+4*N6*(exp(_Z))^2*_Z-4*N6*exp(_Z)*_Z))-N1*N2, x[2] = N1*N2*N6+N1*N2*exp(RootOf(6*LR*N6+2*F1*Kex*N3^2*(exp(_Z))^3+F1*N3^2*N5*(exp(_Z))^3-2*F1*Kex*N3^2*(exp(_Z))^2+2*F1*Kin*N3^2*(exp(_Z))^2+2*F1*N3^2*N6*(exp(_Z))^2-2*F1*Kin*N3^2*exp(_Z)-F1*N3^2*N5*exp(_Z)-2*F1*N3^2*N6*exp(_Z)+2*F1*Kin*N3^2*N6*exp(_Z)+2*F1*N3^2*N4*N6*exp(_Z)+2*F1*Kex*N3^2*N6*(exp(_Z))^2-2*LR+2*Aol^2*Dol*F1*LR*N3^2*N5*(exp(_Z))^3-2*Aol^2*Dol*F1*LR*N3^2*N5*(exp(_Z))^2+2*(exp(_Z))^3*_Z-4*(exp(_Z))^2*_Z+2*_Z*exp(_Z)+2*N6*(exp(_Z))^3-6*LR*(exp(_Z))^2-4*N6^2*exp(_Z)-4*N6*(exp(_Z))^2+6*LR*exp(_Z)+2*N6*exp(_Z)+2*LR*(exp(_Z))^3+2*N6^3*exp(_Z)+4*N6^2*(exp(_Z))^2+2*Aol^2*Dol*F1*LR*N3^2*N5*N6*(exp(_Z))^2+2*LR*N6^3-6*LR*N6^2+2*F1*N3^2*(exp(_Z))^3-4*F1*N3^2*(exp(_Z))^2+2*F1*N3^2*exp(_Z)+6*LR*N6^2*exp(_Z)+6*LR*N6*(exp(_Z))^2-12*LR*N6*exp(_Z)+2*N6^2*exp(_Z)*_Z+4*N6*(exp(_Z))^2*_Z-4*N6*exp(_Z)*_Z))-N1*N2, x[3] = N3/(N6+exp(RootOf(6*LR*N6+2*F1*Kex*N3^2*(exp(_Z))^3+F1*N3^2*N5*(exp(_Z))^3-2*F1*Kex*N3^2*(exp(_Z))^2+2*F1*Kin*N3^2*(exp(_Z))^2+2*F1*N3^2*N6*(exp(_Z))^2-2*F1*Kin*N3^2*exp(_Z)-F1*N3^2*N5*exp(_Z)-2*F1*N3^2*N6*exp(_Z)+2*F1*Kin*N3^2*N6*exp(_Z)+2*F1*N3^2*N4*N6*exp(_Z)+2*F1*Kex*N3^2*N6*(exp(_Z))^2-2*LR+2*Aol^2*Dol*F1*LR*N3^2*N5*(exp(_Z))^3-2*Aol^2*Dol*F1*LR*N3^2*N5*(exp(_Z))^2+2*(exp(_Z))^3*_Z-4*(exp(_Z))^2*_Z+2*_Z*exp(_Z)+2*N6*(exp(_Z))^3-6*LR*(exp(_Z))^2-4*N6^2*exp(_Z)-4*N6*(exp(_Z))^2+6*LR*exp(_Z)+2*N6*exp(_Z)+2*LR*(exp(_Z))^3+2*N6^3*exp(_Z)+4*N6^2*(exp(_Z))^2+2*Aol^2*Dol*F1*LR*N3^2*N5*N6*(exp(_Z))^2+2*LR*N6^3-6*LR*N6^2+2*F1*N3^2*(exp(_Z))^3-4*F1*N3^2*(exp(_Z))^2+2*F1*N3^2*exp(_Z)+6*LR*N6^2*exp(_Z)+6*LR*N6*(exp(_Z))^2-12*LR*N6*exp(_Z)+2*N6^2*exp(_Z)*_Z+4*N6*(exp(_Z))^2*_Z-4*N6*exp(_Z)*_Z))-1)}

(2)

That's a mess.  We back up and do things manually as much as possible.  We have:

F[1](x[1],x[2],x[3]) = 0;
solve(%, x[1]);
tmp1 := %[2];  # ignore the solution x[1]=0; pick the other one and call it tmp1

2*x[1]*(N1*N2*N3-x[1]*x[3])/(N1*N2*N6) = 0

 

0, N1*N2*N3/x[3]

 

N1*N2*N3/x[3]

(3)

Similarly, solve F[2] =0 for x[2]:

simplify(F[2](tmp1,x[2],x[3]));
tmp2 := solve(%, x[2]);  # solve for x[2] and call the solution tmp2

(-N6*x[3]+N3)*(N1*N2*N3-x[2]*x[3])*x[2]^2/(N2*N1*((N1*N2*N3+x[2]*(-N6*x[3]+N3))*ln(((N1*N2+x[2])*N3-N6*x[2]*x[3])/(N1*N2*N3))-x[2]*(-N6*x[3]+N3)))

 

N1*N2*N3/x[3]

(4)

It remians to solve the equation F[3]=0.  But it does not have a solution in terms of elementary function:

simplify(F[3](tmp1, tmp2, x[3]));

(((-N6+1)*x[3]+N3)*ln((-N6*x[3]+N3+x[3])/x[3])-(N6-1)*((1/2)*N5*N6+N4-N5)*N6*F1*x[3]^3+N3*((1+Kex+(3/2)*N5+Aol^2*Dol*LR*N5)*N6^2+(-2*Aol^2*Dol*LR*N5-2*Kex-Kin+N4-3*N5-1)*N6+Aol^2*Dol*LR*N5+Kex+Kin+N5)*F1*x[3]^2+(-2*((Aol^2*Dol*LR*N5+Kex+(3/4)*N5+1)*N6+(-Aol^2*Dol*LR-3/4)*N5-Kex-(1/2)*Kin-1/2)*F1*N3^2-N6^2+N6)*x[3]+N3*(F1*(Aol^2*Dol*LR*N5+Kex+(1/2)*N5+1)*N3^2+LR+N6))*x[3]/(F1*(((N6-1)*x[3]-N3)*N3*N1*N2*ln((-N6*x[3]+N3+x[3])/x[3])+((N6^2-N6)*x[3]-N3*(Aol*LR+N6))*x[3]))

(5)

So we seek a numerical solution.  Toward that end, we make a list of the problem's parameters:

indets({F[1](x[1],x[2],x[3]), F[2](x[1],x[2],x[3]), F[3](x[1],x[2],x[3])}, name);

{Aol, Dol, F1, Kex, Kin, LR, N1, N2, N3, N4, N5, N6, x[1], x[2], x[3]}

(6)

Pick numerical values for the parameters:

params:= F1=1.493520000, LR=0.3178477690, Aol=0.7843287882, Dol= 0.5128205128e-1, N4= 3.670047218, N5= 7.340094435, N1= 1.054254618, N2= 0.5146253739e-1, N6=0.650636, N3=2.64407, Kin=42.48, Kex=0.68

F1 = 1.493520000, LR = .3178477690, Aol = .7843287882, Dol = 0.5128205128e-1, N4 = 3.670047218, N5 = 7.340094435, N1 = 1.054254618, N2 = 0.5146253739e-1, N6 = .650636, N3 = 2.64407, Kin = 42.48, Kex = .68

(7)

Let's see what F[3] looks like as a function of x[3]:

plot(eval(F[3](tmp1, tmp2, x[3]), {params}), x[3]=0..200);

 

We see that there is a root near x[3]=150.  We apply fsolve() to obtain the precise value.  We call it X[3]:

eval(F[3](tmp1, tmp2, x[3]), {params}):
X[3] := fsolve(%, x[3]);

141.8570556

(8)

With that in hand, we may evaluate the other two coordinates of the equilibrium:

X[1] := eval(tmp1, {params, x[3]=X[3]});

0.1011250420e-2

(9)

X[2] := eval(tmp2, {params, x[3]=X[3]});

0.1011250420e-2

(10)

Sanity check: Let's verify that we have made no mistakes:

eval([F[1](X[1],X[2],X[3]),
      F[2](X[1],X[2],X[3]),
      F[3](X[1],X[2],X[3])], {params});

[-0.5729462929e-11, -0.4460049627e-11, 0.5576334169e-4]

(11)

That's not bad.  The third value is not as small as it can be, but if necessary, we may increase the Digits value in order to obtain greater accuracy.

Aside: With the hindsight obtained from our manual calculation above, we may ask Maple to find the equilibrium at once through a single application of the fsolve() command:

eval({F[1](x[1],x[2],x[3])=0,
      F[2](x[1],x[2],x[3])=0,
      F[3](x[1],x[2],x[3])=0}, {params}):
fsolve(%, {x[1]=0..1e-2,x[2]=0..1e-2,x[3]=140..160});

{x[1] = 0.1011250419e-2, x[2] = 0.1011250419e-2, x[3] = 141.8570556}

(12)

which is identical to what we obtained earlier.

 

Now we linearize the system about the equilibrium.  We begin by evaluating  F[1], F[2] and F[3] at the parameter values:

G := eval([F[1](x[1],x[2],x[3]),
           F[2](x[1],x[2],x[3]),
           F[3](x[1],x[2],x[3])], {params}):

Here is the Jacobian matrix at any x[1], x[2], x[3]:

J := < diff(G[1],x[1]), diff(G[1],x[2]), diff(G[1],x[3]);
       diff(G[2],x[1]), diff(G[2],x[2]), diff(G[2],x[3]);
       diff(G[3],x[1]), diff(G[3],x[2]), diff(G[3],x[3]) >:

Evaluate the Jacobian at the equilibrium to obtain the linearized matrix:

A := eval(J, {x[1]=X[1], x[2]=X[2], x[3]=X[3]});

_rtable[18446883888842582486]

(13)

Find the eigenvalues of the linearized matrix

LinearAlgebra:-Eigenvalues(A);

_rtable[18446883888835980694]

(14)

We have two positive eigenvalues, indicating that the equilibrium is unstable.

 

 

 

Download mw2.mw

Let me write L instead of LL for greater legibility.  By differentiating your expression for L we get:

Solve this as a differential equation:
dsol := dsolve({de, ic}, numeric);

Then plot it:

plots:-odeplot(dsol), phi=0..2*Pi);

To read of the value of the solution at phi=4, do:

dsol(4);

 

 

iR := rand(1..nR):
iC := rand(1..nC):
C(iR(),iC());  # pick a random element of C

C(iR(),iC());  # pick another random element of C

First 27 28 29 30 31 32 33 Last Page 29 of 53