Rouben Rostamian

MaplePrimes Activity


These are answers submitted by Rouben Rostamian

mtaylor does not like expressions with "diff" in them, but it works well when converted to "D".  So all you need is:

convert(lhs(Eq1), D):
mtaylor(%, [x,t], 2);

 

I am posting this as an "Answer" since the question answered here is quite distinct from the question that was originally asked and answered in this thread.

Geodesics connecting two points on a torus

restart;

with(plots):

with(VariationalCalculus):

The parametric equation of a torus with major and minor radii of a and b.

< (a+b*cos(v))*cos(u), (a+b*cos(v))*sin(u),  b*sin(v) >;
x := unapply(%, u, v):

Vector(3, {(1) = (a+b*cos(v))*cos(u), (2) = (a+b*cos(v))*sin(u), (3) = b*sin(v)})

Calculate the coefficients E, F, and G of the first fundamental form:

xu := diff(x(u,v),u):
xv := diff(x(u,v),v):
E := unapply(simplify(xu^+ . xu), u, v);
F := unapply(simplify(xu^+ . xv), u, v);
G := unapply(simplify(xv^+ . xv), u, v);

proc (u, v) options operator, arrow; (a+b*cos(v))^2 end proc

proc (u, v) options operator, arrow; 0 end proc

proc (u, v) options operator, arrow; b^2 end proc

Look for geodesics of the form x(u, v(u)).  These account for all geodesics with the exception

of those corresponding to "u="constant.  The latter are plain circles so we don't need Maple

to calculate them.

 

From differential geometry, the length of  any curve of the form x(u, v(u)), u__1 < u and u < u__2 

is given by L = int(Upsilon(u), u = u__1 .. u__2) where:

Upsilon := sqrt(E(u, v(u)) + 2*F(u, v(u))*diff(v(u),u) + G(u,v(u))*(diff(v(u),u))^2);

((a+b*cos(v(u)))^2+b^2*(diff(v(u), u))^2)^(1/2)

The minimum length is obtained with the help from the Euler-Lagrange equation

which leads to a second order nonlinear differential equation in v(u):

EulerLagrange(Upsilon, u, v(u)):
remove(type, %, equation)[]:
isolate(%, diff(v(u), u, u)):
de := simplify(%);

diff(diff(v(u), u), u) = -(2*b^2*(diff(v(u), u))^2+(a+b*cos(v(u)))^2)*sin(v(u))/((a+b*cos(v(u)))*b)

Pick numbers for the torus's radii:

a, b := 5, 2;

5, 2

torus := plot3d(x(u,v), u=-Pi..Pi, v=-Pi..Pi,
        scaling=constrained, color="khaki", style=surface);

Example 1

 

Calculate a geodesic from u = 0, v = 0 to u = (1/2)*Pi,  v = (1/2)*Pi:

bc1 := v(0)=0,  v(Pi/2)=Pi/2;

v(0) = 0, v((1/2)*Pi) = (1/2)*Pi

dsol1 := dsolve({de, bc1}, numeric, output=operator);

[u = proc (u) local _res, _dat, _solnproc; option `Copyright (c) 1993 by the University of Waterloo. All rights reserved.`; _dat := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(21, {(1) = .0, (2) = 0.5860933145427747e-1, (3) = .11721866290855494, (4) = .17582799436283242, (5) = .23445728501980884, (6) = .29400251389637233, (7) = .35502246529707177, (8) = .4176324593904259, (9) = .48228601222277023, (10) = .5512774626633876, (11) = .6260306219686177, (12) = .7081249005896944, (13) = .7985125481567577, (14) = .8998553552891154, (15) = 1.0097294694706644, (16) = 1.1235608288918082, (17) = 1.236518680079433, (18) = 1.3442780572143578, (19) = 1.4354896847639433, (20) = 1.5083320801396727, (21) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(21, 2, {(1, 1) = .0, (1, 2) = 4.357909520225549, (2, 1) = .2533473418001706, (2, 2) = 4.253184219882809, (3, 1) = .4950045392990294, (3, 2) = 3.9682426260835926, (4, 1) = .7163213657367207, (4, 2) = 3.5718304902965725, (5, 1) = .912986520750112, (5, 2) = 3.1352819174892472, (6, 1) = 1.0866622862817927, (6, 2) = 2.7029203986640025, (7, 1) = 1.2390473250060285, (7, 2) = 2.2996023968537105, (8, 1) = 1.3714065523042172, (8, 2) = 1.9372281704148966, (9, 1) = 1.4859944998591417, (9, 2) = 1.6158898922071914, (10, 1) = 1.587137032220874, (10, 2) = 1.3241155689575193, (11, 1) = 1.6758207471908326, (11, 2) = 1.0559025112956482, (12, 1) = 1.7519378227487177, (12, 2) = .8049893321158691, (13, 1) = 1.8136775679360608, (13, 2) = .566571063410118, (14, 1) = 1.8589077269041003, (14, 2) = .33025980575675135, (15, 1) = 1.8821194017143614, (15, 2) = 0.9449920022222437e-1, (16, 1) = 1.879341830166544, (16, 2) = -.1435752401424998, (17, 1) = 1.8494009920056307, (17, 2) = -.3895492919942197, (18, 1) = 1.7937205716265703, (18, 2) = -.649482813775163, (19, 1) = 1.7232026399266667, (19, 2) = -.9032024763979258, (20, 1) = 1.649041988044007, (20, 2) = -1.138744988151322, (21, 1) = 1.5707963267949, (21, 2) = -1.37200094134623}, datatype = float[8], order = C_order); YP := Matrix(21, 2, {(1, 1) = 4.357909520225549, (1, 2) = -.0, (2, 1) = 4.253184219882809, (2, 2) = -3.48400814417279, (3, 1) = 3.9682426260835926, (3, 2) = -6.031898300951247, (4, 1) = 3.5718304902965725, (4, 2) = -7.285198339756213, (5, 1) = 3.1352819174892472, (5, 2) = -7.462358620559608, (6, 1) = 2.7029203986640025, (6, 2) = -6.985675492056729, (7, 1) = 2.2996023968537105, (7, 2) = -6.210452323447571, (8, 1) = 1.9372281704148966, (8, 2) = -5.371378792594195, (9, 1) = 1.6158898922071914, (9, 2) = -4.588579439987948, (10, 1) = 1.3241155689575193, (10, 2) = -3.8949934400656105, (11, 1) = 1.0559025112956482, (11, 2) = -3.3078240571262456, (12, 1) = .8049893321158691, (12, 2) = -2.831415429501529, (13, 1) = .566571063410118, (13, 2) = -2.46897776239132, (14, 1) = .33025980575675135, (14, 2) = -2.2189138501893897, (15, 1) = 0.9449920022222437e-1, (15, 2) = -2.0959796964461206, (16, 1) = -.1435752401424998, (16, 2) = -2.110492861185544, (17, 1) = -.3895492919942197, (17, 2) = -2.2703348506653094, (18, 1) = -.649482813775163, (18, 2) = -2.5835657026971863, (19, 1) = -.9032024763979258, (19, 2) = -3.0077240548867414, (20, 1) = -1.138744988151322, (20, 2) = -3.482022199297429, (21, 1) = -1.37200094134623, (21, 2) = -4.005909266443952}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(21, {(1) = .0, (2) = 0.5860933145427747e-1, (3) = .11721866290855494, (4) = .17582799436283242, (5) = .23445728501980884, (6) = .29400251389637233, (7) = .35502246529707177, (8) = .4176324593904259, (9) = .48228601222277023, (10) = .5512774626633876, (11) = .6260306219686177, (12) = .7081249005896944, (13) = .7985125481567577, (14) = .8998553552891154, (15) = 1.0097294694706644, (16) = 1.1235608288918082, (17) = 1.236518680079433, (18) = 1.3442780572143578, (19) = 1.4354896847639433, (20) = 1.5083320801396727, (21) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(21, 2, {(1, 1) = .0, (1, 2) = 0.6072503241630317e-7, (2, 1) = 0.1633853429871433e-7, (2, 2) = -0.17727261949849427e-7, (3, 1) = 0.61119342794151085e-8, (3, 2) = -0.8326391241592253e-7, (4, 1) = -0.8900614449991116e-8, (4, 2) = -0.5046791702922638e-7, (5, 1) = -0.12191319360321298e-7, (5, 2) = -0.2346020405227589e-7, (6, 1) = -0.9575722148775851e-8, (6, 2) = -0.25118370529491878e-7, (7, 1) = -0.7857479569879596e-8, (7, 2) = -0.28341312692007233e-7, (8, 1) = -0.854262175747852e-8, (8, 2) = -0.22349665722449066e-7, (9, 1) = -0.10412904856270964e-7, (9, 2) = -0.12056403907819441e-7, (10, 1) = -0.12496603030736918e-7, (10, 2) = -0.21735212793440864e-8, (11, 1) = -0.14343296103736601e-7, (11, 2) = 0.4884974297168228e-8, (12, 1) = -0.15809361149223226e-7, (12, 2) = 0.8424061973135961e-8, (13, 1) = -0.1684004558944395e-7, (13, 2) = 0.8468555558744448e-8, (14, 1) = -0.17663088227947315e-7, (14, 2) = 0.5752865457923729e-8, (15, 1) = -0.1799958791726186e-7, (15, 2) = 0.8947994861895889e-9, (16, 1) = -0.1754706929898934e-7, (16, 2) = -0.4029590222151902e-8, (17, 1) = -0.15600567545640277e-7, (17, 2) = -0.5508170053250888e-8, (18, 1) = -0.1101866414537828e-7, (18, 2) = 0.17737187382485602e-8, (19, 1) = -0.6481329226736263e-8, (19, 2) = 0.1388172656806454e-7, (20, 1) = -0.31379335721370494e-8, (20, 2) = 0.2492283863873428e-7, (21, 1) = .0, (21, 2) = 0.3612844847603369e-7}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[21] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(8.326391241592253e-8) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 21, [v(u), diff(v(u), u)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[21] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[21] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(21, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(21, 2, X, Y, outpoint, yout, L, V) end if; [u = outpoint, seq('[v(u), diff(v(u), u)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[21] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(8.326391241592253e-8) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 21, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[21] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[21] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(21, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(21, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893628625364698316, (2) = 36893628625364698756, (3) = 36893628625364698932}), (3) = [u, v(u), diff(v(u), u)], (4) = 0}); _solnproc := _dat[1]; if member(u, ["last", 'last']) then _res := _solnproc("last"); if type(_res, 'list') then return _res[1] end if elif type(u, `=`) and member(lhs(u), ["initial", 'initial']) then if type(rhs(u), 'list') then _res := _solnproc("initial" = [0, op(rhs(u))]) else _res := _solnproc("initial" = [1, rhs(u)]) end if; if type(_res, 'list') then return _res[1] end if elif u = "sysvars" then return _dat[3] end if; u end proc, v = proc (u) local res, data, solnproc, v, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](u) else outpoint := evalf(u) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(21, {(1) = .0, (2) = 0.5860933145427747e-1, (3) = .11721866290855494, (4) = .17582799436283242, (5) = .23445728501980884, (6) = .29400251389637233, (7) = .35502246529707177, (8) = .4176324593904259, (9) = .48228601222277023, (10) = .5512774626633876, (11) = .6260306219686177, (12) = .7081249005896944, (13) = .7985125481567577, (14) = .8998553552891154, (15) = 1.0097294694706644, (16) = 1.1235608288918082, (17) = 1.236518680079433, (18) = 1.3442780572143578, (19) = 1.4354896847639433, (20) = 1.5083320801396727, (21) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(21, 2, {(1, 1) = .0, (1, 2) = 4.357909520225549, (2, 1) = .2533473418001706, (2, 2) = 4.253184219882809, (3, 1) = .4950045392990294, (3, 2) = 3.9682426260835926, (4, 1) = .7163213657367207, (4, 2) = 3.5718304902965725, (5, 1) = .912986520750112, (5, 2) = 3.1352819174892472, (6, 1) = 1.0866622862817927, (6, 2) = 2.7029203986640025, (7, 1) = 1.2390473250060285, (7, 2) = 2.2996023968537105, (8, 1) = 1.3714065523042172, (8, 2) = 1.9372281704148966, (9, 1) = 1.4859944998591417, (9, 2) = 1.6158898922071914, (10, 1) = 1.587137032220874, (10, 2) = 1.3241155689575193, (11, 1) = 1.6758207471908326, (11, 2) = 1.0559025112956482, (12, 1) = 1.7519378227487177, (12, 2) = .8049893321158691, (13, 1) = 1.8136775679360608, (13, 2) = .566571063410118, (14, 1) = 1.8589077269041003, (14, 2) = .33025980575675135, (15, 1) = 1.8821194017143614, (15, 2) = 0.9449920022222437e-1, (16, 1) = 1.879341830166544, (16, 2) = -.1435752401424998, (17, 1) = 1.8494009920056307, (17, 2) = -.3895492919942197, (18, 1) = 1.7937205716265703, (18, 2) = -.649482813775163, (19, 1) = 1.7232026399266667, (19, 2) = -.9032024763979258, (20, 1) = 1.649041988044007, (20, 2) = -1.138744988151322, (21, 1) = 1.5707963267949, (21, 2) = -1.37200094134623}, datatype = float[8], order = C_order); YP := Matrix(21, 2, {(1, 1) = 4.357909520225549, (1, 2) = -.0, (2, 1) = 4.253184219882809, (2, 2) = -3.48400814417279, (3, 1) = 3.9682426260835926, (3, 2) = -6.031898300951247, (4, 1) = 3.5718304902965725, (4, 2) = -7.285198339756213, (5, 1) = 3.1352819174892472, (5, 2) = -7.462358620559608, (6, 1) = 2.7029203986640025, (6, 2) = -6.985675492056729, (7, 1) = 2.2996023968537105, (7, 2) = -6.210452323447571, (8, 1) = 1.9372281704148966, (8, 2) = -5.371378792594195, (9, 1) = 1.6158898922071914, (9, 2) = -4.588579439987948, (10, 1) = 1.3241155689575193, (10, 2) = -3.8949934400656105, (11, 1) = 1.0559025112956482, (11, 2) = -3.3078240571262456, (12, 1) = .8049893321158691, (12, 2) = -2.831415429501529, (13, 1) = .566571063410118, (13, 2) = -2.46897776239132, (14, 1) = .33025980575675135, (14, 2) = -2.2189138501893897, (15, 1) = 0.9449920022222437e-1, (15, 2) = -2.0959796964461206, (16, 1) = -.1435752401424998, (16, 2) = -2.110492861185544, (17, 1) = -.3895492919942197, (17, 2) = -2.2703348506653094, (18, 1) = -.649482813775163, (18, 2) = -2.5835657026971863, (19, 1) = -.9032024763979258, (19, 2) = -3.0077240548867414, (20, 1) = -1.138744988151322, (20, 2) = -3.482022199297429, (21, 1) = -1.37200094134623, (21, 2) = -4.005909266443952}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(21, {(1) = .0, (2) = 0.5860933145427747e-1, (3) = .11721866290855494, (4) = .17582799436283242, (5) = .23445728501980884, (6) = .29400251389637233, (7) = .35502246529707177, (8) = .4176324593904259, (9) = .48228601222277023, (10) = .5512774626633876, (11) = .6260306219686177, (12) = .7081249005896944, (13) = .7985125481567577, (14) = .8998553552891154, (15) = 1.0097294694706644, (16) = 1.1235608288918082, (17) = 1.236518680079433, (18) = 1.3442780572143578, (19) = 1.4354896847639433, (20) = 1.5083320801396727, (21) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(21, 2, {(1, 1) = .0, (1, 2) = 0.6072503241630317e-7, (2, 1) = 0.1633853429871433e-7, (2, 2) = -0.17727261949849427e-7, (3, 1) = 0.61119342794151085e-8, (3, 2) = -0.8326391241592253e-7, (4, 1) = -0.8900614449991116e-8, (4, 2) = -0.5046791702922638e-7, (5, 1) = -0.12191319360321298e-7, (5, 2) = -0.2346020405227589e-7, (6, 1) = -0.9575722148775851e-8, (6, 2) = -0.25118370529491878e-7, (7, 1) = -0.7857479569879596e-8, (7, 2) = -0.28341312692007233e-7, (8, 1) = -0.854262175747852e-8, (8, 2) = -0.22349665722449066e-7, (9, 1) = -0.10412904856270964e-7, (9, 2) = -0.12056403907819441e-7, (10, 1) = -0.12496603030736918e-7, (10, 2) = -0.21735212793440864e-8, (11, 1) = -0.14343296103736601e-7, (11, 2) = 0.4884974297168228e-8, (12, 1) = -0.15809361149223226e-7, (12, 2) = 0.8424061973135961e-8, (13, 1) = -0.1684004558944395e-7, (13, 2) = 0.8468555558744448e-8, (14, 1) = -0.17663088227947315e-7, (14, 2) = 0.5752865457923729e-8, (15, 1) = -0.1799958791726186e-7, (15, 2) = 0.8947994861895889e-9, (16, 1) = -0.1754706929898934e-7, (16, 2) = -0.4029590222151902e-8, (17, 1) = -0.15600567545640277e-7, (17, 2) = -0.5508170053250888e-8, (18, 1) = -0.1101866414537828e-7, (18, 2) = 0.17737187382485602e-8, (19, 1) = -0.6481329226736263e-8, (19, 2) = 0.1388172656806454e-7, (20, 1) = -0.31379335721370494e-8, (20, 2) = 0.2492283863873428e-7, (21, 1) = .0, (21, 2) = 0.3612844847603369e-7}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[21] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(8.326391241592253e-8) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 21, [v(u), diff(v(u), u)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[21] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[21] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(21, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(21, 2, X, Y, outpoint, yout, L, V) end if; [u = outpoint, seq('[v(u), diff(v(u), u)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[21] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(8.326391241592253e-8) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 21, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[21] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[21] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(21, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(21, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893628625364698316, (2) = 36893628625364698756, (3) = 36893628625364698932}), (3) = [u, v(u), diff(v(u), u)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(u) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(u) else v := pointto(data[2][2]); return ('v')(u) end if end if; try res := solnproc(outpoint); res[2] catch: error  end try end proc, D(v) = proc (u) local res, data, solnproc, `D(v)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](u) else outpoint := evalf(u) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(21, {(1) = .0, (2) = 0.5860933145427747e-1, (3) = .11721866290855494, (4) = .17582799436283242, (5) = .23445728501980884, (6) = .29400251389637233, (7) = .35502246529707177, (8) = .4176324593904259, (9) = .48228601222277023, (10) = .5512774626633876, (11) = .6260306219686177, (12) = .7081249005896944, (13) = .7985125481567577, (14) = .8998553552891154, (15) = 1.0097294694706644, (16) = 1.1235608288918082, (17) = 1.236518680079433, (18) = 1.3442780572143578, (19) = 1.4354896847639433, (20) = 1.5083320801396727, (21) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(21, 2, {(1, 1) = .0, (1, 2) = 4.357909520225549, (2, 1) = .2533473418001706, (2, 2) = 4.253184219882809, (3, 1) = .4950045392990294, (3, 2) = 3.9682426260835926, (4, 1) = .7163213657367207, (4, 2) = 3.5718304902965725, (5, 1) = .912986520750112, (5, 2) = 3.1352819174892472, (6, 1) = 1.0866622862817927, (6, 2) = 2.7029203986640025, (7, 1) = 1.2390473250060285, (7, 2) = 2.2996023968537105, (8, 1) = 1.3714065523042172, (8, 2) = 1.9372281704148966, (9, 1) = 1.4859944998591417, (9, 2) = 1.6158898922071914, (10, 1) = 1.587137032220874, (10, 2) = 1.3241155689575193, (11, 1) = 1.6758207471908326, (11, 2) = 1.0559025112956482, (12, 1) = 1.7519378227487177, (12, 2) = .8049893321158691, (13, 1) = 1.8136775679360608, (13, 2) = .566571063410118, (14, 1) = 1.8589077269041003, (14, 2) = .33025980575675135, (15, 1) = 1.8821194017143614, (15, 2) = 0.9449920022222437e-1, (16, 1) = 1.879341830166544, (16, 2) = -.1435752401424998, (17, 1) = 1.8494009920056307, (17, 2) = -.3895492919942197, (18, 1) = 1.7937205716265703, (18, 2) = -.649482813775163, (19, 1) = 1.7232026399266667, (19, 2) = -.9032024763979258, (20, 1) = 1.649041988044007, (20, 2) = -1.138744988151322, (21, 1) = 1.5707963267949, (21, 2) = -1.37200094134623}, datatype = float[8], order = C_order); YP := Matrix(21, 2, {(1, 1) = 4.357909520225549, (1, 2) = -.0, (2, 1) = 4.253184219882809, (2, 2) = -3.48400814417279, (3, 1) = 3.9682426260835926, (3, 2) = -6.031898300951247, (4, 1) = 3.5718304902965725, (4, 2) = -7.285198339756213, (5, 1) = 3.1352819174892472, (5, 2) = -7.462358620559608, (6, 1) = 2.7029203986640025, (6, 2) = -6.985675492056729, (7, 1) = 2.2996023968537105, (7, 2) = -6.210452323447571, (8, 1) = 1.9372281704148966, (8, 2) = -5.371378792594195, (9, 1) = 1.6158898922071914, (9, 2) = -4.588579439987948, (10, 1) = 1.3241155689575193, (10, 2) = -3.8949934400656105, (11, 1) = 1.0559025112956482, (11, 2) = -3.3078240571262456, (12, 1) = .8049893321158691, (12, 2) = -2.831415429501529, (13, 1) = .566571063410118, (13, 2) = -2.46897776239132, (14, 1) = .33025980575675135, (14, 2) = -2.2189138501893897, (15, 1) = 0.9449920022222437e-1, (15, 2) = -2.0959796964461206, (16, 1) = -.1435752401424998, (16, 2) = -2.110492861185544, (17, 1) = -.3895492919942197, (17, 2) = -2.2703348506653094, (18, 1) = -.649482813775163, (18, 2) = -2.5835657026971863, (19, 1) = -.9032024763979258, (19, 2) = -3.0077240548867414, (20, 1) = -1.138744988151322, (20, 2) = -3.482022199297429, (21, 1) = -1.37200094134623, (21, 2) = -4.005909266443952}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(21, {(1) = .0, (2) = 0.5860933145427747e-1, (3) = .11721866290855494, (4) = .17582799436283242, (5) = .23445728501980884, (6) = .29400251389637233, (7) = .35502246529707177, (8) = .4176324593904259, (9) = .48228601222277023, (10) = .5512774626633876, (11) = .6260306219686177, (12) = .7081249005896944, (13) = .7985125481567577, (14) = .8998553552891154, (15) = 1.0097294694706644, (16) = 1.1235608288918082, (17) = 1.236518680079433, (18) = 1.3442780572143578, (19) = 1.4354896847639433, (20) = 1.5083320801396727, (21) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(21, 2, {(1, 1) = .0, (1, 2) = 0.6072503241630317e-7, (2, 1) = 0.1633853429871433e-7, (2, 2) = -0.17727261949849427e-7, (3, 1) = 0.61119342794151085e-8, (3, 2) = -0.8326391241592253e-7, (4, 1) = -0.8900614449991116e-8, (4, 2) = -0.5046791702922638e-7, (5, 1) = -0.12191319360321298e-7, (5, 2) = -0.2346020405227589e-7, (6, 1) = -0.9575722148775851e-8, (6, 2) = -0.25118370529491878e-7, (7, 1) = -0.7857479569879596e-8, (7, 2) = -0.28341312692007233e-7, (8, 1) = -0.854262175747852e-8, (8, 2) = -0.22349665722449066e-7, (9, 1) = -0.10412904856270964e-7, (9, 2) = -0.12056403907819441e-7, (10, 1) = -0.12496603030736918e-7, (10, 2) = -0.21735212793440864e-8, (11, 1) = -0.14343296103736601e-7, (11, 2) = 0.4884974297168228e-8, (12, 1) = -0.15809361149223226e-7, (12, 2) = 0.8424061973135961e-8, (13, 1) = -0.1684004558944395e-7, (13, 2) = 0.8468555558744448e-8, (14, 1) = -0.17663088227947315e-7, (14, 2) = 0.5752865457923729e-8, (15, 1) = -0.1799958791726186e-7, (15, 2) = 0.8947994861895889e-9, (16, 1) = -0.1754706929898934e-7, (16, 2) = -0.4029590222151902e-8, (17, 1) = -0.15600567545640277e-7, (17, 2) = -0.5508170053250888e-8, (18, 1) = -0.1101866414537828e-7, (18, 2) = 0.17737187382485602e-8, (19, 1) = -0.6481329226736263e-8, (19, 2) = 0.1388172656806454e-7, (20, 1) = -0.31379335721370494e-8, (20, 2) = 0.2492283863873428e-7, (21, 1) = .0, (21, 2) = 0.3612844847603369e-7}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[21] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(8.326391241592253e-8) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 21, [v(u), diff(v(u), u)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[21] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[21] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(21, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(21, 2, X, Y, outpoint, yout, L, V) end if; [u = outpoint, seq('[v(u), diff(v(u), u)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[21] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(8.326391241592253e-8) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 21, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[21] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[21] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(21, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(21, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893628625364698316, (2) = 36893628625364698756, (3) = 36893628625364698932}), (3) = [u, v(u), diff(v(u), u)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(u) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(u) else `D(v)` := pointto(data[2][3]); return ('`D(v)`')(u) end if end if; try res := solnproc(outpoint); res[3] catch: error  end try end proc]

display(
        torus,
        tubeplot([seq(eval(x(u, v(u)), dsol1))], u=0..Pi/2, color=red, radius=0.1),
        pointplot3d(eval([x(0,v(0)),x(Pi/2,v(Pi/2))], dsol1), symbol=solidsphere, symbolsize=20, color="Orange"),
lightmodel=light4, thickness=5, orientation=[-5,75,0], size=[700,400],
style=surface, axes=none);

 

Example 2

 

bc2 := v(0)=0,  v(Pi/2)=Pi;

v(0) = 0, v((1/2)*Pi) = Pi

dsol2 := dsolve({de, bc2}, numeric, output=operator);

[u = proc (u) local _res, _dat, _solnproc; option `Copyright (c) 1993 by the University of Waterloo. All rights reserved.`; _dat := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(25, {(1) = .0, (2) = 0.3556697983665059e-1, (3) = 0.7150815650209673e-1, (4) = .1078355952208751, (5) = .14456202386531472, (6) = .18170088505495013, (7) = .2192663936438809, (8) = .25772582968519775, (9) = .2979698369946872, (10) = .34028667559059855, (11) = .38503401227598166, (12) = .43268598844062967, (13) = .48418267682069066, (14) = .54178398151824, (15) = .6084908129577877, (16) = .6905705623174822, (17) = .7936582413926776, (18) = .9362490342852545, (19) = 1.1290955386275305, (20) = 1.2785289405368818, (21) = 1.3762683057594027, (22) = 1.4410821559755675, (23) = 1.4911439441371346, (24) = 1.5334604576293163, (25) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(25, 2, {(1, 1) = .0, (1, 2) = 8.027222261980723, (2, 1) = .2831190340450847, (2, 2) = 7.828369059489753, (3, 1) = .5555864658560054, (3, 2) = 7.287670355233425, (4, 1) = .8071856825371913, (4, 2) = 6.54481306582631, (5, 1) = 1.0328331222442264, (5, 2) = 5.745156668353998, (6, 1) = 1.2318715807045222, (6, 2) = 4.987033344028576, (7, 1) = 1.4062899344379456, (7, 2) = 4.316682182254274, (8, 1) = 1.5608590578898303, (8, 2) = 3.739193866869814, (9, 1) = 1.7009934741789976, (9, 2) = 3.241862801797417, (10, 1) = 1.8288761198346395, (10, 2) = 2.817246508505084, (11, 1) = 1.9465497589776795, (11, 2) = 2.455373052357135, (12, 1) = 2.0559118912274252, (12, 2) = 2.146059224600939, (13, 1) = 2.1592833618063074, (13, 2) = 1.8786440703412244, (14, 1) = 2.260381800745741, (14, 2) = 1.6409272186274388, (15, 1) = 2.362338845054942, (15, 2) = 1.4249780044463283, (16, 1) = 2.4705572534383973, (16, 2) = 1.2215356731044336, (17, 1) = 2.5862348892169664, (17, 2) = 1.0329309045427477, (18, 1) = 2.7197502962411266, (18, 2) = .8522354096629391, (19, 1) = 2.868097308964122, (19, 2) = .7002166019075773, (20, 1) = 2.9670989492898685, (20, 2) = .6306046195751053, (21, 1) = 3.0272505993270076, (21, 2) = .6023260373483883, (22, 1) = 3.065868563957721, (22, 2) = .5901748294236376, (23, 1) = 3.095251805141905, (23, 2) = .5841893523046803, (24, 1) = 3.11990600006039, (24, 2) = .5813793052108006, (25, 1) = 3.14159265358979, (25, 2) = .5805900104831727}, datatype = float[8], order = C_order); YP := Matrix(25, 2, {(1, 1) = 8.027222261980723, (1, 2) = -.0, (2, 1) = 7.828369059489753, (2, 2) = -10.861805181334308, (3, 1) = 7.287670355233425, (3, 2) = -18.492634875073744, (4, 1) = 6.54481306582631, (4, 2) = -21.694990694475745, (5, 1) = 5.745156668353998, (5, 2) = -21.40568916672294, (6, 1) = 4.987033344028576, (6, 2) = -19.233324103734176, (7, 1) = 4.316682182254274, (7, 2) = -16.42945105476428, (8, 1) = 3.739193866869814, (8, 2) = -13.650236112103359, (9, 1) = 3.241862801797417, (9, 2) = -11.143337685208598, (10, 1) = 2.817246508505084, (10, 2) = -9.007662429827185, (11, 1) = 2.455373052357135, (11, 2) = -7.242681944771625, (12, 1) = 2.146059224600939, (12, 2) = -5.805737354677115, (13, 1) = 1.8786440703412244, (13, 2) = -4.636510741573245, (14, 1) = 1.6409272186274388, (14, 2) = -3.6671563351547207, (15, 1) = 1.4249780044463283, (15, 2) = -2.852577215638926, (16, 1) = 1.2215356731044336, (16, 2) = -2.1483661147204827, (17, 1) = 1.0329309045427477, (17, 2) = -1.5518631600869446, (18, 1) = .8522354096629391, (18, 2) = -1.024669368486231, (19, 1) = .7002166019075773, (19, 2) = -.5874907987071298, (20, 1) = .6306046195751053, (20, 2) = -.35417872498610686, (21, 1) = .6023260373483883, (21, 2) = -.22683550784375403, (22, 1) = .5901748294236376, (22, 2) = -.14876072185358538, (23, 1) = .5841893523046803, (23, 2) = -0.9060027226914852e-1, (24, 1) = .5813793052108006, (24, 2) = -0.4230373846316707e-1, (25, 1) = .5805900104831727, (25, 2) = -0.6298834938184995e-14}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(25, {(1) = .0, (2) = 0.3556697983665059e-1, (3) = 0.7150815650209673e-1, (4) = .1078355952208751, (5) = .14456202386531472, (6) = .18170088505495013, (7) = .2192663936438809, (8) = .25772582968519775, (9) = .2979698369946872, (10) = .34028667559059855, (11) = .38503401227598166, (12) = .43268598844062967, (13) = .48418267682069066, (14) = .54178398151824, (15) = .6084908129577877, (16) = .6905705623174822, (17) = .7936582413926776, (18) = .9362490342852545, (19) = 1.1290955386275305, (20) = 1.2785289405368818, (21) = 1.3762683057594027, (22) = 1.4410821559755675, (23) = 1.4911439441371346, (24) = 1.5334604576293163, (25) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(25, 2, {(1, 1) = .0, (1, 2) = 0.31500831778913094e-6, (2, 1) = 0.3132220020535465e-7, (2, 2) = 0.7779131439750735e-7, (3, 1) = 0.14325613236197187e-7, (3, 2) = -0.6898540876289522e-7, (4, 1) = -0.6036355453398498e-8, (4, 2) = 0.7943001698758059e-7, (5, 1) = -0.13260007889026392e-8, (5, 2) = 0.11756415179265621e-6, (6, 1) = 0.1071471554168767e-7, (6, 2) = 0.44460301809323215e-7, (7, 1) = 0.16948724685756332e-7, (7, 2) = -0.6994714895790386e-8, (8, 1) = 0.1782055631368677e-7, (8, 2) = -0.1641681279404671e-7, (9, 1) = 0.16393950975769278e-7, (9, 2) = -0.58427989726364065e-8, (10, 1) = 0.14618894539761003e-7, (10, 2) = 0.7611526601257115e-8, (11, 1) = 0.13363200796132462e-7, (11, 2) = 0.16937803808645205e-7, (12, 1) = 0.12801606379592921e-7, (12, 2) = 0.21469959634400602e-7, (13, 1) = 0.12794426509551367e-7, (13, 2) = 0.22808086897112244e-7, (14, 1) = 0.13080732166085607e-7, (14, 2) = 0.22688679611190916e-7, (15, 1) = 0.13483594578904676e-7, (15, 2) = 0.2185857499871233e-7, (16, 1) = 0.13492144691744485e-7, (16, 2) = 0.2072575098426527e-7, (17, 1) = 0.12840479015099201e-7, (17, 2) = 0.17970028302554435e-7, (18, 1) = 0.720289485656478e-8, (18, 2) = 0.11283105136137962e-7, (19, 1) = -0.10626354523447358e-8, (19, 2) = -0.7464659107819674e-8, (20, 1) = 0.19375865427224214e-8, (20, 2) = -0.1047570220567349e-7, (21, 1) = 0.15016966694503165e-8, (21, 2) = -0.914149161086985e-8, (22, 1) = 0.10081859027200914e-8, (22, 2) = -0.848749960193092e-8, (23, 1) = 0.618147262744349e-9, (23, 2) = -0.8172877515951791e-8, (24, 1) = 0.2897545785236149e-9, (24, 2) = -0.8027811845254448e-8, (25, 1) = .0, (25, 2) = -0.7987456326182811e-8}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[25] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(3.1500831778913094e-7) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 25, [v(u), diff(v(u), u)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[25] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[25] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(25, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(25, 2, X, Y, outpoint, yout, L, V) end if; [u = outpoint, seq('[v(u), diff(v(u), u)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[25] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(3.1500831778913094e-7) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 25, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[25] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[25] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(25, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(25, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893628625364672284, (2) = 36893628625364664316, (3) = 36893628625364664492}), (3) = [u, v(u), diff(v(u), u)], (4) = 0}); _solnproc := _dat[1]; if member(u, ["last", 'last']) then _res := _solnproc("last"); if type(_res, 'list') then return _res[1] end if elif type(u, `=`) and member(lhs(u), ["initial", 'initial']) then if type(rhs(u), 'list') then _res := _solnproc("initial" = [0, op(rhs(u))]) else _res := _solnproc("initial" = [1, rhs(u)]) end if; if type(_res, 'list') then return _res[1] end if elif u = "sysvars" then return _dat[3] end if; u end proc, v = proc (u) local res, data, solnproc, v, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](u) else outpoint := evalf(u) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(25, {(1) = .0, (2) = 0.3556697983665059e-1, (3) = 0.7150815650209673e-1, (4) = .1078355952208751, (5) = .14456202386531472, (6) = .18170088505495013, (7) = .2192663936438809, (8) = .25772582968519775, (9) = .2979698369946872, (10) = .34028667559059855, (11) = .38503401227598166, (12) = .43268598844062967, (13) = .48418267682069066, (14) = .54178398151824, (15) = .6084908129577877, (16) = .6905705623174822, (17) = .7936582413926776, (18) = .9362490342852545, (19) = 1.1290955386275305, (20) = 1.2785289405368818, (21) = 1.3762683057594027, (22) = 1.4410821559755675, (23) = 1.4911439441371346, (24) = 1.5334604576293163, (25) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(25, 2, {(1, 1) = .0, (1, 2) = 8.027222261980723, (2, 1) = .2831190340450847, (2, 2) = 7.828369059489753, (3, 1) = .5555864658560054, (3, 2) = 7.287670355233425, (4, 1) = .8071856825371913, (4, 2) = 6.54481306582631, (5, 1) = 1.0328331222442264, (5, 2) = 5.745156668353998, (6, 1) = 1.2318715807045222, (6, 2) = 4.987033344028576, (7, 1) = 1.4062899344379456, (7, 2) = 4.316682182254274, (8, 1) = 1.5608590578898303, (8, 2) = 3.739193866869814, (9, 1) = 1.7009934741789976, (9, 2) = 3.241862801797417, (10, 1) = 1.8288761198346395, (10, 2) = 2.817246508505084, (11, 1) = 1.9465497589776795, (11, 2) = 2.455373052357135, (12, 1) = 2.0559118912274252, (12, 2) = 2.146059224600939, (13, 1) = 2.1592833618063074, (13, 2) = 1.8786440703412244, (14, 1) = 2.260381800745741, (14, 2) = 1.6409272186274388, (15, 1) = 2.362338845054942, (15, 2) = 1.4249780044463283, (16, 1) = 2.4705572534383973, (16, 2) = 1.2215356731044336, (17, 1) = 2.5862348892169664, (17, 2) = 1.0329309045427477, (18, 1) = 2.7197502962411266, (18, 2) = .8522354096629391, (19, 1) = 2.868097308964122, (19, 2) = .7002166019075773, (20, 1) = 2.9670989492898685, (20, 2) = .6306046195751053, (21, 1) = 3.0272505993270076, (21, 2) = .6023260373483883, (22, 1) = 3.065868563957721, (22, 2) = .5901748294236376, (23, 1) = 3.095251805141905, (23, 2) = .5841893523046803, (24, 1) = 3.11990600006039, (24, 2) = .5813793052108006, (25, 1) = 3.14159265358979, (25, 2) = .5805900104831727}, datatype = float[8], order = C_order); YP := Matrix(25, 2, {(1, 1) = 8.027222261980723, (1, 2) = -.0, (2, 1) = 7.828369059489753, (2, 2) = -10.861805181334308, (3, 1) = 7.287670355233425, (3, 2) = -18.492634875073744, (4, 1) = 6.54481306582631, (4, 2) = -21.694990694475745, (5, 1) = 5.745156668353998, (5, 2) = -21.40568916672294, (6, 1) = 4.987033344028576, (6, 2) = -19.233324103734176, (7, 1) = 4.316682182254274, (7, 2) = -16.42945105476428, (8, 1) = 3.739193866869814, (8, 2) = -13.650236112103359, (9, 1) = 3.241862801797417, (9, 2) = -11.143337685208598, (10, 1) = 2.817246508505084, (10, 2) = -9.007662429827185, (11, 1) = 2.455373052357135, (11, 2) = -7.242681944771625, (12, 1) = 2.146059224600939, (12, 2) = -5.805737354677115, (13, 1) = 1.8786440703412244, (13, 2) = -4.636510741573245, (14, 1) = 1.6409272186274388, (14, 2) = -3.6671563351547207, (15, 1) = 1.4249780044463283, (15, 2) = -2.852577215638926, (16, 1) = 1.2215356731044336, (16, 2) = -2.1483661147204827, (17, 1) = 1.0329309045427477, (17, 2) = -1.5518631600869446, (18, 1) = .8522354096629391, (18, 2) = -1.024669368486231, (19, 1) = .7002166019075773, (19, 2) = -.5874907987071298, (20, 1) = .6306046195751053, (20, 2) = -.35417872498610686, (21, 1) = .6023260373483883, (21, 2) = -.22683550784375403, (22, 1) = .5901748294236376, (22, 2) = -.14876072185358538, (23, 1) = .5841893523046803, (23, 2) = -0.9060027226914852e-1, (24, 1) = .5813793052108006, (24, 2) = -0.4230373846316707e-1, (25, 1) = .5805900104831727, (25, 2) = -0.6298834938184995e-14}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(25, {(1) = .0, (2) = 0.3556697983665059e-1, (3) = 0.7150815650209673e-1, (4) = .1078355952208751, (5) = .14456202386531472, (6) = .18170088505495013, (7) = .2192663936438809, (8) = .25772582968519775, (9) = .2979698369946872, (10) = .34028667559059855, (11) = .38503401227598166, (12) = .43268598844062967, (13) = .48418267682069066, (14) = .54178398151824, (15) = .6084908129577877, (16) = .6905705623174822, (17) = .7936582413926776, (18) = .9362490342852545, (19) = 1.1290955386275305, (20) = 1.2785289405368818, (21) = 1.3762683057594027, (22) = 1.4410821559755675, (23) = 1.4911439441371346, (24) = 1.5334604576293163, (25) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(25, 2, {(1, 1) = .0, (1, 2) = 0.31500831778913094e-6, (2, 1) = 0.3132220020535465e-7, (2, 2) = 0.7779131439750735e-7, (3, 1) = 0.14325613236197187e-7, (3, 2) = -0.6898540876289522e-7, (4, 1) = -0.6036355453398498e-8, (4, 2) = 0.7943001698758059e-7, (5, 1) = -0.13260007889026392e-8, (5, 2) = 0.11756415179265621e-6, (6, 1) = 0.1071471554168767e-7, (6, 2) = 0.44460301809323215e-7, (7, 1) = 0.16948724685756332e-7, (7, 2) = -0.6994714895790386e-8, (8, 1) = 0.1782055631368677e-7, (8, 2) = -0.1641681279404671e-7, (9, 1) = 0.16393950975769278e-7, (9, 2) = -0.58427989726364065e-8, (10, 1) = 0.14618894539761003e-7, (10, 2) = 0.7611526601257115e-8, (11, 1) = 0.13363200796132462e-7, (11, 2) = 0.16937803808645205e-7, (12, 1) = 0.12801606379592921e-7, (12, 2) = 0.21469959634400602e-7, (13, 1) = 0.12794426509551367e-7, (13, 2) = 0.22808086897112244e-7, (14, 1) = 0.13080732166085607e-7, (14, 2) = 0.22688679611190916e-7, (15, 1) = 0.13483594578904676e-7, (15, 2) = 0.2185857499871233e-7, (16, 1) = 0.13492144691744485e-7, (16, 2) = 0.2072575098426527e-7, (17, 1) = 0.12840479015099201e-7, (17, 2) = 0.17970028302554435e-7, (18, 1) = 0.720289485656478e-8, (18, 2) = 0.11283105136137962e-7, (19, 1) = -0.10626354523447358e-8, (19, 2) = -0.7464659107819674e-8, (20, 1) = 0.19375865427224214e-8, (20, 2) = -0.1047570220567349e-7, (21, 1) = 0.15016966694503165e-8, (21, 2) = -0.914149161086985e-8, (22, 1) = 0.10081859027200914e-8, (22, 2) = -0.848749960193092e-8, (23, 1) = 0.618147262744349e-9, (23, 2) = -0.8172877515951791e-8, (24, 1) = 0.2897545785236149e-9, (24, 2) = -0.8027811845254448e-8, (25, 1) = .0, (25, 2) = -0.7987456326182811e-8}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[25] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(3.1500831778913094e-7) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 25, [v(u), diff(v(u), u)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[25] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[25] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(25, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(25, 2, X, Y, outpoint, yout, L, V) end if; [u = outpoint, seq('[v(u), diff(v(u), u)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[25] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(3.1500831778913094e-7) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 25, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[25] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[25] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(25, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(25, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893628625364672284, (2) = 36893628625364664316, (3) = 36893628625364664492}), (3) = [u, v(u), diff(v(u), u)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(u) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(u) else v := pointto(data[2][2]); return ('v')(u) end if end if; try res := solnproc(outpoint); res[2] catch: error  end try end proc, D(v) = proc (u) local res, data, solnproc, `D(v)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](u) else outpoint := evalf(u) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(25, {(1) = .0, (2) = 0.3556697983665059e-1, (3) = 0.7150815650209673e-1, (4) = .1078355952208751, (5) = .14456202386531472, (6) = .18170088505495013, (7) = .2192663936438809, (8) = .25772582968519775, (9) = .2979698369946872, (10) = .34028667559059855, (11) = .38503401227598166, (12) = .43268598844062967, (13) = .48418267682069066, (14) = .54178398151824, (15) = .6084908129577877, (16) = .6905705623174822, (17) = .7936582413926776, (18) = .9362490342852545, (19) = 1.1290955386275305, (20) = 1.2785289405368818, (21) = 1.3762683057594027, (22) = 1.4410821559755675, (23) = 1.4911439441371346, (24) = 1.5334604576293163, (25) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(25, 2, {(1, 1) = .0, (1, 2) = 8.027222261980723, (2, 1) = .2831190340450847, (2, 2) = 7.828369059489753, (3, 1) = .5555864658560054, (3, 2) = 7.287670355233425, (4, 1) = .8071856825371913, (4, 2) = 6.54481306582631, (5, 1) = 1.0328331222442264, (5, 2) = 5.745156668353998, (6, 1) = 1.2318715807045222, (6, 2) = 4.987033344028576, (7, 1) = 1.4062899344379456, (7, 2) = 4.316682182254274, (8, 1) = 1.5608590578898303, (8, 2) = 3.739193866869814, (9, 1) = 1.7009934741789976, (9, 2) = 3.241862801797417, (10, 1) = 1.8288761198346395, (10, 2) = 2.817246508505084, (11, 1) = 1.9465497589776795, (11, 2) = 2.455373052357135, (12, 1) = 2.0559118912274252, (12, 2) = 2.146059224600939, (13, 1) = 2.1592833618063074, (13, 2) = 1.8786440703412244, (14, 1) = 2.260381800745741, (14, 2) = 1.6409272186274388, (15, 1) = 2.362338845054942, (15, 2) = 1.4249780044463283, (16, 1) = 2.4705572534383973, (16, 2) = 1.2215356731044336, (17, 1) = 2.5862348892169664, (17, 2) = 1.0329309045427477, (18, 1) = 2.7197502962411266, (18, 2) = .8522354096629391, (19, 1) = 2.868097308964122, (19, 2) = .7002166019075773, (20, 1) = 2.9670989492898685, (20, 2) = .6306046195751053, (21, 1) = 3.0272505993270076, (21, 2) = .6023260373483883, (22, 1) = 3.065868563957721, (22, 2) = .5901748294236376, (23, 1) = 3.095251805141905, (23, 2) = .5841893523046803, (24, 1) = 3.11990600006039, (24, 2) = .5813793052108006, (25, 1) = 3.14159265358979, (25, 2) = .5805900104831727}, datatype = float[8], order = C_order); YP := Matrix(25, 2, {(1, 1) = 8.027222261980723, (1, 2) = -.0, (2, 1) = 7.828369059489753, (2, 2) = -10.861805181334308, (3, 1) = 7.287670355233425, (3, 2) = -18.492634875073744, (4, 1) = 6.54481306582631, (4, 2) = -21.694990694475745, (5, 1) = 5.745156668353998, (5, 2) = -21.40568916672294, (6, 1) = 4.987033344028576, (6, 2) = -19.233324103734176, (7, 1) = 4.316682182254274, (7, 2) = -16.42945105476428, (8, 1) = 3.739193866869814, (8, 2) = -13.650236112103359, (9, 1) = 3.241862801797417, (9, 2) = -11.143337685208598, (10, 1) = 2.817246508505084, (10, 2) = -9.007662429827185, (11, 1) = 2.455373052357135, (11, 2) = -7.242681944771625, (12, 1) = 2.146059224600939, (12, 2) = -5.805737354677115, (13, 1) = 1.8786440703412244, (13, 2) = -4.636510741573245, (14, 1) = 1.6409272186274388, (14, 2) = -3.6671563351547207, (15, 1) = 1.4249780044463283, (15, 2) = -2.852577215638926, (16, 1) = 1.2215356731044336, (16, 2) = -2.1483661147204827, (17, 1) = 1.0329309045427477, (17, 2) = -1.5518631600869446, (18, 1) = .8522354096629391, (18, 2) = -1.024669368486231, (19, 1) = .7002166019075773, (19, 2) = -.5874907987071298, (20, 1) = .6306046195751053, (20, 2) = -.35417872498610686, (21, 1) = .6023260373483883, (21, 2) = -.22683550784375403, (22, 1) = .5901748294236376, (22, 2) = -.14876072185358538, (23, 1) = .5841893523046803, (23, 2) = -0.9060027226914852e-1, (24, 1) = .5813793052108006, (24, 2) = -0.4230373846316707e-1, (25, 1) = .5805900104831727, (25, 2) = -0.6298834938184995e-14}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(25, {(1) = .0, (2) = 0.3556697983665059e-1, (3) = 0.7150815650209673e-1, (4) = .1078355952208751, (5) = .14456202386531472, (6) = .18170088505495013, (7) = .2192663936438809, (8) = .25772582968519775, (9) = .2979698369946872, (10) = .34028667559059855, (11) = .38503401227598166, (12) = .43268598844062967, (13) = .48418267682069066, (14) = .54178398151824, (15) = .6084908129577877, (16) = .6905705623174822, (17) = .7936582413926776, (18) = .9362490342852545, (19) = 1.1290955386275305, (20) = 1.2785289405368818, (21) = 1.3762683057594027, (22) = 1.4410821559755675, (23) = 1.4911439441371346, (24) = 1.5334604576293163, (25) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(25, 2, {(1, 1) = .0, (1, 2) = 0.31500831778913094e-6, (2, 1) = 0.3132220020535465e-7, (2, 2) = 0.7779131439750735e-7, (3, 1) = 0.14325613236197187e-7, (3, 2) = -0.6898540876289522e-7, (4, 1) = -0.6036355453398498e-8, (4, 2) = 0.7943001698758059e-7, (5, 1) = -0.13260007889026392e-8, (5, 2) = 0.11756415179265621e-6, (6, 1) = 0.1071471554168767e-7, (6, 2) = 0.44460301809323215e-7, (7, 1) = 0.16948724685756332e-7, (7, 2) = -0.6994714895790386e-8, (8, 1) = 0.1782055631368677e-7, (8, 2) = -0.1641681279404671e-7, (9, 1) = 0.16393950975769278e-7, (9, 2) = -0.58427989726364065e-8, (10, 1) = 0.14618894539761003e-7, (10, 2) = 0.7611526601257115e-8, (11, 1) = 0.13363200796132462e-7, (11, 2) = 0.16937803808645205e-7, (12, 1) = 0.12801606379592921e-7, (12, 2) = 0.21469959634400602e-7, (13, 1) = 0.12794426509551367e-7, (13, 2) = 0.22808086897112244e-7, (14, 1) = 0.13080732166085607e-7, (14, 2) = 0.22688679611190916e-7, (15, 1) = 0.13483594578904676e-7, (15, 2) = 0.2185857499871233e-7, (16, 1) = 0.13492144691744485e-7, (16, 2) = 0.2072575098426527e-7, (17, 1) = 0.12840479015099201e-7, (17, 2) = 0.17970028302554435e-7, (18, 1) = 0.720289485656478e-8, (18, 2) = 0.11283105136137962e-7, (19, 1) = -0.10626354523447358e-8, (19, 2) = -0.7464659107819674e-8, (20, 1) = 0.19375865427224214e-8, (20, 2) = -0.1047570220567349e-7, (21, 1) = 0.15016966694503165e-8, (21, 2) = -0.914149161086985e-8, (22, 1) = 0.10081859027200914e-8, (22, 2) = -0.848749960193092e-8, (23, 1) = 0.618147262744349e-9, (23, 2) = -0.8172877515951791e-8, (24, 1) = 0.2897545785236149e-9, (24, 2) = -0.8027811845254448e-8, (25, 1) = .0, (25, 2) = -0.7987456326182811e-8}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[25] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(3.1500831778913094e-7) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 25, [v(u), diff(v(u), u)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[25] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[25] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(25, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(25, 2, X, Y, outpoint, yout, L, V) end if; [u = outpoint, seq('[v(u), diff(v(u), u)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[25] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(3.1500831778913094e-7) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 25, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[25] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[25] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(25, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(25, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893628625364672284, (2) = 36893628625364664316, (3) = 36893628625364664492}), (3) = [u, v(u), diff(v(u), u)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(u) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(u) else `D(v)` := pointto(data[2][3]); return ('`D(v)`')(u) end if end if; try res := solnproc(outpoint); res[3] catch: error  end try end proc]

display(
        torus,
        tubeplot([seq(eval(x(u, v(u)), dsol2))], u=0..Pi/2, color=red, radius=0.1),
        pointplot3d(eval([x(0,v(0)),x(Pi/2,v(Pi/2))], dsol2), symbol=solidsphere, symbolsize=20, color="Orange"),
lightmodel=light4, thickness=5, orientation=[-65,65,0], size=[700,400],
style=surface, axes=none);

 

 

Example 3

 

The end points in this example are identical to those of Example 1 but the new geodesic,
drawn in cyan, is different.  In fact, there are infinitely many  geodesics that connect

those two points.

bc3 := v(0)=0,  v(Pi/2)=5*Pi/2;

v(0) = 0, v((1/2)*Pi) = (5/2)*Pi

dsol3 := dsolve({de, bc3}, numeric, output=operator);

[u = proc (u) local _res, _dat, _solnproc; option `Copyright (c) 1993 by the University of Waterloo. All rights reserved.`; _dat := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(59, {(1) = .0, (2) = 0.13680812436809657e-1, (3) = 0.27971051145644167e-1, (4) = 0.4296023135974479e-1, (5) = 0.5851786182852681e-1, (6) = 0.7435973609701907e-1, (7) = 0.9049963296106847e-1, (8) = .1070194360291177, (9) = .12400404122395811, (10) = .14149911102616744, (11) = .15962080170244286, (12) = .17846661163773977, (13) = .1981659899247577, (14) = .2189484735830971, (15) = .2410342106109193, (16) = .2648591917099649, (17) = .29096256417430655, (18) = .3201405168424954, (19) = .3537506263213988, (20) = .39359925436482457, (21) = .44328213017143814, (22) = .508829664760916, (23) = .5993459008179163, (24) = .7156934169226271, (25) = .8282966673508598, (26) = .9130409367878883, (27) = .9748398788122531, (28) = 1.0223008015052495, (29) = 1.0606661846616776, (30) = 1.0932188074676115, (31) = 1.1216707736458404, (32) = 1.1472399927159063, (33) = 1.1706725764522086, (34) = 1.1924372702961963, (35) = 1.2129338175389266, (36) = 1.2323858241405192, (37) = 1.250955152949817, (38) = 1.268795762648431, (39) = 1.2859897085262963, (40) = 1.3026146566339305, (41) = 1.3187452976919192, (42) = 1.3344237627757964, (43) = 1.3497030677053556, (44) = 1.3646567912885574, (45) = 1.3793073520205892, (46) = 1.3936816310415334, (47) = 1.407863413800478, (48) = 1.421874455055364, (49) = 1.4357209480594326, (50) = 1.449452395680341, (51) = 1.463105461314161, (52) = 1.4766814720936998, (53) = 1.4901926102416252, (54) = 1.5036746366401115, (55) = 1.5171303716739315, (56) = 1.5305608572874234, (57) = 1.5439797161303026, (58) = 1.5573915356105725, (59) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(59, 2, {(1, 1) = .0, (1, 2) = 12.679746440910824, (2, 1) = .17295641157725689, (2, 2) = 12.567764844010108, (3, 1) = .3503687425101184, (3, 2) = 12.226735465168346, (4, 1) = .5296761539769358, (4, 2) = 11.66918438963109, (5, 1) = .7057258717088374, (5, 2) = 10.944263938053027, (6, 1) = .8727045160581467, (6, 2) = 10.12940781981862, (7, 1) = 1.0293675300859457, (7, 2) = 9.286027153268176, (8, 1) = 1.1758543805831463, (8, 2) = 8.457430747175952, (9, 1) = 1.3127197264585053, (9, 2) = 7.671647779381384, (10, 1) = 1.4404597517069202, (10, 2) = 6.945889507639623, (11, 1) = 1.5602083118771684, (11, 2) = 6.28529164237151, (12, 1) = 1.6729138904127339, (12, 2) = 5.690377357385402, (13, 1) = 1.7796245072672423, (13, 2) = 5.157666928630136, (14, 1) = 1.8817159269340347, (14, 2) = 4.680400525330798, (15, 1) = 1.9802286821314778, (15, 2) = 4.2529853303192855, (16, 1) = 2.0768238867507085, (16, 2) = 3.8675310705673276, (17, 1) = 2.173068367774721, (17, 2) = 3.5178917521371798, (18, 1) = 2.270890048473742, (18, 2) = 3.1984139900960797, (19, 1) = 2.3732345057338295, (19, 2) = 2.9030738541180425, (20, 1) = 2.4832304722226684, (20, 2) = 2.6296687269685846, (21, 1) = 2.607217350093064, (21, 2) = 2.3751465147467514, (22, 1) = 2.7547856154152726, (22, 2) = 2.144274550259719, (23, 1) = 2.939616093527199, (23, 2) = 1.961813066469559, (24, 1) = 3.162337834655888, (24, 2) = 1.8947028342219836, (25, 1) = 3.3794261487929442, (25, 2) = 1.9881175251450118, (26, 1) = 3.5551825581028798, (26, 2) = 2.1804710450280265, (27, 1) = 3.69665130286631, (27, 2) = 2.41371269610685, (28, 1) = 3.8169541259171704, (28, 2) = 2.6689707564501304, (29, 1) = 3.9243694765971413, (29, 2) = 2.9422812417392152, (30, 1) = 4.024767234931778, (30, 2) = 3.237123523436467, (31, 1) = 4.121259324516239, (31, 2) = 3.5565852574603505, (32, 1) = 4.216529428559537, (32, 2) = 3.9064929391469123, (33, 1) = 4.312457356149003, (33, 2) = 4.292723456572624, (34, 1) = 4.410412203730131, (34, 2) = 4.720850296041311, (35, 1) = 4.511931211523759, (35, 2) = 5.198255733142234, (36, 1) = 4.618090131180544, (36, 2) = 5.730648052338743, (37, 1) = 4.729865319802914, (37, 2) = 6.322579877258892, (38, 1) = 4.848375884647389, (38, 2) = 6.977624814470957, (39, 1) = 4.974387707359408, (39, 2) = 7.694131606716463, (40, 1) = 5.108607237299307, (40, 2) = 8.464739698798486, (41, 1) = 5.251606222026279, (41, 2) = 9.273734329435953, (42, 1) = 5.403405586640311, (42, 2) = 10.092710388426758, (43, 1) = 5.563684034528413, (43, 2) = 10.88121631033313, (44, 1) = 5.731806698053641, (44, 2) = 11.588598491150355, (45, 1) = 5.905935538945928, (45, 2) = 12.156134835319502, (46, 1) = 6.0836133491883215, (46, 2) = 12.530876289186718, (47, 1) = 6.262647078633722, (47, 2) = 12.678160168039451, (48, 1) = 6.439921199996006, (48, 2) = 12.587708080348033, (49, 1) = 6.612315033049238, (49, 2) = 12.2791039631489, (50, 1) = 6.777770156025198, (50, 2) = 11.79378728978802, (51, 1) = 6.934742040084409, (51, 2) = 11.183836634124887, (52, 1) = 7.0820078226929555, (52, 2) = 10.502833198232775, (53, 1) = 7.219149840143932, (53, 2) = 9.796155822525524, (54, 1) = 7.34648415514996, (54, 2) = 9.096522907410908, (55, 1) = 7.464338781940853, (55, 2) = 8.427075143053173, (56, 1) = 7.573265028033481, (56, 2) = 7.801521511288004, (57, 1) = 7.67403328840954, (57, 2) = 7.22588851589702, (58, 1) = 7.767374215067717, (58, 2) = 6.701837954309735, (59, 1) = 7.85398163397448, (59, 2) = 6.228168238234758}, datatype = float[8], order = C_order); YP := Matrix(59, 2, {(1, 1) = 12.679746440910824, (1, 2) = -.0, (2, 1) = 12.567764844010108, (2, 2) = -16.198974726732907, (3, 1) = 12.226735465168346, (3, 2) = -31.019959257656904, (4, 1) = 11.66918438963109, (4, 2) = -42.61556998298658, (5, 1) = 10.944263938053027, (5, 2) = -49.758388561480395, (6, 1) = 10.12940781981862, (6, 2) = -52.428967468700804, (7, 1) = 9.286027153268176, (7, 2) = -51.59782241363348, (8, 1) = 8.457430747175952, (8, 2) = -48.43560278055239, (9, 1) = 7.671647779381384, (9, 2) = -43.97106435599, (10, 1) = 6.945889507639623, (10, 2) = -38.985423814257885, (11, 1) = 6.28529164237151, (11, 2) = -33.97931379570107, (12, 1) = 5.690377357385402, (12, 2) = -29.25037640167964, (13, 1) = 5.157666928630136, (13, 2) = -24.944278873434246, (14, 1) = 4.680400525330798, (14, 2) = -21.099971062135964, (15, 1) = 4.2529853303192855, (15, 2) = -17.71654087434397, (16, 1) = 3.8675310705673276, (16, 2) = -14.74668416472017, (17, 1) = 3.5178917521371798, (17, 2) = -12.14221532932914, (18, 1) = 3.1984139900960797, (18, 2) = -9.851136892783515, (19, 1) = 2.9030738541180425, (19, 2) = -7.815047340827251, (20, 1) = 2.6296687269685846, (20, 2) = -5.996847641998252, (21, 1) = 2.3751465147467514, (21, 2) = -4.340048329343317, (22, 1) = 2.144274550259719, (22, 2) = -2.7978073376293024, (23, 1) = 1.961813066469559, (23, 2) = -1.320655805545758, (24, 1) = 1.8947028342219836, (24, 2) = .13039610824419176, (25, 1) = 1.9881175251450118, (25, 2) = 1.5787914768274436, (26, 1) = 2.1804710450280265, (26, 2) = 3.0488939854293733, (27, 1) = 2.41371269610685, (27, 2) = 4.590848716067672, (28, 1) = 2.6689707564501304, (28, 2) = 6.254836311594842, (29, 1) = 2.9422812417392152, (29, 2) = 8.080806575409401, (30, 1) = 3.237123523436467, (30, 2) = 10.12389716847413, (31, 1) = 3.5565852574603505, (31, 2) = 12.425685648274625, (32, 1) = 3.9064929391469123, (32, 2) = 15.042554769209124, (33, 1) = 4.292723456572624, (33, 2) = 18.027628684062055, (34, 1) = 4.720850296041311, (34, 2) = 21.42377820734578, (35, 1) = 5.198255733142234, (35, 2) = 25.27273224998513, (36, 1) = 5.730648052338743, (36, 2) = 29.574358687095494, (37, 1) = 6.322579877258892, (37, 2) = 34.27026010854073, (38, 1) = 6.977624814470957, (38, 2) = 39.21645062769387, (39, 1) = 7.694131606716463, (39, 2) = 44.11406880450838, (40, 1) = 8.464739698798486, (40, 2) = 48.471285191096335, (41, 1) = 9.273734329435953, (41, 2) = 51.56564318350719, (42, 1) = 10.092710388426758, (42, 2) = 52.45733113498812, (43, 1) = 10.88121631033313, (43, 2) = 50.12848157993341, (44, 1) = 11.588598491150355, (44, 2) = 43.73470437900077, (45, 1) = 12.156134835319502, (45, 2) = 33.00620482181849, (46, 1) = 12.530876289186718, (46, 2) = 18.57982197925053, (47, 1) = 12.678160168039451, (47, 2) = 1.9582711648426194, (48, 1) = 12.587708080348033, (48, 2) = -14.727409356953261, (49, 1) = 12.2791039631489, (49, 2) = -29.39558090446206, (50, 1) = 11.79378728978802, (50, 2) = -40.669372493045, (51, 1) = 11.183836634124887, (51, 2) = -48.03607321421275, (52, 1) = 10.502833198232775, (52, 2) = -51.72939943874306, (53, 1) = 9.796155822525524, (53, 2) = -52.452900134134595, (54, 1) = 9.096522907410908, (54, 2) = -51.04757024201683, (55, 1) = 8.427075143053173, (55, 2) = -48.28611154332724, (56, 1) = 7.801521511288004, (56, 2) = -44.78604220693657, (57, 1) = 7.22588851589702, (57, 2) = -40.986432776247455, (58, 1) = 6.701837954309735, (58, 2) = -37.176690679157566, (59, 1) = 6.228168238234758, (59, 2) = -33.53206368300497}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(59, {(1) = .0, (2) = 0.13680812436809657e-1, (3) = 0.27971051145644167e-1, (4) = 0.4296023135974479e-1, (5) = 0.5851786182852681e-1, (6) = 0.7435973609701907e-1, (7) = 0.9049963296106847e-1, (8) = .1070194360291177, (9) = .12400404122395811, (10) = .14149911102616744, (11) = .15962080170244286, (12) = .17846661163773977, (13) = .1981659899247577, (14) = .2189484735830971, (15) = .2410342106109193, (16) = .2648591917099649, (17) = .29096256417430655, (18) = .3201405168424954, (19) = .3537506263213988, (20) = .39359925436482457, (21) = .44328213017143814, (22) = .508829664760916, (23) = .5993459008179163, (24) = .7156934169226271, (25) = .8282966673508598, (26) = .9130409367878883, (27) = .9748398788122531, (28) = 1.0223008015052495, (29) = 1.0606661846616776, (30) = 1.0932188074676115, (31) = 1.1216707736458404, (32) = 1.1472399927159063, (33) = 1.1706725764522086, (34) = 1.1924372702961963, (35) = 1.2129338175389266, (36) = 1.2323858241405192, (37) = 1.250955152949817, (38) = 1.268795762648431, (39) = 1.2859897085262963, (40) = 1.3026146566339305, (41) = 1.3187452976919192, (42) = 1.3344237627757964, (43) = 1.3497030677053556, (44) = 1.3646567912885574, (45) = 1.3793073520205892, (46) = 1.3936816310415334, (47) = 1.407863413800478, (48) = 1.421874455055364, (49) = 1.4357209480594326, (50) = 1.449452395680341, (51) = 1.463105461314161, (52) = 1.4766814720936998, (53) = 1.4901926102416252, (54) = 1.5036746366401115, (55) = 1.5171303716739315, (56) = 1.5305608572874234, (57) = 1.5439797161303026, (58) = 1.5573915356105725, (59) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(59, 2, {(1, 1) = .0, (1, 2) = -0.2040971830865995e-12, (2, 1) = -0.2515085127931946e-15, (2, 2) = -0.2182240868305703e-12, (3, 1) = -0.3034400215680231e-14, (3, 2) = -0.24629572182126297e-12, (4, 1) = -0.70293294530316345e-14, (4, 2) = -0.27355561891671303e-12, (5, 1) = -0.11642509457266535e-13, (5, 2) = -0.2921725988376451e-12, (6, 1) = -0.14891698174826332e-13, (6, 2) = -0.27332966679506926e-12, (7, 1) = -0.2244158402930937e-13, (7, 2) = -0.21555448086863683e-12, (8, 1) = -0.23830070405255755e-13, (8, 2) = -0.14452163468605652e-12, (9, 1) = -0.28784241689197694e-13, (9, 2) = -0.8936429016769738e-13, (10, 1) = -0.2870763992607896e-13, (10, 2) = -0.7015153701410498e-13, (11, 1) = -0.29805232120338505e-13, (11, 2) = -0.20455226198960395e-13, (12, 1) = -0.3071869736898188e-13, (12, 2) = -0.949608712395301e-14, (13, 1) = -0.33085750279284234e-13, (13, 2) = -0.9853725522439467e-14, (14, 1) = -0.3024025650769599e-13, (14, 2) = 0.55343272382320285e-14, (15, 1) = -0.2989762453456761e-13, (15, 2) = 0.9484091577415516e-14, (16, 1) = -0.3126420836975352e-13, (16, 2) = 0.10993914919372806e-15, (17, 1) = -0.2904952409517121e-13, (17, 2) = 0.7741875869166384e-14, (18, 1) = -0.26389405390354672e-13, (18, 2) = -0.39736138956257974e-14, (19, 1) = -0.3066642976676729e-13, (19, 2) = -0.8841791351636723e-14, (20, 1) = -0.3381874764737987e-13, (20, 2) = -0.10474029579197825e-13, (21, 1) = -0.3076950762715862e-13, (21, 2) = -0.14630357321113296e-13, (22, 1) = -0.25742990878046857e-13, (22, 2) = -0.32013707096004785e-13, (23, 1) = -0.26034531106847924e-14, (23, 2) = -0.17882398235769704e-13, (24, 1) = -0.24294629294277565e-13, (24, 2) = 0.6033751098446911e-13, (25, 1) = -0.10212795741481291e-13, (25, 2) = -0.5409909790245115e-14, (26, 1) = 0.65234775286404595e-14, (26, 2) = 0.10506976038853487e-14, (27, 1) = 0.15145921627767115e-13, (27, 2) = 0.11062582034309036e-13, (28, 1) = 0.17727034515154246e-13, (28, 2) = 0.1392374003706416e-13, (29, 1) = 0.20190304444405087e-13, (29, 2) = 0.24077662756883795e-13, (30, 1) = 0.15567756982704383e-13, (30, 2) = 0.3220356728033926e-13, (31, 1) = 0.2049236289955625e-13, (31, 2) = 0.4582315826902611e-13, (32, 1) = 0.2093779309445625e-13, (32, 2) = 0.50847503530540665e-13, (33, 1) = 0.34656722670579105e-13, (33, 2) = 0.65791408284367e-13, (34, 1) = 0.1414627403891834e-13, (34, 2) = 0.7434970442839986e-13, (35, 1) = 0.1430197385087178e-13, (35, 2) = 0.807995248637132e-13, (36, 1) = 0.2674246752632126e-13, (36, 2) = 0.8238316242997303e-13, (37, 1) = 0.3749521089102351e-13, (37, 2) = 0.9551972331079688e-13, (38, 1) = 0.43798173157104124e-13, (38, 2) = 0.8882243056529444e-13, (39, 1) = 0.34765247192333954e-13, (39, 2) = 0.7174268116999525e-13, (40, 1) = 0.3492718539460031e-13, (40, 2) = 0.25074509668472094e-13, (41, 1) = 0.3268343950774218e-13, (41, 2) = -0.6182099171300564e-13, (42, 1) = 0.7615127467050659e-14, (42, 2) = -0.1854246486047524e-12, (43, 1) = 0.20280258788197414e-13, (43, 2) = -0.2612655964015281e-12, (44, 1) = 0.5268977580072408e-14, (44, 2) = -0.3058713868413555e-12, (45, 1) = 0.8243135377351008e-14, (45, 2) = -0.3000324869932838e-12, (46, 1) = 0.9651203882669847e-14, (46, 2) = -0.23958986839330786e-12, (47, 1) = -0.15172603499122148e-13, (47, 2) = -0.14114952424844551e-12, (48, 1) = 0.6415293117671377e-14, (48, 2) = -0.3574626525598719e-13, (49, 1) = 0.11771473310921094e-13, (49, 2) = 0.12758808412240534e-13, (50, 1) = 0.350361321759921e-14, (50, 2) = 0.18960251337597162e-13, (51, 1) = -0.402567915071639e-14, (51, 2) = -0.42598728779319296e-13, (52, 1) = 0.14493706543893737e-13, (52, 2) = -0.4380811741884113e-13, (53, 1) = 0.19531436506149837e-13, (53, 2) = -0.8490114617635297e-13, (54, 1) = 0.4784180312117899e-14, (54, 2) = -0.10238102255674353e-12, (55, 1) = 0.13186433513432542e-13, (55, 2) = -0.12142340951879697e-12, (56, 1) = 0.68589188913736246e-14, (56, 2) = -0.10734720880680753e-12, (57, 1) = 0.4428481028761533e-14, (57, 2) = -0.9866461770792047e-13, (58, 1) = 0.7387414481358141e-14, (58, 2) = -0.9166293971010342e-13, (59, 1) = .0, (59, 2) = -0.731647525953621e-13}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[59] elif outpoint = "order" then return 10 elif outpoint = "error" then return HFloat(3.058713868413555e-13) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 59, [v(u), diff(v(u), u)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[59] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[59] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(59, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(59, 2, X, Y, outpoint, yout, L, V) end if; [u = outpoint, seq('[v(u), diff(v(u), u)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[59] elif outpoint = "order" then return 10 elif outpoint = "error" then return HFloat(3.058713868413555e-13) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 59, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[59] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[59] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(59, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(59, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893628625353841228, (2) = 36893628625353841404, (3) = 36893628625353841580}), (3) = [u, v(u), diff(v(u), u)], (4) = 0}); _solnproc := _dat[1]; if member(u, ["last", 'last']) then _res := _solnproc("last"); if type(_res, 'list') then return _res[1] end if elif type(u, `=`) and member(lhs(u), ["initial", 'initial']) then if type(rhs(u), 'list') then _res := _solnproc("initial" = [0, op(rhs(u))]) else _res := _solnproc("initial" = [1, rhs(u)]) end if; if type(_res, 'list') then return _res[1] end if elif u = "sysvars" then return _dat[3] end if; u end proc, v = proc (u) local res, data, solnproc, v, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](u) else outpoint := evalf(u) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(59, {(1) = .0, (2) = 0.13680812436809657e-1, (3) = 0.27971051145644167e-1, (4) = 0.4296023135974479e-1, (5) = 0.5851786182852681e-1, (6) = 0.7435973609701907e-1, (7) = 0.9049963296106847e-1, (8) = .1070194360291177, (9) = .12400404122395811, (10) = .14149911102616744, (11) = .15962080170244286, (12) = .17846661163773977, (13) = .1981659899247577, (14) = .2189484735830971, (15) = .2410342106109193, (16) = .2648591917099649, (17) = .29096256417430655, (18) = .3201405168424954, (19) = .3537506263213988, (20) = .39359925436482457, (21) = .44328213017143814, (22) = .508829664760916, (23) = .5993459008179163, (24) = .7156934169226271, (25) = .8282966673508598, (26) = .9130409367878883, (27) = .9748398788122531, (28) = 1.0223008015052495, (29) = 1.0606661846616776, (30) = 1.0932188074676115, (31) = 1.1216707736458404, (32) = 1.1472399927159063, (33) = 1.1706725764522086, (34) = 1.1924372702961963, (35) = 1.2129338175389266, (36) = 1.2323858241405192, (37) = 1.250955152949817, (38) = 1.268795762648431, (39) = 1.2859897085262963, (40) = 1.3026146566339305, (41) = 1.3187452976919192, (42) = 1.3344237627757964, (43) = 1.3497030677053556, (44) = 1.3646567912885574, (45) = 1.3793073520205892, (46) = 1.3936816310415334, (47) = 1.407863413800478, (48) = 1.421874455055364, (49) = 1.4357209480594326, (50) = 1.449452395680341, (51) = 1.463105461314161, (52) = 1.4766814720936998, (53) = 1.4901926102416252, (54) = 1.5036746366401115, (55) = 1.5171303716739315, (56) = 1.5305608572874234, (57) = 1.5439797161303026, (58) = 1.5573915356105725, (59) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(59, 2, {(1, 1) = .0, (1, 2) = 12.679746440910824, (2, 1) = .17295641157725689, (2, 2) = 12.567764844010108, (3, 1) = .3503687425101184, (3, 2) = 12.226735465168346, (4, 1) = .5296761539769358, (4, 2) = 11.66918438963109, (5, 1) = .7057258717088374, (5, 2) = 10.944263938053027, (6, 1) = .8727045160581467, (6, 2) = 10.12940781981862, (7, 1) = 1.0293675300859457, (7, 2) = 9.286027153268176, (8, 1) = 1.1758543805831463, (8, 2) = 8.457430747175952, (9, 1) = 1.3127197264585053, (9, 2) = 7.671647779381384, (10, 1) = 1.4404597517069202, (10, 2) = 6.945889507639623, (11, 1) = 1.5602083118771684, (11, 2) = 6.28529164237151, (12, 1) = 1.6729138904127339, (12, 2) = 5.690377357385402, (13, 1) = 1.7796245072672423, (13, 2) = 5.157666928630136, (14, 1) = 1.8817159269340347, (14, 2) = 4.680400525330798, (15, 1) = 1.9802286821314778, (15, 2) = 4.2529853303192855, (16, 1) = 2.0768238867507085, (16, 2) = 3.8675310705673276, (17, 1) = 2.173068367774721, (17, 2) = 3.5178917521371798, (18, 1) = 2.270890048473742, (18, 2) = 3.1984139900960797, (19, 1) = 2.3732345057338295, (19, 2) = 2.9030738541180425, (20, 1) = 2.4832304722226684, (20, 2) = 2.6296687269685846, (21, 1) = 2.607217350093064, (21, 2) = 2.3751465147467514, (22, 1) = 2.7547856154152726, (22, 2) = 2.144274550259719, (23, 1) = 2.939616093527199, (23, 2) = 1.961813066469559, (24, 1) = 3.162337834655888, (24, 2) = 1.8947028342219836, (25, 1) = 3.3794261487929442, (25, 2) = 1.9881175251450118, (26, 1) = 3.5551825581028798, (26, 2) = 2.1804710450280265, (27, 1) = 3.69665130286631, (27, 2) = 2.41371269610685, (28, 1) = 3.8169541259171704, (28, 2) = 2.6689707564501304, (29, 1) = 3.9243694765971413, (29, 2) = 2.9422812417392152, (30, 1) = 4.024767234931778, (30, 2) = 3.237123523436467, (31, 1) = 4.121259324516239, (31, 2) = 3.5565852574603505, (32, 1) = 4.216529428559537, (32, 2) = 3.9064929391469123, (33, 1) = 4.312457356149003, (33, 2) = 4.292723456572624, (34, 1) = 4.410412203730131, (34, 2) = 4.720850296041311, (35, 1) = 4.511931211523759, (35, 2) = 5.198255733142234, (36, 1) = 4.618090131180544, (36, 2) = 5.730648052338743, (37, 1) = 4.729865319802914, (37, 2) = 6.322579877258892, (38, 1) = 4.848375884647389, (38, 2) = 6.977624814470957, (39, 1) = 4.974387707359408, (39, 2) = 7.694131606716463, (40, 1) = 5.108607237299307, (40, 2) = 8.464739698798486, (41, 1) = 5.251606222026279, (41, 2) = 9.273734329435953, (42, 1) = 5.403405586640311, (42, 2) = 10.092710388426758, (43, 1) = 5.563684034528413, (43, 2) = 10.88121631033313, (44, 1) = 5.731806698053641, (44, 2) = 11.588598491150355, (45, 1) = 5.905935538945928, (45, 2) = 12.156134835319502, (46, 1) = 6.0836133491883215, (46, 2) = 12.530876289186718, (47, 1) = 6.262647078633722, (47, 2) = 12.678160168039451, (48, 1) = 6.439921199996006, (48, 2) = 12.587708080348033, (49, 1) = 6.612315033049238, (49, 2) = 12.2791039631489, (50, 1) = 6.777770156025198, (50, 2) = 11.79378728978802, (51, 1) = 6.934742040084409, (51, 2) = 11.183836634124887, (52, 1) = 7.0820078226929555, (52, 2) = 10.502833198232775, (53, 1) = 7.219149840143932, (53, 2) = 9.796155822525524, (54, 1) = 7.34648415514996, (54, 2) = 9.096522907410908, (55, 1) = 7.464338781940853, (55, 2) = 8.427075143053173, (56, 1) = 7.573265028033481, (56, 2) = 7.801521511288004, (57, 1) = 7.67403328840954, (57, 2) = 7.22588851589702, (58, 1) = 7.767374215067717, (58, 2) = 6.701837954309735, (59, 1) = 7.85398163397448, (59, 2) = 6.228168238234758}, datatype = float[8], order = C_order); YP := Matrix(59, 2, {(1, 1) = 12.679746440910824, (1, 2) = -.0, (2, 1) = 12.567764844010108, (2, 2) = -16.198974726732907, (3, 1) = 12.226735465168346, (3, 2) = -31.019959257656904, (4, 1) = 11.66918438963109, (4, 2) = -42.61556998298658, (5, 1) = 10.944263938053027, (5, 2) = -49.758388561480395, (6, 1) = 10.12940781981862, (6, 2) = -52.428967468700804, (7, 1) = 9.286027153268176, (7, 2) = -51.59782241363348, (8, 1) = 8.457430747175952, (8, 2) = -48.43560278055239, (9, 1) = 7.671647779381384, (9, 2) = -43.97106435599, (10, 1) = 6.945889507639623, (10, 2) = -38.985423814257885, (11, 1) = 6.28529164237151, (11, 2) = -33.97931379570107, (12, 1) = 5.690377357385402, (12, 2) = -29.25037640167964, (13, 1) = 5.157666928630136, (13, 2) = -24.944278873434246, (14, 1) = 4.680400525330798, (14, 2) = -21.099971062135964, (15, 1) = 4.2529853303192855, (15, 2) = -17.71654087434397, (16, 1) = 3.8675310705673276, (16, 2) = -14.74668416472017, (17, 1) = 3.5178917521371798, (17, 2) = -12.14221532932914, (18, 1) = 3.1984139900960797, (18, 2) = -9.851136892783515, (19, 1) = 2.9030738541180425, (19, 2) = -7.815047340827251, (20, 1) = 2.6296687269685846, (20, 2) = -5.996847641998252, (21, 1) = 2.3751465147467514, (21, 2) = -4.340048329343317, (22, 1) = 2.144274550259719, (22, 2) = -2.7978073376293024, (23, 1) = 1.961813066469559, (23, 2) = -1.320655805545758, (24, 1) = 1.8947028342219836, (24, 2) = .13039610824419176, (25, 1) = 1.9881175251450118, (25, 2) = 1.5787914768274436, (26, 1) = 2.1804710450280265, (26, 2) = 3.0488939854293733, (27, 1) = 2.41371269610685, (27, 2) = 4.590848716067672, (28, 1) = 2.6689707564501304, (28, 2) = 6.254836311594842, (29, 1) = 2.9422812417392152, (29, 2) = 8.080806575409401, (30, 1) = 3.237123523436467, (30, 2) = 10.12389716847413, (31, 1) = 3.5565852574603505, (31, 2) = 12.425685648274625, (32, 1) = 3.9064929391469123, (32, 2) = 15.042554769209124, (33, 1) = 4.292723456572624, (33, 2) = 18.027628684062055, (34, 1) = 4.720850296041311, (34, 2) = 21.42377820734578, (35, 1) = 5.198255733142234, (35, 2) = 25.27273224998513, (36, 1) = 5.730648052338743, (36, 2) = 29.574358687095494, (37, 1) = 6.322579877258892, (37, 2) = 34.27026010854073, (38, 1) = 6.977624814470957, (38, 2) = 39.21645062769387, (39, 1) = 7.694131606716463, (39, 2) = 44.11406880450838, (40, 1) = 8.464739698798486, (40, 2) = 48.471285191096335, (41, 1) = 9.273734329435953, (41, 2) = 51.56564318350719, (42, 1) = 10.092710388426758, (42, 2) = 52.45733113498812, (43, 1) = 10.88121631033313, (43, 2) = 50.12848157993341, (44, 1) = 11.588598491150355, (44, 2) = 43.73470437900077, (45, 1) = 12.156134835319502, (45, 2) = 33.00620482181849, (46, 1) = 12.530876289186718, (46, 2) = 18.57982197925053, (47, 1) = 12.678160168039451, (47, 2) = 1.9582711648426194, (48, 1) = 12.587708080348033, (48, 2) = -14.727409356953261, (49, 1) = 12.2791039631489, (49, 2) = -29.39558090446206, (50, 1) = 11.79378728978802, (50, 2) = -40.669372493045, (51, 1) = 11.183836634124887, (51, 2) = -48.03607321421275, (52, 1) = 10.502833198232775, (52, 2) = -51.72939943874306, (53, 1) = 9.796155822525524, (53, 2) = -52.452900134134595, (54, 1) = 9.096522907410908, (54, 2) = -51.04757024201683, (55, 1) = 8.427075143053173, (55, 2) = -48.28611154332724, (56, 1) = 7.801521511288004, (56, 2) = -44.78604220693657, (57, 1) = 7.22588851589702, (57, 2) = -40.986432776247455, (58, 1) = 6.701837954309735, (58, 2) = -37.176690679157566, (59, 1) = 6.228168238234758, (59, 2) = -33.53206368300497}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(59, {(1) = .0, (2) = 0.13680812436809657e-1, (3) = 0.27971051145644167e-1, (4) = 0.4296023135974479e-1, (5) = 0.5851786182852681e-1, (6) = 0.7435973609701907e-1, (7) = 0.9049963296106847e-1, (8) = .1070194360291177, (9) = .12400404122395811, (10) = .14149911102616744, (11) = .15962080170244286, (12) = .17846661163773977, (13) = .1981659899247577, (14) = .2189484735830971, (15) = .2410342106109193, (16) = .2648591917099649, (17) = .29096256417430655, (18) = .3201405168424954, (19) = .3537506263213988, (20) = .39359925436482457, (21) = .44328213017143814, (22) = .508829664760916, (23) = .5993459008179163, (24) = .7156934169226271, (25) = .8282966673508598, (26) = .9130409367878883, (27) = .9748398788122531, (28) = 1.0223008015052495, (29) = 1.0606661846616776, (30) = 1.0932188074676115, (31) = 1.1216707736458404, (32) = 1.1472399927159063, (33) = 1.1706725764522086, (34) = 1.1924372702961963, (35) = 1.2129338175389266, (36) = 1.2323858241405192, (37) = 1.250955152949817, (38) = 1.268795762648431, (39) = 1.2859897085262963, (40) = 1.3026146566339305, (41) = 1.3187452976919192, (42) = 1.3344237627757964, (43) = 1.3497030677053556, (44) = 1.3646567912885574, (45) = 1.3793073520205892, (46) = 1.3936816310415334, (47) = 1.407863413800478, (48) = 1.421874455055364, (49) = 1.4357209480594326, (50) = 1.449452395680341, (51) = 1.463105461314161, (52) = 1.4766814720936998, (53) = 1.4901926102416252, (54) = 1.5036746366401115, (55) = 1.5171303716739315, (56) = 1.5305608572874234, (57) = 1.5439797161303026, (58) = 1.5573915356105725, (59) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(59, 2, {(1, 1) = .0, (1, 2) = -0.2040971830865995e-12, (2, 1) = -0.2515085127931946e-15, (2, 2) = -0.2182240868305703e-12, (3, 1) = -0.3034400215680231e-14, (3, 2) = -0.24629572182126297e-12, (4, 1) = -0.70293294530316345e-14, (4, 2) = -0.27355561891671303e-12, (5, 1) = -0.11642509457266535e-13, (5, 2) = -0.2921725988376451e-12, (6, 1) = -0.14891698174826332e-13, (6, 2) = -0.27332966679506926e-12, (7, 1) = -0.2244158402930937e-13, (7, 2) = -0.21555448086863683e-12, (8, 1) = -0.23830070405255755e-13, (8, 2) = -0.14452163468605652e-12, (9, 1) = -0.28784241689197694e-13, (9, 2) = -0.8936429016769738e-13, (10, 1) = -0.2870763992607896e-13, (10, 2) = -0.7015153701410498e-13, (11, 1) = -0.29805232120338505e-13, (11, 2) = -0.20455226198960395e-13, (12, 1) = -0.3071869736898188e-13, (12, 2) = -0.949608712395301e-14, (13, 1) = -0.33085750279284234e-13, (13, 2) = -0.9853725522439467e-14, (14, 1) = -0.3024025650769599e-13, (14, 2) = 0.55343272382320285e-14, (15, 1) = -0.2989762453456761e-13, (15, 2) = 0.9484091577415516e-14, (16, 1) = -0.3126420836975352e-13, (16, 2) = 0.10993914919372806e-15, (17, 1) = -0.2904952409517121e-13, (17, 2) = 0.7741875869166384e-14, (18, 1) = -0.26389405390354672e-13, (18, 2) = -0.39736138956257974e-14, (19, 1) = -0.3066642976676729e-13, (19, 2) = -0.8841791351636723e-14, (20, 1) = -0.3381874764737987e-13, (20, 2) = -0.10474029579197825e-13, (21, 1) = -0.3076950762715862e-13, (21, 2) = -0.14630357321113296e-13, (22, 1) = -0.25742990878046857e-13, (22, 2) = -0.32013707096004785e-13, (23, 1) = -0.26034531106847924e-14, (23, 2) = -0.17882398235769704e-13, (24, 1) = -0.24294629294277565e-13, (24, 2) = 0.6033751098446911e-13, (25, 1) = -0.10212795741481291e-13, (25, 2) = -0.5409909790245115e-14, (26, 1) = 0.65234775286404595e-14, (26, 2) = 0.10506976038853487e-14, (27, 1) = 0.15145921627767115e-13, (27, 2) = 0.11062582034309036e-13, (28, 1) = 0.17727034515154246e-13, (28, 2) = 0.1392374003706416e-13, (29, 1) = 0.20190304444405087e-13, (29, 2) = 0.24077662756883795e-13, (30, 1) = 0.15567756982704383e-13, (30, 2) = 0.3220356728033926e-13, (31, 1) = 0.2049236289955625e-13, (31, 2) = 0.4582315826902611e-13, (32, 1) = 0.2093779309445625e-13, (32, 2) = 0.50847503530540665e-13, (33, 1) = 0.34656722670579105e-13, (33, 2) = 0.65791408284367e-13, (34, 1) = 0.1414627403891834e-13, (34, 2) = 0.7434970442839986e-13, (35, 1) = 0.1430197385087178e-13, (35, 2) = 0.807995248637132e-13, (36, 1) = 0.2674246752632126e-13, (36, 2) = 0.8238316242997303e-13, (37, 1) = 0.3749521089102351e-13, (37, 2) = 0.9551972331079688e-13, (38, 1) = 0.43798173157104124e-13, (38, 2) = 0.8882243056529444e-13, (39, 1) = 0.34765247192333954e-13, (39, 2) = 0.7174268116999525e-13, (40, 1) = 0.3492718539460031e-13, (40, 2) = 0.25074509668472094e-13, (41, 1) = 0.3268343950774218e-13, (41, 2) = -0.6182099171300564e-13, (42, 1) = 0.7615127467050659e-14, (42, 2) = -0.1854246486047524e-12, (43, 1) = 0.20280258788197414e-13, (43, 2) = -0.2612655964015281e-12, (44, 1) = 0.5268977580072408e-14, (44, 2) = -0.3058713868413555e-12, (45, 1) = 0.8243135377351008e-14, (45, 2) = -0.3000324869932838e-12, (46, 1) = 0.9651203882669847e-14, (46, 2) = -0.23958986839330786e-12, (47, 1) = -0.15172603499122148e-13, (47, 2) = -0.14114952424844551e-12, (48, 1) = 0.6415293117671377e-14, (48, 2) = -0.3574626525598719e-13, (49, 1) = 0.11771473310921094e-13, (49, 2) = 0.12758808412240534e-13, (50, 1) = 0.350361321759921e-14, (50, 2) = 0.18960251337597162e-13, (51, 1) = -0.402567915071639e-14, (51, 2) = -0.42598728779319296e-13, (52, 1) = 0.14493706543893737e-13, (52, 2) = -0.4380811741884113e-13, (53, 1) = 0.19531436506149837e-13, (53, 2) = -0.8490114617635297e-13, (54, 1) = 0.4784180312117899e-14, (54, 2) = -0.10238102255674353e-12, (55, 1) = 0.13186433513432542e-13, (55, 2) = -0.12142340951879697e-12, (56, 1) = 0.68589188913736246e-14, (56, 2) = -0.10734720880680753e-12, (57, 1) = 0.4428481028761533e-14, (57, 2) = -0.9866461770792047e-13, (58, 1) = 0.7387414481358141e-14, (58, 2) = -0.9166293971010342e-13, (59, 1) = .0, (59, 2) = -0.731647525953621e-13}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[59] elif outpoint = "order" then return 10 elif outpoint = "error" then return HFloat(3.058713868413555e-13) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 59, [v(u), diff(v(u), u)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[59] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[59] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(59, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(59, 2, X, Y, outpoint, yout, L, V) end if; [u = outpoint, seq('[v(u), diff(v(u), u)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[59] elif outpoint = "order" then return 10 elif outpoint = "error" then return HFloat(3.058713868413555e-13) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 59, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[59] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[59] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(59, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(59, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893628625353841228, (2) = 36893628625353841404, (3) = 36893628625353841580}), (3) = [u, v(u), diff(v(u), u)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(u) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(u) else v := pointto(data[2][2]); return ('v')(u) end if end if; try res := solnproc(outpoint); res[2] catch: error  end try end proc, D(v) = proc (u) local res, data, solnproc, `D(v)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](u) else outpoint := evalf(u) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(59, {(1) = .0, (2) = 0.13680812436809657e-1, (3) = 0.27971051145644167e-1, (4) = 0.4296023135974479e-1, (5) = 0.5851786182852681e-1, (6) = 0.7435973609701907e-1, (7) = 0.9049963296106847e-1, (8) = .1070194360291177, (9) = .12400404122395811, (10) = .14149911102616744, (11) = .15962080170244286, (12) = .17846661163773977, (13) = .1981659899247577, (14) = .2189484735830971, (15) = .2410342106109193, (16) = .2648591917099649, (17) = .29096256417430655, (18) = .3201405168424954, (19) = .3537506263213988, (20) = .39359925436482457, (21) = .44328213017143814, (22) = .508829664760916, (23) = .5993459008179163, (24) = .7156934169226271, (25) = .8282966673508598, (26) = .9130409367878883, (27) = .9748398788122531, (28) = 1.0223008015052495, (29) = 1.0606661846616776, (30) = 1.0932188074676115, (31) = 1.1216707736458404, (32) = 1.1472399927159063, (33) = 1.1706725764522086, (34) = 1.1924372702961963, (35) = 1.2129338175389266, (36) = 1.2323858241405192, (37) = 1.250955152949817, (38) = 1.268795762648431, (39) = 1.2859897085262963, (40) = 1.3026146566339305, (41) = 1.3187452976919192, (42) = 1.3344237627757964, (43) = 1.3497030677053556, (44) = 1.3646567912885574, (45) = 1.3793073520205892, (46) = 1.3936816310415334, (47) = 1.407863413800478, (48) = 1.421874455055364, (49) = 1.4357209480594326, (50) = 1.449452395680341, (51) = 1.463105461314161, (52) = 1.4766814720936998, (53) = 1.4901926102416252, (54) = 1.5036746366401115, (55) = 1.5171303716739315, (56) = 1.5305608572874234, (57) = 1.5439797161303026, (58) = 1.5573915356105725, (59) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(59, 2, {(1, 1) = .0, (1, 2) = 12.679746440910824, (2, 1) = .17295641157725689, (2, 2) = 12.567764844010108, (3, 1) = .3503687425101184, (3, 2) = 12.226735465168346, (4, 1) = .5296761539769358, (4, 2) = 11.66918438963109, (5, 1) = .7057258717088374, (5, 2) = 10.944263938053027, (6, 1) = .8727045160581467, (6, 2) = 10.12940781981862, (7, 1) = 1.0293675300859457, (7, 2) = 9.286027153268176, (8, 1) = 1.1758543805831463, (8, 2) = 8.457430747175952, (9, 1) = 1.3127197264585053, (9, 2) = 7.671647779381384, (10, 1) = 1.4404597517069202, (10, 2) = 6.945889507639623, (11, 1) = 1.5602083118771684, (11, 2) = 6.28529164237151, (12, 1) = 1.6729138904127339, (12, 2) = 5.690377357385402, (13, 1) = 1.7796245072672423, (13, 2) = 5.157666928630136, (14, 1) = 1.8817159269340347, (14, 2) = 4.680400525330798, (15, 1) = 1.9802286821314778, (15, 2) = 4.2529853303192855, (16, 1) = 2.0768238867507085, (16, 2) = 3.8675310705673276, (17, 1) = 2.173068367774721, (17, 2) = 3.5178917521371798, (18, 1) = 2.270890048473742, (18, 2) = 3.1984139900960797, (19, 1) = 2.3732345057338295, (19, 2) = 2.9030738541180425, (20, 1) = 2.4832304722226684, (20, 2) = 2.6296687269685846, (21, 1) = 2.607217350093064, (21, 2) = 2.3751465147467514, (22, 1) = 2.7547856154152726, (22, 2) = 2.144274550259719, (23, 1) = 2.939616093527199, (23, 2) = 1.961813066469559, (24, 1) = 3.162337834655888, (24, 2) = 1.8947028342219836, (25, 1) = 3.3794261487929442, (25, 2) = 1.9881175251450118, (26, 1) = 3.5551825581028798, (26, 2) = 2.1804710450280265, (27, 1) = 3.69665130286631, (27, 2) = 2.41371269610685, (28, 1) = 3.8169541259171704, (28, 2) = 2.6689707564501304, (29, 1) = 3.9243694765971413, (29, 2) = 2.9422812417392152, (30, 1) = 4.024767234931778, (30, 2) = 3.237123523436467, (31, 1) = 4.121259324516239, (31, 2) = 3.5565852574603505, (32, 1) = 4.216529428559537, (32, 2) = 3.9064929391469123, (33, 1) = 4.312457356149003, (33, 2) = 4.292723456572624, (34, 1) = 4.410412203730131, (34, 2) = 4.720850296041311, (35, 1) = 4.511931211523759, (35, 2) = 5.198255733142234, (36, 1) = 4.618090131180544, (36, 2) = 5.730648052338743, (37, 1) = 4.729865319802914, (37, 2) = 6.322579877258892, (38, 1) = 4.848375884647389, (38, 2) = 6.977624814470957, (39, 1) = 4.974387707359408, (39, 2) = 7.694131606716463, (40, 1) = 5.108607237299307, (40, 2) = 8.464739698798486, (41, 1) = 5.251606222026279, (41, 2) = 9.273734329435953, (42, 1) = 5.403405586640311, (42, 2) = 10.092710388426758, (43, 1) = 5.563684034528413, (43, 2) = 10.88121631033313, (44, 1) = 5.731806698053641, (44, 2) = 11.588598491150355, (45, 1) = 5.905935538945928, (45, 2) = 12.156134835319502, (46, 1) = 6.0836133491883215, (46, 2) = 12.530876289186718, (47, 1) = 6.262647078633722, (47, 2) = 12.678160168039451, (48, 1) = 6.439921199996006, (48, 2) = 12.587708080348033, (49, 1) = 6.612315033049238, (49, 2) = 12.2791039631489, (50, 1) = 6.777770156025198, (50, 2) = 11.79378728978802, (51, 1) = 6.934742040084409, (51, 2) = 11.183836634124887, (52, 1) = 7.0820078226929555, (52, 2) = 10.502833198232775, (53, 1) = 7.219149840143932, (53, 2) = 9.796155822525524, (54, 1) = 7.34648415514996, (54, 2) = 9.096522907410908, (55, 1) = 7.464338781940853, (55, 2) = 8.427075143053173, (56, 1) = 7.573265028033481, (56, 2) = 7.801521511288004, (57, 1) = 7.67403328840954, (57, 2) = 7.22588851589702, (58, 1) = 7.767374215067717, (58, 2) = 6.701837954309735, (59, 1) = 7.85398163397448, (59, 2) = 6.228168238234758}, datatype = float[8], order = C_order); YP := Matrix(59, 2, {(1, 1) = 12.679746440910824, (1, 2) = -.0, (2, 1) = 12.567764844010108, (2, 2) = -16.198974726732907, (3, 1) = 12.226735465168346, (3, 2) = -31.019959257656904, (4, 1) = 11.66918438963109, (4, 2) = -42.61556998298658, (5, 1) = 10.944263938053027, (5, 2) = -49.758388561480395, (6, 1) = 10.12940781981862, (6, 2) = -52.428967468700804, (7, 1) = 9.286027153268176, (7, 2) = -51.59782241363348, (8, 1) = 8.457430747175952, (8, 2) = -48.43560278055239, (9, 1) = 7.671647779381384, (9, 2) = -43.97106435599, (10, 1) = 6.945889507639623, (10, 2) = -38.985423814257885, (11, 1) = 6.28529164237151, (11, 2) = -33.97931379570107, (12, 1) = 5.690377357385402, (12, 2) = -29.25037640167964, (13, 1) = 5.157666928630136, (13, 2) = -24.944278873434246, (14, 1) = 4.680400525330798, (14, 2) = -21.099971062135964, (15, 1) = 4.2529853303192855, (15, 2) = -17.71654087434397, (16, 1) = 3.8675310705673276, (16, 2) = -14.74668416472017, (17, 1) = 3.5178917521371798, (17, 2) = -12.14221532932914, (18, 1) = 3.1984139900960797, (18, 2) = -9.851136892783515, (19, 1) = 2.9030738541180425, (19, 2) = -7.815047340827251, (20, 1) = 2.6296687269685846, (20, 2) = -5.996847641998252, (21, 1) = 2.3751465147467514, (21, 2) = -4.340048329343317, (22, 1) = 2.144274550259719, (22, 2) = -2.7978073376293024, (23, 1) = 1.961813066469559, (23, 2) = -1.320655805545758, (24, 1) = 1.8947028342219836, (24, 2) = .13039610824419176, (25, 1) = 1.9881175251450118, (25, 2) = 1.5787914768274436, (26, 1) = 2.1804710450280265, (26, 2) = 3.0488939854293733, (27, 1) = 2.41371269610685, (27, 2) = 4.590848716067672, (28, 1) = 2.6689707564501304, (28, 2) = 6.254836311594842, (29, 1) = 2.9422812417392152, (29, 2) = 8.080806575409401, (30, 1) = 3.237123523436467, (30, 2) = 10.12389716847413, (31, 1) = 3.5565852574603505, (31, 2) = 12.425685648274625, (32, 1) = 3.9064929391469123, (32, 2) = 15.042554769209124, (33, 1) = 4.292723456572624, (33, 2) = 18.027628684062055, (34, 1) = 4.720850296041311, (34, 2) = 21.42377820734578, (35, 1) = 5.198255733142234, (35, 2) = 25.27273224998513, (36, 1) = 5.730648052338743, (36, 2) = 29.574358687095494, (37, 1) = 6.322579877258892, (37, 2) = 34.27026010854073, (38, 1) = 6.977624814470957, (38, 2) = 39.21645062769387, (39, 1) = 7.694131606716463, (39, 2) = 44.11406880450838, (40, 1) = 8.464739698798486, (40, 2) = 48.471285191096335, (41, 1) = 9.273734329435953, (41, 2) = 51.56564318350719, (42, 1) = 10.092710388426758, (42, 2) = 52.45733113498812, (43, 1) = 10.88121631033313, (43, 2) = 50.12848157993341, (44, 1) = 11.588598491150355, (44, 2) = 43.73470437900077, (45, 1) = 12.156134835319502, (45, 2) = 33.00620482181849, (46, 1) = 12.530876289186718, (46, 2) = 18.57982197925053, (47, 1) = 12.678160168039451, (47, 2) = 1.9582711648426194, (48, 1) = 12.587708080348033, (48, 2) = -14.727409356953261, (49, 1) = 12.2791039631489, (49, 2) = -29.39558090446206, (50, 1) = 11.79378728978802, (50, 2) = -40.669372493045, (51, 1) = 11.183836634124887, (51, 2) = -48.03607321421275, (52, 1) = 10.502833198232775, (52, 2) = -51.72939943874306, (53, 1) = 9.796155822525524, (53, 2) = -52.452900134134595, (54, 1) = 9.096522907410908, (54, 2) = -51.04757024201683, (55, 1) = 8.427075143053173, (55, 2) = -48.28611154332724, (56, 1) = 7.801521511288004, (56, 2) = -44.78604220693657, (57, 1) = 7.22588851589702, (57, 2) = -40.986432776247455, (58, 1) = 6.701837954309735, (58, 2) = -37.176690679157566, (59, 1) = 6.228168238234758, (59, 2) = -33.53206368300497}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(59, {(1) = .0, (2) = 0.13680812436809657e-1, (3) = 0.27971051145644167e-1, (4) = 0.4296023135974479e-1, (5) = 0.5851786182852681e-1, (6) = 0.7435973609701907e-1, (7) = 0.9049963296106847e-1, (8) = .1070194360291177, (9) = .12400404122395811, (10) = .14149911102616744, (11) = .15962080170244286, (12) = .17846661163773977, (13) = .1981659899247577, (14) = .2189484735830971, (15) = .2410342106109193, (16) = .2648591917099649, (17) = .29096256417430655, (18) = .3201405168424954, (19) = .3537506263213988, (20) = .39359925436482457, (21) = .44328213017143814, (22) = .508829664760916, (23) = .5993459008179163, (24) = .7156934169226271, (25) = .8282966673508598, (26) = .9130409367878883, (27) = .9748398788122531, (28) = 1.0223008015052495, (29) = 1.0606661846616776, (30) = 1.0932188074676115, (31) = 1.1216707736458404, (32) = 1.1472399927159063, (33) = 1.1706725764522086, (34) = 1.1924372702961963, (35) = 1.2129338175389266, (36) = 1.2323858241405192, (37) = 1.250955152949817, (38) = 1.268795762648431, (39) = 1.2859897085262963, (40) = 1.3026146566339305, (41) = 1.3187452976919192, (42) = 1.3344237627757964, (43) = 1.3497030677053556, (44) = 1.3646567912885574, (45) = 1.3793073520205892, (46) = 1.3936816310415334, (47) = 1.407863413800478, (48) = 1.421874455055364, (49) = 1.4357209480594326, (50) = 1.449452395680341, (51) = 1.463105461314161, (52) = 1.4766814720936998, (53) = 1.4901926102416252, (54) = 1.5036746366401115, (55) = 1.5171303716739315, (56) = 1.5305608572874234, (57) = 1.5439797161303026, (58) = 1.5573915356105725, (59) = 1.5707963267949}, datatype = float[8], order = C_order); Y := Matrix(59, 2, {(1, 1) = .0, (1, 2) = -0.2040971830865995e-12, (2, 1) = -0.2515085127931946e-15, (2, 2) = -0.2182240868305703e-12, (3, 1) = -0.3034400215680231e-14, (3, 2) = -0.24629572182126297e-12, (4, 1) = -0.70293294530316345e-14, (4, 2) = -0.27355561891671303e-12, (5, 1) = -0.11642509457266535e-13, (5, 2) = -0.2921725988376451e-12, (6, 1) = -0.14891698174826332e-13, (6, 2) = -0.27332966679506926e-12, (7, 1) = -0.2244158402930937e-13, (7, 2) = -0.21555448086863683e-12, (8, 1) = -0.23830070405255755e-13, (8, 2) = -0.14452163468605652e-12, (9, 1) = -0.28784241689197694e-13, (9, 2) = -0.8936429016769738e-13, (10, 1) = -0.2870763992607896e-13, (10, 2) = -0.7015153701410498e-13, (11, 1) = -0.29805232120338505e-13, (11, 2) = -0.20455226198960395e-13, (12, 1) = -0.3071869736898188e-13, (12, 2) = -0.949608712395301e-14, (13, 1) = -0.33085750279284234e-13, (13, 2) = -0.9853725522439467e-14, (14, 1) = -0.3024025650769599e-13, (14, 2) = 0.55343272382320285e-14, (15, 1) = -0.2989762453456761e-13, (15, 2) = 0.9484091577415516e-14, (16, 1) = -0.3126420836975352e-13, (16, 2) = 0.10993914919372806e-15, (17, 1) = -0.2904952409517121e-13, (17, 2) = 0.7741875869166384e-14, (18, 1) = -0.26389405390354672e-13, (18, 2) = -0.39736138956257974e-14, (19, 1) = -0.3066642976676729e-13, (19, 2) = -0.8841791351636723e-14, (20, 1) = -0.3381874764737987e-13, (20, 2) = -0.10474029579197825e-13, (21, 1) = -0.3076950762715862e-13, (21, 2) = -0.14630357321113296e-13, (22, 1) = -0.25742990878046857e-13, (22, 2) = -0.32013707096004785e-13, (23, 1) = -0.26034531106847924e-14, (23, 2) = -0.17882398235769704e-13, (24, 1) = -0.24294629294277565e-13, (24, 2) = 0.6033751098446911e-13, (25, 1) = -0.10212795741481291e-13, (25, 2) = -0.5409909790245115e-14, (26, 1) = 0.65234775286404595e-14, (26, 2) = 0.10506976038853487e-14, (27, 1) = 0.15145921627767115e-13, (27, 2) = 0.11062582034309036e-13, (28, 1) = 0.17727034515154246e-13, (28, 2) = 0.1392374003706416e-13, (29, 1) = 0.20190304444405087e-13, (29, 2) = 0.24077662756883795e-13, (30, 1) = 0.15567756982704383e-13, (30, 2) = 0.3220356728033926e-13, (31, 1) = 0.2049236289955625e-13, (31, 2) = 0.4582315826902611e-13, (32, 1) = 0.2093779309445625e-13, (32, 2) = 0.50847503530540665e-13, (33, 1) = 0.34656722670579105e-13, (33, 2) = 0.65791408284367e-13, (34, 1) = 0.1414627403891834e-13, (34, 2) = 0.7434970442839986e-13, (35, 1) = 0.1430197385087178e-13, (35, 2) = 0.807995248637132e-13, (36, 1) = 0.2674246752632126e-13, (36, 2) = 0.8238316242997303e-13, (37, 1) = 0.3749521089102351e-13, (37, 2) = 0.9551972331079688e-13, (38, 1) = 0.43798173157104124e-13, (38, 2) = 0.8882243056529444e-13, (39, 1) = 0.34765247192333954e-13, (39, 2) = 0.7174268116999525e-13, (40, 1) = 0.3492718539460031e-13, (40, 2) = 0.25074509668472094e-13, (41, 1) = 0.3268343950774218e-13, (41, 2) = -0.6182099171300564e-13, (42, 1) = 0.7615127467050659e-14, (42, 2) = -0.1854246486047524e-12, (43, 1) = 0.20280258788197414e-13, (43, 2) = -0.2612655964015281e-12, (44, 1) = 0.5268977580072408e-14, (44, 2) = -0.3058713868413555e-12, (45, 1) = 0.8243135377351008e-14, (45, 2) = -0.3000324869932838e-12, (46, 1) = 0.9651203882669847e-14, (46, 2) = -0.23958986839330786e-12, (47, 1) = -0.15172603499122148e-13, (47, 2) = -0.14114952424844551e-12, (48, 1) = 0.6415293117671377e-14, (48, 2) = -0.3574626525598719e-13, (49, 1) = 0.11771473310921094e-13, (49, 2) = 0.12758808412240534e-13, (50, 1) = 0.350361321759921e-14, (50, 2) = 0.18960251337597162e-13, (51, 1) = -0.402567915071639e-14, (51, 2) = -0.42598728779319296e-13, (52, 1) = 0.14493706543893737e-13, (52, 2) = -0.4380811741884113e-13, (53, 1) = 0.19531436506149837e-13, (53, 2) = -0.8490114617635297e-13, (54, 1) = 0.4784180312117899e-14, (54, 2) = -0.10238102255674353e-12, (55, 1) = 0.13186433513432542e-13, (55, 2) = -0.12142340951879697e-12, (56, 1) = 0.68589188913736246e-14, (56, 2) = -0.10734720880680753e-12, (57, 1) = 0.4428481028761533e-14, (57, 2) = -0.9866461770792047e-13, (58, 1) = 0.7387414481358141e-14, (58, 2) = -0.9166293971010342e-13, (59, 1) = .0, (59, 2) = -0.731647525953621e-13}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[59] elif outpoint = "order" then return 10 elif outpoint = "error" then return HFloat(3.058713868413555e-13) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 59, [v(u), diff(v(u), u)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[59] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[59] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(59, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(59, 2, X, Y, outpoint, yout, L, V) end if; [u = outpoint, seq('[v(u), diff(v(u), u)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[59] elif outpoint = "order" then return 10 elif outpoint = "error" then return HFloat(3.058713868413555e-13) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 59, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[59] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[59] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(59, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(59, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893628625353841228, (2) = 36893628625353841404, (3) = 36893628625353841580}), (3) = [u, v(u), diff(v(u), u)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(u) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(u) else `D(v)` := pointto(data[2][3]); return ('`D(v)`')(u) end if end if; try res := solnproc(outpoint); res[3] catch: error  end try end proc]

display(
        torus,
        tubeplot([seq(eval(x(u, v(u)), dsol1))], u=0..Pi/2, color=red, radius=0.1),
        tubeplot([seq(eval(x(u, v(u)), dsol3))], u=0..Pi/2, color=cyan, radius=0.1),
        pointplot3d(eval([x(0,v(0)),x(Pi/2,v(Pi/2))], dsol3), symbol=solidsphere, symbolsize=20, color="Orange"),
lightmodel=light4, thickness=5, orientation=[-65,45,0], size=[700,400],
style=surface, axes=none, viewpoint=circleright);

 

 

>

 

Download geodesics-between-two-points.mw

You will find the geodesic equations in the wikipedia web page that you have referenced to.   Admittedly it is rather cryptic, involving Christoffel symbols in an implicit summation.  Once we unpack the notation, the geodesic equations for a surface turn out to be a pair of coupled, second order, nonlinear ODEs.  These equations are usually derived in an introductory course on differential geometry.  To get to those equations, one needs to learn about a surface's first fundamental form and how the Christoffel symbols are expressed in terms of the coefficients of the first fundamental form.  

The Christoffel() proc in the attached worksheet calculates the coefficients of the first fundamental form of any surface and then calculates and returns the corresponding Christoffel symbols.  To understand the details, you need to know some differential geometry.

A second proc, Geodesic_DEs(), applies the equation in the Wikipedia page to calculate and return the surface's geodesic equations.  Once you have those equations, you can apply Maple's dsolve() to calculate and plot the geodesics.  The worksheet includes an illustrative example.

Maple's Differential Geometry package has a GeodesicEquations() function.  Odds are that what I have calculated here can be done more quickly by applying that function but don't know how.  Perhaps someone who knows may show us.

Answers to the several questions that you asked would involve some elementary differential geometry, so I cannot summarize them here in a few lines.  I can, however, give short answers to two of those questions:

  1. What does "to walk forward" mean?  When you move on a surface, at each location you have a velocity vector, an acceleration vector, and a normal vector (i.e., vector perpendicular to the surface).  You are "moving forward", or equivalently, "traveling on a geodesic", provided that those three vectors are co-planar.
  2. Geodesic is the shortest distance between two points in space, but no such end points are shown in the website's animation.  A geodesic typically extends indefinitely in both directions.  There are no end points.  A curve is geodesic if for any pair of points A, B on the curve, the part of the curve that lies between A and B is the shortest path among all curves that lie on the surface and connect A to B. 

restart;

with(plots):

Receives a parametrization x of a surface and returns the corresponding

Christoffel symbols `#msubsup(mi("&Gamma;",fontstyle = "normal"),mi("jk"),mi("i"))`, each of which is a procedure.

Christoffel := proc(x::procedure)
        local u, v, xu, xv, E, F, G, Eu, Ev, Fu, Fv, Gu, Gv, den, C;
        xu := diff(x(u,v),u);
        xv := diff(x(u,v),v);
        # E, F, G are the coefficients of the surface's first fundamental form
        E := xu^+ . xu;
        F := xu^+ . xv;
        G := xv^+ . xv;
        Eu := diff(E, u);
        Ev := diff(E, v);
        Fu := diff(F, u);
        Fv := diff(F, v);
        Gu := diff(G, u);
        Gv := diff(G, v);
        den := 2*(E*G - F^2);
        C[1][1,1] := unapply(simplify((G*Eu - 2*F*Fu + F*Ev)/den), u, v);
        C[1][1,2] := unapply(simplify((G*Ev - F*Gu)/den), u, v);
        C[1][2,2] := unapply(simplify(-(F*Gv - 2*G*Fv + G*Gu)/den), u, v);
        C[2][1,1] := unapply(simplify(-(E*Ev - 2*E*Fu + F*Eu)/den), u, v);
        C[2][1,2] := unapply(simplify((E*Gu - F*Ev)/den), u, v);
        C[2][2,2] := unapply(simplify((E*Gv - 2*F*Fv + F*Gu)/den), u, v);
        C[1][2,1] := C[1][1,2];
        C[2][2,1] := C[2][1,2];
        return C;
end proc:

Example: A sphere

x := (u,v) -> < cos(v)*cos(u), cos(v)*sin(u), sin(v) >;

proc (u, v) options operator, arrow; `<,>`(cos(v)*cos(u), cos(v)*sin(u), sin(v)) end proc

Here are the 8 Christoffel symbols of our parametrization of the sphere:

Gamma := Christoffel(x):

Gamma[1][1,1](u,v), Gamma[1][1,2](u,v), Gamma[1][2,1](u,v), Gamma[1][2,2](u,v);

0, -sin(v)/cos(v), -sin(v)/cos(v), 0

Gamma[2][1,1](u,v), Gamma[2][1,2](u,v), Gamma[2][2,1](u,v), Gamma[2][2,2](u,v);

cos(v)*sin(v), 0, 0, 0

Example: A torus of major radius a and minor radius bNULL

x := (u,v) -> < (a+b*cos(v))*cos(u), (a+b*cos(v))*sin(u),  b*sin(v) >;

proc (u, v) options operator, arrow; `<,>`((a+b*cos(v))*cos(u), (a+b*cos(v))*sin(u), b*sin(v)) end proc

Gamma := Christoffel(x):

Gamma[1][1,1](u,v), Gamma[1][1,2](u,v), Gamma[1][2,1](u,v), Gamma[1][2,2](u,v);

0, -b*sin(v)/(a+b*cos(v)), -b*sin(v)/(a+b*cos(v)), 0

Gamma[2][1,1](u,v), Gamma[2][1,2](u,v), Gamma[2][2,1](u,v), Gamma[2][2,2](u,v);

(a+b*cos(v))*sin(v)/b, 0, 0, 0

The geodesic equations

Geodesic_DEs := proc(x::procedure)
        local Gamma, de, i, j, k, X;
        Gamma := Christoffel(x);
        for i from 1 to 2 do
           de[i] := diff(X[i](t), t, t) + add(add(
                        Gamma[i][j,k](X[1](t),X[2](t))*diff(X[j](t),t)*diff(X[k](t),t),
                        j=1..2), k=1..2) = 0;
        end do:
        eval([de[1],de[2]], {X[1]=u, X[2]=v})[];   # change notation from X to u, v
        return (%);
end proc:

 

Geodesics on a torus

 

Here we calculate and plot geodesics on a torus.  You may change the torus

to any other parametrized surface.  Everthing else remains the same.

< (a+b*cos(v))*cos(u), (a+b*cos(v))*sin(u),  b*sin(v) >;
eval(%, {a=5, b=2});
x := unapply(%, u, v):

Vector(3, {(1) = (a+b*cos(v))*cos(u), (2) = (a+b*cos(v))*sin(u), (3) = b*sin(v)})

Vector[column](%id = 36893628224392653508)

the_torus := plot3d(x(u,v), u=-Pi..Pi, v=-Pi..Pi, scaling=constrained, style=wireframe);

The differential equations of geodesics on torus

DEs := Geodesic_DEs(x);

diff(diff(u(t), t), t)-4*sin(v(t))*(diff(v(t), t))*(diff(u(t), t))/(5+2*cos(v(t))) = 0, diff(diff(v(t), t), t)+(cos(v(t))*sin(v(t))+(5/2)*sin(v(t)))*(diff(u(t), t))^2 = 0

Pick any desired starting point and direction on the torus.  The angle theta determines
the geodesic's initial direction.

unassign('theta');
ICs := u(0) = 0, v(0) = 0, D(u)(0) = cos(theta), D(v)(0) = sin(theta);

u(0) = 0, v(0) = 0, (D(u))(0) = cos(theta), (D(v))(0) = sin(theta)

Pick a theta and solve the geodesic DEs

theta:= 0.95*Pi/2:
dsol := dsolve({DEs, ICs}, numeric, output=operator);

[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( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 28, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..65, {(1) = 4, (2) = 4, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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, (64) = -1, (65) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.5063267118756435e-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..4, {(1) = .0, (2) = 0.7845909618e-1, (3) = .0, (4) = .9969173337}, 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..4, {(1) = .1, (2) = .1, (3) = .1, (4) = .1}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8]), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..8, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..4, {(1) = .0, (2) = 0.7845909618e-1, (3) = .0, (4) = .9969173337}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0.7845909618e-1, (2) = .0, (3) = .9969173337, (4) = -.0}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(t), Y[2] = diff(u(t),t), Y[3] = v(t), Y[4] = diff(v(t),t)]`; YP[2] := 4*sin(Y[3])*Y[4]*Y[2]/(5+2*cos(Y[3])); YP[4] := -(cos(Y[3])*sin(Y[3])+(5/2)*sin(Y[3]))*Y[2]^2; YP[1] := Y[2]; YP[3] := Y[4]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(t), Y[2] = diff(u(t),t), Y[3] = v(t), Y[4] = diff(v(t),t)]`; YP[2] := 4*sin(Y[3])*Y[4]*Y[2]/(5+2*cos(Y[3])); YP[4] := -(cos(Y[3])*sin(Y[3])+(5/2)*sin(Y[3]))*Y[2]^2; YP[1] := Y[2]; YP[3] := Y[4]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 27 ) = (""), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0), ( 28 ) = (0)  ] ))  ] ); _y0 := Array(0..4, {(1) = 0., (2) = 0., (3) = 0.7845909618e-1, (4) = 0.}); _vmap := array( 1 .. 4, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if elif type(_xin, `=`) and lhs(_xin) = "setdatacallback" then if not type(rhs(_xin), 'nonegint') then error "data callback must be a nonnegative integer (address)" end if; _dtbl[1][28] := rhs(_xin) 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..5, {(1) = 36893628224079000428, (2) = 36893628224079000604, (3) = 36893628224079000780, (4) = 36893628224079000956, (5) = 36893628224079001132}), (3) = [t, u(t), diff(u(t), t), v(t), diff(v(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, u = 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( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 28, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..65, {(1) = 4, (2) = 4, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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, (64) = -1, (65) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.5063267118756435e-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..4, {(1) = .0, (2) = 0.7845909618e-1, (3) = .0, (4) = .9969173337}, 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..4, {(1) = .1, (2) = .1, (3) = .1, (4) = .1}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8]), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..8, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..4, {(1) = .0, (2) = 0.7845909618e-1, (3) = .0, (4) = .9969173337}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0.7845909618e-1, (2) = .0, (3) = .9969173337, (4) = -.0}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(t), Y[2] = diff(u(t),t), Y[3] = v(t), Y[4] = diff(v(t),t)]`; YP[2] := 4*sin(Y[3])*Y[4]*Y[2]/(5+2*cos(Y[3])); YP[4] := -(cos(Y[3])*sin(Y[3])+(5/2)*sin(Y[3]))*Y[2]^2; YP[1] := Y[2]; YP[3] := Y[4]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(t), Y[2] = diff(u(t),t), Y[3] = v(t), Y[4] = diff(v(t),t)]`; YP[2] := 4*sin(Y[3])*Y[4]*Y[2]/(5+2*cos(Y[3])); YP[4] := -(cos(Y[3])*sin(Y[3])+(5/2)*sin(Y[3]))*Y[2]^2; YP[1] := Y[2]; YP[3] := Y[4]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 27 ) = (""), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0), ( 28 ) = (0)  ] ))  ] ); _y0 := Array(0..4, {(1) = 0., (2) = 0., (3) = 0.7845909618e-1, (4) = 0.}); _vmap := array( 1 .. 4, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if elif type(_xin, `=`) and lhs(_xin) = "setdatacallback" then if not type(rhs(_xin), 'nonegint') then error "data callback must be a nonnegative integer (address)" end if; _dtbl[1][28] := rhs(_xin) 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..5, {(1) = 36893628224079000428, (2) = 36893628224079000604, (3) = 36893628224079000780, (4) = 36893628224079000956, (5) = 36893628224079001132}), (3) = [t, u(t), diff(u(t), t), v(t), diff(v(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`("u"); 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, D(u) = 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( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 28, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..65, {(1) = 4, (2) = 4, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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, (64) = -1, (65) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.5063267118756435e-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..4, {(1) = .0, (2) = 0.7845909618e-1, (3) = .0, (4) = .9969173337}, 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..4, {(1) = .1, (2) = .1, (3) = .1, (4) = .1}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8]), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..8, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..4, {(1) = .0, (2) = 0.7845909618e-1, (3) = .0, (4) = .9969173337}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0.7845909618e-1, (2) = .0, (3) = .9969173337, (4) = -.0}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(t), Y[2] = diff(u(t),t), Y[3] = v(t), Y[4] = diff(v(t),t)]`; YP[2] := 4*sin(Y[3])*Y[4]*Y[2]/(5+2*cos(Y[3])); YP[4] := -(cos(Y[3])*sin(Y[3])+(5/2)*sin(Y[3]))*Y[2]^2; YP[1] := Y[2]; YP[3] := Y[4]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(t), Y[2] = diff(u(t),t), Y[3] = v(t), Y[4] = diff(v(t),t)]`; YP[2] := 4*sin(Y[3])*Y[4]*Y[2]/(5+2*cos(Y[3])); YP[4] := -(cos(Y[3])*sin(Y[3])+(5/2)*sin(Y[3]))*Y[2]^2; YP[1] := Y[2]; YP[3] := Y[4]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 27 ) = (""), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0), ( 28 ) = (0)  ] ))  ] ); _y0 := Array(0..4, {(1) = 0., (2) = 0., (3) = 0.7845909618e-1, (4) = 0.}); _vmap := array( 1 .. 4, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if elif type(_xin, `=`) and lhs(_xin) = "setdatacallback" then if not type(rhs(_xin), 'nonegint') then error "data callback must be a nonnegative integer (address)" end if; _dtbl[1][28] := rhs(_xin) 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..5, {(1) = 36893628224079000428, (2) = 36893628224079000604, (3) = 36893628224079000780, (4) = 36893628224079000956, (5) = 36893628224079001132}), (3) = [t, u(t), diff(u(t), t), v(t), diff(v(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`("D(u)"); 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, v = 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( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 28, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..65, {(1) = 4, (2) = 4, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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, (64) = -1, (65) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.5063267118756435e-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..4, {(1) = .0, (2) = 0.7845909618e-1, (3) = .0, (4) = .9969173337}, 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..4, {(1) = .1, (2) = .1, (3) = .1, (4) = .1}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8]), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..8, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..4, {(1) = .0, (2) = 0.7845909618e-1, (3) = .0, (4) = .9969173337}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0.7845909618e-1, (2) = .0, (3) = .9969173337, (4) = -.0}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(t), Y[2] = diff(u(t),t), Y[3] = v(t), Y[4] = diff(v(t),t)]`; YP[2] := 4*sin(Y[3])*Y[4]*Y[2]/(5+2*cos(Y[3])); YP[4] := -(cos(Y[3])*sin(Y[3])+(5/2)*sin(Y[3]))*Y[2]^2; YP[1] := Y[2]; YP[3] := Y[4]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(t), Y[2] = diff(u(t),t), Y[3] = v(t), Y[4] = diff(v(t),t)]`; YP[2] := 4*sin(Y[3])*Y[4]*Y[2]/(5+2*cos(Y[3])); YP[4] := -(cos(Y[3])*sin(Y[3])+(5/2)*sin(Y[3]))*Y[2]^2; YP[1] := Y[2]; YP[3] := Y[4]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 27 ) = (""), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0), ( 28 ) = (0)  ] ))  ] ); _y0 := Array(0..4, {(1) = 0., (2) = 0., (3) = 0.7845909618e-1, (4) = 0.}); _vmap := array( 1 .. 4, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if elif type(_xin, `=`) and lhs(_xin) = "setdatacallback" then if not type(rhs(_xin), 'nonegint') then error "data callback must be a nonnegative integer (address)" end if; _dtbl[1][28] := rhs(_xin) 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..5, {(1) = 36893628224079000428, (2) = 36893628224079000604, (3) = 36893628224079000780, (4) = 36893628224079000956, (5) = 36893628224079001132}), (3) = [t, u(t), diff(u(t), t), v(t), diff(v(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[4] 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[4], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 4, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 4, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[4] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[4], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(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`("v"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][4])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[4] catch: error  end try end proc, D(v) = 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( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 28, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..65, {(1) = 4, (2) = 4, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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, (64) = -1, (65) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.5063267118756435e-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..4, {(1) = .0, (2) = 0.7845909618e-1, (3) = .0, (4) = .9969173337}, 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..4, {(1) = .1, (2) = .1, (3) = .1, (4) = .1}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0}, datatype = float[8], order = C_order), Array(1..4, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8]), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..8, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0, (2) = 0, (3) = 0, (4) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..4, {(1) = .0, (2) = 0.7845909618e-1, (3) = .0, (4) = .9969173337}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = 0.7845909618e-1, (2) = .0, (3) = .9969173337, (4) = -.0}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..4, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(t), Y[2] = diff(u(t),t), Y[3] = v(t), Y[4] = diff(v(t),t)]`; YP[2] := 4*sin(Y[3])*Y[4]*Y[2]/(5+2*cos(Y[3])); YP[4] := -(cos(Y[3])*sin(Y[3])+(5/2)*sin(Y[3]))*Y[2]^2; YP[1] := Y[2]; YP[3] := Y[4]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(t), Y[2] = diff(u(t),t), Y[3] = v(t), Y[4] = diff(v(t),t)]`; YP[2] := 4*sin(Y[3])*Y[4]*Y[2]/(5+2*cos(Y[3])); YP[4] := -(cos(Y[3])*sin(Y[3])+(5/2)*sin(Y[3]))*Y[2]^2; YP[1] := Y[2]; YP[3] := Y[4]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 27 ) = (""), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0), ( 28 ) = (0)  ] ))  ] ); _y0 := Array(0..4, {(1) = 0., (2) = 0., (3) = 0.7845909618e-1, (4) = 0.}); _vmap := array( 1 .. 4, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if elif type(_xin, `=`) and lhs(_xin) = "setdatacallback" then if not type(rhs(_xin), 'nonegint') then error "data callback must be a nonnegative integer (address)" end if; _dtbl[1][28] := rhs(_xin) 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..5, {(1) = 36893628224079000428, (2) = 36893628224079000604, (3) = 36893628224079000780, (4) = 36893628224079000956, (5) = 36893628224079001132}), (3) = [t, u(t), diff(u(t), t), v(t), diff(v(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[5] 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[5], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 5, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 5, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[5] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[5], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(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`("D(v)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][5])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[5] catch: error  end try end proc]

Plot the geodesic:

eval(x(u(t),v(t)), dsol);
the_curve := spacecurve(%, t=0..15, color="Red", thickness=5);

Vector(3, {(1) = (5+2*cos(v(t)))*cos(u(t)), (2) = (5+2*cos(v(t)))*sin(u(t)), (3) = 2*sin(v(t))})

Here is a composite drawing of the torus and the geodesic

display(the_torus, the_curve);

 

Download geodesics.mw

 

I did this demo for my students some time ago.

Download mw.mwmw.mw

PS:  It's also possible to plot the springs as coils, as here and here but I prefer the wavy springs shown above for this particular example.

This worksheet will work provided that

  1. the north pole is inside the patch;
  2. the patch is "star-shaped" (that's a technical term) with respect to the pole, that is, every meridian (with 0 <= theta <= Pi) intersects the patch's boundary only once .

These conditions are satisfied in your case.

 

restart;

with(plots):

Tranlsates cartesian coordinates (given as a vector) to spherical coordinates (returned as a list)

cartesian_to_spherical := proc(v::Vector(3))
        local x, y, z, r, theta, phi;
        x, y, z := seq(v);
        r := sqrt(x^2+y^2+z^2);
        theta := arccos(z/r);
        phi := arctan(y/r, x/r);
        return simplify([r, theta, phi]);
end proc:

S := (theta, phi) -> < sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta) >;

proc (theta, phi) options operator, arrow; `<,>`(sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta)) end proc

(1)

Shrink the plotted sphere just a bit so that the superimposed patches stand out:

sphere_plot := plot3d(0.999*S(theta,phi), theta=0..Pi, phi=-Pi..Pi,
        color="Orange", style=patch);

 

C1 is given as a parametric curve in Cartesian coordinates.  The name of the parameter, theta,
is misleading since it is unrelated to the spherical coordinate of the same name.

I changed the parameter name to u to reduce confusion.

C1 := u -> <
        0.3071867916 - 0.3748494088*sin(u) + 0.3092507622*cos(u),
        0.3858134286*cos(u) - 0.5068582065 + 0.1636706976*sin(u),
        0.3224530297*sin(u) + 0.6143735837 + 0.1636706976*cos(u)>:
umin, umax := 0.8870700404, 1.362663780:
# convert the curve to spherical coordinates
cartesian_to_spherical(C1(u)):
my_theta, my_phi := %[2], %[3]:
curve_plot1 := spacecurve(C1(u), u=umin..umax, color="Cyan", thickness=3):
patch_plot1 := plot3d(S(theta,my_phi), theta=0..my_theta, u=umin..umax, color="Red"):

Repeat for curves 2 and 3:

C2 := u -> <
        0.5464684013 - 0.3515280247*sin(u),
        0.4434990987*cos(u),
        0.2704061730*sin(u) + 0.7104089214 >:
umin, umax := 0.7339, 1.8831:
# convert the curve to spherical coordinates
simplify(cartesian_to_spherical(C2(u))):
my_theta, my_phi := %[2], %[3]:
curve_plot2 := spacecurve(C2(u), u=umin..umax, color="Cyan", thickness=3):
patch_plot2 := plot3d(S(theta,my_phi), theta=0..my_theta, u=umin..umax, color="Green"):

C3 := u -> <
        0.2150819669 - 0.3346119696*sin(u),
        0.3437498130*cos(u),
        0.07873222801*sin(u) + 0.9140983608 >:
umin, umax := -0.2908, 2.4602:
# convert the curve to spherical coordinates
cartesian_to_spherical(C3(u)):
my_theta, my_phi := %[2], %[3]:
curve_plot3 := spacecurve(C3(u), u=umin..umax, color="Cyan", thickness=3):
patch_plot3 := plot3d(S(theta,my_phi), theta=0..my_theta, u=umin..umax, color="Blue"):

display(sphere_plot,
        curve_plot1, patch_plot1,
        curve_plot2, patch_plot2,
        curve_plot3, patch_plot3, style=surface);

 
 

 


Download Patch_on_a_Sphere_rr.mw

The equations of motion are of the 2nd order in each of the variables Ext, theta, and phi.  So you will need six initial conditions but you have provided only five.  You need to specify an initial value for D(Ext).

That alone doesn't help, however.  There must be some error in your derivation of the equations of motion.  I didn''t have the patience to examine the ad hoc details of your calculations.  I just re-did the derivation in a systematic and generic way.

In the attached worksheet I have changed parameter values and initial conditions to achieve a good-looking result.  You may restore them to your original selections if you wish.

restart;

with(VariationalCalculus):

with(plots):

Bob's position vector

R := (e, theta, phi) ->
        (a + e) * < sin(theta)*cos(phi),
                    sin(theta)*sin(phi),
                    cos(theta) >;

proc (e, theta, phi) options operator, arrow; (a+e)*`<,>`(sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta)) end proc

Bob's position vector at time t:

r := R(e(t), theta(t), phi(t));

Vector(3, {(1) = (a+e(t))*sin(theta(t))*cos(phi(t)), (2) = (a+e(t))*sin(theta(t))*sin(phi(t)), (3) = (a+e(t))*cos(theta(t))})

Bob's velocity vector

v := diff(r, t);

Vector(3, {(1) = (diff(e(t), t))*sin(theta(t))*cos(phi(t))+(a+e(t))*(diff(theta(t), t))*cos(theta(t))*cos(phi(t))-(a+e(t))*sin(theta(t))*(diff(phi(t), t))*sin(phi(t)), (2) = (diff(e(t), t))*sin(theta(t))*sin(phi(t))+(a+e(t))*(diff(theta(t), t))*cos(theta(t))*sin(phi(t))+(a+e(t))*sin(theta(t))*(diff(phi(t), t))*cos(phi(t)), (3) = (diff(e(t), t))*cos(theta(t))-(a+e(t))*(diff(theta(t), t))*sin(theta(t))})

The kinetic and potential energies:

KE := 1/2*m* simplify(v^+ . v);
PE := -m*g*r[3] + 1/2*k*e(t)^2;

(1/2)*m*(-(cos(theta(t))-1)*(cos(theta(t))+1)*(a+e(t))^2*(diff(phi(t), t))^2+(a+e(t))^2*(diff(theta(t), t))^2+(diff(e(t), t))^2)

-m*g*(a+e(t))*cos(theta(t))+(1/2)*k*e(t)^2

The Lagrangian:

L := KE - PE;

(1/2)*m*(-(cos(theta(t))-1)*(cos(theta(t))+1)*(a+e(t))^2*(diff(phi(t), t))^2+(a+e(t))^2*(diff(theta(t), t))^2+(diff(e(t), t))^2)+m*g*(a+e(t))*cos(theta(t))-(1/2)*k*e(t)^2

The Euler-Lagrange equations:

EulerLagrange(L, t, [e(t), theta(t), phi(t)]):
EL := remove(type, %, equation);

{(1/2)*m*(-2*(cos(theta(t))-1)*(cos(theta(t))+1)*(a+e(t))*(diff(phi(t), t))^2+2*(a+e(t))*(diff(theta(t), t))^2)+m*g*cos(theta(t))-k*e(t)-m*(diff(diff(e(t), t), t)), (1/2)*m*(sin(theta(t))*(cos(theta(t))+1)*(a+e(t))^2*(diff(phi(t), t))^2+(cos(theta(t))-1)*sin(theta(t))*(a+e(t))^2*(diff(phi(t), t))^2)-m*g*(a+e(t))*sin(theta(t))-2*m*(a+e(t))*(diff(theta(t), t))*(diff(e(t), t))-m*(a+e(t))^2*(diff(diff(theta(t), t), t)), -m*(diff(theta(t), t))*sin(theta(t))*(cos(theta(t))+1)*(a+e(t))^2*(diff(phi(t), t))-m*(cos(theta(t))-1)*(diff(theta(t), t))*sin(theta(t))*(a+e(t))^2*(diff(phi(t), t))+2*m*(cos(theta(t))-1)*(cos(theta(t))+1)*(a+e(t))*(diff(phi(t), t))*(diff(e(t), t))+m*(cos(theta(t))-1)*(cos(theta(t))+1)*(a+e(t))^2*(diff(diff(phi(t), t), t))}

ics := {
                e(0) = 0,
                D(e)(0) = 0,
                theta(0) = Pi/3,
                D(theta)(0) = 0,
                phi(0) = Pi/6,
                D(phi)(0) = 1 };

{e(0) = 0, phi(0) = (1/6)*Pi, theta(0) = (1/3)*Pi, (D(e))(0) = 0, (D(phi))(0) = 1, (D(theta))(0) = 0}

g := 1; m := 1; k := 5; a := 1; tmax := 30;

1

1

5

1

30

dsol := dsolve(EL union ics, numeric, output=operator);

[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( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 28, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..65, {(1) = 6, (2) = 6, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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, (64) = -1, (65) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.40381270046732365e-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..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .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..6, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1, (6) = .1}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8]), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..12, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = 1.25, (3) = 1.0, (4) = .0, (5) = .0, (6) = -.43301270189222163}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 27 ) = (""), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0), ( 28 ) = (0)  ] ))  ] ); _y0 := Array(0..6, {(1) = 0., (2) = 0., (3) = 0., (4) = .523598775598299, (5) = 1., (6) = 1.04719755119660}); _vmap := array( 1 .. 6, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5), ( 6 ) = (6)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if elif type(_xin, `=`) and lhs(_xin) = "setdatacallback" then if not type(rhs(_xin), 'nonegint') then error "data callback must be a nonnegative integer (address)" end if; _dtbl[1][28] := rhs(_xin) 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..7, {(1) = 36893627880756563828, (2) = 36893627880756547668, (3) = 36893627880756547844, (4) = 36893627880756548020, (5) = 36893627880756548196, (6) = 36893627880756548372, (7) = 36893627880756548548}), (3) = [t, e(t), diff(e(t), t), phi(t), diff(phi(t), t), theta(t), diff(theta(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, e = 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( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 28, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..65, {(1) = 6, (2) = 6, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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, (64) = -1, (65) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.40381270046732365e-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..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .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..6, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1, (6) = .1}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8]), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..12, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = 1.25, (3) = 1.0, (4) = .0, (5) = .0, (6) = -.43301270189222163}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 27 ) = (""), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0), ( 28 ) = (0)  ] ))  ] ); _y0 := Array(0..6, {(1) = 0., (2) = 0., (3) = 0., (4) = .523598775598299, (5) = 1., (6) = 1.04719755119660}); _vmap := array( 1 .. 6, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5), ( 6 ) = (6)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if elif type(_xin, `=`) and lhs(_xin) = "setdatacallback" then if not type(rhs(_xin), 'nonegint') then error "data callback must be a nonnegative integer (address)" end if; _dtbl[1][28] := rhs(_xin) 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..7, {(1) = 36893627880756563828, (2) = 36893627880756547668, (3) = 36893627880756547844, (4) = 36893627880756548020, (5) = 36893627880756548196, (6) = 36893627880756548372, (7) = 36893627880756548548}), (3) = [t, e(t), diff(e(t), t), phi(t), diff(phi(t), t), theta(t), diff(theta(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`("e"); 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, D(e) = 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( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 28, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..65, {(1) = 6, (2) = 6, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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, (64) = -1, (65) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.40381270046732365e-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..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .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..6, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1, (6) = .1}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8]), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..12, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = 1.25, (3) = 1.0, (4) = .0, (5) = .0, (6) = -.43301270189222163}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 27 ) = (""), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0), ( 28 ) = (0)  ] ))  ] ); _y0 := Array(0..6, {(1) = 0., (2) = 0., (3) = 0., (4) = .523598775598299, (5) = 1., (6) = 1.04719755119660}); _vmap := array( 1 .. 6, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5), ( 6 ) = (6)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if elif type(_xin, `=`) and lhs(_xin) = "setdatacallback" then if not type(rhs(_xin), 'nonegint') then error "data callback must be a nonnegative integer (address)" end if; _dtbl[1][28] := rhs(_xin) 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..7, {(1) = 36893627880756563828, (2) = 36893627880756547668, (3) = 36893627880756547844, (4) = 36893627880756548020, (5) = 36893627880756548196, (6) = 36893627880756548372, (7) = 36893627880756548548}), (3) = [t, e(t), diff(e(t), t), phi(t), diff(phi(t), t), theta(t), diff(theta(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`("D(e)"); 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, phi = 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( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 28, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..65, {(1) = 6, (2) = 6, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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, (64) = -1, (65) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.40381270046732365e-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..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .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..6, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1, (6) = .1}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8]), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..12, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = 1.25, (3) = 1.0, (4) = .0, (5) = .0, (6) = -.43301270189222163}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 27 ) = (""), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0), ( 28 ) = (0)  ] ))  ] ); _y0 := Array(0..6, {(1) = 0., (2) = 0., (3) = 0., (4) = .523598775598299, (5) = 1., (6) = 1.04719755119660}); _vmap := array( 1 .. 6, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5), ( 6 ) = (6)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if elif type(_xin, `=`) and lhs(_xin) = "setdatacallback" then if not type(rhs(_xin), 'nonegint') then error "data callback must be a nonnegative integer (address)" end if; _dtbl[1][28] := rhs(_xin) 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..7, {(1) = 36893627880756563828, (2) = 36893627880756547668, (3) = 36893627880756547844, (4) = 36893627880756548020, (5) = 36893627880756548196, (6) = 36893627880756548372, (7) = 36893627880756548548}), (3) = [t, e(t), diff(e(t), t), phi(t), diff(phi(t), t), theta(t), diff(theta(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[4] 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[4], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 4, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 4, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[4] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[4], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(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`("phi"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][4])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[4] catch: error  end try end proc, D(phi) = 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( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 28, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..65, {(1) = 6, (2) = 6, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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, (64) = -1, (65) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.40381270046732365e-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..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .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..6, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1, (6) = .1}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8]), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..12, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = 1.25, (3) = 1.0, (4) = .0, (5) = .0, (6) = -.43301270189222163}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 27 ) = (""), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0), ( 28 ) = (0)  ] ))  ] ); _y0 := Array(0..6, {(1) = 0., (2) = 0., (3) = 0., (4) = .523598775598299, (5) = 1., (6) = 1.04719755119660}); _vmap := array( 1 .. 6, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5), ( 6 ) = (6)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if elif type(_xin, `=`) and lhs(_xin) = "setdatacallback" then if not type(rhs(_xin), 'nonegint') then error "data callback must be a nonnegative integer (address)" end if; _dtbl[1][28] := rhs(_xin) 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..7, {(1) = 36893627880756563828, (2) = 36893627880756547668, (3) = 36893627880756547844, (4) = 36893627880756548020, (5) = 36893627880756548196, (6) = 36893627880756548372, (7) = 36893627880756548548}), (3) = [t, e(t), diff(e(t), t), phi(t), diff(phi(t), t), theta(t), diff(theta(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[5] 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[5], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 5, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 5, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[5] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[5], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(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`("D(phi)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][5])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[5] catch: error  end try end proc, theta = 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( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 28, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..65, {(1) = 6, (2) = 6, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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, (64) = -1, (65) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.40381270046732365e-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..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .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..6, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1, (6) = .1}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8]), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..12, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = 1.25, (3) = 1.0, (4) = .0, (5) = .0, (6) = -.43301270189222163}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 27 ) = (""), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0), ( 28 ) = (0)  ] ))  ] ); _y0 := Array(0..6, {(1) = 0., (2) = 0., (3) = 0., (4) = .523598775598299, (5) = 1., (6) = 1.04719755119660}); _vmap := array( 1 .. 6, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5), ( 6 ) = (6)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if elif type(_xin, `=`) and lhs(_xin) = "setdatacallback" then if not type(rhs(_xin), 'nonegint') then error "data callback must be a nonnegative integer (address)" end if; _dtbl[1][28] := rhs(_xin) 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..7, {(1) = 36893627880756563828, (2) = 36893627880756547668, (3) = 36893627880756547844, (4) = 36893627880756548020, (5) = 36893627880756548196, (6) = 36893627880756548372, (7) = 36893627880756548548}), (3) = [t, e(t), diff(e(t), t), phi(t), diff(phi(t), t), theta(t), diff(theta(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[6] 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[6], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(t), 'string') = rhs(t); if lhs(_xout) = "initial" then if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else _res := _solnproc("initial" = ["single", 6, rhs(_xout)]) end if elif not type(rhs(_xout), 'list') then error "initial and/or parameter values must be specified in a list" elif lhs(_xout) = "initial_and_parameters" and nops(rhs(_xout)) = nops(_pars)+1 then _res := _solnproc(lhs(_xout) = ["single", 6, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[6] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[6], seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(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`("theta"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][6])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[6] catch: error  end try end proc, D(theta) = 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( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 28, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..65, {(1) = 6, (2) = 6, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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, (64) = -1, (65) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.40381270046732365e-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..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .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..6, {(1) = .1, (2) = .1, (3) = .1, (4) = .1, (5) = .1, (6) = .1}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, 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) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8]), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..12, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..6, {(1) = .0, (2) = .0, (3) = .523598775598299, (4) = 1.0, (5) = 1.0471975511966, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = 1.25, (3) = 1.0, (4) = .0, (5) = .0, (6) = -.43301270189222163}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = e(t), Y[2] = diff(e(t),t), Y[3] = phi(t), Y[4] = diff(phi(t),t), Y[5] = theta(t), Y[6] = diff(theta(t),t)]`; YP[2] := -(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]^2+(1+Y[1])*Y[6]^2+cos(Y[5])-5*Y[1]; YP[4] := -(-Y[6]*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]-(cos(Y[5])-1)*Y[6]*sin(Y[5])*(1+Y[1])^2*Y[4]+2*(cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])*Y[4]*Y[2])/((cos(Y[5])-1)*(cos(Y[5])+1)*(1+Y[1])^2); YP[6] := ((1/2)*sin(Y[5])*(cos(Y[5])+1)*(1+Y[1])^2*Y[4]^2+(1/2)*(cos(Y[5])-1)*sin(Y[5])*(1+Y[1])^2*Y[4]^2-(1+Y[1])*sin(Y[5])-2*(1+Y[1])*Y[6]*Y[2])/(1+Y[1])^2; YP[1] := Y[2]; YP[3] := Y[4]; YP[5] := Y[6]; 0 end proc, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 27 ) = (""), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0), ( 28 ) = (0)  ] ))  ] ); _y0 := Array(0..6, {(1) = 0., (2) = 0., (3) = 0., (4) = .523598775598299, (5) = 1., (6) = 1.04719755119660}); _vmap := array( 1 .. 6, [( 1 ) = (1), ( 2 ) = (2), ( 3 ) = (3), ( 4 ) = (4), ( 5 ) = (5), ( 6 ) = (6)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _i := false; if _par <> [] then _i := `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then _i := `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) or _i end if; if _i then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if elif type(_xin, `=`) and lhs(_xin) = "setdatacallback" then if not type(rhs(_xin), 'nonegint') then error "data callback must be a nonnegative integer (address)" end if; _dtbl[1][28] := rhs(_xin) 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..7, {(1) = 36893627880756563828, (2) = 36893627880756547668, (3) = 36893627880756547844, (4) = 36893627880756548020, (5) = 36893627880756548196, (6) = 36893627880756548372, (7) = 36893627880756548548}), (3) = [t, e(t), diff(e(t), t), phi(t), diff(phi(t), t), theta(t), diff(theta(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[7] 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[7], 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", 7, 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", 7, op(rhs(_xout))]) else _res := _solnproc(_xout) end if; if lhs(_xout) = "initial" then return _res[7] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [_res[7], 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`("D(theta)"); eval(FromInert(_Inert_FUNCTION(_Inert_NAME("assign"), _Inert_EXPSEQ(ToInert(_ndsol), _Inert_VERBATIM(pointto(_dat[2][7])))))); return FromInert(_Inert_FUNCTION(ToInert(_ndsol), _Inert_EXPSEQ(ToInert(t)))) end if end if; try _res := _solnproc(_xout); _res[7] catch: error  end try end proc]

odeplot(dsol, [t, e(t)], t=0..tmax);

orbit := spacecurve(eval([r[1],r[2],-r[3]], dsol), t=0..tmax);

frame := proc(t)
        local r;
        eval(R(e(t), theta(t), phi(t)), dsol);
        r := convert(%, list);
        display(
                plottools:-line([0,0,0], r, thickness=3, color=red),
                pointplot3d([0,0,0], symbol=solidbox, symbolsize=20, color=black),
                pointplot3d(r, symbol=solidsphere, symbolsize=40, color=red));
        # reflect about the horizontal plane so that the z
        # axis points upward
        plottools:-reflect(%, [[0,0,0], [1,0,0], [0,1,0]]);
end proc:

animate(frame, [t], t=0..tmax, background=orbit, scaling=constrained, frames=100);


 

Download pendulum-elastic-3d.mw

 

You didn't provide samples of your expressions, so I made up one.  See if this does what you want.

restart;

rels := {
        -2*M*r+a^2+r^2 = Delta,
        (a^2+r^2)^2-Delta*a^2*sin(theta)^2 = Sigma
};

{(a^2+r^2)^2-Delta*a^2*sin(theta)^2 = Sigma, -2*M*r+a^2+r^2 = Delta}

expr := -7*Delta*a^2*sin(theta)^2 + 20*M^2*r^2 - 20*M*a^2*r - 20*M*r^3 + 12*a^4 + 24*a^2*r^2 + 12*r^4 + 256;

-7*Delta*a^2*sin(theta)^2+20*M^2*r^2-20*M*a^2*r-20*M*r^3+12*a^4+24*a^2*r^2+12*r^4+256

simplify(expr, rels);

5*Delta^2+7*Sigma+256

Download mw.mw

You have asked how to calculate the partial derivative of u with respect to y.  Here is how.

restart;

N:=10;

10

PDE:=diff(u(y, t), t) = diff(u(y, t), y, y);

diff(u(y, t), t) = diff(diff(u(y, t), y), y)

ICBC:= {u(y,0) = 0, u(0,t) = cos(t), u(N, t) = 0};

{u(0, t) = cos(t), u(10, t) = 0, u(y, 0) = 0}

dy := N/100;  # space step
dt := dy^2;   # time step

1/10

1/100

sol1:=pdsolve(PDE,ICBC,numeric,spacestep=dy, timestep=dt):

sol1:-plot3d(t=0..Pi);

vals := sol1:-value(u(y,t), output=listprocedure);

[y = proc () option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; evalf(args[1]) end proc, t = proc () option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; evalf(args[2]) end proc, u(y, t) = proc () local tv, xv, solnproc, stype, ndsol, vals; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; Digits := trunc(evalhf(Digits)); solnproc := proc (tv, xv) local INFO, errest, nd, dvars, dary, daryt, daryx, vals, msg, i, j; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; table( [( "soln_procedures" ) = array( 1 .. 1, [( 1 ) = (36893628102042003692)  ] ) ] ) INFO := table( [( "minspcpoints" ) = 4, ( "spacepts" ) = 101, ( "solmat_v" ) = Vector(606, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = .0, (14) = .0, (15) = .0, (16) = .0, (17) = .0, (18) = .0, (19) = .0, (20) = .0, (21) = .0, (22) = .0, (23) = .0, (24) = .0, (25) = .0, (26) = .0, (27) = .0, (28) = .0, (29) = .0, (30) = .0, (31) = .0, (32) = .0, (33) = .0, (34) = .0, (35) = .0, (36) = .0, (37) = .0, (38) = .0, (39) = .0, (40) = .0, (41) = .0, (42) = .0, (43) = .0, (44) = .0, (45) = .0, (46) = .0, (47) = .0, (48) = .0, (49) = .0, (50) = .0, (51) = .0, (52) = .0, (53) = .0, (54) = .0, (55) = .0, (56) = .0, (57) = .0, (58) = .0, (59) = .0, (60) = .0, (61) = .0, (62) = .0, (63) = .0, (64) = .0, (65) = .0, (66) = .0, (67) = .0, (68) = .0, (69) = .0, (70) = .0, (71) = .0, (72) = .0, (73) = .0, (74) = .0, (75) = .0, (76) = .0, (77) = .0, (78) = .0, (79) = .0, (80) = .0, (81) = .0, (82) = .0, (83) = .0, (84) = .0, (85) = .0, (86) = .0, (87) = .0, (88) = .0, (89) = .0, (90) = .0, (91) = .0, (92) = .0, (93) = .0, (94) = .0, (95) = .0, (96) = .0, (97) = .0, (98) = .0, (99) = .0, (100) = .0, (101) = .0, (102) = .0, (103) = .0, (104) = .0, (105) = .0, (106) = .0, (107) = .0, (108) = .0, (109) = .0, (110) = .0, (111) = .0, (112) = .0, (113) = .0, (114) = .0, (115) = .0, (116) = .0, (117) = .0, (118) = .0, (119) = .0, (120) = .0, (121) = .0, (122) = .0, (123) = .0, (124) = .0, (125) = .0, (126) = .0, (127) = .0, (128) = .0, (129) = .0, (130) = .0, (131) = .0, (132) = .0, (133) = .0, (134) = .0, (135) = .0, (136) = .0, (137) = .0, (138) = .0, (139) = .0, (140) = .0, (141) = .0, (142) = .0, (143) = .0, (144) = .0, (145) = .0, (146) = .0, (147) = .0, (148) = .0, (149) = .0, (150) = .0, (151) = .0, (152) = .0, (153) = .0, (154) = .0, (155) = .0, (156) = .0, (157) = .0, (158) = .0, (159) = .0, (160) = .0, (161) = .0, (162) = .0, (163) = .0, (164) = .0, (165) = .0, (166) = .0, (167) = .0, (168) = .0, (169) = .0, (170) = .0, (171) = .0, (172) = .0, (173) = .0, (174) = .0, (175) = .0, (176) = .0, (177) = .0, (178) = .0, (179) = .0, (180) = .0, (181) = .0, (182) = .0, (183) = .0, (184) = .0, (185) = .0, (186) = .0, (187) = .0, (188) = .0, (189) = .0, (190) = .0, (191) = .0, (192) = .0, (193) = .0, (194) = .0, (195) = .0, (196) = .0, (197) = .0, (198) = .0, (199) = .0, (200) = .0, (201) = .0, (202) = .0, (203) = .0, (204) = .0, (205) = .0, (206) = .0, (207) = .0, (208) = .0, (209) = .0, (210) = .0, (211) = .0, (212) = .0, (213) = .0, (214) = .0, (215) = .0, (216) = .0, (217) = .0, (218) = .0, (219) = .0, (220) = .0, (221) = .0, (222) = .0, (223) = .0, (224) = .0, (225) = .0, (226) = .0, (227) = .0, (228) = .0, (229) = .0, (230) = .0, (231) = .0, (232) = .0, (233) = .0, (234) = .0, (235) = .0, (236) = .0, (237) = .0, (238) = .0, (239) = .0, (240) = .0, (241) = .0, (242) = .0, (243) = .0, (244) = .0, (245) = .0, (246) = .0, (247) = .0, (248) = .0, (249) = .0, (250) = .0, (251) = .0, (252) = .0, (253) = .0, (254) = .0, (255) = .0, (256) = .0, (257) = .0, (258) = .0, (259) = .0, (260) = .0, (261) = .0, (262) = .0, (263) = .0, (264) = .0, (265) = .0, (266) = .0, (267) = .0, (268) = .0, (269) = .0, (270) = .0, (271) = .0, (272) = .0, (273) = .0, (274) = .0, (275) = .0, (276) = .0, (277) = .0, (278) = .0, (279) = .0, (280) = .0, (281) = .0, (282) = .0, (283) = .0, (284) = .0, (285) = .0, (286) = .0, (287) = .0, (288) = .0, (289) = .0, (290) = .0, (291) = .0, (292) = .0, (293) = .0, (294) = .0, (295) = .0, (296) = .0, (297) = .0, (298) = .0, (299) = .0, (300) = .0, (301) = .0, (302) = .0, (303) = .0, (304) = .0, (305) = .0, (306) = .0, (307) = .0, (308) = .0, (309) = .0, (310) = .0, (311) = .0, (312) = .0, (313) = .0, (314) = .0, (315) = .0, (316) = .0, (317) = .0, (318) = .0, (319) = .0, (320) = .0, (321) = .0, (322) = .0, (323) = .0, (324) = .0, (325) = .0, (326) = .0, (327) = .0, (328) = .0, (329) = .0, (330) = .0, (331) = .0, (332) = .0, (333) = .0, (334) = .0, (335) = .0, (336) = .0, (337) = .0, (338) = .0, (339) = .0, (340) = .0, (341) = .0, (342) = .0, (343) = .0, (344) = .0, (345) = .0, (346) = .0, (347) = .0, (348) = .0, (349) = .0, (350) = .0, (351) = .0, (352) = .0, (353) = .0, (354) = .0, (355) = .0, (356) = .0, (357) = .0, (358) = .0, (359) = .0, (360) = .0, (361) = .0, (362) = .0, (363) = .0, (364) = .0, (365) = .0, (366) = .0, (367) = .0, (368) = .0, (369) = .0, (370) = .0, (371) = .0, (372) = .0, (373) = .0, (374) = .0, (375) = .0, (376) = .0, (377) = .0, (378) = .0, (379) = .0, (380) = .0, (381) = .0, (382) = .0, (383) = .0, (384) = .0, (385) = .0, (386) = .0, (387) = .0, (388) = .0, (389) = .0, (390) = .0, (391) = .0, (392) = .0, (393) = .0, (394) = .0, (395) = .0, (396) = .0, (397) = .0, (398) = .0, (399) = .0, (400) = .0, (401) = .0, (402) = .0, (403) = .0, (404) = .0, (405) = .0, (406) = .0, (407) = .0, (408) = .0, (409) = .0, (410) = .0, (411) = .0, (412) = .0, (413) = .0, (414) = .0, (415) = .0, (416) = .0, (417) = .0, (418) = .0, (419) = .0, (420) = .0, (421) = .0, (422) = .0, (423) = .0, (424) = .0, (425) = .0, (426) = .0, (427) = .0, (428) = .0, (429) = .0, (430) = .0, (431) = .0, (432) = .0, (433) = .0, (434) = .0, (435) = .0, (436) = .0, (437) = .0, (438) = .0, (439) = .0, (440) = .0, (441) = .0, (442) = .0, (443) = .0, (444) = .0, (445) = .0, (446) = .0, (447) = .0, (448) = .0, (449) = .0, (450) = .0, (451) = .0, (452) = .0, (453) = .0, (454) = .0, (455) = .0, (456) = .0, (457) = .0, (458) = .0, (459) = .0, (460) = .0, (461) = .0, (462) = .0, (463) = .0, (464) = .0, (465) = .0, (466) = .0, (467) = .0, (468) = .0, (469) = .0, (470) = .0, (471) = .0, (472) = .0, (473) = .0, (474) = .0, (475) = .0, (476) = .0, (477) = .0, (478) = .0, (479) = .0, (480) = .0, (481) = .0, (482) = .0, (483) = .0, (484) = .0, (485) = .0, (486) = .0, (487) = .0, (488) = .0, (489) = .0, (490) = .0, (491) = .0, (492) = .0, (493) = .0, (494) = .0, (495) = .0, (496) = .0, (497) = .0, (498) = .0, (499) = .0, (500) = .0, (501) = .0, (502) = .0, (503) = .0, (504) = .0, (505) = .0, (506) = .0, (507) = .0, (508) = .0, (509) = .0, (510) = .0, (511) = .0, (512) = .0, (513) = .0, (514) = .0, (515) = .0, (516) = .0, (517) = .0, (518) = .0, (519) = .0, (520) = .0, (521) = .0, (522) = .0, (523) = .0, (524) = .0, (525) = .0, (526) = .0, (527) = .0, (528) = .0, (529) = .0, (530) = .0, (531) = .0, (532) = .0, (533) = .0, (534) = .0, (535) = .0, (536) = .0, (537) = .0, (538) = .0, (539) = .0, (540) = .0, (541) = .0, (542) = .0, (543) = .0, (544) = .0, (545) = .0, (546) = .0, (547) = .0, (548) = .0, (549) = .0, (550) = .0, (551) = .0, (552) = .0, (553) = .0, (554) = .0, (555) = .0, (556) = .0, (557) = .0, (558) = .0, (559) = .0, (560) = .0, (561) = .0, (562) = .0, (563) = .0, (564) = .0, (565) = .0, (566) = .0, (567) = .0, (568) = .0, (569) = .0, (570) = .0, (571) = .0, (572) = .0, (573) = .0, (574) = .0, (575) = .0, (576) = .0, (577) = .0, (578) = .0, (579) = .0, (580) = .0, (581) = .0, (582) = .0, (583) = .0, (584) = .0, (585) = .0, (586) = .0, (587) = .0, (588) = .0, (589) = .0, (590) = .0, (591) = .0, (592) = .0, (593) = .0, (594) = .0, (595) = .0, (596) = .0, (597) = .0, (598) = .0, (599) = .0, (600) = .0, (601) = .0, (602) = .0, (603) = .0, (604) = .0, (605) = .0, (606) = .0}, datatype = float[8], order = C_order, attributes = [source_rtable = (Matrix(101, 6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (7, 5) = .0, (7, 6) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0, (8, 5) = .0, (8, 6) = .0, (9, 1) = .0, (9, 2) = .0, (9, 3) = .0, (9, 4) = .0, (9, 5) = .0, (9, 6) = .0, (10, 1) = .0, (10, 2) = .0, (10, 3) = .0, (10, 4) = .0, (10, 5) = .0, (10, 6) = .0, (11, 1) = .0, (11, 2) = .0, (11, 3) = .0, (11, 4) = .0, (11, 5) = .0, (11, 6) = .0, (12, 1) = .0, (12, 2) = .0, (12, 3) = .0, (12, 4) = .0, (12, 5) = .0, (12, 6) = .0, (13, 1) = .0, (13, 2) = .0, (13, 3) = .0, (13, 4) = .0, (13, 5) = .0, (13, 6) = .0, (14, 1) = .0, (14, 2) = .0, (14, 3) = .0, (14, 4) = .0, (14, 5) = .0, (14, 6) = .0, (15, 1) = .0, (15, 2) = .0, (15, 3) = .0, (15, 4) = .0, (15, 5) = .0, (15, 6) = .0, (16, 1) = .0, (16, 2) = .0, (16, 3) = .0, (16, 4) = .0, (16, 5) = .0, (16, 6) = .0, (17, 1) = .0, (17, 2) = .0, (17, 3) = .0, (17, 4) = .0, (17, 5) = .0, (17, 6) = .0, (18, 1) = .0, (18, 2) = .0, (18, 3) = .0, (18, 4) = .0, (18, 5) = .0, (18, 6) = .0, (19, 1) = .0, (19, 2) = .0, (19, 3) = .0, (19, 4) = .0, (19, 5) = .0, (19, 6) = .0, (20, 1) = .0, (20, 2) = .0, (20, 3) = .0, (20, 4) = .0, (20, 5) = .0, (20, 6) = .0, (21, 1) = .0, (21, 2) = .0, (21, 3) = .0, (21, 4) = .0, (21, 5) = .0, (21, 6) = .0, (22, 1) = .0, (22, 2) = .0, (22, 3) = .0, (22, 4) = .0, (22, 5) = .0, (22, 6) = .0, (23, 1) = .0, (23, 2) = .0, (23, 3) = .0, (23, 4) = .0, (23, 5) = .0, (23, 6) = .0, (24, 1) = .0, (24, 2) = .0, (24, 3) = .0, (24, 4) = .0, (24, 5) = .0, (24, 6) = .0, (25, 1) = .0, (25, 2) = .0, (25, 3) = .0, (25, 4) = .0, (25, 5) = .0, (25, 6) = .0, (26, 1) = .0, (26, 2) = .0, (26, 3) = .0, (26, 4) = .0, (26, 5) = .0, (26, 6) = .0, (27, 1) = .0, (27, 2) = .0, (27, 3) = .0, (27, 4) = .0, (27, 5) = .0, (27, 6) = .0, (28, 1) = .0, (28, 2) = .0, (28, 3) = .0, (28, 4) = .0, (28, 5) = .0, (28, 6) = .0, (29, 1) = .0, (29, 2) = .0, (29, 3) = .0, (29, 4) = .0, (29, 5) = .0, (29, 6) = .0, (30, 1) = .0, (30, 2) = .0, (30, 3) = .0, (30, 4) = .0, (30, 5) = .0, (30, 6) = .0, (31, 1) = .0, (31, 2) = .0, (31, 3) = .0, (31, 4) = .0, (31, 5) = .0, (31, 6) = .0, (32, 1) = .0, (32, 2) = .0, (32, 3) = .0, (32, 4) = .0, (32, 5) = .0, (32, 6) = .0, (33, 1) = .0, (33, 2) = .0, (33, 3) = .0, (33, 4) = .0, (33, 5) = .0, (33, 6) = .0, (34, 1) = .0, (34, 2) = .0, (34, 3) = .0, (34, 4) = .0, (34, 5) = .0, (34, 6) = .0, (35, 1) = .0, (35, 2) = .0, (35, 3) = .0, (35, 4) = .0, (35, 5) = .0, (35, 6) = .0, (36, 1) = .0, (36, 2) = .0, (36, 3) = .0, (36, 4) = .0, (36, 5) = .0, (36, 6) = .0, (37, 1) = .0, (37, 2) = .0, (37, 3) = .0, (37, 4) = .0, (37, 5) = .0, (37, 6) = .0, (38, 1) = .0, (38, 2) = .0, (38, 3) = .0, (38, 4) = .0, (38, 5) = .0, (38, 6) = .0, (39, 1) = .0, (39, 2) = .0, (39, 3) = .0, (39, 4) = .0, (39, 5) = .0, (39, 6) = .0, (40, 1) = .0, (40, 2) = .0, (40, 3) = .0, (40, 4) = .0, (40, 5) = .0, (40, 6) = .0, (41, 1) = .0, (41, 2) = .0, (41, 3) = .0, (41, 4) = .0, (41, 5) = .0, (41, 6) = .0, (42, 1) = .0, (42, 2) = .0, (42, 3) = .0, (42, 4) = .0, (42, 5) = .0, (42, 6) = .0, (43, 1) = .0, (43, 2) = .0, (43, 3) = .0, (43, 4) = .0, (43, 5) = .0, (43, 6) = .0, (44, 1) = .0, (44, 2) = .0, (44, 3) = .0, (44, 4) = .0, (44, 5) = .0, (44, 6) = .0, (45, 1) = .0, (45, 2) = .0, (45, 3) = .0, (45, 4) = .0, (45, 5) = .0, (45, 6) = .0, (46, 1) = .0, (46, 2) = .0, (46, 3) = .0, (46, 4) = .0, (46, 5) = .0, (46, 6) = .0, (47, 1) = .0, (47, 2) = .0, (47, 3) = .0, (47, 4) = .0, (47, 5) = .0, (47, 6) = .0, (48, 1) = .0, (48, 2) = .0, (48, 3) = .0, (48, 4) = .0, (48, 5) = .0, (48, 6) = .0, (49, 1) = .0, (49, 2) = .0, (49, 3) = .0, (49, 4) = .0, (49, 5) = .0, (49, 6) = .0, (50, 1) = .0, (50, 2) = .0, (50, 3) = .0, (50, 4) = .0, (50, 5) = .0, (50, 6) = .0, (51, 1) = .0, (51, 2) = .0, (51, 3) = .0, (51, 4) = .0, (51, 5) = .0, (51, 6) = .0, (52, 1) = .0, (52, 2) = .0, (52, 3) = .0, (52, 4) = .0, (52, 5) = .0, (52, 6) = .0, (53, 1) = .0, (53, 2) = .0, (53, 3) = .0, (53, 4) = .0, (53, 5) = .0, (53, 6) = .0, (54, 1) = .0, (54, 2) = .0, (54, 3) = .0, (54, 4) = .0, (54, 5) = .0, (54, 6) = .0, (55, 1) = .0, (55, 2) = .0, (55, 3) = .0, (55, 4) = .0, (55, 5) = .0, (55, 6) = .0, (56, 1) = .0, (56, 2) = .0, (56, 3) = .0, (56, 4) = .0, (56, 5) = .0, (56, 6) = .0, (57, 1) = .0, (57, 2) = .0, (57, 3) = .0, (57, 4) = .0, (57, 5) = .0, (57, 6) = .0, (58, 1) = .0, (58, 2) = .0, (58, 3) = .0, (58, 4) = .0, (58, 5) = .0, (58, 6) = .0, (59, 1) = .0, (59, 2) = .0, (59, 3) = .0, (59, 4) = .0, (59, 5) = .0, (59, 6) = .0, (60, 1) = .0, (60, 2) = .0, (60, 3) = .0, (60, 4) = .0, (60, 5) = .0, (60, 6) = .0, (61, 1) = .0, (61, 2) = .0, (61, 3) = .0, (61, 4) = .0, (61, 5) = .0, (61, 6) = .0, (62, 1) = .0, (62, 2) = .0, (62, 3) = .0, (62, 4) = .0, (62, 5) = .0, (62, 6) = .0, (63, 1) = .0, (63, 2) = .0, (63, 3) = .0, (63, 4) = .0, (63, 5) = .0, (63, 6) = .0, (64, 1) = .0, (64, 2) = .0, (64, 3) = .0, (64, 4) = .0, (64, 5) = .0, (64, 6) = .0, (65, 1) = .0, (65, 2) = .0, (65, 3) = .0, (65, 4) = .0, (65, 5) = .0, (65, 6) = .0, (66, 1) = .0, (66, 2) = .0, (66, 3) = .0, (66, 4) = .0, (66, 5) = .0, (66, 6) = .0, (67, 1) = .0, (67, 2) = .0, (67, 3) = .0, (67, 4) = .0, (67, 5) = .0, (67, 6) = .0, (68, 1) = .0, (68, 2) = .0, (68, 3) = .0, (68, 4) = .0, (68, 5) = .0, (68, 6) = .0, (69, 1) = .0, (69, 2) = .0, (69, 3) = .0, (69, 4) = .0, (69, 5) = .0, (69, 6) = .0, (70, 1) = .0, (70, 2) = .0, (70, 3) = .0, (70, 4) = .0, (70, 5) = .0, (70, 6) = .0, (71, 1) = .0, (71, 2) = .0, (71, 3) = .0, (71, 4) = .0, (71, 5) = .0, (71, 6) = .0, (72, 1) = .0, (72, 2) = .0, (72, 3) = .0, (72, 4) = .0, (72, 5) = .0, (72, 6) = .0, (73, 1) = .0, (73, 2) = .0, (73, 3) = .0, (73, 4) = .0, (73, 5) = .0, (73, 6) = .0, (74, 1) = .0, (74, 2) = .0, (74, 3) = .0, (74, 4) = .0, (74, 5) = .0, (74, 6) = .0, (75, 1) = .0, (75, 2) = .0, (75, 3) = .0, (75, 4) = .0, (75, 5) = .0, (75, 6) = .0, (76, 1) = .0, (76, 2) = .0, (76, 3) = .0, (76, 4) = .0, (76, 5) = .0, (76, 6) = .0, (77, 1) = .0, (77, 2) = .0, (77, 3) = .0, (77, 4) = .0, (77, 5) = .0, (77, 6) = .0, (78, 1) = .0, (78, 2) = .0, (78, 3) = .0, (78, 4) = .0, (78, 5) = .0, (78, 6) = .0, (79, 1) = .0, (79, 2) = .0, (79, 3) = .0, (79, 4) = .0, (79, 5) = .0, (79, 6) = .0, (80, 1) = .0, (80, 2) = .0, (80, 3) = .0, (80, 4) = .0, (80, 5) = .0, (80, 6) = .0, (81, 1) = .0, (81, 2) = .0, (81, 3) = .0, (81, 4) = .0, (81, 5) = .0, (81, 6) = .0, (82, 1) = .0, (82, 2) = .0, (82, 3) = .0, (82, 4) = .0, (82, 5) = .0, (82, 6) = .0, (83, 1) = .0, (83, 2) = .0, (83, 3) = .0, (83, 4) = .0, (83, 5) = .0, (83, 6) = .0, (84, 1) = .0, (84, 2) = .0, (84, 3) = .0, (84, 4) = .0, (84, 5) = .0, (84, 6) = .0, (85, 1) = .0, (85, 2) = .0, (85, 3) = .0, (85, 4) = .0, (85, 5) = .0, (85, 6) = .0, (86, 1) = .0, (86, 2) = .0, (86, 3) = .0, (86, 4) = .0, (86, 5) = .0, (86, 6) = .0, (87, 1) = .0, (87, 2) = .0, (87, 3) = .0, (87, 4) = .0, (87, 5) = .0, (87, 6) = .0, (88, 1) = .0, (88, 2) = .0, (88, 3) = .0, (88, 4) = .0, (88, 5) = .0, (88, 6) = .0, (89, 1) = .0, (89, 2) = .0, (89, 3) = .0, (89, 4) = .0, (89, 5) = .0, (89, 6) = .0, (90, 1) = .0, (90, 2) = .0, (90, 3) = .0, (90, 4) = .0, (90, 5) = .0, (90, 6) = .0, (91, 1) = .0, (91, 2) = .0, (91, 3) = .0, (91, 4) = .0, (91, 5) = .0, (91, 6) = .0, (92, 1) = .0, (92, 2) = .0, (92, 3) = .0, (92, 4) = .0, (92, 5) = .0, (92, 6) = .0, (93, 1) = .0, (93, 2) = .0, (93, 3) = .0, (93, 4) = .0, (93, 5) = .0, (93, 6) = .0, (94, 1) = .0, (94, 2) = .0, (94, 3) = .0, (94, 4) = .0, (94, 5) = .0, (94, 6) = .0, (95, 1) = .0, (95, 2) = .0, (95, 3) = .0, (95, 4) = .0, (95, 5) = .0, (95, 6) = .0, (96, 1) = .0, (96, 2) = .0, (96, 3) = .0, (96, 4) = .0, (96, 5) = .0, (96, 6) = .0, (97, 1) = .0, (97, 2) = .0, (97, 3) = .0, (97, 4) = .0, (97, 5) = .0, (97, 6) = .0, (98, 1) = .0, (98, 2) = .0, (98, 3) = .0, (98, 4) = .0, (98, 5) = .0, (98, 6) = .0, (99, 1) = .0, (99, 2) = .0, (99, 3) = .0, (99, 4) = .0, (99, 5) = .0, (99, 6) = .0, (100, 1) = .0, (100, 2) = .0, (100, 3) = .0, (100, 4) = .0, (100, 5) = .0, (100, 6) = .0, (101, 1) = .0, (101, 2) = .0, (101, 3) = .0, (101, 4) = .0, (101, 5) = .0, (101, 6) = .0}, datatype = float[8], order = C_order))]), ( "solvec3" ) = Vector(101, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = .0, (14) = .0, (15) = .0, (16) = .0, (17) = .0, (18) = .0, (19) = .0, (20) = .0, (21) = .0, (22) = .0, (23) = .0, (24) = .0, (25) = .0, (26) = .0, (27) = .0, (28) = .0, (29) = .0, (30) = .0, (31) = .0, (32) = .0, (33) = .0, (34) = .0, (35) = .0, (36) = .0, (37) = .0, (38) = .0, (39) = .0, (40) = .0, (41) = .0, (42) = .0, (43) = .0, (44) = .0, (45) = .0, (46) = .0, (47) = .0, (48) = .0, (49) = .0, (50) = .0, (51) = .0, (52) = .0, (53) = .0, (54) = .0, (55) = .0, (56) = .0, (57) = .0, (58) = .0, (59) = .0, (60) = .0, (61) = .0, (62) = .0, (63) = .0, (64) = .0, (65) = .0, (66) = .0, (67) = .0, (68) = .0, (69) = .0, (70) = .0, (71) = .0, (72) = .0, (73) = .0, (74) = .0, (75) = .0, (76) = .0, (77) = .0, (78) = .0, (79) = .0, (80) = .0, (81) = .0, (82) = .0, (83) = .0, (84) = .0, (85) = .0, (86) = .0, (87) = .0, (88) = .0, (89) = .0, (90) = .0, (91) = .0, (92) = .0, (93) = .0, (94) = .0, (95) = .0, (96) = .0, (97) = .0, (98) = .0, (99) = .0, (100) = .0, (101) = .0}, datatype = float[8]), ( "timevar" ) = t, ( "initialized" ) = false, ( "depvars" ) = [u], ( "BCS", 1 ) = {[[1, 0, 0], b[1, 0, 0]-cos(t)], [[1, 0, 10], b[1, 0, 10]]}, ( "periodic" ) = false, ( "PDEs" ) = [diff(u(y, t), t)-(diff(diff(u(y, t), y), y))], ( "spaceadaptive" ) = false, ( "stages" ) = 1, ( "explicit" ) = false, ( "totalwidth" ) = 6, ( "soltimes" ) = Vector(3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8]), ( "dependson" ) = [{1}], ( "intspace" ) = Matrix(101, 1, {(1, 1) = .0, (2, 1) = .0, (3, 1) = .0, (4, 1) = .0, (5, 1) = .0, (6, 1) = .0, (7, 1) = .0, (8, 1) = .0, (9, 1) = .0, (10, 1) = .0, (11, 1) = .0, (12, 1) = .0, (13, 1) = .0, (14, 1) = .0, (15, 1) = .0, (16, 1) = .0, (17, 1) = .0, (18, 1) = .0, (19, 1) = .0, (20, 1) = .0, (21, 1) = .0, (22, 1) = .0, (23, 1) = .0, (24, 1) = .0, (25, 1) = .0, (26, 1) = .0, (27, 1) = .0, (28, 1) = .0, (29, 1) = .0, (30, 1) = .0, (31, 1) = .0, (32, 1) = .0, (33, 1) = .0, (34, 1) = .0, (35, 1) = .0, (36, 1) = .0, (37, 1) = .0, (38, 1) = .0, (39, 1) = .0, (40, 1) = .0, (41, 1) = .0, (42, 1) = .0, (43, 1) = .0, (44, 1) = .0, (45, 1) = .0, (46, 1) = .0, (47, 1) = .0, (48, 1) = .0, (49, 1) = .0, (50, 1) = .0, (51, 1) = .0, (52, 1) = .0, (53, 1) = .0, (54, 1) = .0, (55, 1) = .0, (56, 1) = .0, (57, 1) = .0, (58, 1) = .0, (59, 1) = .0, (60, 1) = .0, (61, 1) = .0, (62, 1) = .0, (63, 1) = .0, (64, 1) = .0, (65, 1) = .0, (66, 1) = .0, (67, 1) = .0, (68, 1) = .0, (69, 1) = .0, (70, 1) = .0, (71, 1) = .0, (72, 1) = .0, (73, 1) = .0, (74, 1) = .0, (75, 1) = .0, (76, 1) = .0, (77, 1) = .0, (78, 1) = .0, (79, 1) = .0, (80, 1) = .0, (81, 1) = .0, (82, 1) = .0, (83, 1) = .0, (84, 1) = .0, (85, 1) = .0, (86, 1) = .0, (87, 1) = .0, (88, 1) = .0, (89, 1) = .0, (90, 1) = .0, (91, 1) = .0, (92, 1) = .0, (93, 1) = .0, (94, 1) = .0, (95, 1) = .0, (96, 1) = .0, (97, 1) = .0, (98, 1) = .0, (99, 1) = .0, (100, 1) = .0, (101, 1) = .0}, datatype = float[8], order = C_order), ( "solmat_i1" ) = 0, ( "eqndep" ) = [1], ( "solspace" ) = Vector(101, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = .0, (14) = .0, (15) = .0, (16) = .0, (17) = .0, (18) = .0, (19) = .0, (20) = .0, (21) = .0, (22) = .0, (23) = .0, (24) = .0, (25) = .0, (26) = .0, (27) = .0, (28) = .0, (29) = .0, (30) = .0, (31) = .0, (32) = .0, (33) = .0, (34) = .0, (35) = .0, (36) = .0, (37) = .0, (38) = .0, (39) = .0, (40) = .0, (41) = .0, (42) = .0, (43) = .0, (44) = .0, (45) = .0, (46) = .0, (47) = .0, (48) = .0, (49) = .0, (50) = .0, (51) = .0, (52) = .0, (53) = .0, (54) = .0, (55) = .0, (56) = .0, (57) = .0, (58) = .0, (59) = .0, (60) = .0, (61) = .0, (62) = .0, (63) = .0, (64) = .0, (65) = .0, (66) = .0, (67) = .0, (68) = .0, (69) = .0, (70) = .0, (71) = .0, (72) = .0, (73) = .0, (74) = .0, (75) = .0, (76) = .0, (77) = .0, (78) = .0, (79) = .0, (80) = .0, (81) = .0, (82) = .0, (83) = .0, (84) = .0, (85) = .0, (86) = .0, (87) = .0, (88) = .0, (89) = .0, (90) = .0, (91) = .0, (92) = .0, (93) = .0, (94) = .0, (95) = .0, (96) = .0, (97) = .0, (98) = .0, (99) = .0, (100) = .0, (101) = 10.0}, datatype = float[8]), ( "solvec1" ) = Vector(101, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = .0, (14) = .0, (15) = .0, (16) = .0, (17) = .0, (18) = .0, (19) = .0, (20) = .0, (21) = .0, (22) = .0, (23) = .0, (24) = .0, (25) = .0, (26) = .0, (27) = .0, (28) = .0, (29) = .0, (30) = .0, (31) = .0, (32) = .0, (33) = .0, (34) = .0, (35) = .0, (36) = .0, (37) = .0, (38) = .0, (39) = .0, (40) = .0, (41) = .0, (42) = .0, (43) = .0, (44) = .0, (45) = .0, (46) = .0, (47) = .0, (48) = .0, (49) = .0, (50) = .0, (51) = .0, (52) = .0, (53) = .0, (54) = .0, (55) = .0, (56) = .0, (57) = .0, (58) = .0, (59) = .0, (60) = .0, (61) = .0, (62) = .0, (63) = .0, (64) = .0, (65) = .0, (66) = .0, (67) = .0, (68) = .0, (69) = .0, (70) = .0, (71) = .0, (72) = .0, (73) = .0, (74) = .0, (75) = .0, (76) = .0, (77) = .0, (78) = .0, (79) = .0, (80) = .0, (81) = .0, (82) = .0, (83) = .0, (84) = .0, (85) = .0, (86) = .0, (87) = .0, (88) = .0, (89) = .0, (90) = .0, (91) = .0, (92) = .0, (93) = .0, (94) = .0, (95) = .0, (96) = .0, (97) = .0, (98) = .0, (99) = .0, (100) = .0, (101) = .0}, datatype = float[8]), ( "adjusted" ) = false, ( "startup_only" ) = false, ( "solmat_ne" ) = 0, ( "matrixproc" ) = proc (v, vp, vpp, t, x, k, h, n, mat) local _s1, _s2, xi; _s1 := -(1/2)/h^2; _s2 := (h^2+k)/(k*h^2); mat[3] := 1; mat[6*n-3] := 1; for xi from 2 to n-1 do mat[6*xi-3] := _s2; mat[6*xi-4] := _s1; mat[6*xi-2] := _s1 end do end proc, ( "allocspace" ) = 101, ( "inputargs" ) = [diff(u(y, t), t) = diff(diff(u(y, t), y), y), {u(0, t) = cos(t), u(10, t) = 0, u(y, 0) = 0}, spacestep = 1/10, timestep = 1/100], ( "depeqn" ) = [1], ( "solvec2" ) = Vector(101, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = .0, (14) = .0, (15) = .0, (16) = .0, (17) = .0, (18) = .0, (19) = .0, (20) = .0, (21) = .0, (22) = .0, (23) = .0, (24) = .0, (25) = .0, (26) = .0, (27) = .0, (28) = .0, (29) = .0, (30) = .0, (31) = .0, (32) = .0, (33) = .0, (34) = .0, (35) = .0, (36) = .0, (37) = .0, (38) = .0, (39) = .0, (40) = .0, (41) = .0, (42) = .0, (43) = .0, (44) = .0, (45) = .0, (46) = .0, (47) = .0, (48) = .0, (49) = .0, (50) = .0, (51) = .0, (52) = .0, (53) = .0, (54) = .0, (55) = .0, (56) = .0, (57) = .0, (58) = .0, (59) = .0, (60) = .0, (61) = .0, (62) = .0, (63) = .0, (64) = .0, (65) = .0, (66) = .0, (67) = .0, (68) = .0, (69) = .0, (70) = .0, (71) = .0, (72) = .0, (73) = .0, (74) = .0, (75) = .0, (76) = .0, (77) = .0, (78) = .0, (79) = .0, (80) = .0, (81) = .0, (82) = .0, (83) = .0, (84) = .0, (85) = .0, (86) = .0, (87) = .0, (88) = .0, (89) = .0, (90) = .0, (91) = .0, (92) = .0, (93) = .0, (94) = .0, (95) = .0, (96) = .0, (97) = .0, (98) = .0, (99) = .0, (100) = .0, (101) = .0}, datatype = float[8]), ( "timeadaptive" ) = false, ( "solvec5" ) = 0, ( "solvec4" ) = 0, ( "indepvars" ) = [y, t], ( "spacestep" ) = .100000000000000, ( "pts", y ) = [0, 10], ( "IBC" ) = b, ( "depshift" ) = [1], ( "ICS" ) = [0], ( "banded" ) = true, ( "multidep" ) = [false, false], ( "timei" ) = 3, ( "matrixhf" ) = true, ( "spacevar" ) = y, ( "solmat_i2" ) = 0, ( "extrabcs" ) = [0], ( "fdepvars" ) = [u(y, t)], ( "vectorhf" ) = true, ( "method" ) = theta, ( "autonomous" ) = true, ( "mixed" ) = false, ( "norigdepvars" ) = 1, ( "linear" ) = true, ( "spaceidx" ) = 1, ( "depdords" ) = [[[2, 1]]], ( "bandwidth" ) = [1, 2], ( "solmatrix" ) = Matrix(101, 6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (7, 5) = .0, (7, 6) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0, (8, 5) = .0, (8, 6) = .0, (9, 1) = .0, (9, 2) = .0, (9, 3) = .0, (9, 4) = .0, (9, 5) = .0, (9, 6) = .0, (10, 1) = .0, (10, 2) = .0, (10, 3) = .0, (10, 4) = .0, (10, 5) = .0, (10, 6) = .0, (11, 1) = .0, (11, 2) = .0, (11, 3) = .0, (11, 4) = .0, (11, 5) = .0, (11, 6) = .0, (12, 1) = .0, (12, 2) = .0, (12, 3) = .0, (12, 4) = .0, (12, 5) = .0, (12, 6) = .0, (13, 1) = .0, (13, 2) = .0, (13, 3) = .0, (13, 4) = .0, (13, 5) = .0, (13, 6) = .0, (14, 1) = .0, (14, 2) = .0, (14, 3) = .0, (14, 4) = .0, (14, 5) = .0, (14, 6) = .0, (15, 1) = .0, (15, 2) = .0, (15, 3) = .0, (15, 4) = .0, (15, 5) = .0, (15, 6) = .0, (16, 1) = .0, (16, 2) = .0, (16, 3) = .0, (16, 4) = .0, (16, 5) = .0, (16, 6) = .0, (17, 1) = .0, (17, 2) = .0, (17, 3) = .0, (17, 4) = .0, (17, 5) = .0, (17, 6) = .0, (18, 1) = .0, (18, 2) = .0, (18, 3) = .0, (18, 4) = .0, (18, 5) = .0, (18, 6) = .0, (19, 1) = .0, (19, 2) = .0, (19, 3) = .0, (19, 4) = .0, (19, 5) = .0, (19, 6) = .0, (20, 1) = .0, (20, 2) = .0, (20, 3) = .0, (20, 4) = .0, (20, 5) = .0, (20, 6) = .0, (21, 1) = .0, (21, 2) = .0, (21, 3) = .0, (21, 4) = .0, (21, 5) = .0, (21, 6) = .0, (22, 1) = .0, (22, 2) = .0, (22, 3) = .0, (22, 4) = .0, (22, 5) = .0, (22, 6) = .0, (23, 1) = .0, (23, 2) = .0, (23, 3) = .0, (23, 4) = .0, (23, 5) = .0, (23, 6) = .0, (24, 1) = .0, (24, 2) = .0, (24, 3) = .0, (24, 4) = .0, (24, 5) = .0, (24, 6) = .0, (25, 1) = .0, (25, 2) = .0, (25, 3) = .0, (25, 4) = .0, (25, 5) = .0, (25, 6) = .0, (26, 1) = .0, (26, 2) = .0, (26, 3) = .0, (26, 4) = .0, (26, 5) = .0, (26, 6) = .0, (27, 1) = .0, (27, 2) = .0, (27, 3) = .0, (27, 4) = .0, (27, 5) = .0, (27, 6) = .0, (28, 1) = .0, (28, 2) = .0, (28, 3) = .0, (28, 4) = .0, (28, 5) = .0, (28, 6) = .0, (29, 1) = .0, (29, 2) = .0, (29, 3) = .0, (29, 4) = .0, (29, 5) = .0, (29, 6) = .0, (30, 1) = .0, (30, 2) = .0, (30, 3) = .0, (30, 4) = .0, (30, 5) = .0, (30, 6) = .0, (31, 1) = .0, (31, 2) = .0, (31, 3) = .0, (31, 4) = .0, (31, 5) = .0, (31, 6) = .0, (32, 1) = .0, (32, 2) = .0, (32, 3) = .0, (32, 4) = .0, (32, 5) = .0, (32, 6) = .0, (33, 1) = .0, (33, 2) = .0, (33, 3) = .0, (33, 4) = .0, (33, 5) = .0, (33, 6) = .0, (34, 1) = .0, (34, 2) = .0, (34, 3) = .0, (34, 4) = .0, (34, 5) = .0, (34, 6) = .0, (35, 1) = .0, (35, 2) = .0, (35, 3) = .0, (35, 4) = .0, (35, 5) = .0, (35, 6) = .0, (36, 1) = .0, (36, 2) = .0, (36, 3) = .0, (36, 4) = .0, (36, 5) = .0, (36, 6) = .0, (37, 1) = .0, (37, 2) = .0, (37, 3) = .0, (37, 4) = .0, (37, 5) = .0, (37, 6) = .0, (38, 1) = .0, (38, 2) = .0, (38, 3) = .0, (38, 4) = .0, (38, 5) = .0, (38, 6) = .0, (39, 1) = .0, (39, 2) = .0, (39, 3) = .0, (39, 4) = .0, (39, 5) = .0, (39, 6) = .0, (40, 1) = .0, (40, 2) = .0, (40, 3) = .0, (40, 4) = .0, (40, 5) = .0, (40, 6) = .0, (41, 1) = .0, (41, 2) = .0, (41, 3) = .0, (41, 4) = .0, (41, 5) = .0, (41, 6) = .0, (42, 1) = .0, (42, 2) = .0, (42, 3) = .0, (42, 4) = .0, (42, 5) = .0, (42, 6) = .0, (43, 1) = .0, (43, 2) = .0, (43, 3) = .0, (43, 4) = .0, (43, 5) = .0, (43, 6) = .0, (44, 1) = .0, (44, 2) = .0, (44, 3) = .0, (44, 4) = .0, (44, 5) = .0, (44, 6) = .0, (45, 1) = .0, (45, 2) = .0, (45, 3) = .0, (45, 4) = .0, (45, 5) = .0, (45, 6) = .0, (46, 1) = .0, (46, 2) = .0, (46, 3) = .0, (46, 4) = .0, (46, 5) = .0, (46, 6) = .0, (47, 1) = .0, (47, 2) = .0, (47, 3) = .0, (47, 4) = .0, (47, 5) = .0, (47, 6) = .0, (48, 1) = .0, (48, 2) = .0, (48, 3) = .0, (48, 4) = .0, (48, 5) = .0, (48, 6) = .0, (49, 1) = .0, (49, 2) = .0, (49, 3) = .0, (49, 4) = .0, (49, 5) = .0, (49, 6) = .0, (50, 1) = .0, (50, 2) = .0, (50, 3) = .0, (50, 4) = .0, (50, 5) = .0, (50, 6) = .0, (51, 1) = .0, (51, 2) = .0, (51, 3) = .0, (51, 4) = .0, (51, 5) = .0, (51, 6) = .0, (52, 1) = .0, (52, 2) = .0, (52, 3) = .0, (52, 4) = .0, (52, 5) = .0, (52, 6) = .0, (53, 1) = .0, (53, 2) = .0, (53, 3) = .0, (53, 4) = .0, (53, 5) = .0, (53, 6) = .0, (54, 1) = .0, (54, 2) = .0, (54, 3) = .0, (54, 4) = .0, (54, 5) = .0, (54, 6) = .0, (55, 1) = .0, (55, 2) = .0, (55, 3) = .0, (55, 4) = .0, (55, 5) = .0, (55, 6) = .0, (56, 1) = .0, (56, 2) = .0, (56, 3) = .0, (56, 4) = .0, (56, 5) = .0, (56, 6) = .0, (57, 1) = .0, (57, 2) = .0, (57, 3) = .0, (57, 4) = .0, (57, 5) = .0, (57, 6) = .0, (58, 1) = .0, (58, 2) = .0, (58, 3) = .0, (58, 4) = .0, (58, 5) = .0, (58, 6) = .0, (59, 1) = .0, (59, 2) = .0, (59, 3) = .0, (59, 4) = .0, (59, 5) = .0, (59, 6) = .0, (60, 1) = .0, (60, 2) = .0, (60, 3) = .0, (60, 4) = .0, (60, 5) = .0, (60, 6) = .0, (61, 1) = .0, (61, 2) = .0, (61, 3) = .0, (61, 4) = .0, (61, 5) = .0, (61, 6) = .0, (62, 1) = .0, (62, 2) = .0, (62, 3) = .0, (62, 4) = .0, (62, 5) = .0, (62, 6) = .0, (63, 1) = .0, (63, 2) = .0, (63, 3) = .0, (63, 4) = .0, (63, 5) = .0, (63, 6) = .0, (64, 1) = .0, (64, 2) = .0, (64, 3) = .0, (64, 4) = .0, (64, 5) = .0, (64, 6) = .0, (65, 1) = .0, (65, 2) = .0, (65, 3) = .0, (65, 4) = .0, (65, 5) = .0, (65, 6) = .0, (66, 1) = .0, (66, 2) = .0, (66, 3) = .0, (66, 4) = .0, (66, 5) = .0, (66, 6) = .0, (67, 1) = .0, (67, 2) = .0, (67, 3) = .0, (67, 4) = .0, (67, 5) = .0, (67, 6) = .0, (68, 1) = .0, (68, 2) = .0, (68, 3) = .0, (68, 4) = .0, (68, 5) = .0, (68, 6) = .0, (69, 1) = .0, (69, 2) = .0, (69, 3) = .0, (69, 4) = .0, (69, 5) = .0, (69, 6) = .0, (70, 1) = .0, (70, 2) = .0, (70, 3) = .0, (70, 4) = .0, (70, 5) = .0, (70, 6) = .0, (71, 1) = .0, (71, 2) = .0, (71, 3) = .0, (71, 4) = .0, (71, 5) = .0, (71, 6) = .0, (72, 1) = .0, (72, 2) = .0, (72, 3) = .0, (72, 4) = .0, (72, 5) = .0, (72, 6) = .0, (73, 1) = .0, (73, 2) = .0, (73, 3) = .0, (73, 4) = .0, (73, 5) = .0, (73, 6) = .0, (74, 1) = .0, (74, 2) = .0, (74, 3) = .0, (74, 4) = .0, (74, 5) = .0, (74, 6) = .0, (75, 1) = .0, (75, 2) = .0, (75, 3) = .0, (75, 4) = .0, (75, 5) = .0, (75, 6) = .0, (76, 1) = .0, (76, 2) = .0, (76, 3) = .0, (76, 4) = .0, (76, 5) = .0, (76, 6) = .0, (77, 1) = .0, (77, 2) = .0, (77, 3) = .0, (77, 4) = .0, (77, 5) = .0, (77, 6) = .0, (78, 1) = .0, (78, 2) = .0, (78, 3) = .0, (78, 4) = .0, (78, 5) = .0, (78, 6) = .0, (79, 1) = .0, (79, 2) = .0, (79, 3) = .0, (79, 4) = .0, (79, 5) = .0, (79, 6) = .0, (80, 1) = .0, (80, 2) = .0, (80, 3) = .0, (80, 4) = .0, (80, 5) = .0, (80, 6) = .0, (81, 1) = .0, (81, 2) = .0, (81, 3) = .0, (81, 4) = .0, (81, 5) = .0, (81, 6) = .0, (82, 1) = .0, (82, 2) = .0, (82, 3) = .0, (82, 4) = .0, (82, 5) = .0, (82, 6) = .0, (83, 1) = .0, (83, 2) = .0, (83, 3) = .0, (83, 4) = .0, (83, 5) = .0, (83, 6) = .0, (84, 1) = .0, (84, 2) = .0, (84, 3) = .0, (84, 4) = .0, (84, 5) = .0, (84, 6) = .0, (85, 1) = .0, (85, 2) = .0, (85, 3) = .0, (85, 4) = .0, (85, 5) = .0, (85, 6) = .0, (86, 1) = .0, (86, 2) = .0, (86, 3) = .0, (86, 4) = .0, (86, 5) = .0, (86, 6) = .0, (87, 1) = .0, (87, 2) = .0, (87, 3) = .0, (87, 4) = .0, (87, 5) = .0, (87, 6) = .0, (88, 1) = .0, (88, 2) = .0, (88, 3) = .0, (88, 4) = .0, (88, 5) = .0, (88, 6) = .0, (89, 1) = .0, (89, 2) = .0, (89, 3) = .0, (89, 4) = .0, (89, 5) = .0, (89, 6) = .0, (90, 1) = .0, (90, 2) = .0, (90, 3) = .0, (90, 4) = .0, (90, 5) = .0, (90, 6) = .0, (91, 1) = .0, (91, 2) = .0, (91, 3) = .0, (91, 4) = .0, (91, 5) = .0, (91, 6) = .0, (92, 1) = .0, (92, 2) = .0, (92, 3) = .0, (92, 4) = .0, (92, 5) = .0, (92, 6) = .0, (93, 1) = .0, (93, 2) = .0, (93, 3) = .0, (93, 4) = .0, (93, 5) = .0, (93, 6) = .0, (94, 1) = .0, (94, 2) = .0, (94, 3) = .0, (94, 4) = .0, (94, 5) = .0, (94, 6) = .0, (95, 1) = .0, (95, 2) = .0, (95, 3) = .0, (95, 4) = .0, (95, 5) = .0, (95, 6) = .0, (96, 1) = .0, (96, 2) = .0, (96, 3) = .0, (96, 4) = .0, (96, 5) = .0, (96, 6) = .0, (97, 1) = .0, (97, 2) = .0, (97, 3) = .0, (97, 4) = .0, (97, 5) = .0, (97, 6) = .0, (98, 1) = .0, (98, 2) = .0, (98, 3) = .0, (98, 4) = .0, (98, 5) = .0, (98, 6) = .0, (99, 1) = .0, (99, 2) = .0, (99, 3) = .0, (99, 4) = .0, (99, 5) = .0, (99, 6) = .0, (100, 1) = .0, (100, 2) = .0, (100, 3) = .0, (100, 4) = .0, (100, 5) = .0, (100, 6) = .0, (101, 1) = .0, (101, 2) = .0, (101, 3) = .0, (101, 4) = .0, (101, 5) = .0, (101, 6) = .0}, datatype = float[8], order = C_order), ( "erroraccum" ) = true, ( "eqnords" ) = [[2, 1]], ( "t0" ) = 0, ( "vectorproc" ) = proc (v, vp, vpp, t, x, k, h, n, vec) local _s1, _s2, _s3, xi; _s2 := 1/k; _s3 := (1/2)/h^2; vec[1] := cos(t+k); vec[n] := 0; for xi from 2 to n-1 do _s1 := vp[xi-1]-2*vp[xi]+vp[xi+1]; vec[xi] := _s3*_s1+_s2*vp[xi] end do end proc, ( "maxords" ) = [2, 1], ( "rightwidth" ) = 0, ( "theta" ) = 1/2, ( "depords" ) = [[2, 1]], ( "timeidx" ) = 2, ( "solution" ) = Array(1..3, 1..101, 1..1, {(1, 1, 1) = .0, (1, 2, 1) = .0, (1, 3, 1) = .0, (1, 4, 1) = .0, (1, 5, 1) = .0, (1, 6, 1) = .0, (1, 7, 1) = .0, (1, 8, 1) = .0, (1, 9, 1) = .0, (1, 10, 1) = .0, (1, 11, 1) = .0, (1, 12, 1) = .0, (1, 13, 1) = .0, (1, 14, 1) = .0, (1, 15, 1) = .0, (1, 16, 1) = .0, (1, 17, 1) = .0, (1, 18, 1) = .0, (1, 19, 1) = .0, (1, 20, 1) = .0, (1, 21, 1) = .0, (1, 22, 1) = .0, (1, 23, 1) = .0, (1, 24, 1) = .0, (1, 25, 1) = .0, (1, 26, 1) = .0, (1, 27, 1) = .0, (1, 28, 1) = .0, (1, 29, 1) = .0, (1, 30, 1) = .0, (1, 31, 1) = .0, (1, 32, 1) = .0, (1, 33, 1) = .0, (1, 34, 1) = .0, (1, 35, 1) = .0, (1, 36, 1) = .0, (1, 37, 1) = .0, (1, 38, 1) = .0, (1, 39, 1) = .0, (1, 40, 1) = .0, (1, 41, 1) = .0, (1, 42, 1) = .0, (1, 43, 1) = .0, (1, 44, 1) = .0, (1, 45, 1) = .0, (1, 46, 1) = .0, (1, 47, 1) = .0, (1, 48, 1) = .0, (1, 49, 1) = .0, (1, 50, 1) = .0, (1, 51, 1) = .0, (1, 52, 1) = .0, (1, 53, 1) = .0, (1, 54, 1) = .0, (1, 55, 1) = .0, (1, 56, 1) = .0, (1, 57, 1) = .0, (1, 58, 1) = .0, (1, 59, 1) = .0, (1, 60, 1) = .0, (1, 61, 1) = .0, (1, 62, 1) = .0, (1, 63, 1) = .0, (1, 64, 1) = .0, (1, 65, 1) = .0, (1, 66, 1) = .0, (1, 67, 1) = .0, (1, 68, 1) = .0, (1, 69, 1) = .0, (1, 70, 1) = .0, (1, 71, 1) = .0, (1, 72, 1) = .0, (1, 73, 1) = .0, (1, 74, 1) = .0, (1, 75, 1) = .0, (1, 76, 1) = .0, (1, 77, 1) = .0, (1, 78, 1) = .0, (1, 79, 1) = .0, (1, 80, 1) = .0, (1, 81, 1) = .0, (1, 82, 1) = .0, (1, 83, 1) = .0, (1, 84, 1) = .0, (1, 85, 1) = .0, (1, 86, 1) = .0, (1, 87, 1) = .0, (1, 88, 1) = .0, (1, 89, 1) = .0, (1, 90, 1) = .0, (1, 91, 1) = .0, (1, 92, 1) = .0, (1, 93, 1) = .0, (1, 94, 1) = .0, (1, 95, 1) = .0, (1, 96, 1) = .0, (1, 97, 1) = .0, (1, 98, 1) = .0, (1, 99, 1) = .0, (1, 100, 1) = .0, (1, 101, 1) = .0, (2, 1, 1) = .0, (2, 2, 1) = .0, (2, 3, 1) = .0, (2, 4, 1) = .0, (2, 5, 1) = .0, (2, 6, 1) = .0, (2, 7, 1) = .0, (2, 8, 1) = .0, (2, 9, 1) = .0, (2, 10, 1) = .0, (2, 11, 1) = .0, (2, 12, 1) = .0, (2, 13, 1) = .0, (2, 14, 1) = .0, (2, 15, 1) = .0, (2, 16, 1) = .0, (2, 17, 1) = .0, (2, 18, 1) = .0, (2, 19, 1) = .0, (2, 20, 1) = .0, (2, 21, 1) = .0, (2, 22, 1) = .0, (2, 23, 1) = .0, (2, 24, 1) = .0, (2, 25, 1) = .0, (2, 26, 1) = .0, (2, 27, 1) = .0, (2, 28, 1) = .0, (2, 29, 1) = .0, (2, 30, 1) = .0, (2, 31, 1) = .0, (2, 32, 1) = .0, (2, 33, 1) = .0, (2, 34, 1) = .0, (2, 35, 1) = .0, (2, 36, 1) = .0, (2, 37, 1) = .0, (2, 38, 1) = .0, (2, 39, 1) = .0, (2, 40, 1) = .0, (2, 41, 1) = .0, (2, 42, 1) = .0, (2, 43, 1) = .0, (2, 44, 1) = .0, (2, 45, 1) = .0, (2, 46, 1) = .0, (2, 47, 1) = .0, (2, 48, 1) = .0, (2, 49, 1) = .0, (2, 50, 1) = .0, (2, 51, 1) = .0, (2, 52, 1) = .0, (2, 53, 1) = .0, (2, 54, 1) = .0, (2, 55, 1) = .0, (2, 56, 1) = .0, (2, 57, 1) = .0, (2, 58, 1) = .0, (2, 59, 1) = .0, (2, 60, 1) = .0, (2, 61, 1) = .0, (2, 62, 1) = .0, (2, 63, 1) = .0, (2, 64, 1) = .0, (2, 65, 1) = .0, (2, 66, 1) = .0, (2, 67, 1) = .0, (2, 68, 1) = .0, (2, 69, 1) = .0, (2, 70, 1) = .0, (2, 71, 1) = .0, (2, 72, 1) = .0, (2, 73, 1) = .0, (2, 74, 1) = .0, (2, 75, 1) = .0, (2, 76, 1) = .0, (2, 77, 1) = .0, (2, 78, 1) = .0, (2, 79, 1) = .0, (2, 80, 1) = .0, (2, 81, 1) = .0, (2, 82, 1) = .0, (2, 83, 1) = .0, (2, 84, 1) = .0, (2, 85, 1) = .0, (2, 86, 1) = .0, (2, 87, 1) = .0, (2, 88, 1) = .0, (2, 89, 1) = .0, (2, 90, 1) = .0, (2, 91, 1) = .0, (2, 92, 1) = .0, (2, 93, 1) = .0, (2, 94, 1) = .0, (2, 95, 1) = .0, (2, 96, 1) = .0, (2, 97, 1) = .0, (2, 98, 1) = .0, (2, 99, 1) = .0, (2, 100, 1) = .0, (2, 101, 1) = .0, (3, 1, 1) = .0, (3, 2, 1) = .0, (3, 3, 1) = .0, (3, 4, 1) = .0, (3, 5, 1) = .0, (3, 6, 1) = .0, (3, 7, 1) = .0, (3, 8, 1) = .0, (3, 9, 1) = .0, (3, 10, 1) = .0, (3, 11, 1) = .0, (3, 12, 1) = .0, (3, 13, 1) = .0, (3, 14, 1) = .0, (3, 15, 1) = .0, (3, 16, 1) = .0, (3, 17, 1) = .0, (3, 18, 1) = .0, (3, 19, 1) = .0, (3, 20, 1) = .0, (3, 21, 1) = .0, (3, 22, 1) = .0, (3, 23, 1) = .0, (3, 24, 1) = .0, (3, 25, 1) = .0, (3, 26, 1) = .0, (3, 27, 1) = .0, (3, 28, 1) = .0, (3, 29, 1) = .0, (3, 30, 1) = .0, (3, 31, 1) = .0, (3, 32, 1) = .0, (3, 33, 1) = .0, (3, 34, 1) = .0, (3, 35, 1) = .0, (3, 36, 1) = .0, (3, 37, 1) = .0, (3, 38, 1) = .0, (3, 39, 1) = .0, (3, 40, 1) = .0, (3, 41, 1) = .0, (3, 42, 1) = .0, (3, 43, 1) = .0, (3, 44, 1) = .0, (3, 45, 1) = .0, (3, 46, 1) = .0, (3, 47, 1) = .0, (3, 48, 1) = .0, (3, 49, 1) = .0, (3, 50, 1) = .0, (3, 51, 1) = .0, (3, 52, 1) = .0, (3, 53, 1) = .0, (3, 54, 1) = .0, (3, 55, 1) = .0, (3, 56, 1) = .0, (3, 57, 1) = .0, (3, 58, 1) = .0, (3, 59, 1) = .0, (3, 60, 1) = .0, (3, 61, 1) = .0, (3, 62, 1) = .0, (3, 63, 1) = .0, (3, 64, 1) = .0, (3, 65, 1) = .0, (3, 66, 1) = .0, (3, 67, 1) = .0, (3, 68, 1) = .0, (3, 69, 1) = .0, (3, 70, 1) = .0, (3, 71, 1) = .0, (3, 72, 1) = .0, (3, 73, 1) = .0, (3, 74, 1) = .0, (3, 75, 1) = .0, (3, 76, 1) = .0, (3, 77, 1) = .0, (3, 78, 1) = .0, (3, 79, 1) = .0, (3, 80, 1) = .0, (3, 81, 1) = .0, (3, 82, 1) = .0, (3, 83, 1) = .0, (3, 84, 1) = .0, (3, 85, 1) = .0, (3, 86, 1) = .0, (3, 87, 1) = .0, (3, 88, 1) = .0, (3, 89, 1) = .0, (3, 90, 1) = .0, (3, 91, 1) = .0, (3, 92, 1) = .0, (3, 93, 1) = .0, (3, 94, 1) = .0, (3, 95, 1) = .0, (3, 96, 1) = .0, (3, 97, 1) = .0, (3, 98, 1) = .0, (3, 99, 1) = .0, (3, 100, 1) = .0, (3, 101, 1) = .0}, datatype = float[8], order = C_order), ( "leftwidth" ) = 1, ( "solmat_is" ) = 0, ( "timestep" ) = 0.100000000000000e-1, ( "errorest" ) = false ] ); if xv = "left" then return INFO["solspace"][1] elif xv = "right" then return INFO["solspace"][INFO["spacepts"]] elif tv = "start" then return INFO["t0"] elif not (type(tv, 'numeric') and type(xv, 'numeric')) then error "non-numeric input" end if; if xv < INFO["solspace"][1] or INFO["solspace"][INFO["spacepts"]] < xv then error "requested %1 value must be in the range %2..%3", INFO["spacevar"], INFO["solspace"][1], INFO["solspace"][INFO["spacepts"]] end if; dary := Vector(3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8]); daryt := 0; daryx := 0; dvars := [proc (t, x, u) u[1] end proc]; errest := false; nd := nops(INFO["depvars"]); if dary[nd+1] <> tv then try `pdsolve/numeric/evolve_solution`(INFO, tv) catch: msg := StringTools:-FormatMessage(lastexception[2 .. -1]); if tv < INFO["t0"] then error cat("unable to compute solution for %1<%2:
", msg), INFO["timevar"], INFO["failtime"] else error cat("unable to compute solution for %1>%2:
", msg), INFO["timevar"], INFO["failtime"] end if end try end if; if dary[nd+1] <> tv or dary[nd+2] <> xv then `pdsolve/interp2dto0d`(3, INFO["soltimes"], INFO["spacepts"], INFO["solspace"], nops(INFO["depvars"]), INFO["solution"], true, tv, xv, dary); if errest then `pdsolve/interp2dto0d`(3, INFO["soltimes"], INFO["spacepts"], INFO["err_t"], nops(INFO["depvars"]), INFO["solution"], true, tv, xv, daryt); `pdsolve/interp2dto0d`(3, INFO["soltimes"], INFO["spacepts"], INFO["err_x"], nops(INFO["depvars"]), INFO["solution"], true, tv, xv, daryx) end if end if; dary[nd+1] := tv; dary[nd+2] := xv; if dvars = [] then [seq(dary[i], i = 1 .. INFO["norigdepvars"])] else vals := NULL; for i to nops(dvars) do j := eval(dvars[i]); try if errest then vals := vals, evalhf(j(tv, xv, dary, daryt, daryx)) else vals := vals, evalhf(j(tv, xv, dary)) end if catch: userinfo(5, `pdsolve/numeric`, `evalhf failure`); try if errest then vals := vals, j(tv, xv, dary, daryt, daryx) else vals := vals, j(tv, xv, dary) end if catch: vals := vals, undefined end try end try end do; [vals] end if end proc; stype := "2nd"; if nargs = 1 then if args[1] = "left" then return solnproc(0, "left") elif args[1] = "right" then return solnproc(0, "right") elif args[1] = "start" then return solnproc("start", 0) else error "too few arguments to solution procedure" end if elif nargs = 2 then if stype = "1st" then tv := evalf(args[1]); xv := evalf(args[2]) else tv := evalf(args[2]); xv := evalf(args[1]) end if; if not (type(tv, 'numeric') and type(xv, 'numeric')) then if procname <> unknown then return ('procname')(args[1 .. nargs]) else ndsol := pointto(solnproc("soln_procedures")[1]); return ('ndsol')(args[1 .. nargs]) end if end if else error "incorrect arguments to solution procedure" end if; vals := solnproc(tv, xv); vals[1] end proc]

This proc captures the value of the solution u:

U := eval(u(y,t), vals);

proc () local tv, xv, solnproc, stype, ndsol, vals; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; Digits := trunc(evalhf(Digits)); solnproc := proc (tv, xv) local INFO, errest, nd, dvars, dary, daryt, daryx, vals, msg, i, j; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; table( [( "soln_procedures" ) = array( 1 .. 1, [( 1 ) = (36893628102042003692)  ] ) ] ) INFO := table( [( "minspcpoints" ) = 4, ( "spacepts" ) = 101, ( "solmat_v" ) = Vector(606, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = .0, (14) = .0, (15) = .0, (16) = .0, (17) = .0, (18) = .0, (19) = .0, (20) = .0, (21) = .0, (22) = .0, (23) = .0, (24) = .0, (25) = .0, (26) = .0, (27) = .0, (28) = .0, (29) = .0, (30) = .0, (31) = .0, (32) = .0, (33) = .0, (34) = .0, (35) = .0, (36) = .0, (37) = .0, (38) = .0, (39) = .0, (40) = .0, (41) = .0, (42) = .0, (43) = .0, (44) = .0, (45) = .0, (46) = .0, (47) = .0, (48) = .0, (49) = .0, (50) = .0, (51) = .0, (52) = .0, (53) = .0, (54) = .0, (55) = .0, (56) = .0, (57) = .0, (58) = .0, (59) = .0, (60) = .0, (61) = .0, (62) = .0, (63) = .0, (64) = .0, (65) = .0, (66) = .0, (67) = .0, (68) = .0, (69) = .0, (70) = .0, (71) = .0, (72) = .0, (73) = .0, (74) = .0, (75) = .0, (76) = .0, (77) = .0, (78) = .0, (79) = .0, (80) = .0, (81) = .0, (82) = .0, (83) = .0, (84) = .0, (85) = .0, (86) = .0, (87) = .0, (88) = .0, (89) = .0, (90) = .0, (91) = .0, (92) = .0, (93) = .0, (94) = .0, (95) = .0, (96) = .0, (97) = .0, (98) = .0, (99) = .0, (100) = .0, (101) = .0, (102) = .0, (103) = .0, (104) = .0, (105) = .0, (106) = .0, (107) = .0, (108) = .0, (109) = .0, (110) = .0, (111) = .0, (112) = .0, (113) = .0, (114) = .0, (115) = .0, (116) = .0, (117) = .0, (118) = .0, (119) = .0, (120) = .0, (121) = .0, (122) = .0, (123) = .0, (124) = .0, (125) = .0, (126) = .0, (127) = .0, (128) = .0, (129) = .0, (130) = .0, (131) = .0, (132) = .0, (133) = .0, (134) = .0, (135) = .0, (136) = .0, (137) = .0, (138) = .0, (139) = .0, (140) = .0, (141) = .0, (142) = .0, (143) = .0, (144) = .0, (145) = .0, (146) = .0, (147) = .0, (148) = .0, (149) = .0, (150) = .0, (151) = .0, (152) = .0, (153) = .0, (154) = .0, (155) = .0, (156) = .0, (157) = .0, (158) = .0, (159) = .0, (160) = .0, (161) = .0, (162) = .0, (163) = .0, (164) = .0, (165) = .0, (166) = .0, (167) = .0, (168) = .0, (169) = .0, (170) = .0, (171) = .0, (172) = .0, (173) = .0, (174) = .0, (175) = .0, (176) = .0, (177) = .0, (178) = .0, (179) = .0, (180) = .0, (181) = .0, (182) = .0, (183) = .0, (184) = .0, (185) = .0, (186) = .0, (187) = .0, (188) = .0, (189) = .0, (190) = .0, (191) = .0, (192) = .0, (193) = .0, (194) = .0, (195) = .0, (196) = .0, (197) = .0, (198) = .0, (199) = .0, (200) = .0, (201) = .0, (202) = .0, (203) = .0, (204) = .0, (205) = .0, (206) = .0, (207) = .0, (208) = .0, (209) = .0, (210) = .0, (211) = .0, (212) = .0, (213) = .0, (214) = .0, (215) = .0, (216) = .0, (217) = .0, (218) = .0, (219) = .0, (220) = .0, (221) = .0, (222) = .0, (223) = .0, (224) = .0, (225) = .0, (226) = .0, (227) = .0, (228) = .0, (229) = .0, (230) = .0, (231) = .0, (232) = .0, (233) = .0, (234) = .0, (235) = .0, (236) = .0, (237) = .0, (238) = .0, (239) = .0, (240) = .0, (241) = .0, (242) = .0, (243) = .0, (244) = .0, (245) = .0, (246) = .0, (247) = .0, (248) = .0, (249) = .0, (250) = .0, (251) = .0, (252) = .0, (253) = .0, (254) = .0, (255) = .0, (256) = .0, (257) = .0, (258) = .0, (259) = .0, (260) = .0, (261) = .0, (262) = .0, (263) = .0, (264) = .0, (265) = .0, (266) = .0, (267) = .0, (268) = .0, (269) = .0, (270) = .0, (271) = .0, (272) = .0, (273) = .0, (274) = .0, (275) = .0, (276) = .0, (277) = .0, (278) = .0, (279) = .0, (280) = .0, (281) = .0, (282) = .0, (283) = .0, (284) = .0, (285) = .0, (286) = .0, (287) = .0, (288) = .0, (289) = .0, (290) = .0, (291) = .0, (292) = .0, (293) = .0, (294) = .0, (295) = .0, (296) = .0, (297) = .0, (298) = .0, (299) = .0, (300) = .0, (301) = .0, (302) = .0, (303) = .0, (304) = .0, (305) = .0, (306) = .0, (307) = .0, (308) = .0, (309) = .0, (310) = .0, (311) = .0, (312) = .0, (313) = .0, (314) = .0, (315) = .0, (316) = .0, (317) = .0, (318) = .0, (319) = .0, (320) = .0, (321) = .0, (322) = .0, (323) = .0, (324) = .0, (325) = .0, (326) = .0, (327) = .0, (328) = .0, (329) = .0, (330) = .0, (331) = .0, (332) = .0, (333) = .0, (334) = .0, (335) = .0, (336) = .0, (337) = .0, (338) = .0, (339) = .0, (340) = .0, (341) = .0, (342) = .0, (343) = .0, (344) = .0, (345) = .0, (346) = .0, (347) = .0, (348) = .0, (349) = .0, (350) = .0, (351) = .0, (352) = .0, (353) = .0, (354) = .0, (355) = .0, (356) = .0, (357) = .0, (358) = .0, (359) = .0, (360) = .0, (361) = .0, (362) = .0, (363) = .0, (364) = .0, (365) = .0, (366) = .0, (367) = .0, (368) = .0, (369) = .0, (370) = .0, (371) = .0, (372) = .0, (373) = .0, (374) = .0, (375) = .0, (376) = .0, (377) = .0, (378) = .0, (379) = .0, (380) = .0, (381) = .0, (382) = .0, (383) = .0, (384) = .0, (385) = .0, (386) = .0, (387) = .0, (388) = .0, (389) = .0, (390) = .0, (391) = .0, (392) = .0, (393) = .0, (394) = .0, (395) = .0, (396) = .0, (397) = .0, (398) = .0, (399) = .0, (400) = .0, (401) = .0, (402) = .0, (403) = .0, (404) = .0, (405) = .0, (406) = .0, (407) = .0, (408) = .0, (409) = .0, (410) = .0, (411) = .0, (412) = .0, (413) = .0, (414) = .0, (415) = .0, (416) = .0, (417) = .0, (418) = .0, (419) = .0, (420) = .0, (421) = .0, (422) = .0, (423) = .0, (424) = .0, (425) = .0, (426) = .0, (427) = .0, (428) = .0, (429) = .0, (430) = .0, (431) = .0, (432) = .0, (433) = .0, (434) = .0, (435) = .0, (436) = .0, (437) = .0, (438) = .0, (439) = .0, (440) = .0, (441) = .0, (442) = .0, (443) = .0, (444) = .0, (445) = .0, (446) = .0, (447) = .0, (448) = .0, (449) = .0, (450) = .0, (451) = .0, (452) = .0, (453) = .0, (454) = .0, (455) = .0, (456) = .0, (457) = .0, (458) = .0, (459) = .0, (460) = .0, (461) = .0, (462) = .0, (463) = .0, (464) = .0, (465) = .0, (466) = .0, (467) = .0, (468) = .0, (469) = .0, (470) = .0, (471) = .0, (472) = .0, (473) = .0, (474) = .0, (475) = .0, (476) = .0, (477) = .0, (478) = .0, (479) = .0, (480) = .0, (481) = .0, (482) = .0, (483) = .0, (484) = .0, (485) = .0, (486) = .0, (487) = .0, (488) = .0, (489) = .0, (490) = .0, (491) = .0, (492) = .0, (493) = .0, (494) = .0, (495) = .0, (496) = .0, (497) = .0, (498) = .0, (499) = .0, (500) = .0, (501) = .0, (502) = .0, (503) = .0, (504) = .0, (505) = .0, (506) = .0, (507) = .0, (508) = .0, (509) = .0, (510) = .0, (511) = .0, (512) = .0, (513) = .0, (514) = .0, (515) = .0, (516) = .0, (517) = .0, (518) = .0, (519) = .0, (520) = .0, (521) = .0, (522) = .0, (523) = .0, (524) = .0, (525) = .0, (526) = .0, (527) = .0, (528) = .0, (529) = .0, (530) = .0, (531) = .0, (532) = .0, (533) = .0, (534) = .0, (535) = .0, (536) = .0, (537) = .0, (538) = .0, (539) = .0, (540) = .0, (541) = .0, (542) = .0, (543) = .0, (544) = .0, (545) = .0, (546) = .0, (547) = .0, (548) = .0, (549) = .0, (550) = .0, (551) = .0, (552) = .0, (553) = .0, (554) = .0, (555) = .0, (556) = .0, (557) = .0, (558) = .0, (559) = .0, (560) = .0, (561) = .0, (562) = .0, (563) = .0, (564) = .0, (565) = .0, (566) = .0, (567) = .0, (568) = .0, (569) = .0, (570) = .0, (571) = .0, (572) = .0, (573) = .0, (574) = .0, (575) = .0, (576) = .0, (577) = .0, (578) = .0, (579) = .0, (580) = .0, (581) = .0, (582) = .0, (583) = .0, (584) = .0, (585) = .0, (586) = .0, (587) = .0, (588) = .0, (589) = .0, (590) = .0, (591) = .0, (592) = .0, (593) = .0, (594) = .0, (595) = .0, (596) = .0, (597) = .0, (598) = .0, (599) = .0, (600) = .0, (601) = .0, (602) = .0, (603) = .0, (604) = .0, (605) = .0, (606) = .0}, datatype = float[8], order = C_order, attributes = [source_rtable = (Matrix(101, 6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (7, 5) = .0, (7, 6) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0, (8, 5) = .0, (8, 6) = .0, (9, 1) = .0, (9, 2) = .0, (9, 3) = .0, (9, 4) = .0, (9, 5) = .0, (9, 6) = .0, (10, 1) = .0, (10, 2) = .0, (10, 3) = .0, (10, 4) = .0, (10, 5) = .0, (10, 6) = .0, (11, 1) = .0, (11, 2) = .0, (11, 3) = .0, (11, 4) = .0, (11, 5) = .0, (11, 6) = .0, (12, 1) = .0, (12, 2) = .0, (12, 3) = .0, (12, 4) = .0, (12, 5) = .0, (12, 6) = .0, (13, 1) = .0, (13, 2) = .0, (13, 3) = .0, (13, 4) = .0, (13, 5) = .0, (13, 6) = .0, (14, 1) = .0, (14, 2) = .0, (14, 3) = .0, (14, 4) = .0, (14, 5) = .0, (14, 6) = .0, (15, 1) = .0, (15, 2) = .0, (15, 3) = .0, (15, 4) = .0, (15, 5) = .0, (15, 6) = .0, (16, 1) = .0, (16, 2) = .0, (16, 3) = .0, (16, 4) = .0, (16, 5) = .0, (16, 6) = .0, (17, 1) = .0, (17, 2) = .0, (17, 3) = .0, (17, 4) = .0, (17, 5) = .0, (17, 6) = .0, (18, 1) = .0, (18, 2) = .0, (18, 3) = .0, (18, 4) = .0, (18, 5) = .0, (18, 6) = .0, (19, 1) = .0, (19, 2) = .0, (19, 3) = .0, (19, 4) = .0, (19, 5) = .0, (19, 6) = .0, (20, 1) = .0, (20, 2) = .0, (20, 3) = .0, (20, 4) = .0, (20, 5) = .0, (20, 6) = .0, (21, 1) = .0, (21, 2) = .0, (21, 3) = .0, (21, 4) = .0, (21, 5) = .0, (21, 6) = .0, (22, 1) = .0, (22, 2) = .0, (22, 3) = .0, (22, 4) = .0, (22, 5) = .0, (22, 6) = .0, (23, 1) = .0, (23, 2) = .0, (23, 3) = .0, (23, 4) = .0, (23, 5) = .0, (23, 6) = .0, (24, 1) = .0, (24, 2) = .0, (24, 3) = .0, (24, 4) = .0, (24, 5) = .0, (24, 6) = .0, (25, 1) = .0, (25, 2) = .0, (25, 3) = .0, (25, 4) = .0, (25, 5) = .0, (25, 6) = .0, (26, 1) = .0, (26, 2) = .0, (26, 3) = .0, (26, 4) = .0, (26, 5) = .0, (26, 6) = .0, (27, 1) = .0, (27, 2) = .0, (27, 3) = .0, (27, 4) = .0, (27, 5) = .0, (27, 6) = .0, (28, 1) = .0, (28, 2) = .0, (28, 3) = .0, (28, 4) = .0, (28, 5) = .0, (28, 6) = .0, (29, 1) = .0, (29, 2) = .0, (29, 3) = .0, (29, 4) = .0, (29, 5) = .0, (29, 6) = .0, (30, 1) = .0, (30, 2) = .0, (30, 3) = .0, (30, 4) = .0, (30, 5) = .0, (30, 6) = .0, (31, 1) = .0, (31, 2) = .0, (31, 3) = .0, (31, 4) = .0, (31, 5) = .0, (31, 6) = .0, (32, 1) = .0, (32, 2) = .0, (32, 3) = .0, (32, 4) = .0, (32, 5) = .0, (32, 6) = .0, (33, 1) = .0, (33, 2) = .0, (33, 3) = .0, (33, 4) = .0, (33, 5) = .0, (33, 6) = .0, (34, 1) = .0, (34, 2) = .0, (34, 3) = .0, (34, 4) = .0, (34, 5) = .0, (34, 6) = .0, (35, 1) = .0, (35, 2) = .0, (35, 3) = .0, (35, 4) = .0, (35, 5) = .0, (35, 6) = .0, (36, 1) = .0, (36, 2) = .0, (36, 3) = .0, (36, 4) = .0, (36, 5) = .0, (36, 6) = .0, (37, 1) = .0, (37, 2) = .0, (37, 3) = .0, (37, 4) = .0, (37, 5) = .0, (37, 6) = .0, (38, 1) = .0, (38, 2) = .0, (38, 3) = .0, (38, 4) = .0, (38, 5) = .0, (38, 6) = .0, (39, 1) = .0, (39, 2) = .0, (39, 3) = .0, (39, 4) = .0, (39, 5) = .0, (39, 6) = .0, (40, 1) = .0, (40, 2) = .0, (40, 3) = .0, (40, 4) = .0, (40, 5) = .0, (40, 6) = .0, (41, 1) = .0, (41, 2) = .0, (41, 3) = .0, (41, 4) = .0, (41, 5) = .0, (41, 6) = .0, (42, 1) = .0, (42, 2) = .0, (42, 3) = .0, (42, 4) = .0, (42, 5) = .0, (42, 6) = .0, (43, 1) = .0, (43, 2) = .0, (43, 3) = .0, (43, 4) = .0, (43, 5) = .0, (43, 6) = .0, (44, 1) = .0, (44, 2) = .0, (44, 3) = .0, (44, 4) = .0, (44, 5) = .0, (44, 6) = .0, (45, 1) = .0, (45, 2) = .0, (45, 3) = .0, (45, 4) = .0, (45, 5) = .0, (45, 6) = .0, (46, 1) = .0, (46, 2) = .0, (46, 3) = .0, (46, 4) = .0, (46, 5) = .0, (46, 6) = .0, (47, 1) = .0, (47, 2) = .0, (47, 3) = .0, (47, 4) = .0, (47, 5) = .0, (47, 6) = .0, (48, 1) = .0, (48, 2) = .0, (48, 3) = .0, (48, 4) = .0, (48, 5) = .0, (48, 6) = .0, (49, 1) = .0, (49, 2) = .0, (49, 3) = .0, (49, 4) = .0, (49, 5) = .0, (49, 6) = .0, (50, 1) = .0, (50, 2) = .0, (50, 3) = .0, (50, 4) = .0, (50, 5) = .0, (50, 6) = .0, (51, 1) = .0, (51, 2) = .0, (51, 3) = .0, (51, 4) = .0, (51, 5) = .0, (51, 6) = .0, (52, 1) = .0, (52, 2) = .0, (52, 3) = .0, (52, 4) = .0, (52, 5) = .0, (52, 6) = .0, (53, 1) = .0, (53, 2) = .0, (53, 3) = .0, (53, 4) = .0, (53, 5) = .0, (53, 6) = .0, (54, 1) = .0, (54, 2) = .0, (54, 3) = .0, (54, 4) = .0, (54, 5) = .0, (54, 6) = .0, (55, 1) = .0, (55, 2) = .0, (55, 3) = .0, (55, 4) = .0, (55, 5) = .0, (55, 6) = .0, (56, 1) = .0, (56, 2) = .0, (56, 3) = .0, (56, 4) = .0, (56, 5) = .0, (56, 6) = .0, (57, 1) = .0, (57, 2) = .0, (57, 3) = .0, (57, 4) = .0, (57, 5) = .0, (57, 6) = .0, (58, 1) = .0, (58, 2) = .0, (58, 3) = .0, (58, 4) = .0, (58, 5) = .0, (58, 6) = .0, (59, 1) = .0, (59, 2) = .0, (59, 3) = .0, (59, 4) = .0, (59, 5) = .0, (59, 6) = .0, (60, 1) = .0, (60, 2) = .0, (60, 3) = .0, (60, 4) = .0, (60, 5) = .0, (60, 6) = .0, (61, 1) = .0, (61, 2) = .0, (61, 3) = .0, (61, 4) = .0, (61, 5) = .0, (61, 6) = .0, (62, 1) = .0, (62, 2) = .0, (62, 3) = .0, (62, 4) = .0, (62, 5) = .0, (62, 6) = .0, (63, 1) = .0, (63, 2) = .0, (63, 3) = .0, (63, 4) = .0, (63, 5) = .0, (63, 6) = .0, (64, 1) = .0, (64, 2) = .0, (64, 3) = .0, (64, 4) = .0, (64, 5) = .0, (64, 6) = .0, (65, 1) = .0, (65, 2) = .0, (65, 3) = .0, (65, 4) = .0, (65, 5) = .0, (65, 6) = .0, (66, 1) = .0, (66, 2) = .0, (66, 3) = .0, (66, 4) = .0, (66, 5) = .0, (66, 6) = .0, (67, 1) = .0, (67, 2) = .0, (67, 3) = .0, (67, 4) = .0, (67, 5) = .0, (67, 6) = .0, (68, 1) = .0, (68, 2) = .0, (68, 3) = .0, (68, 4) = .0, (68, 5) = .0, (68, 6) = .0, (69, 1) = .0, (69, 2) = .0, (69, 3) = .0, (69, 4) = .0, (69, 5) = .0, (69, 6) = .0, (70, 1) = .0, (70, 2) = .0, (70, 3) = .0, (70, 4) = .0, (70, 5) = .0, (70, 6) = .0, (71, 1) = .0, (71, 2) = .0, (71, 3) = .0, (71, 4) = .0, (71, 5) = .0, (71, 6) = .0, (72, 1) = .0, (72, 2) = .0, (72, 3) = .0, (72, 4) = .0, (72, 5) = .0, (72, 6) = .0, (73, 1) = .0, (73, 2) = .0, (73, 3) = .0, (73, 4) = .0, (73, 5) = .0, (73, 6) = .0, (74, 1) = .0, (74, 2) = .0, (74, 3) = .0, (74, 4) = .0, (74, 5) = .0, (74, 6) = .0, (75, 1) = .0, (75, 2) = .0, (75, 3) = .0, (75, 4) = .0, (75, 5) = .0, (75, 6) = .0, (76, 1) = .0, (76, 2) = .0, (76, 3) = .0, (76, 4) = .0, (76, 5) = .0, (76, 6) = .0, (77, 1) = .0, (77, 2) = .0, (77, 3) = .0, (77, 4) = .0, (77, 5) = .0, (77, 6) = .0, (78, 1) = .0, (78, 2) = .0, (78, 3) = .0, (78, 4) = .0, (78, 5) = .0, (78, 6) = .0, (79, 1) = .0, (79, 2) = .0, (79, 3) = .0, (79, 4) = .0, (79, 5) = .0, (79, 6) = .0, (80, 1) = .0, (80, 2) = .0, (80, 3) = .0, (80, 4) = .0, (80, 5) = .0, (80, 6) = .0, (81, 1) = .0, (81, 2) = .0, (81, 3) = .0, (81, 4) = .0, (81, 5) = .0, (81, 6) = .0, (82, 1) = .0, (82, 2) = .0, (82, 3) = .0, (82, 4) = .0, (82, 5) = .0, (82, 6) = .0, (83, 1) = .0, (83, 2) = .0, (83, 3) = .0, (83, 4) = .0, (83, 5) = .0, (83, 6) = .0, (84, 1) = .0, (84, 2) = .0, (84, 3) = .0, (84, 4) = .0, (84, 5) = .0, (84, 6) = .0, (85, 1) = .0, (85, 2) = .0, (85, 3) = .0, (85, 4) = .0, (85, 5) = .0, (85, 6) = .0, (86, 1) = .0, (86, 2) = .0, (86, 3) = .0, (86, 4) = .0, (86, 5) = .0, (86, 6) = .0, (87, 1) = .0, (87, 2) = .0, (87, 3) = .0, (87, 4) = .0, (87, 5) = .0, (87, 6) = .0, (88, 1) = .0, (88, 2) = .0, (88, 3) = .0, (88, 4) = .0, (88, 5) = .0, (88, 6) = .0, (89, 1) = .0, (89, 2) = .0, (89, 3) = .0, (89, 4) = .0, (89, 5) = .0, (89, 6) = .0, (90, 1) = .0, (90, 2) = .0, (90, 3) = .0, (90, 4) = .0, (90, 5) = .0, (90, 6) = .0, (91, 1) = .0, (91, 2) = .0, (91, 3) = .0, (91, 4) = .0, (91, 5) = .0, (91, 6) = .0, (92, 1) = .0, (92, 2) = .0, (92, 3) = .0, (92, 4) = .0, (92, 5) = .0, (92, 6) = .0, (93, 1) = .0, (93, 2) = .0, (93, 3) = .0, (93, 4) = .0, (93, 5) = .0, (93, 6) = .0, (94, 1) = .0, (94, 2) = .0, (94, 3) = .0, (94, 4) = .0, (94, 5) = .0, (94, 6) = .0, (95, 1) = .0, (95, 2) = .0, (95, 3) = .0, (95, 4) = .0, (95, 5) = .0, (95, 6) = .0, (96, 1) = .0, (96, 2) = .0, (96, 3) = .0, (96, 4) = .0, (96, 5) = .0, (96, 6) = .0, (97, 1) = .0, (97, 2) = .0, (97, 3) = .0, (97, 4) = .0, (97, 5) = .0, (97, 6) = .0, (98, 1) = .0, (98, 2) = .0, (98, 3) = .0, (98, 4) = .0, (98, 5) = .0, (98, 6) = .0, (99, 1) = .0, (99, 2) = .0, (99, 3) = .0, (99, 4) = .0, (99, 5) = .0, (99, 6) = .0, (100, 1) = .0, (100, 2) = .0, (100, 3) = .0, (100, 4) = .0, (100, 5) = .0, (100, 6) = .0, (101, 1) = .0, (101, 2) = .0, (101, 3) = .0, (101, 4) = .0, (101, 5) = .0, (101, 6) = .0}, datatype = float[8], order = C_order))]), ( "solvec3" ) = Vector(101, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = .0, (14) = .0, (15) = .0, (16) = .0, (17) = .0, (18) = .0, (19) = .0, (20) = .0, (21) = .0, (22) = .0, (23) = .0, (24) = .0, (25) = .0, (26) = .0, (27) = .0, (28) = .0, (29) = .0, (30) = .0, (31) = .0, (32) = .0, (33) = .0, (34) = .0, (35) = .0, (36) = .0, (37) = .0, (38) = .0, (39) = .0, (40) = .0, (41) = .0, (42) = .0, (43) = .0, (44) = .0, (45) = .0, (46) = .0, (47) = .0, (48) = .0, (49) = .0, (50) = .0, (51) = .0, (52) = .0, (53) = .0, (54) = .0, (55) = .0, (56) = .0, (57) = .0, (58) = .0, (59) = .0, (60) = .0, (61) = .0, (62) = .0, (63) = .0, (64) = .0, (65) = .0, (66) = .0, (67) = .0, (68) = .0, (69) = .0, (70) = .0, (71) = .0, (72) = .0, (73) = .0, (74) = .0, (75) = .0, (76) = .0, (77) = .0, (78) = .0, (79) = .0, (80) = .0, (81) = .0, (82) = .0, (83) = .0, (84) = .0, (85) = .0, (86) = .0, (87) = .0, (88) = .0, (89) = .0, (90) = .0, (91) = .0, (92) = .0, (93) = .0, (94) = .0, (95) = .0, (96) = .0, (97) = .0, (98) = .0, (99) = .0, (100) = .0, (101) = .0}, datatype = float[8]), ( "timevar" ) = t, ( "initialized" ) = false, ( "depvars" ) = [u], ( "BCS", 1 ) = {[[1, 0, 0], b[1, 0, 0]-cos(t)], [[1, 0, 10], b[1, 0, 10]]}, ( "periodic" ) = false, ( "PDEs" ) = [diff(u(y, t), t)-(diff(diff(u(y, t), y), y))], ( "spaceadaptive" ) = false, ( "stages" ) = 1, ( "explicit" ) = false, ( "totalwidth" ) = 6, ( "soltimes" ) = Vector(3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8]), ( "dependson" ) = [{1}], ( "intspace" ) = Matrix(101, 1, {(1, 1) = .0, (2, 1) = .0, (3, 1) = .0, (4, 1) = .0, (5, 1) = .0, (6, 1) = .0, (7, 1) = .0, (8, 1) = .0, (9, 1) = .0, (10, 1) = .0, (11, 1) = .0, (12, 1) = .0, (13, 1) = .0, (14, 1) = .0, (15, 1) = .0, (16, 1) = .0, (17, 1) = .0, (18, 1) = .0, (19, 1) = .0, (20, 1) = .0, (21, 1) = .0, (22, 1) = .0, (23, 1) = .0, (24, 1) = .0, (25, 1) = .0, (26, 1) = .0, (27, 1) = .0, (28, 1) = .0, (29, 1) = .0, (30, 1) = .0, (31, 1) = .0, (32, 1) = .0, (33, 1) = .0, (34, 1) = .0, (35, 1) = .0, (36, 1) = .0, (37, 1) = .0, (38, 1) = .0, (39, 1) = .0, (40, 1) = .0, (41, 1) = .0, (42, 1) = .0, (43, 1) = .0, (44, 1) = .0, (45, 1) = .0, (46, 1) = .0, (47, 1) = .0, (48, 1) = .0, (49, 1) = .0, (50, 1) = .0, (51, 1) = .0, (52, 1) = .0, (53, 1) = .0, (54, 1) = .0, (55, 1) = .0, (56, 1) = .0, (57, 1) = .0, (58, 1) = .0, (59, 1) = .0, (60, 1) = .0, (61, 1) = .0, (62, 1) = .0, (63, 1) = .0, (64, 1) = .0, (65, 1) = .0, (66, 1) = .0, (67, 1) = .0, (68, 1) = .0, (69, 1) = .0, (70, 1) = .0, (71, 1) = .0, (72, 1) = .0, (73, 1) = .0, (74, 1) = .0, (75, 1) = .0, (76, 1) = .0, (77, 1) = .0, (78, 1) = .0, (79, 1) = .0, (80, 1) = .0, (81, 1) = .0, (82, 1) = .0, (83, 1) = .0, (84, 1) = .0, (85, 1) = .0, (86, 1) = .0, (87, 1) = .0, (88, 1) = .0, (89, 1) = .0, (90, 1) = .0, (91, 1) = .0, (92, 1) = .0, (93, 1) = .0, (94, 1) = .0, (95, 1) = .0, (96, 1) = .0, (97, 1) = .0, (98, 1) = .0, (99, 1) = .0, (100, 1) = .0, (101, 1) = .0}, datatype = float[8], order = C_order), ( "solmat_i1" ) = 0, ( "eqndep" ) = [1], ( "solspace" ) = Vector(101, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = .0, (14) = .0, (15) = .0, (16) = .0, (17) = .0, (18) = .0, (19) = .0, (20) = .0, (21) = .0, (22) = .0, (23) = .0, (24) = .0, (25) = .0, (26) = .0, (27) = .0, (28) = .0, (29) = .0, (30) = .0, (31) = .0, (32) = .0, (33) = .0, (34) = .0, (35) = .0, (36) = .0, (37) = .0, (38) = .0, (39) = .0, (40) = .0, (41) = .0, (42) = .0, (43) = .0, (44) = .0, (45) = .0, (46) = .0, (47) = .0, (48) = .0, (49) = .0, (50) = .0, (51) = .0, (52) = .0, (53) = .0, (54) = .0, (55) = .0, (56) = .0, (57) = .0, (58) = .0, (59) = .0, (60) = .0, (61) = .0, (62) = .0, (63) = .0, (64) = .0, (65) = .0, (66) = .0, (67) = .0, (68) = .0, (69) = .0, (70) = .0, (71) = .0, (72) = .0, (73) = .0, (74) = .0, (75) = .0, (76) = .0, (77) = .0, (78) = .0, (79) = .0, (80) = .0, (81) = .0, (82) = .0, (83) = .0, (84) = .0, (85) = .0, (86) = .0, (87) = .0, (88) = .0, (89) = .0, (90) = .0, (91) = .0, (92) = .0, (93) = .0, (94) = .0, (95) = .0, (96) = .0, (97) = .0, (98) = .0, (99) = .0, (100) = .0, (101) = 10.0}, datatype = float[8]), ( "solvec1" ) = Vector(101, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = .0, (14) = .0, (15) = .0, (16) = .0, (17) = .0, (18) = .0, (19) = .0, (20) = .0, (21) = .0, (22) = .0, (23) = .0, (24) = .0, (25) = .0, (26) = .0, (27) = .0, (28) = .0, (29) = .0, (30) = .0, (31) = .0, (32) = .0, (33) = .0, (34) = .0, (35) = .0, (36) = .0, (37) = .0, (38) = .0, (39) = .0, (40) = .0, (41) = .0, (42) = .0, (43) = .0, (44) = .0, (45) = .0, (46) = .0, (47) = .0, (48) = .0, (49) = .0, (50) = .0, (51) = .0, (52) = .0, (53) = .0, (54) = .0, (55) = .0, (56) = .0, (57) = .0, (58) = .0, (59) = .0, (60) = .0, (61) = .0, (62) = .0, (63) = .0, (64) = .0, (65) = .0, (66) = .0, (67) = .0, (68) = .0, (69) = .0, (70) = .0, (71) = .0, (72) = .0, (73) = .0, (74) = .0, (75) = .0, (76) = .0, (77) = .0, (78) = .0, (79) = .0, (80) = .0, (81) = .0, (82) = .0, (83) = .0, (84) = .0, (85) = .0, (86) = .0, (87) = .0, (88) = .0, (89) = .0, (90) = .0, (91) = .0, (92) = .0, (93) = .0, (94) = .0, (95) = .0, (96) = .0, (97) = .0, (98) = .0, (99) = .0, (100) = .0, (101) = .0}, datatype = float[8]), ( "adjusted" ) = false, ( "startup_only" ) = false, ( "solmat_ne" ) = 0, ( "matrixproc" ) = proc (v, vp, vpp, t, x, k, h, n, mat) local _s1, _s2, xi; _s1 := -(1/2)/h^2; _s2 := (h^2+k)/(k*h^2); mat[3] := 1; mat[6*n-3] := 1; for xi from 2 to n-1 do mat[6*xi-3] := _s2; mat[6*xi-4] := _s1; mat[6*xi-2] := _s1 end do end proc, ( "allocspace" ) = 101, ( "inputargs" ) = [diff(u(y, t), t) = diff(diff(u(y, t), y), y), {u(0, t) = cos(t), u(10, t) = 0, u(y, 0) = 0}, spacestep = 1/10, timestep = 1/100], ( "depeqn" ) = [1], ( "solvec2" ) = Vector(101, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (6) = .0, (7) = .0, (8) = .0, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = .0, (14) = .0, (15) = .0, (16) = .0, (17) = .0, (18) = .0, (19) = .0, (20) = .0, (21) = .0, (22) = .0, (23) = .0, (24) = .0, (25) = .0, (26) = .0, (27) = .0, (28) = .0, (29) = .0, (30) = .0, (31) = .0, (32) = .0, (33) = .0, (34) = .0, (35) = .0, (36) = .0, (37) = .0, (38) = .0, (39) = .0, (40) = .0, (41) = .0, (42) = .0, (43) = .0, (44) = .0, (45) = .0, (46) = .0, (47) = .0, (48) = .0, (49) = .0, (50) = .0, (51) = .0, (52) = .0, (53) = .0, (54) = .0, (55) = .0, (56) = .0, (57) = .0, (58) = .0, (59) = .0, (60) = .0, (61) = .0, (62) = .0, (63) = .0, (64) = .0, (65) = .0, (66) = .0, (67) = .0, (68) = .0, (69) = .0, (70) = .0, (71) = .0, (72) = .0, (73) = .0, (74) = .0, (75) = .0, (76) = .0, (77) = .0, (78) = .0, (79) = .0, (80) = .0, (81) = .0, (82) = .0, (83) = .0, (84) = .0, (85) = .0, (86) = .0, (87) = .0, (88) = .0, (89) = .0, (90) = .0, (91) = .0, (92) = .0, (93) = .0, (94) = .0, (95) = .0, (96) = .0, (97) = .0, (98) = .0, (99) = .0, (100) = .0, (101) = .0}, datatype = float[8]), ( "timeadaptive" ) = false, ( "solvec5" ) = 0, ( "solvec4" ) = 0, ( "indepvars" ) = [y, t], ( "spacestep" ) = .100000000000000, ( "pts", y ) = [0, 10], ( "IBC" ) = b, ( "depshift" ) = [1], ( "ICS" ) = [0], ( "banded" ) = true, ( "multidep" ) = [false, false], ( "timei" ) = 3, ( "matrixhf" ) = true, ( "spacevar" ) = y, ( "solmat_i2" ) = 0, ( "extrabcs" ) = [0], ( "fdepvars" ) = [u(y, t)], ( "vectorhf" ) = true, ( "method" ) = theta, ( "autonomous" ) = true, ( "mixed" ) = false, ( "norigdepvars" ) = 1, ( "linear" ) = true, ( "spaceidx" ) = 1, ( "depdords" ) = [[[2, 1]]], ( "bandwidth" ) = [1, 2], ( "solmatrix" ) = Matrix(101, 6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (7, 5) = .0, (7, 6) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0, (8, 5) = .0, (8, 6) = .0, (9, 1) = .0, (9, 2) = .0, (9, 3) = .0, (9, 4) = .0, (9, 5) = .0, (9, 6) = .0, (10, 1) = .0, (10, 2) = .0, (10, 3) = .0, (10, 4) = .0, (10, 5) = .0, (10, 6) = .0, (11, 1) = .0, (11, 2) = .0, (11, 3) = .0, (11, 4) = .0, (11, 5) = .0, (11, 6) = .0, (12, 1) = .0, (12, 2) = .0, (12, 3) = .0, (12, 4) = .0, (12, 5) = .0, (12, 6) = .0, (13, 1) = .0, (13, 2) = .0, (13, 3) = .0, (13, 4) = .0, (13, 5) = .0, (13, 6) = .0, (14, 1) = .0, (14, 2) = .0, (14, 3) = .0, (14, 4) = .0, (14, 5) = .0, (14, 6) = .0, (15, 1) = .0, (15, 2) = .0, (15, 3) = .0, (15, 4) = .0, (15, 5) = .0, (15, 6) = .0, (16, 1) = .0, (16, 2) = .0, (16, 3) = .0, (16, 4) = .0, (16, 5) = .0, (16, 6) = .0, (17, 1) = .0, (17, 2) = .0, (17, 3) = .0, (17, 4) = .0, (17, 5) = .0, (17, 6) = .0, (18, 1) = .0, (18, 2) = .0, (18, 3) = .0, (18, 4) = .0, (18, 5) = .0, (18, 6) = .0, (19, 1) = .0, (19, 2) = .0, (19, 3) = .0, (19, 4) = .0, (19, 5) = .0, (19, 6) = .0, (20, 1) = .0, (20, 2) = .0, (20, 3) = .0, (20, 4) = .0, (20, 5) = .0, (20, 6) = .0, (21, 1) = .0, (21, 2) = .0, (21, 3) = .0, (21, 4) = .0, (21, 5) = .0, (21, 6) = .0, (22, 1) = .0, (22, 2) = .0, (22, 3) = .0, (22, 4) = .0, (22, 5) = .0, (22, 6) = .0, (23, 1) = .0, (23, 2) = .0, (23, 3) = .0, (23, 4) = .0, (23, 5) = .0, (23, 6) = .0, (24, 1) = .0, (24, 2) = .0, (24, 3) = .0, (24, 4) = .0, (24, 5) = .0, (24, 6) = .0, (25, 1) = .0, (25, 2) = .0, (25, 3) = .0, (25, 4) = .0, (25, 5) = .0, (25, 6) = .0, (26, 1) = .0, (26, 2) = .0, (26, 3) = .0, (26, 4) = .0, (26, 5) = .0, (26, 6) = .0, (27, 1) = .0, (27, 2) = .0, (27, 3) = .0, (27, 4) = .0, (27, 5) = .0, (27, 6) = .0, (28, 1) = .0, (28, 2) = .0, (28, 3) = .0, (28, 4) = .0, (28, 5) = .0, (28, 6) = .0, (29, 1) = .0, (29, 2) = .0, (29, 3) = .0, (29, 4) = .0, (29, 5) = .0, (29, 6) = .0, (30, 1) = .0, (30, 2) = .0, (30, 3) = .0, (30, 4) = .0, (30, 5) = .0, (30, 6) = .0, (31, 1) = .0, (31, 2) = .0, (31, 3) = .0, (31, 4) = .0, (31, 5) = .0, (31, 6) = .0, (32, 1) = .0, (32, 2) = .0, (32, 3) = .0, (32, 4) = .0, (32, 5) = .0, (32, 6) = .0, (33, 1) = .0, (33, 2) = .0, (33, 3) = .0, (33, 4) = .0, (33, 5) = .0, (33, 6) = .0, (34, 1) = .0, (34, 2) = .0, (34, 3) = .0, (34, 4) = .0, (34, 5) = .0, (34, 6) = .0, (35, 1) = .0, (35, 2) = .0, (35, 3) = .0, (35, 4) = .0, (35, 5) = .0, (35, 6) = .0, (36, 1) = .0, (36, 2) = .0, (36, 3) = .0, (36, 4) = .0, (36, 5) = .0, (36, 6) = .0, (37, 1) = .0, (37, 2) = .0, (37, 3) = .0, (37, 4) = .0, (37, 5) = .0, (37, 6) = .0, (38, 1) = .0, (38, 2) = .0, (38, 3) = .0, (38, 4) = .0, (38, 5) = .0, (38, 6) = .0, (39, 1) = .0, (39, 2) = .0, (39, 3) = .0, (39, 4) = .0, (39, 5) = .0, (39, 6) = .0, (40, 1) = .0, (40, 2) = .0, (40, 3) = .0, (40, 4) = .0, (40, 5) = .0, (40, 6) = .0, (41, 1) = .0, (41, 2) = .0, (41, 3) = .0, (41, 4) = .0, (41, 5) = .0, (41, 6) = .0, (42, 1) = .0, (42, 2) = .0, (42, 3) = .0, (42, 4) = .0, (42, 5) = .0, (42, 6) = .0, (43, 1) = .0, (43, 2) = .0, (43, 3) = .0, (43, 4) = .0, (43, 5) = .0, (43, 6) = .0, (44, 1) = .0, (44, 2) = .0, (44, 3) = .0, (44, 4) = .0, (44, 5) = .0, (44, 6) = .0, (45, 1) = .0, (45, 2) = .0, (45, 3) = .0, (45, 4) = .0, (45, 5) = .0, (45, 6) = .0, (46, 1) = .0, (46, 2) = .0, (46, 3) = .0, (46, 4) = .0, (46, 5) = .0, (46, 6) = .0, (47, 1) = .0, (47, 2) = .0, (47, 3) = .0, (47, 4) = .0, (47, 5) = .0, (47, 6) = .0, (48, 1) = .0, (48, 2) = .0, (48, 3) = .0, (48, 4) = .0, (48, 5) = .0, (48, 6) = .0, (49, 1) = .0, (49, 2) = .0, (49, 3) = .0, (49, 4) = .0, (49, 5) = .0, (49, 6) = .0, (50, 1) = .0, (50, 2) = .0, (50, 3) = .0, (50, 4) = .0, (50, 5) = .0, (50, 6) = .0, (51, 1) = .0, (51, 2) = .0, (51, 3) = .0, (51, 4) = .0, (51, 5) = .0, (51, 6) = .0, (52, 1) = .0, (52, 2) = .0, (52, 3) = .0, (52, 4) = .0, (52, 5) = .0, (52, 6) = .0, (53, 1) = .0, (53, 2) = .0, (53, 3) = .0, (53, 4) = .0, (53, 5) = .0, (53, 6) = .0, (54, 1) = .0, (54, 2) = .0, (54, 3) = .0, (54, 4) = .0, (54, 5) = .0, (54, 6) = .0, (55, 1) = .0, (55, 2) = .0, (55, 3) = .0, (55, 4) = .0, (55, 5) = .0, (55, 6) = .0, (56, 1) = .0, (56, 2) = .0, (56, 3) = .0, (56, 4) = .0, (56, 5) = .0, (56, 6) = .0, (57, 1) = .0, (57, 2) = .0, (57, 3) = .0, (57, 4) = .0, (57, 5) = .0, (57, 6) = .0, (58, 1) = .0, (58, 2) = .0, (58, 3) = .0, (58, 4) = .0, (58, 5) = .0, (58, 6) = .0, (59, 1) = .0, (59, 2) = .0, (59, 3) = .0, (59, 4) = .0, (59, 5) = .0, (59, 6) = .0, (60, 1) = .0, (60, 2) = .0, (60, 3) = .0, (60, 4) = .0, (60, 5) = .0, (60, 6) = .0, (61, 1) = .0, (61, 2) = .0, (61, 3) = .0, (61, 4) = .0, (61, 5) = .0, (61, 6) = .0, (62, 1) = .0, (62, 2) = .0, (62, 3) = .0, (62, 4) = .0, (62, 5) = .0, (62, 6) = .0, (63, 1) = .0, (63, 2) = .0, (63, 3) = .0, (63, 4) = .0, (63, 5) = .0, (63, 6) = .0, (64, 1) = .0, (64, 2) = .0, (64, 3) = .0, (64, 4) = .0, (64, 5) = .0, (64, 6) = .0, (65, 1) = .0, (65, 2) = .0, (65, 3) = .0, (65, 4) = .0, (65, 5) = .0, (65, 6) = .0, (66, 1) = .0, (66, 2) = .0, (66, 3) = .0, (66, 4) = .0, (66, 5) = .0, (66, 6) = .0, (67, 1) = .0, (67, 2) = .0, (67, 3) = .0, (67, 4) = .0, (67, 5) = .0, (67, 6) = .0, (68, 1) = .0, (68, 2) = .0, (68, 3) = .0, (68, 4) = .0, (68, 5) = .0, (68, 6) = .0, (69, 1) = .0, (69, 2) = .0, (69, 3) = .0, (69, 4) = .0, (69, 5) = .0, (69, 6) = .0, (70, 1) = .0, (70, 2) = .0, (70, 3) = .0, (70, 4) = .0, (70, 5) = .0, (70, 6) = .0, (71, 1) = .0, (71, 2) = .0, (71, 3) = .0, (71, 4) = .0, (71, 5) = .0, (71, 6) = .0, (72, 1) = .0, (72, 2) = .0, (72, 3) = .0, (72, 4) = .0, (72, 5) = .0, (72, 6) = .0, (73, 1) = .0, (73, 2) = .0, (73, 3) = .0, (73, 4) = .0, (73, 5) = .0, (73, 6) = .0, (74, 1) = .0, (74, 2) = .0, (74, 3) = .0, (74, 4) = .0, (74, 5) = .0, (74, 6) = .0, (75, 1) = .0, (75, 2) = .0, (75, 3) = .0, (75, 4) = .0, (75, 5) = .0, (75, 6) = .0, (76, 1) = .0, (76, 2) = .0, (76, 3) = .0, (76, 4) = .0, (76, 5) = .0, (76, 6) = .0, (77, 1) = .0, (77, 2) = .0, (77, 3) = .0, (77, 4) = .0, (77, 5) = .0, (77, 6) = .0, (78, 1) = .0, (78, 2) = .0, (78, 3) = .0, (78, 4) = .0, (78, 5) = .0, (78, 6) = .0, (79, 1) = .0, (79, 2) = .0, (79, 3) = .0, (79, 4) = .0, (79, 5) = .0, (79, 6) = .0, (80, 1) = .0, (80, 2) = .0, (80, 3) = .0, (80, 4) = .0, (80, 5) = .0, (80, 6) = .0, (81, 1) = .0, (81, 2) = .0, (81, 3) = .0, (81, 4) = .0, (81, 5) = .0, (81, 6) = .0, (82, 1) = .0, (82, 2) = .0, (82, 3) = .0, (82, 4) = .0, (82, 5) = .0, (82, 6) = .0, (83, 1) = .0, (83, 2) = .0, (83, 3) = .0, (83, 4) = .0, (83, 5) = .0, (83, 6) = .0, (84, 1) = .0, (84, 2) = .0, (84, 3) = .0, (84, 4) = .0, (84, 5) = .0, (84, 6) = .0, (85, 1) = .0, (85, 2) = .0, (85, 3) = .0, (85, 4) = .0, (85, 5) = .0, (85, 6) = .0, (86, 1) = .0, (86, 2) = .0, (86, 3) = .0, (86, 4) = .0, (86, 5) = .0, (86, 6) = .0, (87, 1) = .0, (87, 2) = .0, (87, 3) = .0, (87, 4) = .0, (87, 5) = .0, (87, 6) = .0, (88, 1) = .0, (88, 2) = .0, (88, 3) = .0, (88, 4) = .0, (88, 5) = .0, (88, 6) = .0, (89, 1) = .0, (89, 2) = .0, (89, 3) = .0, (89, 4) = .0, (89, 5) = .0, (89, 6) = .0, (90, 1) = .0, (90, 2) = .0, (90, 3) = .0, (90, 4) = .0, (90, 5) = .0, (90, 6) = .0, (91, 1) = .0, (91, 2) = .0, (91, 3) = .0, (91, 4) = .0, (91, 5) = .0, (91, 6) = .0, (92, 1) = .0, (92, 2) = .0, (92, 3) = .0, (92, 4) = .0, (92, 5) = .0, (92, 6) = .0, (93, 1) = .0, (93, 2) = .0, (93, 3) = .0, (93, 4) = .0, (93, 5) = .0, (93, 6) = .0, (94, 1) = .0, (94, 2) = .0, (94, 3) = .0, (94, 4) = .0, (94, 5) = .0, (94, 6) = .0, (95, 1) = .0, (95, 2) = .0, (95, 3) = .0, (95, 4) = .0, (95, 5) = .0, (95, 6) = .0, (96, 1) = .0, (96, 2) = .0, (96, 3) = .0, (96, 4) = .0, (96, 5) = .0, (96, 6) = .0, (97, 1) = .0, (97, 2) = .0, (97, 3) = .0, (97, 4) = .0, (97, 5) = .0, (97, 6) = .0, (98, 1) = .0, (98, 2) = .0, (98, 3) = .0, (98, 4) = .0, (98, 5) = .0, (98, 6) = .0, (99, 1) = .0, (99, 2) = .0, (99, 3) = .0, (99, 4) = .0, (99, 5) = .0, (99, 6) = .0, (100, 1) = .0, (100, 2) = .0, (100, 3) = .0, (100, 4) = .0, (100, 5) = .0, (100, 6) = .0, (101, 1) = .0, (101, 2) = .0, (101, 3) = .0, (101, 4) = .0, (101, 5) = .0, (101, 6) = .0}, datatype = float[8], order = C_order), ( "erroraccum" ) = true, ( "eqnords" ) = [[2, 1]], ( "t0" ) = 0, ( "vectorproc" ) = proc (v, vp, vpp, t, x, k, h, n, vec) local _s1, _s2, _s3, xi; _s2 := 1/k; _s3 := (1/2)/h^2; vec[1] := cos(t+k); vec[n] := 0; for xi from 2 to n-1 do _s1 := vp[xi-1]-2*vp[xi]+vp[xi+1]; vec[xi] := _s3*_s1+_s2*vp[xi] end do end proc, ( "maxords" ) = [2, 1], ( "rightwidth" ) = 0, ( "theta" ) = 1/2, ( "depords" ) = [[2, 1]], ( "timeidx" ) = 2, ( "solution" ) = Array(1..3, 1..101, 1..1, {(1, 1, 1) = .0, (1, 2, 1) = .0, (1, 3, 1) = .0, (1, 4, 1) = .0, (1, 5, 1) = .0, (1, 6, 1) = .0, (1, 7, 1) = .0, (1, 8, 1) = .0, (1, 9, 1) = .0, (1, 10, 1) = .0, (1, 11, 1) = .0, (1, 12, 1) = .0, (1, 13, 1) = .0, (1, 14, 1) = .0, (1, 15, 1) = .0, (1, 16, 1) = .0, (1, 17, 1) = .0, (1, 18, 1) = .0, (1, 19, 1) = .0, (1, 20, 1) = .0, (1, 21, 1) = .0, (1, 22, 1) = .0, (1, 23, 1) = .0, (1, 24, 1) = .0, (1, 25, 1) = .0, (1, 26, 1) = .0, (1, 27, 1) = .0, (1, 28, 1) = .0, (1, 29, 1) = .0, (1, 30, 1) = .0, (1, 31, 1) = .0, (1, 32, 1) = .0, (1, 33, 1) = .0, (1, 34, 1) = .0, (1, 35, 1) = .0, (1, 36, 1) = .0, (1, 37, 1) = .0, (1, 38, 1) = .0, (1, 39, 1) = .0, (1, 40, 1) = .0, (1, 41, 1) = .0, (1, 42, 1) = .0, (1, 43, 1) = .0, (1, 44, 1) = .0, (1, 45, 1) = .0, (1, 46, 1) = .0, (1, 47, 1) = .0, (1, 48, 1) = .0, (1, 49, 1) = .0, (1, 50, 1) = .0, (1, 51, 1) = .0, (1, 52, 1) = .0, (1, 53, 1) = .0, (1, 54, 1) = .0, (1, 55, 1) = .0, (1, 56, 1) = .0, (1, 57, 1) = .0, (1, 58, 1) = .0, (1, 59, 1) = .0, (1, 60, 1) = .0, (1, 61, 1) = .0, (1, 62, 1) = .0, (1, 63, 1) = .0, (1, 64, 1) = .0, (1, 65, 1) = .0, (1, 66, 1) = .0, (1, 67, 1) = .0, (1, 68, 1) = .0, (1, 69, 1) = .0, (1, 70, 1) = .0, (1, 71, 1) = .0, (1, 72, 1) = .0, (1, 73, 1) = .0, (1, 74, 1) = .0, (1, 75, 1) = .0, (1, 76, 1) = .0, (1, 77, 1) = .0, (1, 78, 1) = .0, (1, 79, 1) = .0, (1, 80, 1) = .0, (1, 81, 1) = .0, (1, 82, 1) = .0, (1, 83, 1) = .0, (1, 84, 1) = .0, (1, 85, 1) = .0, (1, 86, 1) = .0, (1, 87, 1) = .0, (1, 88, 1) = .0, (1, 89, 1) = .0, (1, 90, 1) = .0, (1, 91, 1) = .0, (1, 92, 1) = .0, (1, 93, 1) = .0, (1, 94, 1) = .0, (1, 95, 1) = .0, (1, 96, 1) = .0, (1, 97, 1) = .0, (1, 98, 1) = .0, (1, 99, 1) = .0, (1, 100, 1) = .0, (1, 101, 1) = .0, (2, 1, 1) = .0, (2, 2, 1) = .0, (2, 3, 1) = .0, (2, 4, 1) = .0, (2, 5, 1) = .0, (2, 6, 1) = .0, (2, 7, 1) = .0, (2, 8, 1) = .0, (2, 9, 1) = .0, (2, 10, 1) = .0, (2, 11, 1) = .0, (2, 12, 1) = .0, (2, 13, 1) = .0, (2, 14, 1) = .0, (2, 15, 1) = .0, (2, 16, 1) = .0, (2, 17, 1) = .0, (2, 18, 1) = .0, (2, 19, 1) = .0, (2, 20, 1) = .0, (2, 21, 1) = .0, (2, 22, 1) = .0, (2, 23, 1) = .0, (2, 24, 1) = .0, (2, 25, 1) = .0, (2, 26, 1) = .0, (2, 27, 1) = .0, (2, 28, 1) = .0, (2, 29, 1) = .0, (2, 30, 1) = .0, (2, 31, 1) = .0, (2, 32, 1) = .0, (2, 33, 1) = .0, (2, 34, 1) = .0, (2, 35, 1) = .0, (2, 36, 1) = .0, (2, 37, 1) = .0, (2, 38, 1) = .0, (2, 39, 1) = .0, (2, 40, 1) = .0, (2, 41, 1) = .0, (2, 42, 1) = .0, (2, 43, 1) = .0, (2, 44, 1) = .0, (2, 45, 1) = .0, (2, 46, 1) = .0, (2, 47, 1) = .0, (2, 48, 1) = .0, (2, 49, 1) = .0, (2, 50, 1) = .0, (2, 51, 1) = .0, (2, 52, 1) = .0, (2, 53, 1) = .0, (2, 54, 1) = .0, (2, 55, 1) = .0, (2, 56, 1) = .0, (2, 57, 1) = .0, (2, 58, 1) = .0, (2, 59, 1) = .0, (2, 60, 1) = .0, (2, 61, 1) = .0, (2, 62, 1) = .0, (2, 63, 1) = .0, (2, 64, 1) = .0, (2, 65, 1) = .0, (2, 66, 1) = .0, (2, 67, 1) = .0, (2, 68, 1) = .0, (2, 69, 1) = .0, (2, 70, 1) = .0, (2, 71, 1) = .0, (2, 72, 1) = .0, (2, 73, 1) = .0, (2, 74, 1) = .0, (2, 75, 1) = .0, (2, 76, 1) = .0, (2, 77, 1) = .0, (2, 78, 1) = .0, (2, 79, 1) = .0, (2, 80, 1) = .0, (2, 81, 1) = .0, (2, 82, 1) = .0, (2, 83, 1) = .0, (2, 84, 1) = .0, (2, 85, 1) = .0, (2, 86, 1) = .0, (2, 87, 1) = .0, (2, 88, 1) = .0, (2, 89, 1) = .0, (2, 90, 1) = .0, (2, 91, 1) = .0, (2, 92, 1) = .0, (2, 93, 1) = .0, (2, 94, 1) = .0, (2, 95, 1) = .0, (2, 96, 1) = .0, (2, 97, 1) = .0, (2, 98, 1) = .0, (2, 99, 1) = .0, (2, 100, 1) = .0, (2, 101, 1) = .0, (3, 1, 1) = .0, (3, 2, 1) = .0, (3, 3, 1) = .0, (3, 4, 1) = .0, (3, 5, 1) = .0, (3, 6, 1) = .0, (3, 7, 1) = .0, (3, 8, 1) = .0, (3, 9, 1) = .0, (3, 10, 1) = .0, (3, 11, 1) = .0, (3, 12, 1) = .0, (3, 13, 1) = .0, (3, 14, 1) = .0, (3, 15, 1) = .0, (3, 16, 1) = .0, (3, 17, 1) = .0, (3, 18, 1) = .0, (3, 19, 1) = .0, (3, 20, 1) = .0, (3, 21, 1) = .0, (3, 22, 1) = .0, (3, 23, 1) = .0, (3, 24, 1) = .0, (3, 25, 1) = .0, (3, 26, 1) = .0, (3, 27, 1) = .0, (3, 28, 1) = .0, (3, 29, 1) = .0, (3, 30, 1) = .0, (3, 31, 1) = .0, (3, 32, 1) = .0, (3, 33, 1) = .0, (3, 34, 1) = .0, (3, 35, 1) = .0, (3, 36, 1) = .0, (3, 37, 1) = .0, (3, 38, 1) = .0, (3, 39, 1) = .0, (3, 40, 1) = .0, (3, 41, 1) = .0, (3, 42, 1) = .0, (3, 43, 1) = .0, (3, 44, 1) = .0, (3, 45, 1) = .0, (3, 46, 1) = .0, (3, 47, 1) = .0, (3, 48, 1) = .0, (3, 49, 1) = .0, (3, 50, 1) = .0, (3, 51, 1) = .0, (3, 52, 1) = .0, (3, 53, 1) = .0, (3, 54, 1) = .0, (3, 55, 1) = .0, (3, 56, 1) = .0, (3, 57, 1) = .0, (3, 58, 1) = .0, (3, 59, 1) = .0, (3, 60, 1) = .0, (3, 61, 1) = .0, (3, 62, 1) = .0, (3, 63, 1) = .0, (3, 64, 1) = .0, (3, 65, 1) = .0, (3, 66, 1) = .0, (3, 67, 1) = .0, (3, 68, 1) = .0, (3, 69, 1) = .0, (3, 70, 1) = .0, (3, 71, 1) = .0, (3, 72, 1) = .0, (3, 73, 1) = .0, (3, 74, 1) = .0, (3, 75, 1) = .0, (3, 76, 1) = .0, (3, 77, 1) = .0, (3, 78, 1) = .0, (3, 79, 1) = .0, (3, 80, 1) = .0, (3, 81, 1) = .0, (3, 82, 1) = .0, (3, 83, 1) = .0, (3, 84, 1) = .0, (3, 85, 1) = .0, (3, 86, 1) = .0, (3, 87, 1) = .0, (3, 88, 1) = .0, (3, 89, 1) = .0, (3, 90, 1) = .0, (3, 91, 1) = .0, (3, 92, 1) = .0, (3, 93, 1) = .0, (3, 94, 1) = .0, (3, 95, 1) = .0, (3, 96, 1) = .0, (3, 97, 1) = .0, (3, 98, 1) = .0, (3, 99, 1) = .0, (3, 100, 1) = .0, (3, 101, 1) = .0}, datatype = float[8], order = C_order), ( "leftwidth" ) = 1, ( "solmat_is" ) = 0, ( "timestep" ) = 0.100000000000000e-1, ( "errorest" ) = false ] ); if xv = "left" then return INFO["solspace"][1] elif xv = "right" then return INFO["solspace"][INFO["spacepts"]] elif tv = "start" then return INFO["t0"] elif not (type(tv, 'numeric') and type(xv, 'numeric')) then error "non-numeric input" end if; if xv < INFO["solspace"][1] or INFO["solspace"][INFO["spacepts"]] < xv then error "requested %1 value must be in the range %2..%3", INFO["spacevar"], INFO["solspace"][1], INFO["solspace"][INFO["spacepts"]] end if; dary := Vector(3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8]); daryt := 0; daryx := 0; dvars := [proc (t, x, u) u[1] end proc]; errest := false; nd := nops(INFO["depvars"]); if dary[nd+1] <> tv then try `pdsolve/numeric/evolve_solution`(INFO, tv) catch: msg := StringTools:-FormatMessage(lastexception[2 .. -1]); if tv < INFO["t0"] then error cat("unable to compute solution for %1<%2:
", msg), INFO["timevar"], INFO["failtime"] else error cat("unable to compute solution for %1>%2:
", msg), INFO["timevar"], INFO["failtime"] end if end try end if; if dary[nd+1] <> tv or dary[nd+2] <> xv then `pdsolve/interp2dto0d`(3, INFO["soltimes"], INFO["spacepts"], INFO["solspace"], nops(INFO["depvars"]), INFO["solution"], true, tv, xv, dary); if errest then `pdsolve/interp2dto0d`(3, INFO["soltimes"], INFO["spacepts"], INFO["err_t"], nops(INFO["depvars"]), INFO["solution"], true, tv, xv, daryt); `pdsolve/interp2dto0d`(3, INFO["soltimes"], INFO["spacepts"], INFO["err_x"], nops(INFO["depvars"]), INFO["solution"], true, tv, xv, daryx) end if end if; dary[nd+1] := tv; dary[nd+2] := xv; if dvars = [] then [seq(dary[i], i = 1 .. INFO["norigdepvars"])] else vals := NULL; for i to nops(dvars) do j := eval(dvars[i]); try if errest then vals := vals, evalhf(j(tv, xv, dary, daryt, daryx)) else vals := vals, evalhf(j(tv, xv, dary)) end if catch: userinfo(5, `pdsolve/numeric`, `evalhf failure`); try if errest then vals := vals, j(tv, xv, dary, daryt, daryx) else vals := vals, j(tv, xv, dary) end if catch: vals := vals, undefined end try end try end do; [vals] end if end proc; stype := "2nd"; if nargs = 1 then if args[1] = "left" then return solnproc(0, "left") elif args[1] = "right" then return solnproc(0, "right") elif args[1] = "start" then return solnproc("start", 0) else error "too few arguments to solution procedure" end if elif nargs = 2 then if stype = "1st" then tv := evalf(args[1]); xv := evalf(args[2]) else tv := evalf(args[2]); xv := evalf(args[1]) end if; if not (type(tv, 'numeric') and type(xv, 'numeric')) then if procname <> unknown then return ('procname')(args[1 .. nargs]) else ndsol := pointto(solnproc("soln_procedures")[1]); return ('ndsol')(args[1 .. nargs]) end if end if else error "incorrect arguments to solution procedure" end if; vals := solnproc(tv, xv); vals[1] end proc

Here is the solution evaluated at 1, .5:

U(1,0.5);

.303691166362792919

Here is the flux, "-(&PartialD; u)/(&PartialD; y)", evaluated at 1, .5:

-D[1](U)(1,0.5);

.4534226475

The plot of the flux (it takes some time, be patient):

plot3d(-D[1](U)(y,t), y=0..N, t=0..Pi);

 

Download numerical-flux.mw

Disclaimer: This is not an answer!

I am posting this as an "Answer" to set it apart from the twisty discussion thread that we have had so far.

I have converted the OP's equations and data into a self-contained Maple worksheet.  At the end of the worksheet I have inserted the questions that the OP is seeking answers for.  My attempts to solve the equations were unsuccessful.  See what you can do with this.

restart;

kernelopts('version');

`Maple 2022.1, X86 64 LINUX, May 26 2022, Build ID 1619613`

with(LinearAlgebra):

with(Units):

Automatically loading the Units[Simple] subpackage
 

N__bld := 4;

4

D__rtr := 30*Unit('ft');
R__tip := D__rtr/2;
chd := 8*Unit('inch');
R__hng := 1*Unit('ft');

30*Units:-Unit(ft)

15*Units:-Unit(ft)

8*Units:-Unit(`in`)

Units:-Unit(ft)

rho__air:=ThermophysicalData:-Atmosphere(10,density,useunits);

1.223824621*Units:-Unit(kg/m^3)

a__air:=ThermophysicalData:-Atmosphere(10, speedofsound, useunits);

340.2555759*Units:-Unit(m/s)

M__tip := 0.62;

.62

omega:=(M__tip*a__air)/R__tip;      

46.14139482*Units:-Unit(1/s)

Cl__alpha := 0.1*Unit(1/'deg');
C__L := alpha -> alpha*Cl__alpha;  

.1*Units:-Unit(1/arcdeg)

proc (alpha) options operator, arrow; Units:-Simple:-`*`(alpha, Cl__alpha) end proc

I converted NACA0012_CD_alpha.xlsx to NACA0012_CD_alpha.csv, and applied

the following commands to determine a sixth degree polynomial fit.

I have pasted the resulting polynomial here, so you don't need the raw data file.

(*
data := Import("/tmp/NACA0012_CD_alpha.csv"):
Data := convert(data, 'Matrix'):
alp := LinearAlgebra:-Column(Data, 1) *~ Unit('deg');
cd := LinearAlgebra:-Column(Data, 2);
fit_me := Statistics:-PolynomialFit(6, Data, x);
*)
fit_me := 0.00340780072932875 + 0.0000826700291382254*x + 0.000146289994961542*x^2 - 1.63712719600353*10^(-6)*x^3 - 1.31704118799963*10^(-6)*x^4 + 7.08093026284748*10^(-9)*x^5 + 6.41167350162788*10^(-9)*x^6;

0.340780072932875e-2+0.826700291382254e-4*x+0.146289994961542e-3*x^2-0.1637127196e-5*x^3-0.1317041188e-5*x^4+0.7080930263e-8*x^5+0.6411673502e-8*x^6

plot(fit_me, x=-15..15);

C__D := unapply(fit_me, x);

proc (x) options operator, arrow; 0.340780072932875e-2+0.826700291382254e-4*x+0.146289994961542e-3*x^2-0.1637127196e-5*x^3-0.1317041188e-5*x^4+0.7080930263e-8*x^5+0.6411673502e-8*x^6 end proc

omega;

46.14139482*Units:-Unit(1/s)

Note unit specification of the arctan.  Angles are measured in radians in Maple.
That may be different in MapleFlow. Check!

alpha__i := (r, theta, u) -> theta - arctan(u/(omega*r))*Unit('radian') - 8*Unit('deg')*r/R__tip + 6*Unit('deg');

proc (r, theta, u) options operator, arrow; Units:-Simple:-`+`(theta, Units:-Simple:-`-`(Units:-Simple:-`*`(Units:-Simple:-arctan(Units:-Simple:-`*`(u, Units:-Simple:-`/`(Units:-Simple:-`*`(omega, r)))), Units:-Unit('radian'))), Units:-Simple:-`-`(Units:-Simple:-`*`(8, Units:-Unit('deg'), r, Units:-Simple:-`/`(R__tip))), Units:-Simple:-`*`(6, Units:-Unit('deg'))) end proc

lf__s := (r, theta, u) -> 1/2*rho__air*chd*(omega^2*r^2 + u^2)*C__L(alpha__i(r, theta, u));

proc (r, theta, u) options operator, arrow; Units:-Simple:-`*`(1, Units:-Simple:-`/`(2), rho__air, chd, Units:-Simple:-`+`(Units:-Simple:-`*`(Units:-Simple:-`^`(omega, 2), Units:-Simple:-`^`(r, 2)), Units:-Simple:-`^`(u, 2)), C__L(alpha__i(r, theta, u))) end proc

dr__s := (r, theta, u) -> 1/2*rho__air*chd*(omega^2*r^2 + u^2)*C__D(alpha__i(r, theta, u));

proc (r, theta, u) options operator, arrow; Units:-Simple:-`*`(1, Units:-Simple:-`/`(2), rho__air, chd, Units:-Simple:-`+`(Units:-Simple:-`*`(Units:-Simple:-`^`(omega, 2), Units:-Simple:-`^`(r, 2)), Units:-Simple:-`^`(u, 2)), C__D(alpha__i(r, theta, u))) end proc

dr__s(r, theta, u);

.1243405815*(2129.028316*r^2*Units:-Unit(1/s^2)+u^2)*(0.340780072932875e-2+0.826700291382254e-4*theta-0.826700291382254e-4*arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-0.4409068221e-4*r*Units:-Unit(arcdeg/ft)+0.4960201748e-3*Units:-Unit(arcdeg)+0.146289994961542e-3*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^2-0.1637127196e-5*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^3-0.1317041188e-5*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^4+0.7080930263e-8*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^5+0.6411673502e-8*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^6)*Units:-Unit(kg/m^2)

lf__s(r, theta, u)*cos(alpha__i(r, theta, u)) - dr__s(r, theta, u)*sin(alpha__i(r, theta, u)):
th__s := unapply(%, r, theta, u);

proc (r, theta, u) options operator, arrow; (.1243405815*(2129.028316*r^2*Units:-Unit(1/s^2)+u^2)*(.1*theta*Units:-Unit(1/arcdeg)-5.729577951*arctan(0.2167251345e-1*u*Units:-Unit(s)/r)-0.5333333333e-1*r*Units:-Unit(1/ft)+.6)*cos(-theta+arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)+(8/15)*r*Units:-Unit(arcdeg/ft)-6*Units:-Unit(arcdeg))+.1243405815*(2129.028316*r^2*Units:-Unit(1/s^2)+u^2)*(0.340780072932875e-2+0.826700291382254e-4*theta-0.826700291382254e-4*arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-0.4409068221e-4*r*Units:-Unit(arcdeg/ft)+0.4960201748e-3*Units:-Unit(arcdeg)+0.146289994961542e-3*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^2-0.1637127196e-5*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^3-0.1317041188e-5*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^4+0.7080930263e-8*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^5+0.6411673502e-8*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^6)*sin(-theta+arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)+(8/15)*r*Units:-Unit(arcdeg/ft)-6*Units:-Unit(arcdeg)))*Units:-Unit(kg/m^2) end proc

dr__s(r, theta, u)*cos(alpha__i(r, theta, u)) + lf__s(r, theta, u)*sin(alpha__i(r, theta, u)):
trq__s := unapply(%, r, theta, u);

proc (r, theta, u) options operator, arrow; (.1243405815*(2129.028316*r^2*Units:-Unit(1/s^2)+u^2)*(0.340780072932875e-2+0.826700291382254e-4*theta-0.826700291382254e-4*arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-0.4409068221e-4*r*Units:-Unit(arcdeg/ft)+0.4960201748e-3*Units:-Unit(arcdeg)+0.146289994961542e-3*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^2-0.1637127196e-5*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^3-0.1317041188e-5*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^4+0.7080930263e-8*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^5+0.6411673502e-8*(theta-arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)-(8/15)*r*Units:-Unit(arcdeg/ft)+6*Units:-Unit(arcdeg))^6)*cos(-theta+arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)+(8/15)*r*Units:-Unit(arcdeg/ft)-6*Units:-Unit(arcdeg))-.1243405815*(2129.028316*r^2*Units:-Unit(1/s^2)+u^2)*(.1*theta*Units:-Unit(1/arcdeg)-5.729577951*arctan(0.2167251345e-1*u*Units:-Unit(s)/r)-0.5333333333e-1*r*Units:-Unit(1/ft)+.6)*sin(-theta+arctan(0.2167251345e-1*u*Units:-Unit(s)/r)*Units:-Unit(rad)+(8/15)*r*Units:-Unit(arcdeg/ft)-6*Units:-Unit(arcdeg)))*Units:-Unit(kg/m^2) end proc

Thust := (theta, u) -> N__bld *
        int(th__s(r, theta, u), r = R__hng .. R__tip, numeric);

proc (theta, u) options operator, arrow; Units:-Simple:-`*`(N__bld, int(th__s(r, theta, u), Units:-Simple:-`=`(r, R__hng .. R__tip), numeric)) end proc

Thust := proc(theta, u)
        #print(theta, u);
        N__bld * int(th__s(r, theta, u), r = R__hng .. R__tip, numeric);
end proc:

UD := u -> 2*rho__air*u^2*Pi*R__tip^2;

proc (u) options operator, arrow; Units:-Simple:-`*`(2, rho__air, Units:-Simple:-`^`(u, 2), Pi, Units:-Simple:-`^`(R__tip, 2)) end proc

eqn2 := (theta, u) -> Thust(theta, u) - UD(u);

proc (theta, u) options operator, arrow; Units:-Simple:-`+`(Thust(theta, u), Units:-Simple:-`-`(UD(u))) end proc

 

Questions

 

eqn2(theta,u) may evaluated at arbitrary theta and u values:

eqn2(6*Unit('degree'), 5*Unit('m'/'sec'));

9351.119025*Units:-Unit(N)

eqn2(6*Unit('degree'), 10*Unit('m'/'sec'));

-9476.904304*Units:-Unit(N)

We see that eqn2(6,u) changes sign as u goes from 5 to 10, so

so it is zero for some u between 5 and 10.
Question 1: How do we find that u?

The following (which I have commented out) does not work:

# fsolve('eqn2'(6*Unit('degree'), u*Unit('m'/'sec')), u = 5 .. 10);

Question 2: Suppose that we figure out how to answer the previous question.

How do we generalize it to make it work for unspecified values of the first argument,

that is, find U so that:

# U := theta -> fsolve(eqn2(theta*Unit('degree'), u*Unit('m'/'sec')), u = 0..100);

Observation: The following does work!
I plot the 3D graph of z = eqn2(theta,u) along with the plane z=0.

The intersection curve of those two surfaces is the graph of the function U defined above.


Note: I don't know how to make surfdata work with units,
so I divide the value of  Thust by Unit(N) to remove the unit.

[seq([seq(
        [theta, u, Thust( theta*Unit('degree'), u*Unit('ft'/'sec') )/Unit(N)],                         theta=0..15, 3)], u = 0..100, 10)]:
plots:-surfdata(%):
plot3d(0, theta=0..15, u=0..100):
plots:-display(%,%%, style=surface);

 

Download rotor-equation.mw

What you have shown appears to be an incomplete fragment (what is "Thust", for instance?) and therefore I cannot tell you how to fix that.  If Maple's fsolve cannot solve your equation, I doubt that your own Newton's root-finder will do any better.

Nonetheless, since you asked for a recursive implementation of Newton's root-finding method, here it is, for whatever it's worth.

restart;

Implements the Newton root-finding iteration.

Required arguments:

        f:        a function

        x0:        starting point of the root-finding iteration

Optional arguments:
        eps: tolerance -- iteration stops when consecutive x values are less than eps
                 default eps = 1e-5
        nmax: iteration is aborted if numer of iterations exceeds nmax
                default nmax = 10

NewtIt := proc(f, x0, {eps:=1e-5, nmax:=10})
        local x, xnew;
        x := evalf(x0);
        xnew := x - f(x)/D(f)(x);
        if is(abs(xnew - x) < eps) then
                return xnew;
        elif nmax = 0 then
                error "number of iterations exceeded nmax";
        else
                return `procname`(f, xnew, :-eps=eps, :-nmax=nmax-1);
        end if;
end proc:

NewtIt(x->x^2 - 4, 10);

2.000000000

NewtIt(x->x^2 - 4, 10, eps=0.01);

2.000009271

NewtIt(x->x^2 - 4, 10, eps=0.01, nmax=2);

Error, (in NewtIt) number of iterations exceeded nmax

 

Download newton-iteration.mw

restart;

ftaylor := mtaylor(g(x,y), [x, y], 3);

g(0, 0)+(D[1](g))(0, 0)*x+(D[2](g))(0, 0)*y+(1/2)*(D[1, 1](g))(0, 0)*x^2+(D[1, 2](g))(0, 0)*x*y+(1/2)*(D[2, 2](g))(0, 0)*y^2

g := (x,y) -> exp(-x^2-y^2);

proc (x, y) options operator, arrow; exp(-x^2-y^2) end proc

ftaylor;

-x^2-y^2+1

Or maybe

restart;

ftaylor := n -> mtaylor(g(x,y), [x, y], n);

proc (n) options operator, arrow; mtaylor(g(x, y), [x, y], n) end proc

g := (x,y) -> exp(-x^2-y^2);

proc (x, y) options operator, arrow; exp(-x^2-y^2) end proc

ftaylor(3);

-x^2-y^2+1

ftaylor(5);

1-x^2-y^2+(1/2)*x^4+y^2*x^2+(1/2)*y^4

 

Download mw.mw


 

restart;

to_list := u -> `if`( type(u,`*`), convert(u, list), [u]):

 

to_list(a^2*b^5);

[a^2, b^5]

to_list(a^2);

[a^2]

TomLeslie has already answered your question. Here is a shorter alternative.

restart;

Are the rows of the matrix unique?

uniqueRows := proc(A::Matrix)
        local rows, n1, n2;
        rows := convert(A, listlist);
        n1 := nops(rows);
        rows := convert(rows, set);
        n2 := nops(rows);
        return evalb(n1=n2);
end proc:

A := Matrix([[1, 2, 3], [3, 2, 1], [4, 6, 5]]);

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

uniqueRows(A);

true

A := Matrix([[1, 2, 3], [1,2,3], [4, 6, 5]]);

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

uniqueRows(A);

false

Determine if A and B are the same modulo row permutations

RowEqual := proc(A::Matrix, B::Matrix)
        local rowsA, rowsB;
        rowsA := sort(convert(A, listlist));
        rowsB := sort(convert(B, listlist));
        return ArrayTools:-IsEqual(rowsA, rowsB);
end proc:

A := Matrix([[1, 2, 3], [3, 2, 1], [4, 6, 5]]);

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

B := Matrix([[3, 2, 1], [1, 2, 3], [4, 6, 5]]);

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

RowEqual(A, B);

true

B := Matrix([[5, 2, 1], [1, 2, 3], [4, 6, 5]]);

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

RowEqual(A, B);

false

Download mw.mw

 

I don't know why you refer to singular solutions. I don't see anything "singular" there.

Neither of the two solutions produced by your construction is a solutions.  You are "misleading" Maple into looking at the ODE as one of the d'Alembert type.  Maple blindly obliges and produces the wrong results.

Here is how one (illegally) casts your equation into a d'Alembert type.

  1. Square both sides of the equation to get (dy/dx)^2 = 1 + x + y;
  2. Rearrange into y + 1 = - x + (dy/dx)^2
  3. Let z = 1 + y.  Then z = - x + (dz/dx)^2

This is a d'Alembert ODE (see ?Solving d'Alembert ODEs) with f(s)=-1 and g(s)=s^2.

Where is the error?  It is in Step 1.  By squaring the two sides of the ODE, we are introducing spurious solutions.  Maple's solution would be correct (for the wrong reasons) if you replace the right-hand side of your ODE by its negative.

To avoid the issue, don't impose the dalembert requirement.  Do dsolve(ode_1) to let Maple do its own thing and produce the correct, albeit implicit, solution.

This comes close to what you have sketched.

p := plots:-display(
	plot(floor(x), x=1..8, discont=[color="Red"], color="Green"),
	plot(floor(x), x=-8..-1/2, discont=[color="Red"], color="Green"),
	symbol=solidcircle, symbolsize=10, thickness=3):
plottools:-transform((x,y)->[1/x, 1/y])(p);

5 6 7 8 9 10 11 Last Page 7 of 53