Rouben Rostamian

MaplePrimes Activity


These are answers submitted by Rouben Rostamian

restart;

eqns :=
        c - d = d - b,
        d = a,
        a^2 + c^2 = 19^2,
        1/2*a*(c-b) = 60;

c-d = d-b, d = a, a^2+c^2 = 361, (1/2)*a*(c-b) = 60

sol := solve({eqns});

{a = RootOf(2*_Z^4-241*_Z^2+3600), b = (1/30)*RootOf(2*_Z^4-241*_Z^2+3600)^3-(181/60)*RootOf(2*_Z^4-241*_Z^2+3600), c = -(1/30)*RootOf(2*_Z^4-241*_Z^2+3600)^3+(301/60)*RootOf(2*_Z^4-241*_Z^2+3600), d = RootOf(2*_Z^4-241*_Z^2+3600)}

subs(sol, sqrt(a^2+b^2)):
simplify(%);

11

 

Download mw.mw

 

Here is a proof.  I suspect that it can be done in a more elegant and more insightful way but I haven't spent much time on it.

restart;

In the diagram below, the red curve is the graph of an arbitrary smooth function f(x).

The green line intersects the curve at A and B.  The region trapped between the

curve and the green line is colored yellow.  

 

Tangent lines to the curve drawn at the points A and B intersect at C, forming

a triangle ABC.  Let
R = (area of the yellow region) / (area of the triangle ABC).

The goal of this worksheet is to show that R converges to 2/3 as B approaches A.

 

Let A=(a,f(a)), B=(b,f(b)).
Equations of tangent lines at x=a and x=b to the curve y=f(x).

tan__1 := y = f(a) + D(f)(a)*(x-a);
tan__2 := y = f(b) + D(f)(b)*(x-b);

y = f(a)+(D(f))(a)*(x-a)

y = f(b)+(D(f))(b)*(x-b)

The intersection point of the tangent lines

inter := simplify(solve({tan__1, tan__2}, {x,y}));

{x = ((D(f))(a)*a-(D(f))(b)*b-f(a)+f(b))/((D(f))(a)-(D(f))(b)), y = (((a-b)*(D(f))(b)+f(b))*(D(f))(a)-f(a)*(D(f))(b))/((D(f))(a)-(D(f))(b))}

Let (X,Y) be the coordinates of the intersection point:

X := simplify(subs(inter, x));
Y := simplify(subs(inter, y));

((D(f))(a)*a-(D(f))(b)*b-f(a)+f(b))/((D(f))(a)-(D(f))(b))

(((a-b)*(D(f))(b)+f(b))*(D(f))(a)-f(a)*(D(f))(b))/((D(f))(a)-(D(f))(b))

The area of the triangle with vertices (a,f(a)), (b,f(b)), (X,Y):

<a,X,b;f(a),Y,f(b);1,1,1>;
A__triangle := simplify(1/2*LinearAlgebra:-Determinant(%));

Matrix(3, 3, {(1, 1) = a, (1, 2) = ((D(f))(a)*a-(D(f))(b)*b-f(a)+f(b))/((D(f))(a)-(D(f))(b)), (1, 3) = b, (2, 1) = f(a), (2, 2) = (((a-b)*(D(f))(b)+f(b))*(D(f))(a)-f(a)*(D(f))(b))/((D(f))(a)-(D(f))(b)), (2, 3) = f(b), (3, 1) = 1, (3, 2) = 1, (3, 3) = 1})

((a-b)*(D(f))(b)-f(a)+f(b))*((a-b)*(D(f))(a)-f(a)+f(b))/(2*(D(f))(a)-2*(D(f))(b))

The equation of the line connecting A and B:

line__ab := y = f(a) + (f(b)-f(a))/(b-a)*(x-a);

y = f(a)+(f(b)-f(a))*(x-a)/(b-a)

The area of the of the region bounded by the line above and the curve y=f(x)
(i.e., the area of the yellow region in the figure)

A__region := int(rhs(line__ab) - f(x), x=a..b);

int(f(a)+(f(b)-f(a))*(x-a)/(b-a)-f(x), x = a .. b)

The ratio of the areas

R := A__region / A__triangle;

(int(f(a)+(f(b)-f(a))*(x-a)/(b-a)-f(x), x = a .. b))*(2*(D(f))(a)-2*(D(f))(b))/(((a-b)*(D(f))(b)-f(a)+f(b))*((a-b)*(D(f))(a)-f(a)+f(b)))

Both the numerator and denominator of R vanish when b=a.  We apply l'Hospital's

rule to find the limit of R as b approaches a:

simplify(diff(A__region, b)):         # derivative of the numerator
simplify(diff(A__triangle, b)):       # derivative of the denominator
simplify(%%/%):                       # l'Hospital's rule
limit(%, b=a);                        # limit of the ratio

2/3

 

 

Download vollers-theorem.mw

 

restart;

with(plots):

p1 := implicitplot([x = y^2 - 3, x = y - y^2], x=-4..1, y=-2..3,
        color=["Red", "Blue"], thickness=3);

p2 := inequal({x > y^2 - 3, x < y - y^2}, x=-4..1, y=-2..3,
        color="DarkSeaGreen", nolines);

display(p1,p2);

 

Download mw.mw

 

I have no idea what "sweep frequency analysis" may mean but I see that your worksheet suffers from bad choices of parameters. Any worksheet that has numbers like 0.0001 and 4000 occurring in the same expression should raise a red flag.  Do you really need those numbers?

I have reproduced your worksheet with a milder set of numbers, and made a few adjustments. See if this is something like what you expect. If so, then change the parameters just a little at a time to make them more to your liking. If not, say what it is that you don't like. A statement like "the two images do not correspond to each other" is not very informative. You need to be more clear about what you mean.

restart;

de := diff(theta(t), t$2) + g*sin(theta(t))/l;

diff(diff(theta(t), t), t)+g*sin(theta(t))/l

g := 1;
T := 40;

1

40

l1 := 0.01 + t/T;
l2 := (1 + 0.01) - t/T;

0.1e-1+(1/40)*t

1.01-(1/40)*t

De1 := subs(l=l1, de);
De2 := subs(l=l2, de);

diff(diff(theta(t), t), t)+sin(theta(t))/(0.1e-1+(1/40)*t)

diff(diff(theta(t), t), t)+sin(theta(t))/(1.01-(1/40)*t)

ICs := theta(0) = 0.1, D(theta)(0) = 0;

theta(0) = .1, (D(theta))(0) = 0

dsol1 := dsolve({De1,ICs}, numeric, output=operator);
dsol2 := dsolve({De2,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) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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.5056081345686286e-3, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = -9.983341664682815}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(0.1e-1+(1/40)*X); YP[1] := Y[2]; 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, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(0.1e-1+(1/40)*X); YP[1] := Y[2]; 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..2, {(1) = 0., (2) = .1}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _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..3, {(1) = 36893628138453246124, (2) = 36893628138453249292, (3) = 36893628138453228988}), (3) = [t, theta(t), diff(theta(t), t)], (4) = []}); _solnproc := _dat[1]; _pars := map(lhs, _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, 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) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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.5056081345686286e-3, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = -9.983341664682815}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(0.1e-1+(1/40)*X); YP[1] := Y[2]; 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, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(0.1e-1+(1/40)*X); YP[1] := Y[2]; 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..2, {(1) = 0., (2) = .1}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _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..3, {(1) = 36893628138453246124, (2) = 36893628138453249292, (3) = 36893628138453228988}), (3) = [t, theta(t), diff(theta(t), t)], (4) = []}); _solnproc := _dat[1]; _pars := map(lhs, _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`("theta"); 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(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) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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.5056081345686286e-3, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = -9.983341664682815}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(0.1e-1+(1/40)*X); YP[1] := Y[2]; 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, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(0.1e-1+(1/40)*X); YP[1] := Y[2]; 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..2, {(1) = 0., (2) = .1}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _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..3, {(1) = 36893628138453246124, (2) = 36893628138453249292, (3) = 36893628138453228988}), (3) = [t, theta(t), diff(theta(t), t)], (4) = []}); _solnproc := _dat[1]; _pars := map(lhs, _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(theta)"); 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]

[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) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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.5106642159143149e-1, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = -0.9884496697705758e-1}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(1.01-(1/40)*X); YP[1] := Y[2]; 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, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(1.01-(1/40)*X); YP[1] := Y[2]; 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..2, {(1) = 0., (2) = .1}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _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..3, {(1) = 36893628138444436772, (2) = 36893628138438679468, (3) = 36893628138438673084}), (3) = [t, theta(t), diff(theta(t), t)], (4) = []}); _solnproc := _dat[1]; _pars := map(lhs, _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, 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) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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.5106642159143149e-1, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = -0.9884496697705758e-1}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(1.01-(1/40)*X); YP[1] := Y[2]; 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, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(1.01-(1/40)*X); YP[1] := Y[2]; 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..2, {(1) = 0., (2) = .1}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _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..3, {(1) = 36893628138444436772, (2) = 36893628138438679468, (3) = 36893628138438673084}), (3) = [t, theta(t), diff(theta(t), t)], (4) = []}); _solnproc := _dat[1]; _pars := map(lhs, _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`("theta"); 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(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) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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.5106642159143149e-1, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = -0.9884496697705758e-1}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(1.01-(1/40)*X); YP[1] := Y[2]; 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, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(1.01-(1/40)*X); YP[1] := Y[2]; 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..2, {(1) = 0., (2) = .1}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _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..3, {(1) = 36893628138444436772, (2) = 36893628138438679468, (3) = 36893628138438673084}), (3) = [t, theta(t), diff(theta(t), t)], (4) = []}); _solnproc := _dat[1]; _pars := map(lhs, _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(theta)"); 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]

theta1 := subs(dsol1, theta);
theta2 := subs(dsol2, 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) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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.5056081345686286e-3, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = -9.983341664682815}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(0.1e-1+(1/40)*X); YP[1] := Y[2]; 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, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(0.1e-1+(1/40)*X); YP[1] := Y[2]; 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..2, {(1) = 0., (2) = .1}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _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..3, {(1) = 36893628138453246124, (2) = 36893628138453249292, (3) = 36893628138453228988}), (3) = [t, theta(t), diff(theta(t), t)], (4) = []}); _solnproc := _dat[1]; _pars := map(lhs, _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`("theta"); 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

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) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 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.5106642159143149e-1, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..4, {(1) = .0, (2) = .0, (3) = .0, (4) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8])]), ( 8 ) = ([Array(1..2, {(1) = .1, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = -0.9884496697705758e-1}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(1.01-(1/40)*X); YP[1] := Y[2]; 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, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = theta(t), Y[2] = diff(theta(t),t)]`; YP[2] := -sin(Y[1])/(1.01-(1/40)*X); YP[1] := Y[2]; 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..2, {(1) = 0., (2) = .1}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); _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..3, {(1) = 36893628138444436772, (2) = 36893628138438679468, (3) = 36893628138438673084}), (3) = [t, theta(t), diff(theta(t), t)], (4) = []}); _solnproc := _dat[1]; _pars := map(lhs, _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`("theta"); 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

p1 := plot([l1, theta1(t), t=0..T], color="Red"):
p2 := plot([l2, theta2(t), t=0..T], color="Green"):

plots:-display(p1, p2);

simple.mw

You are attempting to apply pdsolve() to solve a system of two differential equations for the unknowns w(r,z) and theta(r,z).  If  you look closely at your system, you will observe that there are no derivatives with respect to z in them, and therefore what you have is a system of ordinary, not pertial, differential equations.  The unknowns are w(r) and theta(r);  the value of z can be assigned arbitrarily.  In fact, z enters only indirectly, as h(z).  Therefore there is no point in retaining z in the formulation at all.  Just replace h(z) with h, and assign values to h as desired.   In the following worksheet I have plotted two sets of solutions with h=1 and h=0.8.

Be sure to closely inspect the worksheet to make sure that I have entered your data correctly.  I make no guarantees on that.

restart;

de1 := diff(w(r),r,r) + 1/r*diff(w(r),r) - (1/Da+x3/x1*M^2)*w(r) - 1/x1*(DP+theta(r)*x4*Gr*sin(alpha))=0;

diff(diff(w(r), r), r)+(diff(w(r), r))/r-(1/Da+x3*M^2/x1)*w(r)-(DP+theta(r)*x4*Gr*sin(alpha))/x1 = 0

de2 := diff(theta(r),r,r) + 1/r*diff(theta(r),r) + S/x5 = 0;

diff(diff(theta(r), r), r)+(diff(theta(r), r))/r+S/x5 = 0

BCs1 := D(w)(0) = 0, w(h) = 0;

(D(w))(0) = 0, w(h) = 0

BCs2 := D(theta)(0) = 0, theta(h)=0;

(D(theta))(0) = 0, theta(h) = 0

params :=
        DP=96*x1/(6-b*h^2)/h^4*(F + a*h/24 - 11/6144*b*(b-4*a)*h^8),
        a=x4*S*Gr/(4*x1*x5)*sin(alpha),
        b=1/Da+(x3*M/(x1*(1+m^2))),
        x1=1/((1-phi1)^(5/2)*(1-phi2)^(5/2)),
        x3=shnf/sf,
        x4=(1-phi2)*((1-phi1)+phi1*(RBs1)/(RBf))+phi2*RBs2/RBf,
        x5=khnf/kf,
        khnf=kbf*((ks2+2*kbf-2*phi2*(kbf-ks2))/(ks2+2*kbf+phi2*(kbf-ks2))),
        kbf=kf*((ks1+2*kf-2*phi1*(kf-ks1))/(ks1+2*kf+phi1*(kf-ks1))),
        shnf=sbf*((ss2+2*sbf-2*phi2*(sbf-ss2))/(ss2+2*sbf+phi2*(sbf-ss2))),
        sbf=sf*((ss1+2*sf-2*phi1*(sf-ss1))/(ss1+2*sf+phi1*(sf-ss1))),
        ks1=401, ks2=76.5, kf=0.4972,
        Da=1/10, Gr=2, S=1/10, alpha=Pi/4,
        m=1/2, F=3/2,
        RBs1=8933*16.7*10^(6),
        RBs2=6320*18*10^(6),
        RBf=1063*1.8*10^(6),
        ss1=59.6*10^(6),
        ss2=2.7*10^(-8),
        sf=6.67*10^(-1),
        phi1=1/100, phi2=2/100;

DP = 96*x1*(F+(1/24)*a*h-(11/6144)*b*(b-4*a)*h^8)/((-b*h^2+6)*h^4), a = (1/4)*x4*S*Gr*sin(alpha)/(x1*x5), b = 1/Da+x3*M/(x1*(m^2+1)), x1 = 1/((1-phi1)^(5/2)*(1-phi2)^(5/2)), x3 = shnf/sf, x4 = (1-phi2)*(1-phi1+phi1*RBs1/RBf)+phi2*RBs2/RBf, x5 = khnf/kf, khnf = kbf*(ks2+2*kbf-2*phi2*(kbf-ks2))/(ks2+2*kbf+phi2*(kbf-ks2)), kbf = kf*(ks1+2*kf-2*phi1*(kf-ks1))/(ks1+2*kf+phi1*(kf-ks1)), shnf = sbf*(ss2+2*sbf-2*phi2*(sbf-ss2))/(ss2+2*sbf+phi2*(sbf-ss2)), sbf = sf*(ss1+2*sf-2*phi1*(sf-ss1))/(ss1+2*sf+phi1*(sf-ss1)), ks1 = 401, ks2 = 76.5, kf = .4972, Da = 1/10, Gr = 2, S = 1/10, alpha = (1/4)*Pi, m = 1/2, F = 3/2, RBs1 = 0.1491811000e12, RBs2 = 113760000000, RBf = 1913400000., ss1 = 59600000.0, ss2 = 0.2700000000e-7, sf = .6670000000, phi1 = 1/100, phi2 = 1/50

Maple's dsolve() fails to solve {de1,de2} as a system:

dsolve({de1,de2, BCs1, BCs2}, {w(r), theta(r)});

Note, however, that de2 is independent of w, so it can be solved on its own:

theta_sol := evalf(dsolve({subs(params, de2), D(theta)(0)=0, theta(h) = 0}));

theta(r) = -0.2289404327e-1*r^2+0.2289404327e-1*h^2

We substitute the calculated theta into de1 and solve it for w:

evalf(subs(params, theta_sol, de1)):
w_sol := evalf(dsolve({%, D(w)(0) = 0, w(h) = 0}));

w(r) = 0.2000000000e-19*BesselJ(0., 0.1000000000e-4*(-9268785999.*M^2-0.1000000000e12)^(1/2)*r)*(0.4379567811e49*M^4*h^8+0.1160535436e51*M^3*h^8+0.8158269332e51*h^8*M^2+0.1252090011e52*h^8*M+0.8292091506e52*h^8-0.1301414645e50*M*h^6-0.1755103965e51*h^6+0.1053062379e51*h^4-0.1626768306e50*M^2*h-0.6673525921e52*M^2-0.1755103965e51*h-0.7200000002e53)/(BesselJ(0., 0.1000000000e-4*(-9268785999.*M^2-0.1000000000e12)^(1/2)*h)*h^4*(0.6370280450e30*M^5*h^2+0.8591039390e31*M^4*h^2+0.1374566303e32*M^3*h^2-0.5154623634e31*M^4+0.1853757200e33*M^2*h^2+0.7415028801e32*h^2*M-0.1112254320e33*M^2+0.1000000000e34*h^2-0.6000000000e33))+0.2000000000e-19*(-0.4379567811e49*(M+13.48612429)*(M+13.70130202)*(M^2+10.78889943)*h^8+(0.3015633461e49*M^3*r^2+(0.4066920765e50*r^2+0.2440152459e50)*M^2+(0.3253536613e50*r^2+0.1301414645e50)*M+0.4387759914e51*r^2+0.4387759914e51)*h^6+(-0.2440152459e50*M^2*r^2-0.2632655948e51*r^2-0.1053062379e51)*h^4+(0.1626768306e50*M^2+0.1755103965e51)*h+0.6673525921e52*M^2+0.7200000002e53)/(h^4*(9268785999.*M^2+0.1000000000e12)^2*(7415028801.*h^2*M+0.1000000000e12*h^2-0.6000000000e11))

h := 1;
seq(rhs(w_sol), M in [2, 5, 7,9]):
plot([%], r=0..h);
h := 'h':

1

h := 0.8;
seq(rhs(w_sol), M in [2, 5, 7,9]):
plot([%], r=0..h);
h := 'h':

.8

Download mw.mw

 

Note: The contents of vector quantities are shown as question marks on this web page.  That's due to this website's interface.  Vectors are shown properly in the actual worksheet.

Geodesic on a rounded cube

restart;

with(plots):

We wish to obtain a geodesic curve that connect the opposite vertices of

the "rounded cube" x^4+y^4+z^4 = 1.
We begin by finding a parametric representation of the cube through

introducing spherical coordinates r, u, v defined as
x = (r*cos*u*cos)*v, y = r*cos*u*sin*v, z = r*sin*u

where r >= 0, -(1/2)*Pi < u and u < (1/2)*Pi, -Pi < v and v < Pi.

eq_implicit := x^4 + y^4 + z^4 = 1;

x^4+y^4+z^4 = 1

rels := x = r*cos(u)*sin(v), y = r*cos(u)*cos(v), z = r*sin(u);

x = r*cos(u)*sin(v), y = r*cos(u)*cos(v), z = r*sin(u)

Convert the implicitly defined surface to a parametric surface:

subs(rels, eq_implicit):
isolate(%, r^4):
surd(rhs(%), 4):
subs(rels, r=%, <x,y,z>):
S := unapply(%, u, v);

proc (u, v) options operator, arrow; rtable(1 .. 3, {1 = surd(1/(cos(u)^4*sin(v)^4+cos(u)^4*cos(v)^4+sin(u)^4), 4)*cos(u)*sin(v), 2 = surd(1/(cos(u)^4*sin(v)^4+cos(u)^4*cos(v)^4+sin(u)^4), 4)*cos(u)*cos(v), 3 = surd(1/(cos(u)^4*sin(v)^4+cos(u)^4*cos(v)^4+sin(u)^4), 4)*sin(u)}, datatype = anything, subtype = Vector[column], storage = rectangular, order = Fortran_order) end proc

Here's what the surface looks like:

p1 := plot3d(S(u,v), u=-Pi/2..Pi/2, v=-Pi..Pi, color="Orange");

Find the coordinates of the points P and Q at a pair of opposing vertices of the surface

where we have x = y and y = z

subs(rels, {x=y, x=z}):
solve(%, {u,v}, explicit);
p, q := %[1], %[2];

{u = arctan((1/2)*2^(1/2)), v = (1/4)*Pi}, {u = -arctan((1/2)*2^(1/2)), v = -(3/4)*Pi}

{u = arctan((1/2)*2^(1/2)), v = (1/4)*Pi}, {u = -arctan((1/2)*2^(1/2)), v = -(3/4)*Pi}

P := simplify(subs(p, S(u,v)));
Q := simplify(subs(q, S(u,v)));

Vector(3, {(1) = (1/2)*sqrt(2)*3^(1/4)*cos((1/2)*arctan(2*sqrt(2))), (2) = (1/2)*sqrt(2)*3^(1/4)*cos((1/2)*arctan(2*sqrt(2))), (3) = 3^(1/4)*sin((1/2)*arctan(2*sqrt(2)))})

Vector[column](%id = 36893627908823856540)

p2 := pointplot3d([P, Q], symbol=solidsphere, symbolsize=30,
        color=["Red", "Green"]):

Consider a curve that lies on the surface, parametrized by the u coordinate:

C := S(u,v(u));

Vector(3, {(1) = (1/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4))^(1/4)*cos(u)*sin(v(u)), (2) = (1/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4))^(1/4)*cos(u)*cos(v(u)), (3) = (1/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4))^(1/4)*sin(u)})

The tangent vector to C:

T := diff(C,u);

Vector(3, {(1) = -(1/4)*(-4*cos(u)^3*sin(v(u))^4*sin(u)+4*cos(u)^4*sin(v(u))^3*(diff(v(u), u))*cos(v(u))-4*cos(u)^3*cos(v(u))^4*sin(u)-4*cos(u)^4*cos(v(u))^3*(diff(v(u), u))*sin(v(u))+4*sin(u)^3*cos(u))*(1/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4))^(1/4)*cos(u)*sin(v(u))/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4)-(1/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4))^(1/4)*sin(u)*sin(v(u))+(1/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4))^(1/4)*cos(u)*(diff(v(u), u))*cos(v(u)), (2) = -(1/4)*(-4*cos(u)^3*sin(v(u))^4*sin(u)+4*cos(u)^4*sin(v(u))^3*(diff(v(u), u))*cos(v(u))-4*cos(u)^3*cos(v(u))^4*sin(u)-4*cos(u)^4*cos(v(u))^3*(diff(v(u), u))*sin(v(u))+4*sin(u)^3*cos(u))*(1/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4))^(1/4)*cos(u)*cos(v(u))/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4)-(1/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4))^(1/4)*sin(u)*cos(v(u))-(1/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4))^(1/4)*cos(u)*(diff(v(u), u))*sin(v(u)), (3) = -(1/4)*(-4*cos(u)^3*sin(v(u))^4*sin(u)+4*cos(u)^4*sin(v(u))^3*(diff(v(u), u))*cos(v(u))-4*cos(u)^3*cos(v(u))^4*sin(u)-4*cos(u)^4*cos(v(u))^3*(diff(v(u), u))*sin(v(u))+4*sin(u)^3*cos(u))*(1/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4))^(1/4)*sin(u)/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4)+(1/(cos(u)^4*sin(v(u))^4+cos(u)^4*cos(v(u))^4+sin(u)^4))^(1/4)*cos(u)})

The length of the tangent vector:

T__len := sqrt(simplify(T^+ . T));

2*6^(1/2)*(surd(1/(cos(u)^4*cos(4*v(u))+4*sin(u)^4+3*cos(u)^4), 4)^2*((-(1/3)*cos(u)^6*sin(u)^2*cos(v(u))^8+(2/3)*cos(u)^6*sin(u)^2*cos(v(u))^6+cos(u)^4*(-(13/12)*cos(u)^2+1/3+cos(u)^4)*cos(v(u))^4+((3/4)*cos(u)^6-(1/3)*cos(u)^4-(2/3)*cos(u)^8)*cos(v(u))^2+(1/3)*(cos(u)^4-cos(u)^2+1/2)^2)*cos(u)^2*(diff(v(u), u))^2+(2/3)*sin(v(u))*cos(u)^5*(cos(v(u))^2-1/2)*cos(v(u))*sin(u)*(cos(u)^2*cos(v(u))^4-cos(u)^2*cos(v(u))^2+cos(u)^2-1/2)*(diff(v(u), u))-(1/4)*cos(u)^2+(1/4)*cos(u)^4-(1/3)*sin(v(u))^2*cos(v(u))^6*cos(u)^6+(1/3)*sin(v(u))^2*cos(v(u))^4*cos(u)^6-(1/3)*cos(v(u))^2*sin(v(u))^2*cos(u)^6+1/12)/(2*cos(u)^4*cos(v(u))^4-2*cos(u)^4*cos(v(u))^2+2*cos(u)^4-2*cos(u)^2+1)^2)^(1/2)

C is a geodesic if it satisfies the Euler-Lagrange differential equation

DE := VariationalCalculus:-EulerLagrange(T__len, u, v(u)):

BC := subs(p, d=v, d(u)=v), subs(q, d=v, d(u)=v);

v(arctan((1/2)*2^(1/2))) = (1/4)*Pi, v(-arctan((1/2)*2^(1/2))) = -(3/4)*Pi

Without help, dsolve fails:

dsol := dsolve({DE[], BC}, numeric, output=operator);

Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging

To get a solution, we specify a finer starting mesh.  This takes a few minutes, be patient:

st := time():
dsol := dsolve({DE[], BC}, numeric, output=operator, initmesh=256);
time() - st;

Warning, computation is being performed near the boundary of the current precision, suggest increasing Digits to approximately 16 or efficiency may be degraded

[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(256, {(1) = -.615479708670389, (2) = -.6138337655059911, (3) = -.6121877371363221, (4) = -.610541623152404, (5) = -.6088953251908921, (6) = -.6072487671472097, (7) = -.6056019471744036, (8) = -.6039547492398832, (9) = -.6023071028585135, (10) = -.600659003239894, (11) = -.5990103110283401, (12) = -.5973609594036162, (13) = -.5957109382804167, (14) = -.5940600787075152, (15) = -.592408316893275, (16) = -.5907556337655888, (17) = -.589101824521824, (18) = -.5874468288606902, (19) = -.585790613017156, (20) = -.5841329309576447, (21) = -.5824737271461466, (22) = -.5808129444592497, (23) = -.5791502923727325, (24) = -.5774857217781857, (25) = -.5758191392268837, (26) = -.5741502104173669, (27) = -.5724788940395652, (28) = -.5708050411421474, (29) = -.5691282811123882, (30) = -.5674485804227406, (31) = -.5657657065322664, (32) = -.5640792708720453, (33) = -.5623892445543703, (34) = -.5606952706775499, (35) = -.5589969780179599, (36) = -.5572943246689157, (37) = -.555586796800204, (38) = -.5538740753768657, (39) = -.5521560662027295, (40) = -.5504321023790923, (41) = -.5487019283191328, (42) = -.5469653407777109, (43) = -.5452215561139513, (44) = -.5434703809718867, (45) = -.5417114118674226, (46) = -.5399438369309824, (47) = -.5381675001638607, (48) = -.5363816612793244, (49) = -.5345856438064434, (50) = -.5327791976962112, (51) = -.5309612570931616, (52) = -.5291313415384594, (53) = -.5272888957313684, (54) = -.525432745213056, (55) = -.523562514992632, (56) = -.5216770864410629, (57) = -.5197755400848111, (58) = -.5178572425620112, (59) = -.515920711401875, (60) = -.5139652765527121, (61) = -.5119895907876776, (62) = -.5099924034933055, (63) = -.5079727160294226, (64) = -.5059287438667803, (65) = -.5038594483715606, (66) = -.5017629397592426, (67) = -.4996377699518008, (68) = -.49748213518145645, (69) = -.49529405774722146, (70) = -.49307171190353477, (71) = -.4908127037482733, (72) = -.48851496049995186, (73) = -.48617577893132347, (74) = -.4837926795108566, (75) = -.48136264479140517, (76) = -.4788826875598093, (77) = -.47634940862604525, (78) = -.4737592248726671, (79) = -.47110824288051906, (80) = -.46839220670201365, (81) = -.46560652263193936, (82) = -.4627462688840759, (83) = -.45980582730548547, (84) = -.4567795100866846, (85) = -.4536605585746382, (86) = -.45044190982538507, (87) = -.44711596396700165, (88) = -.4436737732409932, (89) = -.44010588450370247, (90) = -.43640194597493315, (91) = -.4325503265005061, (92) = -.4285378041296347, (93) = -.4243499633478024, (94) = -.41997068666716125, (95) = -.415381857195644, (96) = -.41056307352817695, (97) = -.4054913072194831, (98) = -.40014286075850014, (99) = -.3945291762613631, (100) = -.3887243469845279, (101) = -.38272333283023513, (102) = -.37651248996445524, (103) = -.3700765357249298, (104) = -.3633984542976641, (105) = -.35645951516908386, (106) = -.3492382879874373, (107) = -.3417110407352021, (108) = -.33385046669876445, (109) = -.32562584741600087, (110) = -.3170017781423065, (111) = -.3079373927769954, (112) = -.29838534976786646, (113) = -.28829018526282596, (114) = -.2775863529897709, (115) = -.26619576640273657, (116) = -.25402428090287404, (117) = -.24095674999268518, (118) = -.22685076083627745, (119) = -.21152693593807945, (120) = -.19475483127449672, (121) = -.17623202423500914, (122) = -.15554979660920581, (123) = -.13228994492398807, (124) = -.1082372279662562, (125) = -0.8418451100852434e-1, (126) = -0.6013179405079247e-1, (127) = -0.360790770930606e-1, (128) = -0.12026360135328736e-1, (129) = 0.1202635682240313e-1, (130) = 0.36079073780135e-1, (131) = 0.6013179073786687e-1, (132) = 0.8418450769559874e-1, (133) = .1082372246533306, (134) = .13228994161106247, (135) = .15554979358804727, (136) = .17623202154579037, (137) = .1947548288517443, (138) = .21152693373373746, (139) = .22685075881419176, (140) = .24095674812499612, (141) = .25402427916759346, (142) = .266195764782475, (143) = .2775863514700435, (144) = .2882901838320805, (145) = .298385348416205, (146) = .30793739149611127, (147) = .31700177692513, (148) = .32562584625647806, (149) = .3338504655917917, (150) = .3417110396761509, (151) = .34923828697230785, (152) = .3564595141944389, (153) = .3633984533603477, (154) = .37007653482219466, (155) = .37651248909388624, (156) = .3827233319895611, (157) = .3887243461717439, (158) = .39452917547476085, (159) = .4001428600026771, (160) = .40549130650739146, (161) = .410563072857691, (162) = .4153818565630173, (163) = .4199706860690814, (164) = .4243499627813222, (165) = .42853780359211907, (166) = .4325503259895911, (167) = .4364019454885977, (168) = .44010588404014256, (169) = .4436737727984631, (170) = .447115963543925, (171) = .45044190942046414, (172) = .453660558186639, (173) = .45677950971441716, (174) = .4598058269479823, (175) = .46274626854038836, (176) = .4656065223011885, (177) = .468392206383466, (178) = .47110824257342615, (179) = .4737592245763975, (180) = .4763494083399846, (181) = .4788826872834117, (182) = .48136264452415733, (183) = .4837926792522918, (184) = .48617577868100653, (185) = .4885149602574814, (186) = .49081270351328304, (187) = .49307171167567043, (188) = .4952940575261847, (189) = .4974821349669204, (190) = .4996377697435383, (191) = .5017629395569352, (192) = .5038594481750222, (193) = .5059287436757538, (194) = .5079727158437204, (195) = .5099924033127412, (196) = .5119895906120454, (197) = .5139652763818926, (198) = .5159207112356502, (199) = .517857242400274, (200) = .5197755399274191, (201) = .5216770862878711, (202) = .5235625148435622, (203) = .5254327450679438, (204) = .527288895590138, (205) = .529131341401021, (206) = .5309612569593932, (207) = .5327791975660613, (208) = .5345856436798079, (209) = .5363816611561303, (210) = .5381675000440663, (211) = .5399438368144777, (212) = .5417114117541697, (213) = .5434703808618371, (214) = .5452215560070248, (215) = .5469653406738793, (216) = .5487019282183432, (217) = .550432102281291, (218) = .5521560661078934, (219) = .5538740752849417, (220) = .5555867967111572, (221) = .5572943245827272, (222) = .5589969779345795, (223) = .5606952705969559, (224) = .5623892444765469, (225) = .5640792707969473, (226) = .5657657064598809, (227) = .567448580353051, (228) = .5691282810453618, (229) = .5708050410777735, (230) = .572478893977828, (231) = .5741502103582431, (232) = .5758191391703643, (233) = .5774857217242565, (234) = .5791502923213769, (235) = .5808129444104603, (236) = .5824737270999113, (237) = .5841329309139516, (238) = .5857906129759993, (239) = .5874468288220598, (240) = .5891018244857117, (241) = .5907556337319899, (242) = .592408316862182, (243) = .5940600786789219, (244) = .59571093825432, (245) = .597360959380009, (246) = .5990103110072196, (247) = .6006590032212563, (248) = .602307102842355, (249) = .6039547492262015, (250) = .605601947163196, (251) = .6072487671384748, (252) = .60889532518463, (253) = .6105416231486125, (254) = .6121877371346346, (255) = .6138337655055719, (256) = .615479708670389}, datatype = float[8], order = C_order); Y := Matrix(256, 2, {(1, 1) = -2.35619449019234, (1, 2) = 12.118672760959774, (2, 1) = -2.337290286256281, (2, 2) = 10.914658446600086, (3, 1) = -2.3201008276005637, (3, 2) = 10.010693556288953, (4, 1) = -2.3042274489049164, (4, 2) = 9.301772103437811, (5, 1) = -2.2894019626109485, (5, 2) = 8.727840811274362, (6, 1) = -2.2754345312302515, (6, 2) = 8.25177412070392, (7, 1) = -2.2621856009081305, (7, 2) = 7.849239603358558, (8, 1) = -2.2495479912910765, (8, 2) = 7.503505631367268, (9, 1) = -2.237438216937433, (9, 2) = 7.202667464492366, (10, 1) = -2.2257900845870067, (10, 2) = 6.9380000914469795, (11, 1) = -2.2145489434481087, (11, 2) = 6.702920347222946, (12, 1) = -2.2036701874921634, (12, 2) = 6.492381622935028, (13, 1) = -2.1931169326136617, (13, 2) = 6.302442718336018, (14, 1) = -2.182857087056544, (14, 2) = 6.1299557556249535, (15, 1) = -2.1728639002327887, (15, 2) = 5.972396952904152, (16, 1) = -2.163114638683964, (16, 2) = 5.827713143173982, (17, 1) = -2.1535885656610416, (17, 2) = 5.694198333816598, (18, 1) = -2.1442683694669147, (18, 2) = 5.570445902587254, (19, 1) = -2.135139003947531, (19, 2) = 5.455278113161753, (20, 1) = -2.1261860618884074, (20, 2) = 5.347686388424327, (21, 1) = -2.117397725718667, (21, 2) = 5.246825138078152, (22, 1) = -2.1087634545082783, (22, 2) = 5.151970330277958, (23, 1) = -2.1002726297503918, (23, 2) = 5.062486400497311, (24, 1) = -2.09191686701165, (24, 2) = 4.977836260324988, (25, 1) = -2.0836883833144606, (25, 2) = 4.89755068349214, (26, 1) = -2.0755789618481537, (26, 2) = 4.821209181407477, (27, 1) = -2.0675824841724295, (27, 2) = 4.748456236732863, (28, 1) = -2.0596928691103513, (28, 2) = 4.678974379599474, (29, 1) = -2.051903519080722, (29, 2) = 4.612474707184249, (30, 1) = -2.0442098747249235, (30, 2) = 4.548714275787255, (31, 1) = -2.0366068506718946, (31, 2) = 4.487469833466657, (32, 1) = -2.029089044589754, (32, 2) = 4.428537179987267, (33, 1) = -2.021652996969941, (33, 2) = 4.37174600352715, (34, 1) = -2.0142940866632357, (34, 2) = 4.316933039412177, (35, 1) = -2.0070079294921044, (35, 2) = 4.263951400135515, (36, 1) = -1.9997918012046616, (36, 2) = 4.212678754210403, (37, 1) = -1.9926411949448875, (37, 2) = 4.1629910012947215, (38, 1) = -1.9855526610971537, (38, 2) = 4.114781573443895, (39, 1) = -1.9785238619833743, (39, 2) = 4.067959975624121, (40, 1) = -1.9715502957463595, (40, 2) = 4.022428994561768, (41, 1) = -1.9646293254778062, (41, 2) = 3.9781108598165833, (42, 1) = -1.957758660364256, (42, 2) = 3.934935932616207, (43, 1) = -1.9509338703093544, (43, 2) = 3.8928267394753386, (44, 1) = -1.944153004798682, (44, 2) = 3.851726365609299, (45, 1) = -1.9374134094480575, (45, 2) = 3.8115778491539154, (46, 1) = -1.930711011983108, (46, 2) = 3.772320003327631, (47, 1) = -1.9240443660461672, (47, 2) = 3.7339108293070433, (48, 1) = -1.9174099329338168, (48, 2) = 3.6962994182504065, (49, 1) = -1.9108045560622748, (49, 2) = 3.659440318691635, (50, 1) = -1.9042267545887381, (50, 2) = 3.6233001437964765, (51, 1) = -1.8976721834422676, (51, 2) = 3.5878322615247313, (52, 1) = -1.8911387498163468, (52, 2) = 3.5530048270523595, (53, 1) = -1.8846241810749393, (53, 2) = 3.5187870099890954, (54, 1) = -1.8781241357772231, (54, 2) = 3.485139202181243, (55, 1) = -1.8716371986951243, (55, 2) = 3.452038938466664, (56, 1) = -1.865159466522433, (56, 2) = 3.4194526469660533, (57, 1) = -1.8586878578861092, (57, 2) = 3.387352720953515, (58, 1) = -1.852220367454726, (58, 2) = 3.355718347457449, (59, 1) = -1.8457522424271995, (59, 2) = 3.324516730438481, (60, 1) = -1.8392815825813371, (60, 2) = 3.29373037446758, (61, 1) = -1.8328043493386406, (61, 2) = 3.2633328038479608, (62, 1) = -1.8263169664273664, (62, 2) = 3.2333011360701454, (63, 1) = -1.8198167981272089, (63, 2) = 3.203618031881599, (64, 1) = -1.813298813394356, (64, 2) = 3.1742564189641698, (65, 1) = -1.806760514416245, (65, 2) = 3.14520192132763, (66, 1) = -1.8001968467477523, (66, 2) = 3.1164298804842017, (67, 1) = -1.7936043097811496, (67, 2) = 3.087923727510235, (68, 1) = -1.7869784494621208, (68, 2) = 3.059663858549224, (69, 1) = -1.7803144554167043, (69, 2) = 3.0316303722528506, (70, 1) = -1.773608159705147, (70, 2) = 3.003807252664023, (71, 1) = -1.7668538681850854, (71, 2) = 2.976173342920477, (72, 1) = -1.7600470567674849, (72, 2) = 2.9487135554766004, (73, 1) = -1.7531815429128443, (73, 2) = 2.9214073446110134, (74, 1) = -1.7462520392971868, (74, 2) = 2.894239096407252, (75, 1) = -1.739251935110602, (75, 2) = 2.867189346904102, (76, 1) = -1.7321749778761224, (76, 2) = 2.840241498377158, (77, 1) = -1.7250140205120181, (77, 2) = 2.813377042640132, (78, 1) = -1.71776170736756, (78, 2) = 2.786578322127765, (79, 1) = -1.710410145187836, (79, 2) = 2.7598273981420816, (80, 1) = -1.702950796897438, (80, 2) = 2.7331058270979764, (81, 1) = -1.6953745919813825, (81, 2) = 2.706395235922123, (82, 1) = -1.6876719923104895, (82, 2) = 2.679677712979381, (83, 1) = -1.6798320535801188, (83, 2) = 2.652932785787809, (84, 1) = -1.6718441587879003, (84, 2) = 2.6261436160121594, (85, 1) = -1.6636954194758775, (85, 2) = 2.59928845114405, (86, 1) = -1.6553727854910854, (86, 2) = 2.5723481008907183, (87, 1) = -1.6468624877620444, (87, 2) = 2.545304290612758, (88, 1) = -1.6381480621612516, (88, 2) = 2.5181338444174726, (89, 1) = -1.629212624315195, (89, 2) = 2.490816474920481, (90, 1) = -1.6200379626559427, (90, 2) = 2.4633323383202774, (91, 1) = -1.610603726190067, (91, 2) = 2.435660225598683, (92, 1) = -1.600886842296156, (92, 2) = 2.407776753470986, (93, 1) = -1.590862673461241, (93, 2) = 2.379660658525142, (94, 1) = -1.5805039774298852, (94, 2) = 2.3512907600058233, (95, 1) = -1.5697804425895585, (95, 2) = 2.3226459265785855, (96, 1) = -1.5586583014691535, (96, 2) = 2.293705534146932, (97, 1) = -1.5470998615698928, (97, 2) = 2.264450008190539, (98, 1) = -1.5350682338848733, (98, 2) = 2.2348743168779803, (99, 1) = -1.5226063468150763, (99, 2) = 2.2051737248528798, (100, 1) = -1.5098914960211454, (100, 2) = 2.17583738657371, (101, 1) = -1.4969217602954346, (101, 2) = 2.1469084566347605, (102, 1) = -1.483676933938617, (102, 2) = 2.1183928671531187, (103, 1) = -1.4701342356942662, (103, 2) = 2.090298680436436, (104, 1) = -1.456268237054072, (104, 2) = 2.062637371249721, (105, 1) = -1.4420510120219698, (105, 2) = 2.0354256916943894, (106, 1) = -1.4274502395871247, (106, 2) = 2.0086839641858134, (107, 1) = -1.4124301696269619, (107, 2) = 1.982440430772687, (108, 1) = -1.396949207859653, (108, 2) = 1.9567299468981632, (109, 1) = -1.3809604090221987, (109, 2) = 1.9315987904171668, (110, 1) = -1.3644091203399373, (110, 2) = 1.90710568533949, (111, 1) = -1.3472316418753183, (111, 2) = 1.8833262710134948, (112, 1) = -1.3293533968260578, (112, 2) = 1.8603588503339894, (113, 1) = -1.3106858612504209, (113, 2) = 1.8383314042303163, (114, 1) = -1.2911228307959204, (114, 2) = 1.817412138903023, (115, 1) = -1.2705355796858275, (115, 2) = 1.7978248787898543, (116, 1) = -1.248765731648311, (116, 2) = 1.7798711356935655, (117, 1) = -1.225614926126585, (117, 2) = 1.763963185281574, (118, 1) = -1.200830935267974, (118, 2) = 1.7506757021906965, (119, 1) = -1.1740854857729608, (119, 2) = 1.7408255448851555, (120, 1) = -1.1449402048254178, (120, 2) = 1.7356000930834823, (121, 1) = -1.112792654079651, (121, 2) = 1.736765562026282, (122, 1) = -1.076783198309804, (122, 2) = 1.7470005348334907, (123, 1) = -1.0359027942603893, (123, 2) = 1.7701883209179174, (124, 1) = -.9929061378220345, (124, 2) = 1.8071518462503395, (125, 1) = -.9488753802410032, (125, 2) = 1.8556720762877739, (126, 1) = -.9035856416474204, (126, 2) = 1.9105602217533053, (127, 1) = -.8569996596327668, (127, 2) = 1.9612047634124612, (128, 1) = -.8093960435992642, (128, 2) = 1.9925954032717297, (129, 1) = -.761400289896857, (129, 2) = 1.9925954056751198, (130, 1) = -.7137966737557435, (130, 2) = 1.9612047696396848, (131, 1) = -.6672106915684193, (131, 2) = 1.9105602294964226, (132, 1) = -.6219209527887216, (132, 2) = 1.855672083763541, (133, 1) = -.5778901950429396, (133, 2) = 1.8071518523502108, (134, 1) = -.5348935384786714, (134, 2) = 1.7701883252585813, (135, 1) = -.49401313383975687, (135, 2) = 1.747000537150921, (136, 1) = -.45800367746021514, (136, 2) = 1.7367655628415017, (137, 1) = -.4258561262471038, (137, 2) = 1.7356000928289879, (138, 1) = -.39671084493089215, (138, 2) = 1.7408255438725242, (139, 1) = -.3699653951377459, (139, 2) = 1.7506757006156077, (140, 1) = -.3451814040331261, (140, 2) = 1.7639631832878049, (141, 1) = -.32203059830507375, (141, 2) = 1.7798711333745194, (142, 1) = -.30026075009166514, (142, 2) = 1.7978248762196696, (143, 1) = -.2796734988303415, (143, 2) = 1.8174121361251319, (144, 1) = -.2601104682438874, (144, 2) = 1.8383314012826037, (145, 1) = -.24144293255250612, (145, 2) = 1.8603588472423433, (146, 1) = -.22356468740089847, (146, 2) = 1.8833262678026457, (147, 1) = -.20638720884511483, (147, 2) = 1.9071056820325802, (148, 1) = -.18983592008109626, (148, 2) = 1.9315987870236686, (149, 1) = -.17384712116975945, (149, 2) = 1.9567299434167018, (150, 1) = -.15836615933579365, (150, 2) = 1.9824404272037903, (151, 1) = -.14334608931514567, (151, 2) = 2.0086839605395936, (152, 1) = -.12874531682500312, (152, 2) = 2.0354256879874106, (153, 1) = -.11452809174235111, (153, 2) = 2.062637367479104, (154, 1) = -.10066209305576505, (154, 2) = 2.0902986765983758, (155, 1) = -0.8711939476860638e-1, (155, 2) = 2.118392863260354, (156, 1) = -0.7387456837236098e-1, (156, 2) = 2.1469084526936144, (157, 1) = -0.60904832610221504e-1, (157, 2) = 2.175837382566909, (158, 1) = -0.4818998178237595e-1, (158, 2) = 2.2051737207834075, (159, 1) = -0.3572809466713802e-1, (159, 2) = 2.2348743127922583, (160, 1) = -0.23696466905448903e-1, (160, 2) = 2.2644500041646727, (161, 1) = -0.12138026931617684e-1, (161, 2) = 2.2937055301846807, (162, 1) = -0.10158857427529687e-2, (162, 2) = 2.3226459226924674, (163, 1) = 0.9707649160640567e-2, (163, 2) = 2.3512907561955467, (164, 1) = 0.20066345250206022e-1, (164, 2) = 2.3796606547873345, (165, 1) = 0.30090514138934432e-1, (165, 2) = 2.4077767498016844, (166, 1) = 0.39807398082675735e-1, (166, 2) = 2.435660221997729, (167, 1) = 0.4924163459500751e-1, (167, 2) = 2.463332334780739, (168, 1) = 0.5841629629769051e-1, (168, 2) = 2.490816471448168, (169, 1) = 0.6735173418411464e-1, (169, 2) = 2.5181338409954215, (170, 1) = 0.7606615982248231e-1, (170, 2) = 2.5453042872557936, (171, 1) = 0.8457645758690016e-1, (171, 2) = 2.5723480975870063, (172, 1) = 0.9289909160487612e-1, (172, 2) = 2.5992884478819875, (173, 1) = .10104783094790701, (173, 2) = 2.6261436128033866, (174, 1) = .10903572576945493, (174, 2) = 2.652932782626758, (175, 1) = .11687566452741904, (175, 2) = 2.679677709854055, (176, 1) = .12457826422424711, (176, 2) = 2.7063952328267518, (177, 1) = .13215446916492207, (177, 2) = 2.7331058240418673, (178, 1) = .13961381747853283, (178, 2) = 2.7598273951286862, (179, 1) = .14696537968035128, (179, 2) = 2.786578319164531, (180, 1) = .15421769284577339, (180, 2) = 2.813377039715548, (181, 1) = .16137865022983547, (181, 2) = 2.840241495490389, (182, 1) = .1684556074833026, (182, 2) = 2.8671893440509666, (183, 1) = .17545571168801935, (183, 2) = 2.8942390936057563, (184, 1) = .18238521532102625, (184, 2) = 2.921407341841214, (185, 1) = .1892507291922418, (185, 2) = 2.948713552731732, (186, 1) = .1960575406257235, (186, 2) = 2.976173340196842, (187, 1) = .20281183216095594, (187, 2) = 3.003807249950244, (188, 1) = .20951812788710494, (188, 2) = 3.031630369558518, (189, 1) = .21618212194647154, (189, 2) = 3.0596638558915292, (190, 1) = .22280798227907891, (190, 2) = 3.087923724878711, (191, 1) = .22940051925857516, (191, 2) = 3.116429877855737, (192, 1) = .23596418693963114, (192, 2) = 3.1452019187126066, (193, 1) = .24250248592976217, (193, 2) = 3.174256416366404, (194, 1) = .24902047067429922, (194, 2) = 3.203618029300584, (195, 1) = .25552063898580135, (195, 2) = 3.233301133512497, (196, 1) = .26200802190802075, (196, 2) = 3.2633328013174117, (197, 1) = .2684852551614961, (197, 2) = 3.293730371934068, (198, 1) = .2749559150176309, (198, 2) = 3.324516727923597, (199, 1) = .2814240400552919, (199, 2) = 3.355718344955579, (200, 1) = .2878915304965398, (200, 2) = 3.3873527184670316, (201, 1) = .2943631391424539, (201, 2) = 3.419452644495199, (202, 1) = .3008408713246704, (202, 2) = 3.452038936023861, (203, 1) = .3073278084159586, (203, 2) = 3.4851391997638705, (204, 1) = .31382785372281113, (204, 2) = 3.518787007595249, (205, 1) = .3203424224732208, (205, 2) = 3.5530048246636516, (206, 1) = .32687585610786957, (206, 2) = 3.5878322591378202, (207, 1) = .3334304272630384, (207, 2) = 3.6233001413972294, (208, 1) = .34000822874505454, (208, 2) = 3.6594403163130003, (209, 1) = .346613605625009, (209, 2) = 3.6962994158992246, (210, 1) = .3532480387458031, (210, 2) = 3.733910826968825, (211, 1) = .35991468469094073, (211, 2) = 3.772320000996824, (212, 1) = .36661708216412175, (212, 2) = 3.8115778468489965, (213, 1) = .3733566775229776, (213, 2) = 3.851726363332059, (214, 1) = .38013754304180297, (214, 2) = 3.8928267372315797, (215, 1) = .3869623331049322, (215, 2) = 3.934935930441873, (216, 1) = .39383299822677503, (216, 2) = 3.978110857651852, (217, 1) = .4007539685035025, (217, 2) = 4.022428992375078, (218, 1) = .4077275347487492, (218, 2) = 4.0679599734355065, (219, 1) = .41475633387072003, (219, 2) = 4.114781571285711, (220, 1) = .42184486772664703, (220, 2) = 4.162990999115868, (221, 1) = .4289954739946092, (221, 2) = 4.21267875197291, (222, 1) = .43621160229018285, (222, 2) = 4.263951397940499, (223, 1) = .44349775946952946, (223, 2) = 4.316933037240854, (224, 1) = .4508566697847075, (224, 2) = 4.371746001472759, (225, 1) = .4582927174130059, (225, 2) = 4.428537177892839, (226, 1) = .46581052350376145, (226, 2) = 4.487469831432685, (227, 1) = .4734135475655795, (227, 2) = 4.548714273764117, (228, 1) = .48110719193019813, (228, 2) = 4.612474705197783, (229, 1) = .4888965419689955, (229, 2) = 4.678974377813236, (230, 1) = .4967861570404521, (230, 2) = 4.7484562348806385, (231, 1) = .5047826347254658, (231, 2) = 4.8212091794085215, (232, 1) = .5128920562010075, (232, 2) = 4.897550681391886, (233, 1) = .5211205399075063, (233, 2) = 4.977836258214376, (234, 1) = .5294763026557, (234, 2) = 5.062486398380529, (235, 1) = .5379671274230966, (235, 2) = 5.151970328113153, (236, 1) = .54660139864321, (236, 2) = 5.246825135949528, (237, 1) = .5553897348228287, (237, 2) = 5.347686386243535, (238, 1) = .5643426768922236, (238, 2) = 5.45527811128566, (239, 1) = .5734720424222883, (239, 2) = 5.570445900590808, (240, 1) = .5827922386273318, (240, 2) = 5.694198331847795, (241, 1) = .5923183116613285, (241, 2) = 5.827713141100247, (242, 1) = .6020675732216765, (242, 2) = 5.97239695109456, (243, 1) = .612060760057737, (243, 2) = 6.129955753954183, (244, 1) = .622320605627775, (244, 2) = 6.302442716859202, (245, 1) = .6328738605195571, (245, 2) = 6.492381621232821, (246, 1) = .6437526164891595, (246, 2) = 6.702920345468326, (247, 1) = .654993757641648, (247, 2) = 6.938000089073476, (248, 1) = .6666418900060076, (248, 2) = 7.20266746245575, (249, 1) = .678751664374535, (249, 2) = 7.503505629494219, (250, 1) = .6913892740071063, (250, 2) = 7.849239600963847, (251, 1) = .7046382043460715, (251, 2) = 8.251774119315153, (252, 1) = .7186056357462011, (252, 2) = 8.727840810952246, (253, 1) = .7334311220622616, (253, 2) = 9.30177210389072, (254, 1) = .74930450078053, (254, 2) = 10.010693558249125, (255, 1) = .766493959452669, (255, 2) = 10.914658448521092, (256, 1) = .785398163397448, (256, 2) = 12.118672763119722}, datatype = float[8], order = C_order); YP := Matrix(256, 2, {(1, 1) = 12.118672760959774, (1, 2) = -856.132513417093, (2, 1) = 10.914658446600086, (2, 2) = -626.3138713842598, (3, 1) = 10.010693556288953, (3, 2) = -482.2028779602816, (4, 1) = 9.301772103437811, (4, 2) = -385.0044436179127, (5, 1) = 8.727840811274362, (5, 2) = -315.9004029643987, (6, 1) = 8.25177412070392, (6, 2) = -264.77471365782577, (7, 1) = 7.849239603358558, (7, 2) = -225.75521795738067, (8, 1) = 7.503505631367268, (8, 2) = -195.22011305001453, (9, 1) = 7.202667464492366, (9, 2) = -170.82915163273915, (10, 1) = 6.9380000914469795, (10, 2) = -151.0099936160739, (11, 1) = 6.702920347222946, (11, 2) = -134.66931195330426, (12, 1) = 6.492381622935028, (12, 2) = -121.02750817954177, (13, 1) = 6.302442718336018, (13, 2) = -109.51513905854112, (14, 1) = 6.1299557556249535, (14, 2) = -99.70639359539115, (15, 1) = 5.972396952904152, (15, 2) = -91.27855128798726, (16, 1) = 5.827713143173982, (16, 2) = -83.98275540857765, (17, 1) = 5.694198333816598, (17, 2) = -77.62352977596856, (18, 1) = 5.570445902587254, (18, 2) = -72.04656753943121, (19, 1) = 5.455278113161753, (19, 2) = -67.12825374413103, (20, 1) = 5.347686388424327, (20, 2) = -62.76794531415879, (21, 1) = 5.246825138078152, (21, 2) = -58.88393128604594, (22, 1) = 5.151970330277958, (22, 2) = -55.40885507068803, (23, 1) = 5.062486400497311, (23, 2) = -52.28635706995813, (24, 1) = 4.977836260324988, (24, 2) = -49.46978264124701, (25, 1) = 4.89755068349214, (25, 2) = -46.919784022075945, (26, 1) = 4.821209181407477, (26, 2) = -44.60273229586116, (27, 1) = 4.748456236732863, (27, 2) = -42.49042331959783, (28, 1) = 4.678974379599474, (28, 2) = -40.55859334357499, (29, 1) = 4.612474707184249, (29, 2) = -38.78617511212157, (30, 1) = 4.548714275787255, (30, 2) = -37.15534890860894, (31, 1) = 4.487469833466657, (31, 2) = -35.650486075426734, (32, 1) = 4.428537179987267, (32, 2) = -34.257886856585785, (33, 1) = 4.37174600352715, (33, 2) = -32.96589412256592, (34, 1) = 4.316933039412177, (34, 2) = -31.764062891704498, (35, 1) = 4.263951400135515, (35, 2) = -30.643234855887133, (36, 1) = 4.212678754210403, (36, 2) = -29.59556089722199, (37, 1) = 4.1629910012947215, (37, 2) = -28.613836903718852, (38, 1) = 4.114781573443895, (38, 2) = -27.691814535224786, (39, 1) = 4.067959975624121, (39, 2) = -26.824068766107406, (40, 1) = 4.022428994561768, (40, 2) = -26.00550522795828, (41, 1) = 3.9781108598165833, (41, 2) = -25.231789519785515, (42, 1) = 3.934935932616207, (42, 2) = -24.49907419157066, (43, 1) = 3.8928267394753386, (43, 2) = -23.80369093520492, (44, 1) = 3.851726365609299, (44, 2) = -23.142591975070513, (45, 1) = 3.8115778491539154, (45, 2) = -22.512964635975212, (46, 1) = 3.772320003327631, (46, 2) = -21.912148754190753, (47, 1) = 3.7339108293070433, (47, 2) = -21.337971601154468, (48, 1) = 3.6962994182504065, (48, 2) = -20.788292666653856, (49, 1) = 3.659440318691635, (49, 2) = -20.261207504959344, (50, 1) = 3.6233001437964765, (50, 2) = -19.755117660693415, (51, 1) = 3.5878322615247313, (51, 2) = -19.268358478843336, (52, 1) = 3.5530048270523595, (52, 2) = -18.79958066865422, (53, 1) = 3.5187870099890954, (53, 2) = -18.347541660541417, (54, 1) = 3.485139202181243, (54, 2) = -17.91097087199947, (55, 1) = 3.452038938466664, (55, 2) = -17.488900002083938, (56, 1) = 3.4194526469660533, (56, 2) = -17.08028657274201, (57, 1) = 3.387352720953515, (57, 2) = -16.68422876830327, (58, 1) = 3.355718347457449, (58, 2) = -16.299964121863187, (59, 1) = 3.324516730438481, (59, 2) = -15.92663575675902, (60, 1) = 3.29373037446758, (60, 2) = -15.563618180234197, (61, 1) = 3.2633328038479608, (61, 2) = -15.210220163284507, (62, 1) = 3.2333011360701454, (62, 2) = -14.865831987545663, (63, 1) = 3.203618031881599, (63, 2) = -14.529941407415382, (64, 1) = 3.1742564189641698, (64, 2) = -14.201957354118989, (65, 1) = 3.14520192132763, (65, 2) = -13.881460244621785, (66, 1) = 3.1164298804842017, (66, 2) = -13.567942167450001, (67, 1) = 3.087923727510235, (67, 2) = -13.26100834577326, (68, 1) = 3.059663858549224, (68, 2) = -12.960252417563783, (69, 1) = 3.0316303722528506, (69, 2) = -12.665285347917038, (70, 1) = 3.003807252664023, (70, 2) = -12.375777363409917, (71, 1) = 2.976173342920477, (71, 2) = -12.091361988533292, (72, 1) = 2.9487135554766004, (72, 2) = -11.811751212695286, (73, 1) = 2.9214073446110134, (73, 2) = -11.536615533261044, (74, 1) = 2.894239096407252, (74, 2) = -11.265688881896164, (75, 1) = 2.867189346904102, (75, 2) = -10.998678892210954, (76, 1) = 2.840241498377158, (76, 2) = -10.735333260527634, (77, 1) = 2.813377042640132, (77, 2) = -10.475391531295369, (78, 1) = 2.786578322127765, (78, 2) = -10.21861157410054, (79, 1) = 2.7598273981420816, (79, 2) = -9.964757766355802, (80, 1) = 2.7331058270979764, (80, 2) = -9.71359833404566, (81, 1) = 2.706395235922123, (81, 2) = -9.46491022905575, (82, 1) = 2.679677712979381, (82, 2) = -9.218482012351554, (83, 1) = 2.652932785787809, (83, 2) = -8.974085491703697, (84, 1) = 2.6261436160121594, (84, 2) = -8.731531933299696, (85, 1) = 2.59928845114405, (85, 2) = -8.490593473083779, (86, 1) = 2.5723481008907183, (86, 2) = -8.251070500116482, (87, 1) = 2.545304290612758, (87, 2) = -8.01277529384119, (88, 1) = 2.5181338444174726, (88, 2) = -7.775480109929202, (89, 1) = 2.490816474920481, (89, 2) = -7.538985060999222, (90, 1) = 2.4633323383202774, (90, 2) = -7.3030947650199955, (91, 1) = 2.435660225598683, (91, 2) = -7.067601252786613, (92, 1) = 2.407776753470986, (92, 2) = -6.8322757042522, (93, 1) = 2.379660658525142, (93, 2) = -6.59690256295987, (94, 1) = 2.3512907600058233, (94, 2) = -6.361258919987786, (95, 1) = 2.3226459265785855, (95, 2) = -6.1251103875231045, (96, 1) = 2.293705534146932, (96, 2) = -5.888209919491713, (97, 1) = 2.264450008190539, (97, 2) = -5.650295723583867, (98, 1) = 2.2348743168779803, (98, 2) = -5.4111914923081486, (99, 1) = 2.2051737248528798, (99, 2) = -5.172283622209372, (100, 1) = 2.17583738657371, (100, 2) = -4.937229804922309, (101, 1) = 2.1469084566347605, (101, 2) = -4.706035244109046, (102, 1) = 2.1183928671531187, (102, 2) = -4.478368789065424, (103, 1) = 2.090298680436436, (103, 2) = -4.253871611283983, (104, 1) = 2.062637371249721, (104, 2) = -4.032156660587268, (105, 1) = 2.0354256916943894, (105, 2) = -3.812810103274999, (106, 1) = 2.0086839641858134, (106, 2) = -3.5953604296843666, (107, 1) = 1.982440430772687, (107, 2) = -3.379291498088012, (108, 1) = 1.9567299468981632, (108, 2) = -3.1640031846243275, (109, 1) = 1.9315987904171668, (109, 2) = -2.9488131217385263, (110, 1) = 1.90710568533949, (110, 2) = -2.7329148766231843, (111, 1) = 1.8833262710134948, (111, 2) = -2.5153470973244274, (112, 1) = 1.8603588503339894, (112, 2) = -2.294949295598474, (113, 1) = 1.8383314042303163, (113, 2) = -2.0702924424068185, (114, 1) = 1.817412138903023, (114, 2) = -1.839587569353909, (115, 1) = 1.7978248787898543, (115, 2) = -1.600559568556263, (116, 1) = 1.7798711356935655, (116, 2) = -1.3502622211166015, (117, 1) = 1.763963185281574, (117, 2) = -1.0848103200422101, (118, 1) = 1.7506757021906965, (118, 2) = -.7990090369887971, (119, 1) = 1.7408255448851555, (119, 2) = -.4858210215775711, (120, 1) = 1.7356000930834823, (120, 2) = -.13568662798623501, (121, 1) = 1.736765562026282, (121, 2) = .2640804192804802, (122, 1) = 1.7470005348334907, (122, 2) = .7287233244901601, (123, 1) = 1.7701883209179174, (123, 2) = 1.2658292846577381, (124, 1) = 1.8071518462503395, (124, 2) = 1.7976303999609573, (125, 1) = 1.8556720762877739, (125, 2) = 2.2025007475300433, (126, 1) = 1.9105602217533053, (126, 2) = 2.2877562885792377, (127, 1) = 1.9612047634124612, (127, 2) = 1.8139958305815644, (128, 1) = 1.9925954032717297, (128, 2) = .7040111232714268, (129, 1) = 1.9925954056751198, (129, 2) = -.7040109350346981, (130, 1) = 1.9612047696396848, (130, 2) = -1.8139957173365475, (131, 1) = 1.9105602294964226, (131, 2) = -2.287756267663205, (132, 1) = 1.855672083763541, (132, 2) = -2.202500787900515, (133, 1) = 1.8071518523502108, (133, 2) = -1.7976304689619398, (134, 1) = 1.7701883252585813, (134, 2) = -1.2658293621623369, (135, 1) = 1.747000537150921, (135, 2) = -.7287233944999718, (136, 1) = 1.7367655628415017, (136, 2) = -.2640804788589072, (137, 1) = 1.7356000928289879, (137, 2) = .1356865758105073, (138, 1) = 1.7408255438725242, (138, 2) = .4858209759016318, (139, 1) = 1.7506757006156077, (139, 2) = .7990089952580139, (140, 1) = 1.7639631832878049, (140, 2) = 1.0848102821050365, (141, 1) = 1.7798711333745194, (141, 2) = 1.3502621854582824, (142, 1) = 1.7978248762196696, (142, 2) = 1.600559534758377, (143, 1) = 1.8174121361251319, (143, 2) = 1.8395875364259227, (144, 1) = 1.8383314012826037, (144, 2) = 2.0702924110591288, (145, 1) = 1.8603588472423433, (145, 2) = 2.294949264717166, (146, 1) = 1.8833262678026457, (146, 2) = 2.5153470671458207, (147, 1) = 1.9071056820325802, (147, 2) = 2.7329148466370925, (148, 1) = 1.9315987870236686, (148, 2) = 2.9488130917425766, (149, 1) = 1.9567299434167018, (149, 2) = 3.1640031545087486, (150, 1) = 1.9824404272037903, (150, 2) = 3.379291468729201, (151, 1) = 2.0086839605395936, (151, 2) = 3.5953603993348553, (152, 1) = 2.0354256879874106, (152, 2) = 3.812810073365731, (153, 1) = 2.062637367479104, (153, 2) = 4.0321566299589335, (154, 1) = 2.0902986765983758, (154, 2) = 4.253871580256697, (155, 1) = 2.118392863260354, (155, 2) = 4.478368757613599, (156, 1) = 2.1469084526936144, (156, 2) = 4.70603521310951, (157, 1) = 2.175837382566909, (157, 2) = 4.937229772383448, (158, 1) = 2.2051737207834075, (158, 2) = 5.172283590860779, (159, 1) = 2.2348743127922583, (159, 2) = 5.411191458744634, (160, 1) = 2.2644500041646727, (160, 2) = 5.650295690104134, (161, 1) = 2.2937055301846807, (161, 2) = 5.888209887887755, (162, 1) = 2.3226459226924674, (162, 2) = 6.1251103564798495, (163, 1) = 2.3512907561955467, (163, 2) = 6.361258888522481, (164, 1) = 2.3796606547873345, (164, 2) = 6.596902532692219, (165, 1) = 2.4077767498016844, (165, 2) = 6.832275673521365, (166, 1) = 2.435660221997729, (166, 2) = 7.067601221584761, (167, 1) = 2.463332334780739, (167, 2) = 7.303094734533151, (168, 1) = 2.490816471448168, (168, 2) = 7.53898503119106, (169, 1) = 2.5181338409954215, (169, 2) = 7.775480080904302, (170, 1) = 2.5453042872557936, (170, 2) = 8.012775265754804, (171, 1) = 2.5723480975870063, (171, 2) = 8.251070472146123, (172, 1) = 2.5992884478819875, (172, 2) = 8.490593445402647, (173, 1) = 2.6261436128033866, (173, 2) = 8.731531903994723, (174, 1) = 2.652932782626758, (174, 2) = 8.97408546295497, (175, 1) = 2.679677709854055, (175, 2) = 9.218481985306092, (176, 1) = 2.7063952328267518, (176, 2) = 9.464910199685786, (177, 1) = 2.7331058240418673, (177, 2) = 9.713598308240536, (178, 1) = 2.7598273951286862, (178, 2) = 9.964757740576728, (179, 1) = 2.786578319164531, (179, 2) = 10.218611547251097, (180, 1) = 2.813377039715548, (180, 2) = 10.475391505047558, (181, 1) = 2.840241495490389, (181, 2) = 10.735333231766598, (182, 1) = 2.8671893440509666, (182, 2) = 10.99867886771885, (183, 1) = 2.8942390936057563, (183, 2) = 11.26568885657173, (184, 1) = 2.921407341841214, (184, 2) = 11.536615508966532, (185, 1) = 2.948713552731732, (185, 2) = 11.811751185006424, (186, 1) = 2.976173340196842, (186, 2) = 12.091361959778359, (187, 1) = 3.003807249950244, (187, 2) = 12.375777335510161, (188, 1) = 3.031630369558518, (188, 2) = 12.665285319531382, (189, 1) = 3.0596638558915292, (189, 2) = 12.960252390051474, (190, 1) = 3.087923724878711, (190, 2) = 13.261008317004979, (191, 1) = 3.116429877855737, (191, 2) = 13.567942140361016, (192, 1) = 3.1452019187126066, (192, 2) = 13.88146022312268, (193, 1) = 3.174256416366404, (193, 2) = 14.201957328628339, (194, 1) = 3.203618029300584, (194, 2) = 14.529941381548007, (195, 1) = 3.233301133512497, (195, 2) = 14.865831959900095, (196, 1) = 3.2633328013174117, (196, 2) = 15.210220137300256, (197, 1) = 3.293730371934068, (197, 2) = 15.563618149340185, (198, 1) = 3.324516727923597, (198, 2) = 15.926635730295361, (199, 1) = 3.355718344955579, (199, 2) = 16.299964094964025, (200, 1) = 3.3873527184670316, (200, 2) = 16.684228740467564, (201, 1) = 3.419452644495199, (201, 2) = 17.080286540184286, (202, 1) = 3.452038936023861, (202, 2) = 17.48889997104073, (203, 1) = 3.4851391997638705, (203, 2) = 17.91097084002699, (204, 1) = 3.518787007595249, (204, 2) = 18.347541636478987, (205, 1) = 3.5530048246636516, (205, 2) = 18.799580647298527, (206, 1) = 3.5878322591378202, (206, 2) = 19.268358446676956, (207, 1) = 3.6233001413972294, (207, 2) = 19.755117615869175, (208, 1) = 3.6594403163130003, (208, 2) = 20.261207471088934, (209, 1) = 3.6962994158992246, (209, 2) = 20.788292629078093, (210, 1) = 3.733910826968825, (210, 2) = 21.337971563392305, (211, 1) = 3.772320000996824, (211, 2) = 21.912148706412534, (212, 1) = 3.8115778468489965, (212, 2) = 22.51296460441515, (213, 1) = 3.851726363332059, (213, 2) = 23.142591934457023, (214, 1) = 3.8928267372315797, (214, 2) = 23.803690911862482, (215, 1) = 3.934935930441873, (215, 2) = 24.499074151615474, (216, 1) = 3.978110857651852, (216, 2) = 25.231789480065938, (217, 1) = 4.022428992375078, (217, 2) = 26.005505178977995, (218, 1) = 4.0679599734355065, (218, 2) = 26.824068719118205, (219, 1) = 4.114781571285711, (219, 2) = 27.6918144881913, (220, 1) = 4.162990999115868, (220, 2) = 28.613836852058945, (221, 1) = 4.21267875197291, (221, 2) = 29.59556085655894, (222, 1) = 4.263951397940499, (222, 2) = 30.643234815437413, (223, 1) = 4.316933037240854, (223, 2) = 31.76406282895504, (224, 1) = 4.371746001472759, (224, 2) = 32.96589407146075, (225, 1) = 4.428537177892839, (225, 2) = 34.25788681492983, (226, 1) = 4.487469831432685, (226, 2) = 35.65048601879827, (227, 1) = 4.548714273764117, (227, 2) = 37.15534885284654, (228, 1) = 4.612474705197783, (228, 2) = 38.78617503669962, (229, 1) = 4.678974377813236, (229, 2) = 40.55859331572982, (230, 1) = 4.7484562348806385, (230, 2) = 42.49042323841533, (231, 1) = 4.8212091794085215, (231, 2) = 44.602732223421526, (232, 1) = 4.897550681391886, (232, 2) = 46.919783931576994, (233, 1) = 4.977836258214376, (233, 2) = 49.46978253948843, (234, 1) = 5.062486398380529, (234, 2) = 52.286357069382106, (235, 1) = 5.151970328113153, (235, 2) = 55.4088549802804, (236, 1) = 5.246825135949528, (236, 2) = 58.88393116379276, (237, 1) = 5.347686386243535, (237, 2) = 62.767945223547635, (238, 1) = 5.45527811128566, (238, 2) = 67.12825372875328, (239, 1) = 5.570445900590808, (239, 2) = 72.04656744895523, (240, 1) = 5.694198331847795, (240, 2) = 77.62352962526896, (241, 1) = 5.827713141100247, (241, 2) = 83.98275527140292, (242, 1) = 5.97239695109456, (242, 2) = 91.2785511743751, (243, 1) = 6.129955753954183, (243, 2) = 99.70639344239785, (244, 1) = 6.302442716859202, (244, 2) = 109.5151389785495, (245, 1) = 6.492381621232821, (245, 2) = 121.0275080010818, (246, 1) = 6.702920345468326, (246, 2) = 134.66931185772873, (247, 1) = 6.938000089073476, (247, 2) = 151.00999336614797, (248, 1) = 7.20266746245575, (248, 2) = 170.82915130447523, (249, 1) = 7.503505629494219, (249, 2) = 195.22011290049133, (250, 1) = 7.849239600963847, (250, 2) = 225.75521776054381, (251, 1) = 8.251774119315153, (251, 2) = 264.77471370518674, (252, 1) = 8.727840810952246, (252, 2) = 315.9004030601857, (253, 1) = 9.30177210389072, (253, 2) = 385.0044437469404, (254, 1) = 10.010693558249125, (254, 2) = 482.2028777737413, (255, 1) = 10.914658448521092, (255, 2) = 626.3138715247973, (256, 1) = 12.118672763119722, (256, 2) = 856.1325139105058}, 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(256, {(1) = -.615479708670389, (2) = -.6138337655059911, (3) = -.6121877371363221, (4) = -.610541623152404, (5) = -.6088953251908921, (6) = -.6072487671472097, (7) = -.6056019471744036, (8) = -.6039547492398832, (9) = -.6023071028585135, (10) = -.600659003239894, (11) = -.5990103110283401, (12) = -.5973609594036162, (13) = -.5957109382804167, (14) = -.5940600787075152, (15) = -.592408316893275, (16) = -.5907556337655888, (17) = -.589101824521824, (18) = -.5874468288606902, (19) = -.585790613017156, (20) = -.5841329309576447, (21) = -.5824737271461466, (22) = -.5808129444592497, (23) = -.5791502923727325, (24) = -.5774857217781857, (25) = -.5758191392268837, (26) = -.5741502104173669, (27) = -.5724788940395652, (28) = -.5708050411421474, (29) = -.5691282811123882, (30) = -.5674485804227406, (31) = -.5657657065322664, (32) = -.5640792708720453, (33) = -.5623892445543703, (34) = -.5606952706775499, (35) = -.5589969780179599, (36) = -.5572943246689157, (37) = -.555586796800204, (38) = -.5538740753768657, (39) = -.5521560662027295, (40) = -.5504321023790923, (41) = -.5487019283191328, (42) = -.5469653407777109, (43) = -.5452215561139513, (44) = -.5434703809718867, (45) = -.5417114118674226, (46) = -.5399438369309824, (47) = -.5381675001638607, (48) = -.5363816612793244, (49) = -.5345856438064434, (50) = -.5327791976962112, (51) = -.5309612570931616, (52) = -.5291313415384594, (53) = -.5272888957313684, (54) = -.525432745213056, (55) = -.523562514992632, (56) = -.5216770864410629, (57) = -.5197755400848111, (58) = -.5178572425620112, (59) = -.515920711401875, (60) = -.5139652765527121, (61) = -.5119895907876776, (62) = -.5099924034933055, (63) = -.5079727160294226, (64) = -.5059287438667803, (65) = -.5038594483715606, (66) = -.5017629397592426, (67) = -.4996377699518008, (68) = -.49748213518145645, (69) = -.49529405774722146, (70) = -.49307171190353477, (71) = -.4908127037482733, (72) = -.48851496049995186, (73) = -.48617577893132347, (74) = -.4837926795108566, (75) = -.48136264479140517, (76) = -.4788826875598093, (77) = -.47634940862604525, (78) = -.4737592248726671, (79) = -.47110824288051906, (80) = -.46839220670201365, (81) = -.46560652263193936, (82) = -.4627462688840759, (83) = -.45980582730548547, (84) = -.4567795100866846, (85) = -.4536605585746382, (86) = -.45044190982538507, (87) = -.44711596396700165, (88) = -.4436737732409932, (89) = -.44010588450370247, (90) = -.43640194597493315, (91) = -.4325503265005061, (92) = -.4285378041296347, (93) = -.4243499633478024, (94) = -.41997068666716125, (95) = -.415381857195644, (96) = -.41056307352817695, (97) = -.4054913072194831, (98) = -.40014286075850014, (99) = -.3945291762613631, (100) = -.3887243469845279, (101) = -.38272333283023513, (102) = -.37651248996445524, (103) = -.3700765357249298, (104) = -.3633984542976641, (105) = -.35645951516908386, (106) = -.3492382879874373, (107) = -.3417110407352021, (108) = -.33385046669876445, (109) = -.32562584741600087, (110) = -.3170017781423065, (111) = -.3079373927769954, (112) = -.29838534976786646, (113) = -.28829018526282596, (114) = -.2775863529897709, (115) = -.26619576640273657, (116) = -.25402428090287404, (117) = -.24095674999268518, (118) = -.22685076083627745, (119) = -.21152693593807945, (120) = -.19475483127449672, (121) = -.17623202423500914, (122) = -.15554979660920581, (123) = -.13228994492398807, (124) = -.1082372279662562, (125) = -0.8418451100852434e-1, (126) = -0.6013179405079247e-1, (127) = -0.360790770930606e-1, (128) = -0.12026360135328736e-1, (129) = 0.1202635682240313e-1, (130) = 0.36079073780135e-1, (131) = 0.6013179073786687e-1, (132) = 0.8418450769559874e-1, (133) = .1082372246533306, (134) = .13228994161106247, (135) = .15554979358804727, (136) = .17623202154579037, (137) = .1947548288517443, (138) = .21152693373373746, (139) = .22685075881419176, (140) = .24095674812499612, (141) = .25402427916759346, (142) = .266195764782475, (143) = .2775863514700435, (144) = .2882901838320805, (145) = .298385348416205, (146) = .30793739149611127, (147) = .31700177692513, (148) = .32562584625647806, (149) = .3338504655917917, (150) = .3417110396761509, (151) = .34923828697230785, (152) = .3564595141944389, (153) = .3633984533603477, (154) = .37007653482219466, (155) = .37651248909388624, (156) = .3827233319895611, (157) = .3887243461717439, (158) = .39452917547476085, (159) = .4001428600026771, (160) = .40549130650739146, (161) = .410563072857691, (162) = .4153818565630173, (163) = .4199706860690814, (164) = .4243499627813222, (165) = .42853780359211907, (166) = .4325503259895911, (167) = .4364019454885977, (168) = .44010588404014256, (169) = .4436737727984631, (170) = .447115963543925, (171) = .45044190942046414, (172) = .453660558186639, (173) = .45677950971441716, (174) = .4598058269479823, (175) = .46274626854038836, (176) = .4656065223011885, (177) = .468392206383466, (178) = .47110824257342615, (179) = .4737592245763975, (180) = .4763494083399846, (181) = .4788826872834117, (182) = .48136264452415733, (183) = .4837926792522918, (184) = .48617577868100653, (185) = .4885149602574814, (186) = .49081270351328304, (187) = .49307171167567043, (188) = .4952940575261847, (189) = .4974821349669204, (190) = .4996377697435383, (191) = .5017629395569352, (192) = .5038594481750222, (193) = .5059287436757538, (194) = .5079727158437204, (195) = .5099924033127412, (196) = .5119895906120454, (197) = .5139652763818926, (198) = .5159207112356502, (199) = .517857242400274, (200) = .5197755399274191, (201) = .5216770862878711, (202) = .5235625148435622, (203) = .5254327450679438, (204) = .527288895590138, (205) = .529131341401021, (206) = .5309612569593932, (207) = .5327791975660613, (208) = .5345856436798079, (209) = .5363816611561303, (210) = .5381675000440663, (211) = .5399438368144777, (212) = .5417114117541697, (213) = .5434703808618371, (214) = .5452215560070248, (215) = .5469653406738793, (216) = .5487019282183432, (217) = .550432102281291, (218) = .5521560661078934, (219) = .5538740752849417, (220) = .5555867967111572, (221) = .5572943245827272, (222) = .5589969779345795, (223) = .5606952705969559, (224) = .5623892444765469, (225) = .5640792707969473, (226) = .5657657064598809, (227) = .567448580353051, (228) = .5691282810453618, (229) = .5708050410777735, (230) = .572478893977828, (231) = .5741502103582431, (232) = .5758191391703643, (233) = .5774857217242565, (234) = .5791502923213769, (235) = .5808129444104603, (236) = .5824737270999113, (237) = .5841329309139516, (238) = .5857906129759993, (239) = .5874468288220598, (240) = .5891018244857117, (241) = .5907556337319899, (242) = .592408316862182, (243) = .5940600786789219, (244) = .59571093825432, (245) = .597360959380009, (246) = .5990103110072196, (247) = .6006590032212563, (248) = .602307102842355, (249) = .6039547492262015, (250) = .605601947163196, (251) = .6072487671384748, (252) = .60889532518463, (253) = .6105416231486125, (254) = .6121877371346346, (255) = .6138337655055719, (256) = .615479708670389}, datatype = float[8], order = C_order); Y := Matrix(256, 2, {(1, 1) = .0, (1, 2) = 0.8533209791759556e-8, (2, 1) = 0.2515757323757251e-10, (2, 2) = 0.4356551964865028e-8, (3, 1) = 0.34487300349660374e-10, (3, 2) = 0.525825041510047e-8, (4, 1) = 0.4265633390260554e-10, (4, 2) = 0.4300179557821988e-8, (5, 1) = 0.4988853704975202e-10, (5, 2) = 0.46849561392692534e-8, (6, 1) = 0.5728983001630832e-10, (6, 2) = 0.4143633727994945e-8, (7, 1) = 0.6307058723556879e-10, (7, 2) = 0.30236483071126253e-8, (8, 1) = 0.6790288105801636e-10, (8, 2) = 0.29093982078393968e-8, (9, 1) = 0.7243318083872604e-10, (9, 2) = 0.2700903327376346e-8, (10, 1) = 0.76580091870178e-10, (10, 2) = 0.2422176533714323e-8, (11, 1) = 0.8028890421734465e-10, (11, 2) = 0.2028541175103088e-8, (12, 1) = 0.8354468676961248e-10, (12, 2) = 0.1937217968543841e-8, (13, 1) = 0.8649880027565613e-10, (13, 2) = 0.19333251286020524e-8, (14, 1) = 0.8940574977937043e-10, (14, 2) = 0.15160168692251884e-8, (15, 1) = 0.9188996181735388e-10, (15, 2) = 0.14735088369968248e-8, (16, 1) = 0.94191117130654e-10, (16, 2) = 0.12464816363704922e-8, (17, 1) = 0.9608714028928409e-10, (17, 2) = 0.10701622963881223e-8, (18, 1) = 0.9778104342513735e-10, (18, 2) = 0.10355020831958881e-8, (19, 1) = 0.995312239784579e-10, (19, 2) = 0.11078766659246384e-8, (20, 1) = 0.1013453521158331e-9, (20, 2) = 0.1083658467695548e-8, (21, 1) = 0.10309953045416797e-9, (21, 2) = 0.10535526325129998e-8, (22, 1) = 0.10479713163700592e-9, (22, 2) = 0.992013466494286e-9, (23, 1) = 0.10634813939614454e-9, (23, 2) = 0.8776230623788009e-9, (24, 1) = 0.10780270752166236e-9, (24, 2) = 0.8550369122887483e-9, (25, 1) = 0.10920504567861329e-9, (25, 2) = 0.8325755861906453e-9, (26, 1) = 0.11057896533563346e-9, (26, 2) = 0.8048675790133986e-9, (27, 1) = 0.11186527637729964e-9, (27, 2) = 0.7311835551613507e-9, (28, 1) = 0.11306972696613881e-9, (28, 2) = 0.7174220162605665e-9, (29, 1) = 0.114241975814458e-9, (29, 2) = 0.6954835347434e-9, (30, 1) = 0.11538830493187237e-9, (30, 2) = 0.6610366432857858e-9, (31, 1) = 0.11647099035164286e-9, (31, 2) = 0.6279944335675904e-9, (32, 1) = 0.1175132136689262e-9, (32, 2) = 0.6017917330130252e-9, (33, 1) = 0.1185154233592643e-9, (33, 2) = 0.5843873150224554e-9, (34, 1) = 0.1194866873619044e-9, (34, 2) = 0.5666029624070781e-9, (35, 1) = 0.12042797575658022e-9, (35, 2) = 0.5427394686070348e-9, (36, 1) = 0.1213517772657336e-9, (36, 2) = 0.533817435701165e-9, (37, 1) = 0.1222434720949681e-9, (37, 2) = 0.5092851838180783e-9, (38, 1) = 0.12310746546416638e-9, (38, 2) = 0.4978478528210585e-9, (39, 1) = 0.12395036604488718e-9, (39, 2) = 0.4867831881419308e-9, (40, 1) = 0.12477556518360088e-9, (40, 2) = 0.4697596147168694e-9, (41, 1) = 0.12557596890396535e-9, (41, 2) = 0.4560973949558534e-9, (42, 1) = 0.12635223166548033e-9, (42, 2) = 0.4384167451074847e-9, (43, 1) = 0.12711048298775955e-9, (43, 2) = 0.42889083667410355e-9, (44, 1) = 0.12784357476013238e-9, (44, 2) = 0.4119707573609822e-9, (45, 1) = 0.1285622377721097e-9, (45, 2) = 0.40264378399466534e-9, (46, 1) = 0.1292654468525978e-9, (46, 2) = 0.3937181789726958e-9, (47, 1) = 0.12995190868382547e-9, (47, 2) = 0.37918695824490137e-9, (48, 1) = 0.13062141755191356e-9, (48, 2) = 0.36999453909164137e-9, (49, 1) = 0.1312745259721413e-9, (49, 2) = 0.35771019643951154e-9, (50, 1) = 0.13190807791967123e-9, (50, 2) = 0.3443269891615897e-9, (51, 1) = 0.13252185128472693e-9, (51, 2) = 0.33176557536651465e-9, (52, 1) = 0.1331180960014748e-9, (52, 2) = 0.3212118788057865e-9, (53, 1) = 0.13370236815669886e-9, (53, 2) = 0.3111193758209748e-9, (54, 1) = 0.13427204157307295e-9, (54, 2) = 0.30277681741409533e-9, (55, 1) = 0.13482653489180127e-9, (55, 2) = 0.2922613770147601e-9, (56, 1) = 0.13536766963057763e-9, (56, 2) = 0.28198904643355514e-9, (57, 1) = 0.1358964506924581e-9, (57, 2) = 0.27386238593340363e-9, (58, 1) = 0.1364134547181195e-9, (58, 2) = 0.2651859801404068e-9, (59, 1) = 0.13691614481077628e-9, (59, 2) = 0.25510936018178266e-9, (60, 1) = 0.13740755121065104e-9, (60, 2) = 0.24591100303415436e-9, (61, 1) = 0.13788371502415191e-9, (61, 2) = 0.23685557662997546e-9, (62, 1) = 0.13834613546571035e-9, (62, 2) = 0.22758093709326893e-9, (63, 1) = 0.13879784522669758e-9, (63, 2) = 0.21877381995516132e-9, (64, 1) = 0.13923830785402788e-9, (64, 2) = 0.21128479486672138e-9, (65, 1) = 0.13966809857585072e-9, (65, 2) = 0.20471201164945568e-9, (66, 1) = 0.14008937522193296e-9, (66, 2) = 0.19783055046383375e-9, (67, 1) = 0.1405016184519593e-9, (67, 2) = 0.19071812054967575e-9, (68, 1) = 0.1409071100587197e-9, (68, 2) = 0.1842265135512411e-9, (69, 1) = 0.1413022639152057e-9, (69, 2) = 0.17789960734136491e-9, (70, 1) = 0.1416899226561393e-9, (70, 2) = 0.17144994213865875e-9, (71, 1) = 0.1420699405013175e-9, (71, 2) = 0.164915689054326e-9, (72, 1) = 0.14243926274373202e-9, (72, 2) = 0.15866152671510735e-9, (73, 1) = 0.14280639976899333e-9, (73, 2) = 0.15293914367398265e-9, (74, 1) = 0.14316234571407876e-9, (74, 2) = 0.14685924245240502e-9, (75, 1) = 0.14351203546155605e-9, (75, 2) = 0.1412064630772625e-9, (76, 1) = 0.1438541126905857e-9, (76, 2) = 0.13575632008985076e-9, (77, 1) = 0.14419172348317513e-9, (77, 2) = 0.13012146020690178e-9, (78, 1) = 0.14452217768309184e-9, (78, 2) = 0.12514475784613361e-9, (79, 1) = 0.14484753401719306e-9, (79, 2) = 0.12009099118924156e-9, (80, 1) = 0.14516719020474276e-9, (80, 2) = 0.11572049149876656e-9, (81, 1) = 0.1454837130366016e-9, (81, 2) = 0.11108637455442516e-9, (82, 1) = 0.14579553072933421e-9, (82, 2) = 0.10673352377294384e-9, (83, 1) = 0.1461006569840346e-9, (83, 2) = 0.10253354850619121e-9, (84, 1) = 0.14640548028592156e-9, (84, 2) = 0.9867791693628079e-10, (85, 1) = 0.14670626925167535e-9, (85, 2) = 0.9480687017503295e-10, (86, 1) = 0.14700583774830916e-9, (86, 2) = 0.9116116554923188e-10, (87, 1) = 0.1473049909397681e-9, (87, 2) = 0.877869966247201e-10, (88, 1) = 0.14760041098065547e-9, (88, 2) = 0.8464332937873904e-10, (89, 1) = 0.14789678566760437e-9, (89, 2) = 0.8140568540627396e-10, (90, 1) = 0.14819354000131068e-9, (90, 2) = 0.785731969475988e-10, (91, 1) = 0.14848991857465053e-9, (91, 2) = 0.757538450054471e-10, (92, 1) = 0.14878614045810977e-9, (92, 2) = 0.728059451158104e-10, (93, 1) = 0.14908555521160818e-9, (93, 2) = 0.7019108639773054e-10, (94, 1) = 0.14938803263731448e-9, (94, 2) = 0.6785871182608248e-10, (95, 1) = 0.14969571742819318e-9, (95, 2) = 0.6570314850552941e-10, (96, 1) = 0.15000665939816954e-9, (96, 2) = 0.6352981747903578e-10, (97, 1) = 0.1503233008628134e-9, (97, 2) = 0.6158620340441397e-10, (98, 1) = 0.1506454071567134e-9, (98, 2) = 0.600381866160094e-10, (99, 1) = 0.15098072954172405e-9, (99, 2) = 0.5876284495690779e-10, (100, 1) = 0.15131649362842804e-9, (100, 2) = 0.5785943062479622e-10, (101, 1) = 0.15166192024147255e-9, (101, 2) = 0.56983333902370786e-10, (102, 1) = 0.15201436806502833e-9, (102, 2) = 0.5663095967493995e-10, (103, 1) = 0.15237897517143947e-9, (103, 2) = 0.5675181383907271e-10, (104, 1) = 0.1527591712687427e-9, (104, 2) = 0.571542042713807e-10, (105, 1) = 0.153157231138773e-9, (105, 2) = 0.5779159951216207e-10, (106, 1) = 0.1535781995858007e-9, (106, 2) = 0.586881870917977e-10, (107, 1) = 0.15402308422391518e-9, (107, 2) = 0.6008035467798718e-10, (108, 1) = 0.1545014981960464e-9, (108, 2) = 0.6190903717956632e-10, (109, 1) = 0.1550226837737758e-9, (109, 2) = 0.6476364397730228e-10, (110, 1) = 0.15559148248518069e-9, (110, 2) = 0.6792728304923652e-10, (111, 1) = 0.15622732478860817e-9, (111, 2) = 0.7194894745539503e-10, (112, 1) = 0.15693747841982744e-9, (112, 2) = 0.7716184891982996e-10, (113, 1) = 0.15774343430632953e-9, (113, 2) = 0.8252894580087552e-10, (114, 1) = 0.1586626817554741e-9, (114, 2) = 0.8929058072254165e-10, (115, 1) = 0.1597251472433548e-9, (115, 2) = 0.975779133032407e-10, (116, 1) = 0.16096810637633238e-9, (116, 2) = 0.10713680678622781e-9, (117, 1) = 0.1624429732592064e-9, (117, 2) = 0.11829097937170303e-9, (118, 1) = 0.16421336863872674e-9, (118, 2) = 0.13343486818052482e-9, (119, 1) = 0.16640896558606782e-9, (119, 2) = 0.15438857743483395e-9, (120, 1) = 0.16920151692285782e-9, (120, 2) = 0.1799616287504575e-9, (121, 1) = 0.17287160288238618e-9, (121, 2) = 0.21739907195856502e-9, (122, 1) = 0.17778606270230984e-9, (122, 2) = 0.25840880287087396e-9, (123, 1) = 0.18447361064235885e-9, (123, 2) = 0.3154496892435486e-9, (124, 1) = 0.1928360460924727e-9, (124, 2) = 0.3678535668156288e-9, (125, 1) = 0.20275029947602662e-9, (125, 2) = 0.41267939176723456e-9, (126, 1) = 0.21259514620726693e-9, (126, 2) = 0.4514839327908819e-9, (127, 1) = 0.22206027873003437e-9, (127, 2) = 0.4652297617979372e-9, (128, 1) = 0.23103712682809456e-9, (128, 2) = 0.31458807900491405e-9, (129, 1) = 0.2413306468022318e-9, (129, 2) = 0.6146587943674196e-10, (130, 1) = 0.2374287319323687e-9, (130, 2) = -0.30248189102626667e-9, (131, 1) = 0.2281609004219964e-9, (131, 2) = -0.30838216198109124e-9, (132, 1) = 0.2187852801390259e-9, (132, 2) = -0.402643686064273e-9, (133, 1) = 0.20975781391329893e-9, (133, 2) = -0.3424746729205818e-9, (134, 1) = 0.20193562825995716e-9, (134, 2) = -0.34302491728505056e-9, (135, 1) = 0.19511756259532778e-9, (135, 2) = -0.2600189428793413e-9, (136, 1) = 0.18997659135865887e-9, (136, 2) = -0.2381569246329007e-9, (137, 1) = 0.18583894665214568e-9, (137, 2) = -0.18442974701411756e-9, (138, 1) = 0.18305922391915463e-9, (138, 2) = -0.14557853726221435e-9, (139, 1) = 0.18128284098517307e-9, (139, 2) = -0.8475523914546887e-10, (140, 1) = 0.18024608090837897e-9, (140, 2) = -0.6195245125227817e-10, (141, 1) = 0.17960816573837288e-9, (141, 2) = -0.32183825802087174e-10, (142, 1) = 0.17928086801377931e-9, (142, 2) = -0.3483505765024703e-10, (143, 1) = 0.17885351981472387e-9, (143, 2) = -0.34642142700136435e-10, (144, 1) = 0.1785542767244914e-9, (144, 2) = -0.21247896908335142e-10, (145, 1) = 0.17835793799213866e-9, (145, 2) = -0.11726685256897583e-10, (146, 1) = 0.1782680090867723e-9, (146, 2) = -0.11846396144205788e-10, (147, 1) = 0.17809907125905989e-9, (147, 2) = -0.30113614350165256e-10, (148, 1) = 0.17775054007955077e-9, (148, 2) = -0.4448148153058412e-10, (149, 1) = 0.17745595476712513e-9, (149, 2) = -0.268232131621915e-10, (150, 1) = 0.17738478724675014e-9, (150, 2) = 0.5478830046701785e-12, (151, 1) = 0.17738287754576913e-9, (151, 2) = 0.11752989133877892e-11, (152, 1) = 0.1773921433654561e-9, (152, 2) = -0.18415148066836067e-11, (153, 1) = 0.17736395967643572e-9, (153, 2) = 0.8201885316581704e-11, (154, 1) = 0.17748056023622617e-9, (154, 2) = 0.3157732758383743e-10, (155, 1) = 0.17761833634956764e-9, (155, 2) = 0.7303620199416457e-11, (156, 1) = 0.17755960451328362e-9, (156, 2) = -0.19645726102606908e-10, (157, 1) = 0.177490111160808e-9, (157, 2) = -0.6183092036826337e-11, (158, 1) = 0.1774860683177954e-9, (158, 2) = 0.13791199685361597e-10, (159, 1) = 0.17751007347546954e-9, (159, 2) = -0.1123658997823074e-11, (160, 1) = 0.17755374685089973e-9, (160, 2) = 0.9530905723236285e-11, (161, 1) = 0.17761328418355242e-9, (161, 2) = 0.3180032599835407e-10, (162, 1) = 0.1777804158043923e-9, (162, 2) = 0.3172129721923157e-10, (163, 1) = 0.1778891010668955e-9, (163, 2) = 0.1099360055708356e-10, (164, 1) = 0.17792174263627237e-9, (164, 2) = 0.6336900942903055e-11, (165, 1) = 0.17794532741586075e-9, (165, 2) = -0.8106825689249755e-11, (166, 1) = 0.1778612875625986e-9, (166, 2) = -0.317027679655097e-10, (167, 1) = 0.17772309218802811e-9, (167, 2) = -0.3604394611146823e-10, (168, 1) = 0.17753472151607115e-9, (168, 2) = -0.6067263218178792e-10, (169, 1) = 0.17734845788383116e-9, (169, 2) = -0.4301974601090625e-10, (170, 1) = 0.17717180728423692e-9, (170, 2) = -0.708673230717158e-10, (171, 1) = 0.17692909330780661e-9, (171, 2) = -0.7545885488672684e-10, (172, 1) = 0.17669107524190348e-9, (172, 2) = -0.7867451609850719e-10, (173, 1) = 0.17643592864261849e-9, (173, 2) = -0.8467122173832023e-10, (174, 1) = 0.1761626497964295e-9, (174, 2) = -0.10066116960930594e-9, (175, 1) = 0.17585144912895112e-9, (175, 2) = -0.10327533854387069e-9, (176, 1) = 0.17559282130767614e-9, (176, 2) = -0.8564068029823272e-10, (177, 1) = 0.17534767245626483e-9, (177, 2) = -0.9542740414368665e-10, (178, 1) = 0.175070872955065e-9, (178, 2) = -0.11141432025269159e-9, (179, 1) = 0.17472941681676618e-9, (179, 2) = -0.14401924343592074e-9, (180, 1) = 0.17434902748177944e-9, (180, 2) = -0.1374002367609609e-9, (181, 1) = 0.17397684310674838e-9, (181, 2) = -0.1514042023397739e-9, (182, 1) = 0.17359120757281704e-9, (182, 2) = -0.16687656138220841e-9, (183, 1) = 0.17313170857768555e-9, (183, 2) = -0.23765838734579775e-9, (184, 1) = 0.17253760117550773e-9, (184, 2) = -0.24804556507332825e-9, (185, 1) = 0.17197121854554688e-9, (185, 2) = -0.2478784774481122e-9, (186, 1) = 0.17140649552311378e-9, (186, 2) = -0.2248214763691401e-9, (187, 1) = 0.1709007043634424e-9, (187, 2) = -0.21100426153256604e-9, (188, 1) = 0.17042119686362235e-9, (188, 2) = -0.22494646702043228e-9, (189, 1) = 0.1698666780630662e-9, (189, 2) = -0.26753020861153144e-9, (190, 1) = 0.16928851840810036e-9, (190, 2) = -0.27526462995618593e-9, (191, 1) = 0.16872313536551076e-9, (191, 2) = -0.23658036064141335e-9, (192, 1) = 0.16824929688132656e-9, (192, 2) = -0.21785942537103216e-9, (193, 1) = 0.16780275183295847e-9, (193, 2) = -0.223064601469443e-9, (194, 1) = 0.16733906322733267e-9, (194, 2) = -0.2333692724310377e-9, (195, 1) = 0.16684008695267043e-9, (195, 2) = -0.2488801839151861e-9, (196, 1) = 0.16629562418352343e-9, (196, 2) = -0.29060115832163023e-9, (197, 1) = 0.1657485834859793e-9, (197, 2) = -0.25797855795615506e-9, (198, 1) = 0.16520385651821047e-9, (198, 2) = -0.28414245587093825e-9, (199, 1) = 0.16466234222347776e-9, (199, 2) = -0.26368827638414005e-9, (200, 1) = 0.16412831346804377e-9, (200, 2) = -0.2870411840885671e-9, (201, 1) = 0.16354950240127468e-9, (201, 2) = -0.30250781772573616e-9, (202, 1) = 0.1629334785707865e-9, (202, 2) = -0.36372184795261004e-9, (203, 1) = 0.16220060507478054e-9, (203, 2) = -0.38253906582633955e-9, (204, 1) = 0.1614337287419683e-9, (204, 2) = -0.4276495439190967e-9, (205, 1) = 0.16066818900676244e-9, (205, 2) = -0.40053038297561614e-9, (206, 1) = 0.1599513556001602e-9, (206, 2) = -0.395359534420508e-9, (207, 1) = 0.15922068345809328e-9, (207, 2) = -0.39003522154398776e-9, (208, 1) = 0.1584609126564144e-9, (208, 2) = -0.4486345987496402e-9, (209, 1) = 0.15764683019649017e-9, (209, 2) = -0.4673923746733245e-9, (210, 1) = 0.15679112151539502e-9, (210, 2) = -0.4688996721738172e-9, (211, 1) = 0.15595536017878682e-9, (211, 2) = -0.4788288367557785e-9, (212, 1) = 0.1550571038741057e-9, (212, 2) = -0.521898153737371e-9, (213, 1) = 0.15411959786796268e-9, (213, 2) = -0.5799873583276121e-9, (214, 1) = 0.15304138755347932e-9, (214, 2) = -0.6121049187787375e-9, (215, 1) = 0.15189795105220422e-9, (215, 2) = -0.7852360392693309e-9, (216, 1) = 0.15051718370584743e-9, (216, 2) = -0.7608401197568743e-9, (217, 1) = 0.14928155823030808e-9, (217, 2) = -0.718566229861273e-9, (218, 1) = 0.148017034735096e-9, (218, 2) = -0.7194579006760514e-9, (219, 1) = 0.14668417201808262e-9, (219, 2) = -0.8162091653252132e-9, (220, 1) = 0.14529092928060384e-9, (220, 2) = -0.7978579564310519e-9, (221, 1) = 0.14401410981433506e-9, (221, 2) = -0.7109197028545267e-9, (222, 1) = 0.14276148999897797e-9, (222, 2) = -0.8090086191747477e-9, (223, 1) = 0.1412293570053859e-9, (223, 2) = -0.10635261275332528e-8, (224, 1) = 0.1391633809659182e-9, (224, 2) = -0.1362658237052821e-8, (225, 1) = 0.13694246057394117e-9, (225, 2) = -0.12821506674772723e-8, (226, 1) = 0.13459809812027737e-9, (226, 2) = -0.1429939547251233e-8, (227, 1) = 0.132116701753709e-9, (227, 2) = -0.14602024092596638e-8, (228, 1) = 0.1296429147756651e-9, (228, 2) = -0.14848924130649073e-8, (229, 1) = 0.12670420482086657e-9, (229, 2) = -0.2024453530929389e-8, (230, 1) = 0.12359835382786773e-9, (230, 2) = -0.1710735271459598e-8, (231, 1) = 0.12104337913465696e-9, (231, 2) = -0.13854753794763311e-8, (232, 1) = 0.11878109025322994e-9, (232, 2) = -0.1280303923506126e-8, (233, 1) = 0.11669352532796897e-9, (233, 2) = -0.12544804052904891e-8, (234, 1) = 0.11444825006914873e-9, (234, 2) = -0.12984328101201121e-8, (235, 1) = 0.112579974860406e-9, (235, 2) = -0.10689472820984925e-8, (236, 1) = 0.1107091287309365e-9, (236, 2) = -0.1191109641758e-8, (237, 1) = 0.10865889457517803e-9, (237, 2) = -0.11486201657441699e-8, (238, 1) = 0.10626671818473344e-9, (238, 2) = -0.1925202629706879e-8, (239, 1) = 0.1030482856977682e-9, (239, 2) = -0.2018461401541499e-8, (240, 1) = 0.996347364950553e-10, (240, 2) = -0.19260738928663375e-8, (241, 1) = 0.9704899492491931e-10, (241, 2) = -0.15481075300795087e-8, (242, 1) = 0.9437332145766142e-10, (242, 2) = -0.184909221290761e-8, (243, 1) = 0.908939520489789e-10, (243, 2) = -0.2231650328894203e-8, (244, 1) = 0.8732950679214938e-10, (244, 2) = -0.21204959301359874e-8, (245, 1) = 0.8359287719772462e-10, (245, 2) = -0.2352542644486656e-8, (246, 1) = 0.7991776116656887e-10, (246, 2) = -0.22440616410190953e-8, (247, 1) = 0.7711091117822803e-10, (247, 2) = -0.13191753975313803e-8, (248, 1) = 0.7441529799946651e-10, (248, 2) = -0.17910242436330124e-8, (249, 1) = 0.7048259901959399e-10, (249, 2) = -0.28100392420676528e-8, (250, 1) = 0.6644564251098325e-10, (250, 2) = -0.17700391138996297e-8, (251, 1) = 0.6174743674733547e-10, (251, 2) = -0.35983309462523948e-8, (252, 1) = 0.53748800269876703e-10, (252, 2) = -0.6574229670441326e-8, (253, 1) = 0.41046774306620714e-10, (253, 2) = -0.9585281831683094e-8, (254, 1) = 0.2214825555039262e-10, (254, 2) = -0.12765752311713578e-7, (255, 1) = 0.33364537107475994e-11, (255, 2) = -0.12233796849054259e-7, (256, 1) = .0, (256, 2) = -0.9558323369337775e-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[256] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(1.2765752311713578e-8) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 256, [v(u), diff(v(u), u)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[256] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[256] 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`(256, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(256, 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[256] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(1.2765752311713578e-8) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 256, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[256] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[256] 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`(256, 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`(256, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893627908416226420, (2) = 36893627908416226860, (3) = 36893627908416227036}), (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(256, {(1) = -.615479708670389, (2) = -.6138337655059911, (3) = -.6121877371363221, (4) = -.610541623152404, (5) = -.6088953251908921, (6) = -.6072487671472097, (7) = -.6056019471744036, (8) = -.6039547492398832, (9) = -.6023071028585135, (10) = -.600659003239894, (11) = -.5990103110283401, (12) = -.5973609594036162, (13) = -.5957109382804167, (14) = -.5940600787075152, (15) = -.592408316893275, (16) = -.5907556337655888, (17) = -.589101824521824, (18) = -.5874468288606902, (19) = -.585790613017156, (20) = -.5841329309576447, (21) = -.5824737271461466, (22) = -.5808129444592497, (23) = -.5791502923727325, (24) = -.5774857217781857, (25) = -.5758191392268837, (26) = -.5741502104173669, (27) = -.5724788940395652, (28) = -.5708050411421474, (29) = -.5691282811123882, (30) = -.5674485804227406, (31) = -.5657657065322664, (32) = -.5640792708720453, (33) = -.5623892445543703, (34) = -.5606952706775499, (35) = -.5589969780179599, (36) = -.5572943246689157, (37) = -.555586796800204, (38) = -.5538740753768657, (39) = -.5521560662027295, (40) = -.5504321023790923, (41) = -.5487019283191328, (42) = -.5469653407777109, (43) = -.5452215561139513, (44) = -.5434703809718867, (45) = -.5417114118674226, (46) = -.5399438369309824, (47) = -.5381675001638607, (48) = -.5363816612793244, (49) = -.5345856438064434, (50) = -.5327791976962112, (51) = -.5309612570931616, (52) = -.5291313415384594, (53) = -.5272888957313684, (54) = -.525432745213056, (55) = -.523562514992632, (56) = -.5216770864410629, (57) = -.5197755400848111, (58) = -.5178572425620112, (59) = -.515920711401875, (60) = -.5139652765527121, (61) = -.5119895907876776, (62) = -.5099924034933055, (63) = -.5079727160294226, (64) = -.5059287438667803, (65) = -.5038594483715606, (66) = -.5017629397592426, (67) = -.4996377699518008, (68) = -.49748213518145645, (69) = -.49529405774722146, (70) = -.49307171190353477, (71) = -.4908127037482733, (72) = -.48851496049995186, (73) = -.48617577893132347, (74) = -.4837926795108566, (75) = -.48136264479140517, (76) = -.4788826875598093, (77) = -.47634940862604525, (78) = -.4737592248726671, (79) = -.47110824288051906, (80) = -.46839220670201365, (81) = -.46560652263193936, (82) = -.4627462688840759, (83) = -.45980582730548547, (84) = -.4567795100866846, (85) = -.4536605585746382, (86) = -.45044190982538507, (87) = -.44711596396700165, (88) = -.4436737732409932, (89) = -.44010588450370247, (90) = -.43640194597493315, (91) = -.4325503265005061, (92) = -.4285378041296347, (93) = -.4243499633478024, (94) = -.41997068666716125, (95) = -.415381857195644, (96) = -.41056307352817695, (97) = -.4054913072194831, (98) = -.40014286075850014, (99) = -.3945291762613631, (100) = -.3887243469845279, (101) = -.38272333283023513, (102) = -.37651248996445524, (103) = -.3700765357249298, (104) = -.3633984542976641, (105) = -.35645951516908386, (106) = -.3492382879874373, (107) = -.3417110407352021, (108) = -.33385046669876445, (109) = -.32562584741600087, (110) = -.3170017781423065, (111) = -.3079373927769954, (112) = -.29838534976786646, (113) = -.28829018526282596, (114) = -.2775863529897709, (115) = -.26619576640273657, (116) = -.25402428090287404, (117) = -.24095674999268518, (118) = -.22685076083627745, (119) = -.21152693593807945, (120) = -.19475483127449672, (121) = -.17623202423500914, (122) = -.15554979660920581, (123) = -.13228994492398807, (124) = -.1082372279662562, (125) = -0.8418451100852434e-1, (126) = -0.6013179405079247e-1, (127) = -0.360790770930606e-1, (128) = -0.12026360135328736e-1, (129) = 0.1202635682240313e-1, (130) = 0.36079073780135e-1, (131) = 0.6013179073786687e-1, (132) = 0.8418450769559874e-1, (133) = .1082372246533306, (134) = .13228994161106247, (135) = .15554979358804727, (136) = .17623202154579037, (137) = .1947548288517443, (138) = .21152693373373746, (139) = .22685075881419176, (140) = .24095674812499612, (141) = .25402427916759346, (142) = .266195764782475, (143) = .2775863514700435, (144) = .2882901838320805, (145) = .298385348416205, (146) = .30793739149611127, (147) = .31700177692513, (148) = .32562584625647806, (149) = .3338504655917917, (150) = .3417110396761509, (151) = .34923828697230785, (152) = .3564595141944389, (153) = .3633984533603477, (154) = .37007653482219466, (155) = .37651248909388624, (156) = .3827233319895611, (157) = .3887243461717439, (158) = .39452917547476085, (159) = .4001428600026771, (160) = .40549130650739146, (161) = .410563072857691, (162) = .4153818565630173, (163) = .4199706860690814, (164) = .4243499627813222, (165) = .42853780359211907, (166) = .4325503259895911, (167) = .4364019454885977, (168) = .44010588404014256, (169) = .4436737727984631, (170) = .447115963543925, (171) = .45044190942046414, (172) = .453660558186639, (173) = .45677950971441716, (174) = .4598058269479823, (175) = .46274626854038836, (176) = .4656065223011885, (177) = .468392206383466, (178) = .47110824257342615, (179) = .4737592245763975, (180) = .4763494083399846, (181) = .4788826872834117, (182) = .48136264452415733, (183) = .4837926792522918, (184) = .48617577868100653, (185) = .4885149602574814, (186) = .49081270351328304, (187) = .49307171167567043, (188) = .4952940575261847, (189) = .4974821349669204, (190) = .4996377697435383, (191) = .5017629395569352, (192) = .5038594481750222, (193) = .5059287436757538, (194) = .5079727158437204, (195) = .5099924033127412, (196) = .5119895906120454, (197) = .5139652763818926, (198) = .5159207112356502, (199) = .517857242400274, (200) = .5197755399274191, (201) = .5216770862878711, (202) = .5235625148435622, (203) = .5254327450679438, (204) = .527288895590138, (205) = .529131341401021, (206) = .5309612569593932, (207) = .5327791975660613, (208) = .5345856436798079, (209) = .5363816611561303, (210) = .5381675000440663, (211) = .5399438368144777, (212) = .5417114117541697, (213) = .5434703808618371, (214) = .5452215560070248, (215) = .5469653406738793, (216) = .5487019282183432, (217) = .550432102281291, (218) = .5521560661078934, (219) = .5538740752849417, (220) = .5555867967111572, (221) = .5572943245827272, (222) = .5589969779345795, (223) = .5606952705969559, (224) = .5623892444765469, (225) = .5640792707969473, (226) = .5657657064598809, (227) = .567448580353051, (228) = .5691282810453618, (229) = .5708050410777735, (230) = .572478893977828, (231) = .5741502103582431, (232) = .5758191391703643, (233) = .5774857217242565, (234) = .5791502923213769, (235) = .5808129444104603, (236) = .5824737270999113, (237) = .5841329309139516, (238) = .5857906129759993, (239) = .5874468288220598, (240) = .5891018244857117, (241) = .5907556337319899, (242) = .592408316862182, (243) = .5940600786789219, (244) = .59571093825432, (245) = .597360959380009, (246) = .5990103110072196, (247) = .6006590032212563, (248) = .602307102842355, (249) = .6039547492262015, (250) = .605601947163196, (251) = .6072487671384748, (252) = .60889532518463, (253) = .6105416231486125, (254) = .6121877371346346, (255) = .6138337655055719, (256) = .615479708670389}, datatype = float[8], order = C_order); Y := Matrix(256, 2, {(1, 1) = -2.35619449019234, (1, 2) = 12.118672760959774, (2, 1) = -2.337290286256281, (2, 2) = 10.914658446600086, (3, 1) = -2.3201008276005637, (3, 2) = 10.010693556288953, (4, 1) = -2.3042274489049164, (4, 2) = 9.301772103437811, (5, 1) = -2.2894019626109485, (5, 2) = 8.727840811274362, (6, 1) = -2.2754345312302515, (6, 2) = 8.25177412070392, (7, 1) = -2.2621856009081305, (7, 2) = 7.849239603358558, (8, 1) = -2.2495479912910765, (8, 2) = 7.503505631367268, (9, 1) = -2.237438216937433, (9, 2) = 7.202667464492366, (10, 1) = -2.2257900845870067, (10, 2) = 6.9380000914469795, (11, 1) = -2.2145489434481087, (11, 2) = 6.702920347222946, (12, 1) = -2.2036701874921634, (12, 2) = 6.492381622935028, (13, 1) = -2.1931169326136617, (13, 2) = 6.302442718336018, (14, 1) = -2.182857087056544, (14, 2) = 6.1299557556249535, (15, 1) = -2.1728639002327887, (15, 2) = 5.972396952904152, (16, 1) = -2.163114638683964, (16, 2) = 5.827713143173982, (17, 1) = -2.1535885656610416, (17, 2) = 5.694198333816598, (18, 1) = -2.1442683694669147, (18, 2) = 5.570445902587254, (19, 1) = -2.135139003947531, (19, 2) = 5.455278113161753, (20, 1) = -2.1261860618884074, (20, 2) = 5.347686388424327, (21, 1) = -2.117397725718667, (21, 2) = 5.246825138078152, (22, 1) = -2.1087634545082783, (22, 2) = 5.151970330277958, (23, 1) = -2.1002726297503918, (23, 2) = 5.062486400497311, (24, 1) = -2.09191686701165, (24, 2) = 4.977836260324988, (25, 1) = -2.0836883833144606, (25, 2) = 4.89755068349214, (26, 1) = -2.0755789618481537, (26, 2) = 4.821209181407477, (27, 1) = -2.0675824841724295, (27, 2) = 4.748456236732863, (28, 1) = -2.0596928691103513, (28, 2) = 4.678974379599474, (29, 1) = -2.051903519080722, (29, 2) = 4.612474707184249, (30, 1) = -2.0442098747249235, (30, 2) = 4.548714275787255, (31, 1) = -2.0366068506718946, (31, 2) = 4.487469833466657, (32, 1) = -2.029089044589754, (32, 2) = 4.428537179987267, (33, 1) = -2.021652996969941, (33, 2) = 4.37174600352715, (34, 1) = -2.0142940866632357, (34, 2) = 4.316933039412177, (35, 1) = -2.0070079294921044, (35, 2) = 4.263951400135515, (36, 1) = -1.9997918012046616, (36, 2) = 4.212678754210403, (37, 1) = -1.9926411949448875, (37, 2) = 4.1629910012947215, (38, 1) = -1.9855526610971537, (38, 2) = 4.114781573443895, (39, 1) = -1.9785238619833743, (39, 2) = 4.067959975624121, (40, 1) = -1.9715502957463595, (40, 2) = 4.022428994561768, (41, 1) = -1.9646293254778062, (41, 2) = 3.9781108598165833, (42, 1) = -1.957758660364256, (42, 2) = 3.934935932616207, (43, 1) = -1.9509338703093544, (43, 2) = 3.8928267394753386, (44, 1) = -1.944153004798682, (44, 2) = 3.851726365609299, (45, 1) = -1.9374134094480575, (45, 2) = 3.8115778491539154, (46, 1) = -1.930711011983108, (46, 2) = 3.772320003327631, (47, 1) = -1.9240443660461672, (47, 2) = 3.7339108293070433, (48, 1) = -1.9174099329338168, (48, 2) = 3.6962994182504065, (49, 1) = -1.9108045560622748, (49, 2) = 3.659440318691635, (50, 1) = -1.9042267545887381, (50, 2) = 3.6233001437964765, (51, 1) = -1.8976721834422676, (51, 2) = 3.5878322615247313, (52, 1) = -1.8911387498163468, (52, 2) = 3.5530048270523595, (53, 1) = -1.8846241810749393, (53, 2) = 3.5187870099890954, (54, 1) = -1.8781241357772231, (54, 2) = 3.485139202181243, (55, 1) = -1.8716371986951243, (55, 2) = 3.452038938466664, (56, 1) = -1.865159466522433, (56, 2) = 3.4194526469660533, (57, 1) = -1.8586878578861092, (57, 2) = 3.387352720953515, (58, 1) = -1.852220367454726, (58, 2) = 3.355718347457449, (59, 1) = -1.8457522424271995, (59, 2) = 3.324516730438481, (60, 1) = -1.8392815825813371, (60, 2) = 3.29373037446758, (61, 1) = -1.8328043493386406, (61, 2) = 3.2633328038479608, (62, 1) = -1.8263169664273664, (62, 2) = 3.2333011360701454, (63, 1) = -1.8198167981272089, (63, 2) = 3.203618031881599, (64, 1) = -1.813298813394356, (64, 2) = 3.1742564189641698, (65, 1) = -1.806760514416245, (65, 2) = 3.14520192132763, (66, 1) = -1.8001968467477523, (66, 2) = 3.1164298804842017, (67, 1) = -1.7936043097811496, (67, 2) = 3.087923727510235, (68, 1) = -1.7869784494621208, (68, 2) = 3.059663858549224, (69, 1) = -1.7803144554167043, (69, 2) = 3.0316303722528506, (70, 1) = -1.773608159705147, (70, 2) = 3.003807252664023, (71, 1) = -1.7668538681850854, (71, 2) = 2.976173342920477, (72, 1) = -1.7600470567674849, (72, 2) = 2.9487135554766004, (73, 1) = -1.7531815429128443, (73, 2) = 2.9214073446110134, (74, 1) = -1.7462520392971868, (74, 2) = 2.894239096407252, (75, 1) = -1.739251935110602, (75, 2) = 2.867189346904102, (76, 1) = -1.7321749778761224, (76, 2) = 2.840241498377158, (77, 1) = -1.7250140205120181, (77, 2) = 2.813377042640132, (78, 1) = -1.71776170736756, (78, 2) = 2.786578322127765, (79, 1) = -1.710410145187836, (79, 2) = 2.7598273981420816, (80, 1) = -1.702950796897438, (80, 2) = 2.7331058270979764, (81, 1) = -1.6953745919813825, (81, 2) = 2.706395235922123, (82, 1) = -1.6876719923104895, (82, 2) = 2.679677712979381, (83, 1) = -1.6798320535801188, (83, 2) = 2.652932785787809, (84, 1) = -1.6718441587879003, (84, 2) = 2.6261436160121594, (85, 1) = -1.6636954194758775, (85, 2) = 2.59928845114405, (86, 1) = -1.6553727854910854, (86, 2) = 2.5723481008907183, (87, 1) = -1.6468624877620444, (87, 2) = 2.545304290612758, (88, 1) = -1.6381480621612516, (88, 2) = 2.5181338444174726, (89, 1) = -1.629212624315195, (89, 2) = 2.490816474920481, (90, 1) = -1.6200379626559427, (90, 2) = 2.4633323383202774, (91, 1) = -1.610603726190067, (91, 2) = 2.435660225598683, (92, 1) = -1.600886842296156, (92, 2) = 2.407776753470986, (93, 1) = -1.590862673461241, (93, 2) = 2.379660658525142, (94, 1) = -1.5805039774298852, (94, 2) = 2.3512907600058233, (95, 1) = -1.5697804425895585, (95, 2) = 2.3226459265785855, (96, 1) = -1.5586583014691535, (96, 2) = 2.293705534146932, (97, 1) = -1.5470998615698928, (97, 2) = 2.264450008190539, (98, 1) = -1.5350682338848733, (98, 2) = 2.2348743168779803, (99, 1) = -1.5226063468150763, (99, 2) = 2.2051737248528798, (100, 1) = -1.5098914960211454, (100, 2) = 2.17583738657371, (101, 1) = -1.4969217602954346, (101, 2) = 2.1469084566347605, (102, 1) = -1.483676933938617, (102, 2) = 2.1183928671531187, (103, 1) = -1.4701342356942662, (103, 2) = 2.090298680436436, (104, 1) = -1.456268237054072, (104, 2) = 2.062637371249721, (105, 1) = -1.4420510120219698, (105, 2) = 2.0354256916943894, (106, 1) = -1.4274502395871247, (106, 2) = 2.0086839641858134, (107, 1) = -1.4124301696269619, (107, 2) = 1.982440430772687, (108, 1) = -1.396949207859653, (108, 2) = 1.9567299468981632, (109, 1) = -1.3809604090221987, (109, 2) = 1.9315987904171668, (110, 1) = -1.3644091203399373, (110, 2) = 1.90710568533949, (111, 1) = -1.3472316418753183, (111, 2) = 1.8833262710134948, (112, 1) = -1.3293533968260578, (112, 2) = 1.8603588503339894, (113, 1) = -1.3106858612504209, (113, 2) = 1.8383314042303163, (114, 1) = -1.2911228307959204, (114, 2) = 1.817412138903023, (115, 1) = -1.2705355796858275, (115, 2) = 1.7978248787898543, (116, 1) = -1.248765731648311, (116, 2) = 1.7798711356935655, (117, 1) = -1.225614926126585, (117, 2) = 1.763963185281574, (118, 1) = -1.200830935267974, (118, 2) = 1.7506757021906965, (119, 1) = -1.1740854857729608, (119, 2) = 1.7408255448851555, (120, 1) = -1.1449402048254178, (120, 2) = 1.7356000930834823, (121, 1) = -1.112792654079651, (121, 2) = 1.736765562026282, (122, 1) = -1.076783198309804, (122, 2) = 1.7470005348334907, (123, 1) = -1.0359027942603893, (123, 2) = 1.7701883209179174, (124, 1) = -.9929061378220345, (124, 2) = 1.8071518462503395, (125, 1) = -.9488753802410032, (125, 2) = 1.8556720762877739, (126, 1) = -.9035856416474204, (126, 2) = 1.9105602217533053, (127, 1) = -.8569996596327668, (127, 2) = 1.9612047634124612, (128, 1) = -.8093960435992642, (128, 2) = 1.9925954032717297, (129, 1) = -.761400289896857, (129, 2) = 1.9925954056751198, (130, 1) = -.7137966737557435, (130, 2) = 1.9612047696396848, (131, 1) = -.6672106915684193, (131, 2) = 1.9105602294964226, (132, 1) = -.6219209527887216, (132, 2) = 1.855672083763541, (133, 1) = -.5778901950429396, (133, 2) = 1.8071518523502108, (134, 1) = -.5348935384786714, (134, 2) = 1.7701883252585813, (135, 1) = -.49401313383975687, (135, 2) = 1.747000537150921, (136, 1) = -.45800367746021514, (136, 2) = 1.7367655628415017, (137, 1) = -.4258561262471038, (137, 2) = 1.7356000928289879, (138, 1) = -.39671084493089215, (138, 2) = 1.7408255438725242, (139, 1) = -.3699653951377459, (139, 2) = 1.7506757006156077, (140, 1) = -.3451814040331261, (140, 2) = 1.7639631832878049, (141, 1) = -.32203059830507375, (141, 2) = 1.7798711333745194, (142, 1) = -.30026075009166514, (142, 2) = 1.7978248762196696, (143, 1) = -.2796734988303415, (143, 2) = 1.8174121361251319, (144, 1) = -.2601104682438874, (144, 2) = 1.8383314012826037, (145, 1) = -.24144293255250612, (145, 2) = 1.8603588472423433, (146, 1) = -.22356468740089847, (146, 2) = 1.8833262678026457, (147, 1) = -.20638720884511483, (147, 2) = 1.9071056820325802, (148, 1) = -.18983592008109626, (148, 2) = 1.9315987870236686, (149, 1) = -.17384712116975945, (149, 2) = 1.9567299434167018, (150, 1) = -.15836615933579365, (150, 2) = 1.9824404272037903, (151, 1) = -.14334608931514567, (151, 2) = 2.0086839605395936, (152, 1) = -.12874531682500312, (152, 2) = 2.0354256879874106, (153, 1) = -.11452809174235111, (153, 2) = 2.062637367479104, (154, 1) = -.10066209305576505, (154, 2) = 2.0902986765983758, (155, 1) = -0.8711939476860638e-1, (155, 2) = 2.118392863260354, (156, 1) = -0.7387456837236098e-1, (156, 2) = 2.1469084526936144, (157, 1) = -0.60904832610221504e-1, (157, 2) = 2.175837382566909, (158, 1) = -0.4818998178237595e-1, (158, 2) = 2.2051737207834075, (159, 1) = -0.3572809466713802e-1, (159, 2) = 2.2348743127922583, (160, 1) = -0.23696466905448903e-1, (160, 2) = 2.2644500041646727, (161, 1) = -0.12138026931617684e-1, (161, 2) = 2.2937055301846807, (162, 1) = -0.10158857427529687e-2, (162, 2) = 2.3226459226924674, (163, 1) = 0.9707649160640567e-2, (163, 2) = 2.3512907561955467, (164, 1) = 0.20066345250206022e-1, (164, 2) = 2.3796606547873345, (165, 1) = 0.30090514138934432e-1, (165, 2) = 2.4077767498016844, (166, 1) = 0.39807398082675735e-1, (166, 2) = 2.435660221997729, (167, 1) = 0.4924163459500751e-1, (167, 2) = 2.463332334780739, (168, 1) = 0.5841629629769051e-1, (168, 2) = 2.490816471448168, (169, 1) = 0.6735173418411464e-1, (169, 2) = 2.5181338409954215, (170, 1) = 0.7606615982248231e-1, (170, 2) = 2.5453042872557936, (171, 1) = 0.8457645758690016e-1, (171, 2) = 2.5723480975870063, (172, 1) = 0.9289909160487612e-1, (172, 2) = 2.5992884478819875, (173, 1) = .10104783094790701, (173, 2) = 2.6261436128033866, (174, 1) = .10903572576945493, (174, 2) = 2.652932782626758, (175, 1) = .11687566452741904, (175, 2) = 2.679677709854055, (176, 1) = .12457826422424711, (176, 2) = 2.7063952328267518, (177, 1) = .13215446916492207, (177, 2) = 2.7331058240418673, (178, 1) = .13961381747853283, (178, 2) = 2.7598273951286862, (179, 1) = .14696537968035128, (179, 2) = 2.786578319164531, (180, 1) = .15421769284577339, (180, 2) = 2.813377039715548, (181, 1) = .16137865022983547, (181, 2) = 2.840241495490389, (182, 1) = .1684556074833026, (182, 2) = 2.8671893440509666, (183, 1) = .17545571168801935, (183, 2) = 2.8942390936057563, (184, 1) = .18238521532102625, (184, 2) = 2.921407341841214, (185, 1) = .1892507291922418, (185, 2) = 2.948713552731732, (186, 1) = .1960575406257235, (186, 2) = 2.976173340196842, (187, 1) = .20281183216095594, (187, 2) = 3.003807249950244, (188, 1) = .20951812788710494, (188, 2) = 3.031630369558518, (189, 1) = .21618212194647154, (189, 2) = 3.0596638558915292, (190, 1) = .22280798227907891, (190, 2) = 3.087923724878711, (191, 1) = .22940051925857516, (191, 2) = 3.116429877855737, (192, 1) = .23596418693963114, (192, 2) = 3.1452019187126066, (193, 1) = .24250248592976217, (193, 2) = 3.174256416366404, (194, 1) = .24902047067429922, (194, 2) = 3.203618029300584, (195, 1) = .25552063898580135, (195, 2) = 3.233301133512497, (196, 1) = .26200802190802075, (196, 2) = 3.2633328013174117, (197, 1) = .2684852551614961, (197, 2) = 3.293730371934068, (198, 1) = .2749559150176309, (198, 2) = 3.324516727923597, (199, 1) = .2814240400552919, (199, 2) = 3.355718344955579, (200, 1) = .2878915304965398, (200, 2) = 3.3873527184670316, (201, 1) = .2943631391424539, (201, 2) = 3.419452644495199, (202, 1) = .3008408713246704, (202, 2) = 3.452038936023861, (203, 1) = .3073278084159586, (203, 2) = 3.4851391997638705, (204, 1) = .31382785372281113, (204, 2) = 3.518787007595249, (205, 1) = .3203424224732208, (205, 2) = 3.5530048246636516, (206, 1) = .32687585610786957, (206, 2) = 3.5878322591378202, (207, 1) = .3334304272630384, (207, 2) = 3.6233001413972294, (208, 1) = .34000822874505454, (208, 2) = 3.6594403163130003, (209, 1) = .346613605625009, (209, 2) = 3.6962994158992246, (210, 1) = .3532480387458031, (210, 2) = 3.733910826968825, (211, 1) = .35991468469094073, (211, 2) = 3.772320000996824, (212, 1) = .36661708216412175, (212, 2) = 3.8115778468489965, (213, 1) = .3733566775229776, (213, 2) = 3.851726363332059, (214, 1) = .38013754304180297, (214, 2) = 3.8928267372315797, (215, 1) = .3869623331049322, (215, 2) = 3.934935930441873, (216, 1) = .39383299822677503, (216, 2) = 3.978110857651852, (217, 1) = .4007539685035025, (217, 2) = 4.022428992375078, (218, 1) = .4077275347487492, (218, 2) = 4.0679599734355065, (219, 1) = .41475633387072003, (219, 2) = 4.114781571285711, (220, 1) = .42184486772664703, (220, 2) = 4.162990999115868, (221, 1) = .4289954739946092, (221, 2) = 4.21267875197291, (222, 1) = .43621160229018285, (222, 2) = 4.263951397940499, (223, 1) = .44349775946952946, (223, 2) = 4.316933037240854, (224, 1) = .4508566697847075, (224, 2) = 4.371746001472759, (225, 1) = .4582927174130059, (225, 2) = 4.428537177892839, (226, 1) = .46581052350376145, (226, 2) = 4.487469831432685, (227, 1) = .4734135475655795, (227, 2) = 4.548714273764117, (228, 1) = .48110719193019813, (228, 2) = 4.612474705197783, (229, 1) = .4888965419689955, (229, 2) = 4.678974377813236, (230, 1) = .4967861570404521, (230, 2) = 4.7484562348806385, (231, 1) = .5047826347254658, (231, 2) = 4.8212091794085215, (232, 1) = .5128920562010075, (232, 2) = 4.897550681391886, (233, 1) = .5211205399075063, (233, 2) = 4.977836258214376, (234, 1) = .5294763026557, (234, 2) = 5.062486398380529, (235, 1) = .5379671274230966, (235, 2) = 5.151970328113153, (236, 1) = .54660139864321, (236, 2) = 5.246825135949528, (237, 1) = .5553897348228287, (237, 2) = 5.347686386243535, (238, 1) = .5643426768922236, (238, 2) = 5.45527811128566, (239, 1) = .5734720424222883, (239, 2) = 5.570445900590808, (240, 1) = .5827922386273318, (240, 2) = 5.694198331847795, (241, 1) = .5923183116613285, (241, 2) = 5.827713141100247, (242, 1) = .6020675732216765, (242, 2) = 5.97239695109456, (243, 1) = .612060760057737, (243, 2) = 6.129955753954183, (244, 1) = .622320605627775, (244, 2) = 6.302442716859202, (245, 1) = .6328738605195571, (245, 2) = 6.492381621232821, (246, 1) = .6437526164891595, (246, 2) = 6.702920345468326, (247, 1) = .654993757641648, (247, 2) = 6.938000089073476, (248, 1) = .6666418900060076, (248, 2) = 7.20266746245575, (249, 1) = .678751664374535, (249, 2) = 7.503505629494219, (250, 1) = .6913892740071063, (250, 2) = 7.849239600963847, (251, 1) = .7046382043460715, (251, 2) = 8.251774119315153, (252, 1) = .7186056357462011, (252, 2) = 8.727840810952246, (253, 1) = .7334311220622616, (253, 2) = 9.30177210389072, (254, 1) = .74930450078053, (254, 2) = 10.010693558249125, (255, 1) = .766493959452669, (255, 2) = 10.914658448521092, (256, 1) = .785398163397448, (256, 2) = 12.118672763119722}, datatype = float[8], order = C_order); YP := Matrix(256, 2, {(1, 1) = 12.118672760959774, (1, 2) = -856.132513417093, (2, 1) = 10.914658446600086, (2, 2) = -626.3138713842598, (3, 1) = 10.010693556288953, (3, 2) = -482.2028779602816, (4, 1) = 9.301772103437811, (4, 2) = -385.0044436179127, (5, 1) = 8.727840811274362, (5, 2) = -315.9004029643987, (6, 1) = 8.25177412070392, (6, 2) = -264.77471365782577, (7, 1) = 7.849239603358558, (7, 2) = -225.75521795738067, (8, 1) = 7.503505631367268, (8, 2) = -195.22011305001453, (9, 1) = 7.202667464492366, (9, 2) = -170.82915163273915, (10, 1) = 6.9380000914469795, (10, 2) = -151.0099936160739, (11, 1) = 6.702920347222946, (11, 2) = -134.66931195330426, (12, 1) = 6.492381622935028, (12, 2) = -121.02750817954177, (13, 1) = 6.302442718336018, (13, 2) = -109.51513905854112, (14, 1) = 6.1299557556249535, (14, 2) = -99.70639359539115, (15, 1) = 5.972396952904152, (15, 2) = -91.27855128798726, (16, 1) = 5.827713143173982, (16, 2) = -83.98275540857765, (17, 1) = 5.694198333816598, (17, 2) = -77.62352977596856, (18, 1) = 5.570445902587254, (18, 2) = -72.04656753943121, (19, 1) = 5.455278113161753, (19, 2) = -67.12825374413103, (20, 1) = 5.347686388424327, (20, 2) = -62.76794531415879, (21, 1) = 5.246825138078152, (21, 2) = -58.88393128604594, (22, 1) = 5.151970330277958, (22, 2) = -55.40885507068803, (23, 1) = 5.062486400497311, (23, 2) = -52.28635706995813, (24, 1) = 4.977836260324988, (24, 2) = -49.46978264124701, (25, 1) = 4.89755068349214, (25, 2) = -46.919784022075945, (26, 1) = 4.821209181407477, (26, 2) = -44.60273229586116, (27, 1) = 4.748456236732863, (27, 2) = -42.49042331959783, (28, 1) = 4.678974379599474, (28, 2) = -40.55859334357499, (29, 1) = 4.612474707184249, (29, 2) = -38.78617511212157, (30, 1) = 4.548714275787255, (30, 2) = -37.15534890860894, (31, 1) = 4.487469833466657, (31, 2) = -35.650486075426734, (32, 1) = 4.428537179987267, (32, 2) = -34.257886856585785, (33, 1) = 4.37174600352715, (33, 2) = -32.96589412256592, (34, 1) = 4.316933039412177, (34, 2) = -31.764062891704498, (35, 1) = 4.263951400135515, (35, 2) = -30.643234855887133, (36, 1) = 4.212678754210403, (36, 2) = -29.59556089722199, (37, 1) = 4.1629910012947215, (37, 2) = -28.613836903718852, (38, 1) = 4.114781573443895, (38, 2) = -27.691814535224786, (39, 1) = 4.067959975624121, (39, 2) = -26.824068766107406, (40, 1) = 4.022428994561768, (40, 2) = -26.00550522795828, (41, 1) = 3.9781108598165833, (41, 2) = -25.231789519785515, (42, 1) = 3.934935932616207, (42, 2) = -24.49907419157066, (43, 1) = 3.8928267394753386, (43, 2) = -23.80369093520492, (44, 1) = 3.851726365609299, (44, 2) = -23.142591975070513, (45, 1) = 3.8115778491539154, (45, 2) = -22.512964635975212, (46, 1) = 3.772320003327631, (46, 2) = -21.912148754190753, (47, 1) = 3.7339108293070433, (47, 2) = -21.337971601154468, (48, 1) = 3.6962994182504065, (48, 2) = -20.788292666653856, (49, 1) = 3.659440318691635, (49, 2) = -20.261207504959344, (50, 1) = 3.6233001437964765, (50, 2) = -19.755117660693415, (51, 1) = 3.5878322615247313, (51, 2) = -19.268358478843336, (52, 1) = 3.5530048270523595, (52, 2) = -18.79958066865422, (53, 1) = 3.5187870099890954, (53, 2) = -18.347541660541417, (54, 1) = 3.485139202181243, (54, 2) = -17.91097087199947, (55, 1) = 3.452038938466664, (55, 2) = -17.488900002083938, (56, 1) = 3.4194526469660533, (56, 2) = -17.08028657274201, (57, 1) = 3.387352720953515, (57, 2) = -16.68422876830327, (58, 1) = 3.355718347457449, (58, 2) = -16.299964121863187, (59, 1) = 3.324516730438481, (59, 2) = -15.92663575675902, (60, 1) = 3.29373037446758, (60, 2) = -15.563618180234197, (61, 1) = 3.2633328038479608, (61, 2) = -15.210220163284507, (62, 1) = 3.2333011360701454, (62, 2) = -14.865831987545663, (63, 1) = 3.203618031881599, (63, 2) = -14.529941407415382, (64, 1) = 3.1742564189641698, (64, 2) = -14.201957354118989, (65, 1) = 3.14520192132763, (65, 2) = -13.881460244621785, (66, 1) = 3.1164298804842017, (66, 2) = -13.567942167450001, (67, 1) = 3.087923727510235, (67, 2) = -13.26100834577326, (68, 1) = 3.059663858549224, (68, 2) = -12.960252417563783, (69, 1) = 3.0316303722528506, (69, 2) = -12.665285347917038, (70, 1) = 3.003807252664023, (70, 2) = -12.375777363409917, (71, 1) = 2.976173342920477, (71, 2) = -12.091361988533292, (72, 1) = 2.9487135554766004, (72, 2) = -11.811751212695286, (73, 1) = 2.9214073446110134, (73, 2) = -11.536615533261044, (74, 1) = 2.894239096407252, (74, 2) = -11.265688881896164, (75, 1) = 2.867189346904102, (75, 2) = -10.998678892210954, (76, 1) = 2.840241498377158, (76, 2) = -10.735333260527634, (77, 1) = 2.813377042640132, (77, 2) = -10.475391531295369, (78, 1) = 2.786578322127765, (78, 2) = -10.21861157410054, (79, 1) = 2.7598273981420816, (79, 2) = -9.964757766355802, (80, 1) = 2.7331058270979764, (80, 2) = -9.71359833404566, (81, 1) = 2.706395235922123, (81, 2) = -9.46491022905575, (82, 1) = 2.679677712979381, (82, 2) = -9.218482012351554, (83, 1) = 2.652932785787809, (83, 2) = -8.974085491703697, (84, 1) = 2.6261436160121594, (84, 2) = -8.731531933299696, (85, 1) = 2.59928845114405, (85, 2) = -8.490593473083779, (86, 1) = 2.5723481008907183, (86, 2) = -8.251070500116482, (87, 1) = 2.545304290612758, (87, 2) = -8.01277529384119, (88, 1) = 2.5181338444174726, (88, 2) = -7.775480109929202, (89, 1) = 2.490816474920481, (89, 2) = -7.538985060999222, (90, 1) = 2.4633323383202774, (90, 2) = -7.3030947650199955, (91, 1) = 2.435660225598683, (91, 2) = -7.067601252786613, (92, 1) = 2.407776753470986, (92, 2) = -6.8322757042522, (93, 1) = 2.379660658525142, (93, 2) = -6.59690256295987, (94, 1) = 2.3512907600058233, (94, 2) = -6.361258919987786, (95, 1) = 2.3226459265785855, (95, 2) = -6.1251103875231045, (96, 1) = 2.293705534146932, (96, 2) = -5.888209919491713, (97, 1) = 2.264450008190539, (97, 2) = -5.650295723583867, (98, 1) = 2.2348743168779803, (98, 2) = -5.4111914923081486, (99, 1) = 2.2051737248528798, (99, 2) = -5.172283622209372, (100, 1) = 2.17583738657371, (100, 2) = -4.937229804922309, (101, 1) = 2.1469084566347605, (101, 2) = -4.706035244109046, (102, 1) = 2.1183928671531187, (102, 2) = -4.478368789065424, (103, 1) = 2.090298680436436, (103, 2) = -4.253871611283983, (104, 1) = 2.062637371249721, (104, 2) = -4.032156660587268, (105, 1) = 2.0354256916943894, (105, 2) = -3.812810103274999, (106, 1) = 2.0086839641858134, (106, 2) = -3.5953604296843666, (107, 1) = 1.982440430772687, (107, 2) = -3.379291498088012, (108, 1) = 1.9567299468981632, (108, 2) = -3.1640031846243275, (109, 1) = 1.9315987904171668, (109, 2) = -2.9488131217385263, (110, 1) = 1.90710568533949, (110, 2) = -2.7329148766231843, (111, 1) = 1.8833262710134948, (111, 2) = -2.5153470973244274, (112, 1) = 1.8603588503339894, (112, 2) = -2.294949295598474, (113, 1) = 1.8383314042303163, (113, 2) = -2.0702924424068185, (114, 1) = 1.817412138903023, (114, 2) = -1.839587569353909, (115, 1) = 1.7978248787898543, (115, 2) = -1.600559568556263, (116, 1) = 1.7798711356935655, (116, 2) = -1.3502622211166015, (117, 1) = 1.763963185281574, (117, 2) = -1.0848103200422101, (118, 1) = 1.7506757021906965, (118, 2) = -.7990090369887971, (119, 1) = 1.7408255448851555, (119, 2) = -.4858210215775711, (120, 1) = 1.7356000930834823, (120, 2) = -.13568662798623501, (121, 1) = 1.736765562026282, (121, 2) = .2640804192804802, (122, 1) = 1.7470005348334907, (122, 2) = .7287233244901601, (123, 1) = 1.7701883209179174, (123, 2) = 1.2658292846577381, (124, 1) = 1.8071518462503395, (124, 2) = 1.7976303999609573, (125, 1) = 1.8556720762877739, (125, 2) = 2.2025007475300433, (126, 1) = 1.9105602217533053, (126, 2) = 2.2877562885792377, (127, 1) = 1.9612047634124612, (127, 2) = 1.8139958305815644, (128, 1) = 1.9925954032717297, (128, 2) = .7040111232714268, (129, 1) = 1.9925954056751198, (129, 2) = -.7040109350346981, (130, 1) = 1.9612047696396848, (130, 2) = -1.8139957173365475, (131, 1) = 1.9105602294964226, (131, 2) = -2.287756267663205, (132, 1) = 1.855672083763541, (132, 2) = -2.202500787900515, (133, 1) = 1.8071518523502108, (133, 2) = -1.7976304689619398, (134, 1) = 1.7701883252585813, (134, 2) = -1.2658293621623369, (135, 1) = 1.747000537150921, (135, 2) = -.7287233944999718, (136, 1) = 1.7367655628415017, (136, 2) = -.2640804788589072, (137, 1) = 1.7356000928289879, (137, 2) = .1356865758105073, (138, 1) = 1.7408255438725242, (138, 2) = .4858209759016318, (139, 1) = 1.7506757006156077, (139, 2) = .7990089952580139, (140, 1) = 1.7639631832878049, (140, 2) = 1.0848102821050365, (141, 1) = 1.7798711333745194, (141, 2) = 1.3502621854582824, (142, 1) = 1.7978248762196696, (142, 2) = 1.600559534758377, (143, 1) = 1.8174121361251319, (143, 2) = 1.8395875364259227, (144, 1) = 1.8383314012826037, (144, 2) = 2.0702924110591288, (145, 1) = 1.8603588472423433, (145, 2) = 2.294949264717166, (146, 1) = 1.8833262678026457, (146, 2) = 2.5153470671458207, (147, 1) = 1.9071056820325802, (147, 2) = 2.7329148466370925, (148, 1) = 1.9315987870236686, (148, 2) = 2.9488130917425766, (149, 1) = 1.9567299434167018, (149, 2) = 3.1640031545087486, (150, 1) = 1.9824404272037903, (150, 2) = 3.379291468729201, (151, 1) = 2.0086839605395936, (151, 2) = 3.5953603993348553, (152, 1) = 2.0354256879874106, (152, 2) = 3.812810073365731, (153, 1) = 2.062637367479104, (153, 2) = 4.0321566299589335, (154, 1) = 2.0902986765983758, (154, 2) = 4.253871580256697, (155, 1) = 2.118392863260354, (155, 2) = 4.478368757613599, (156, 1) = 2.1469084526936144, (156, 2) = 4.70603521310951, (157, 1) = 2.175837382566909, (157, 2) = 4.937229772383448, (158, 1) = 2.2051737207834075, (158, 2) = 5.172283590860779, (159, 1) = 2.2348743127922583, (159, 2) = 5.411191458744634, (160, 1) = 2.2644500041646727, (160, 2) = 5.650295690104134, (161, 1) = 2.2937055301846807, (161, 2) = 5.888209887887755, (162, 1) = 2.3226459226924674, (162, 2) = 6.1251103564798495, (163, 1) = 2.3512907561955467, (163, 2) = 6.361258888522481, (164, 1) = 2.3796606547873345, (164, 2) = 6.596902532692219, (165, 1) = 2.4077767498016844, (165, 2) = 6.832275673521365, (166, 1) = 2.435660221997729, (166, 2) = 7.067601221584761, (167, 1) = 2.463332334780739, (167, 2) = 7.303094734533151, (168, 1) = 2.490816471448168, (168, 2) = 7.53898503119106, (169, 1) = 2.5181338409954215, (169, 2) = 7.775480080904302, (170, 1) = 2.5453042872557936, (170, 2) = 8.012775265754804, (171, 1) = 2.5723480975870063, (171, 2) = 8.251070472146123, (172, 1) = 2.5992884478819875, (172, 2) = 8.490593445402647, (173, 1) = 2.6261436128033866, (173, 2) = 8.731531903994723, (174, 1) = 2.652932782626758, (174, 2) = 8.97408546295497, (175, 1) = 2.679677709854055, (175, 2) = 9.218481985306092, (176, 1) = 2.7063952328267518, (176, 2) = 9.464910199685786, (177, 1) = 2.7331058240418673, (177, 2) = 9.713598308240536, (178, 1) = 2.7598273951286862, (178, 2) = 9.964757740576728, (179, 1) = 2.786578319164531, (179, 2) = 10.218611547251097, (180, 1) = 2.813377039715548, (180, 2) = 10.475391505047558, (181, 1) = 2.840241495490389, (181, 2) = 10.735333231766598, (182, 1) = 2.8671893440509666, (182, 2) = 10.99867886771885, (183, 1) = 2.8942390936057563, (183, 2) = 11.26568885657173, (184, 1) = 2.921407341841214, (184, 2) = 11.536615508966532, (185, 1) = 2.948713552731732, (185, 2) = 11.811751185006424, (186, 1) = 2.976173340196842, (186, 2) = 12.091361959778359, (187, 1) = 3.003807249950244, (187, 2) = 12.375777335510161, (188, 1) = 3.031630369558518, (188, 2) = 12.665285319531382, (189, 1) = 3.0596638558915292, (189, 2) = 12.960252390051474, (190, 1) = 3.087923724878711, (190, 2) = 13.261008317004979, (191, 1) = 3.116429877855737, (191, 2) = 13.567942140361016, (192, 1) = 3.1452019187126066, (192, 2) = 13.88146022312268, (193, 1) = 3.174256416366404, (193, 2) = 14.201957328628339, (194, 1) = 3.203618029300584, (194, 2) = 14.529941381548007, (195, 1) = 3.233301133512497, (195, 2) = 14.865831959900095, (196, 1) = 3.2633328013174117, (196, 2) = 15.210220137300256, (197, 1) = 3.293730371934068, (197, 2) = 15.563618149340185, (198, 1) = 3.324516727923597, (198, 2) = 15.926635730295361, (199, 1) = 3.355718344955579, (199, 2) = 16.299964094964025, (200, 1) = 3.3873527184670316, (200, 2) = 16.684228740467564, (201, 1) = 3.419452644495199, (201, 2) = 17.080286540184286, (202, 1) = 3.452038936023861, (202, 2) = 17.48889997104073, (203, 1) = 3.4851391997638705, (203, 2) = 17.91097084002699, (204, 1) = 3.518787007595249, (204, 2) = 18.347541636478987, (205, 1) = 3.5530048246636516, (205, 2) = 18.799580647298527, (206, 1) = 3.5878322591378202, (206, 2) = 19.268358446676956, (207, 1) = 3.6233001413972294, (207, 2) = 19.755117615869175, (208, 1) = 3.6594403163130003, (208, 2) = 20.261207471088934, (209, 1) = 3.6962994158992246, (209, 2) = 20.788292629078093, (210, 1) = 3.733910826968825, (210, 2) = 21.337971563392305, (211, 1) = 3.772320000996824, (211, 2) = 21.912148706412534, (212, 1) = 3.8115778468489965, (212, 2) = 22.51296460441515, (213, 1) = 3.851726363332059, (213, 2) = 23.142591934457023, (214, 1) = 3.8928267372315797, (214, 2) = 23.803690911862482, (215, 1) = 3.934935930441873, (215, 2) = 24.499074151615474, (216, 1) = 3.978110857651852, (216, 2) = 25.231789480065938, (217, 1) = 4.022428992375078, (217, 2) = 26.005505178977995, (218, 1) = 4.0679599734355065, (218, 2) = 26.824068719118205, (219, 1) = 4.114781571285711, (219, 2) = 27.6918144881913, (220, 1) = 4.162990999115868, (220, 2) = 28.613836852058945, (221, 1) = 4.21267875197291, (221, 2) = 29.59556085655894, (222, 1) = 4.263951397940499, (222, 2) = 30.643234815437413, (223, 1) = 4.316933037240854, (223, 2) = 31.76406282895504, (224, 1) = 4.371746001472759, (224, 2) = 32.96589407146075, (225, 1) = 4.428537177892839, (225, 2) = 34.25788681492983, (226, 1) = 4.487469831432685, (226, 2) = 35.65048601879827, (227, 1) = 4.548714273764117, (227, 2) = 37.15534885284654, (228, 1) = 4.612474705197783, (228, 2) = 38.78617503669962, (229, 1) = 4.678974377813236, (229, 2) = 40.55859331572982, (230, 1) = 4.7484562348806385, (230, 2) = 42.49042323841533, (231, 1) = 4.8212091794085215, (231, 2) = 44.602732223421526, (232, 1) = 4.897550681391886, (232, 2) = 46.919783931576994, (233, 1) = 4.977836258214376, (233, 2) = 49.46978253948843, (234, 1) = 5.062486398380529, (234, 2) = 52.286357069382106, (235, 1) = 5.151970328113153, (235, 2) = 55.4088549802804, (236, 1) = 5.246825135949528, (236, 2) = 58.88393116379276, (237, 1) = 5.347686386243535, (237, 2) = 62.767945223547635, (238, 1) = 5.45527811128566, (238, 2) = 67.12825372875328, (239, 1) = 5.570445900590808, (239, 2) = 72.04656744895523, (240, 1) = 5.694198331847795, (240, 2) = 77.62352962526896, (241, 1) = 5.827713141100247, (241, 2) = 83.98275527140292, (242, 1) = 5.97239695109456, (242, 2) = 91.2785511743751, (243, 1) = 6.129955753954183, (243, 2) = 99.70639344239785, (244, 1) = 6.302442716859202, (244, 2) = 109.5151389785495, (245, 1) = 6.492381621232821, (245, 2) = 121.0275080010818, (246, 1) = 6.702920345468326, (246, 2) = 134.66931185772873, (247, 1) = 6.938000089073476, (247, 2) = 151.00999336614797, (248, 1) = 7.20266746245575, (248, 2) = 170.82915130447523, (249, 1) = 7.503505629494219, (249, 2) = 195.22011290049133, (250, 1) = 7.849239600963847, (250, 2) = 225.75521776054381, (251, 1) = 8.251774119315153, (251, 2) = 264.77471370518674, (252, 1) = 8.727840810952246, (252, 2) = 315.9004030601857, (253, 1) = 9.30177210389072, (253, 2) = 385.0044437469404, (254, 1) = 10.010693558249125, (254, 2) = 482.2028777737413, (255, 1) = 10.914658448521092, (255, 2) = 626.3138715247973, (256, 1) = 12.118672763119722, (256, 2) = 856.1325139105058}, 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(256, {(1) = -.615479708670389, (2) = -.6138337655059911, (3) = -.6121877371363221, (4) = -.610541623152404, (5) = -.6088953251908921, (6) = -.6072487671472097, (7) = -.6056019471744036, (8) = -.6039547492398832, (9) = -.6023071028585135, (10) = -.600659003239894, (11) = -.5990103110283401, (12) = -.5973609594036162, (13) = -.5957109382804167, (14) = -.5940600787075152, (15) = -.592408316893275, (16) = -.5907556337655888, (17) = -.589101824521824, (18) = -.5874468288606902, (19) = -.585790613017156, (20) = -.5841329309576447, (21) = -.5824737271461466, (22) = -.5808129444592497, (23) = -.5791502923727325, (24) = -.5774857217781857, (25) = -.5758191392268837, (26) = -.5741502104173669, (27) = -.5724788940395652, (28) = -.5708050411421474, (29) = -.5691282811123882, (30) = -.5674485804227406, (31) = -.5657657065322664, (32) = -.5640792708720453, (33) = -.5623892445543703, (34) = -.5606952706775499, (35) = -.5589969780179599, (36) = -.5572943246689157, (37) = -.555586796800204, (38) = -.5538740753768657, (39) = -.5521560662027295, (40) = -.5504321023790923, (41) = -.5487019283191328, (42) = -.5469653407777109, (43) = -.5452215561139513, (44) = -.5434703809718867, (45) = -.5417114118674226, (46) = -.5399438369309824, (47) = -.5381675001638607, (48) = -.5363816612793244, (49) = -.5345856438064434, (50) = -.5327791976962112, (51) = -.5309612570931616, (52) = -.5291313415384594, (53) = -.5272888957313684, (54) = -.525432745213056, (55) = -.523562514992632, (56) = -.5216770864410629, (57) = -.5197755400848111, (58) = -.5178572425620112, (59) = -.515920711401875, (60) = -.5139652765527121, (61) = -.5119895907876776, (62) = -.5099924034933055, (63) = -.5079727160294226, (64) = -.5059287438667803, (65) = -.5038594483715606, (66) = -.5017629397592426, (67) = -.4996377699518008, (68) = -.49748213518145645, (69) = -.49529405774722146, (70) = -.49307171190353477, (71) = -.4908127037482733, (72) = -.48851496049995186, (73) = -.48617577893132347, (74) = -.4837926795108566, (75) = -.48136264479140517, (76) = -.4788826875598093, (77) = -.47634940862604525, (78) = -.4737592248726671, (79) = -.47110824288051906, (80) = -.46839220670201365, (81) = -.46560652263193936, (82) = -.4627462688840759, (83) = -.45980582730548547, (84) = -.4567795100866846, (85) = -.4536605585746382, (86) = -.45044190982538507, (87) = -.44711596396700165, (88) = -.4436737732409932, (89) = -.44010588450370247, (90) = -.43640194597493315, (91) = -.4325503265005061, (92) = -.4285378041296347, (93) = -.4243499633478024, (94) = -.41997068666716125, (95) = -.415381857195644, (96) = -.41056307352817695, (97) = -.4054913072194831, (98) = -.40014286075850014, (99) = -.3945291762613631, (100) = -.3887243469845279, (101) = -.38272333283023513, (102) = -.37651248996445524, (103) = -.3700765357249298, (104) = -.3633984542976641, (105) = -.35645951516908386, (106) = -.3492382879874373, (107) = -.3417110407352021, (108) = -.33385046669876445, (109) = -.32562584741600087, (110) = -.3170017781423065, (111) = -.3079373927769954, (112) = -.29838534976786646, (113) = -.28829018526282596, (114) = -.2775863529897709, (115) = -.26619576640273657, (116) = -.25402428090287404, (117) = -.24095674999268518, (118) = -.22685076083627745, (119) = -.21152693593807945, (120) = -.19475483127449672, (121) = -.17623202423500914, (122) = -.15554979660920581, (123) = -.13228994492398807, (124) = -.1082372279662562, (125) = -0.8418451100852434e-1, (126) = -0.6013179405079247e-1, (127) = -0.360790770930606e-1, (128) = -0.12026360135328736e-1, (129) = 0.1202635682240313e-1, (130) = 0.36079073780135e-1, (131) = 0.6013179073786687e-1, (132) = 0.8418450769559874e-1, (133) = .1082372246533306, (134) = .13228994161106247, (135) = .15554979358804727, (136) = .17623202154579037, (137) = .1947548288517443, (138) = .21152693373373746, (139) = .22685075881419176, (140) = .24095674812499612, (141) = .25402427916759346, (142) = .266195764782475, (143) = .2775863514700435, (144) = .2882901838320805, (145) = .298385348416205, (146) = .30793739149611127, (147) = .31700177692513, (148) = .32562584625647806, (149) = .3338504655917917, (150) = .3417110396761509, (151) = .34923828697230785, (152) = .3564595141944389, (153) = .3633984533603477, (154) = .37007653482219466, (155) = .37651248909388624, (156) = .3827233319895611, (157) = .3887243461717439, (158) = .39452917547476085, (159) = .4001428600026771, (160) = .40549130650739146, (161) = .410563072857691, (162) = .4153818565630173, (163) = .4199706860690814, (164) = .4243499627813222, (165) = .42853780359211907, (166) = .4325503259895911, (167) = .4364019454885977, (168) = .44010588404014256, (169) = .4436737727984631, (170) = .447115963543925, (171) = .45044190942046414, (172) = .453660558186639, (173) = .45677950971441716, (174) = .4598058269479823, (175) = .46274626854038836, (176) = .4656065223011885, (177) = .468392206383466, (178) = .47110824257342615, (179) = .4737592245763975, (180) = .4763494083399846, (181) = .4788826872834117, (182) = .48136264452415733, (183) = .4837926792522918, (184) = .48617577868100653, (185) = .4885149602574814, (186) = .49081270351328304, (187) = .49307171167567043, (188) = .4952940575261847, (189) = .4974821349669204, (190) = .4996377697435383, (191) = .5017629395569352, (192) = .5038594481750222, (193) = .5059287436757538, (194) = .5079727158437204, (195) = .5099924033127412, (196) = .5119895906120454, (197) = .5139652763818926, (198) = .5159207112356502, (199) = .517857242400274, (200) = .5197755399274191, (201) = .5216770862878711, (202) = .5235625148435622, (203) = .5254327450679438, (204) = .527288895590138, (205) = .529131341401021, (206) = .5309612569593932, (207) = .5327791975660613, (208) = .5345856436798079, (209) = .5363816611561303, (210) = .5381675000440663, (211) = .5399438368144777, (212) = .5417114117541697, (213) = .5434703808618371, (214) = .5452215560070248, (215) = .5469653406738793, (216) = .5487019282183432, (217) = .550432102281291, (218) = .5521560661078934, (219) = .5538740752849417, (220) = .5555867967111572, (221) = .5572943245827272, (222) = .5589969779345795, (223) = .5606952705969559, (224) = .5623892444765469, (225) = .5640792707969473, (226) = .5657657064598809, (227) = .567448580353051, (228) = .5691282810453618, (229) = .5708050410777735, (230) = .572478893977828, (231) = .5741502103582431, (232) = .5758191391703643, (233) = .5774857217242565, (234) = .5791502923213769, (235) = .5808129444104603, (236) = .5824737270999113, (237) = .5841329309139516, (238) = .5857906129759993, (239) = .5874468288220598, (240) = .5891018244857117, (241) = .5907556337319899, (242) = .592408316862182, (243) = .5940600786789219, (244) = .59571093825432, (245) = .597360959380009, (246) = .5990103110072196, (247) = .6006590032212563, (248) = .602307102842355, (249) = .6039547492262015, (250) = .605601947163196, (251) = .6072487671384748, (252) = .60889532518463, (253) = .6105416231486125, (254) = .6121877371346346, (255) = .6138337655055719, (256) = .615479708670389}, datatype = float[8], order = C_order); Y := Matrix(256, 2, {(1, 1) = .0, (1, 2) = 0.8533209791759556e-8, (2, 1) = 0.2515757323757251e-10, (2, 2) = 0.4356551964865028e-8, (3, 1) = 0.34487300349660374e-10, (3, 2) = 0.525825041510047e-8, (4, 1) = 0.4265633390260554e-10, (4, 2) = 0.4300179557821988e-8, (5, 1) = 0.4988853704975202e-10, (5, 2) = 0.46849561392692534e-8, (6, 1) = 0.5728983001630832e-10, (6, 2) = 0.4143633727994945e-8, (7, 1) = 0.6307058723556879e-10, (7, 2) = 0.30236483071126253e-8, (8, 1) = 0.6790288105801636e-10, (8, 2) = 0.29093982078393968e-8, (9, 1) = 0.7243318083872604e-10, (9, 2) = 0.2700903327376346e-8, (10, 1) = 0.76580091870178e-10, (10, 2) = 0.2422176533714323e-8, (11, 1) = 0.8028890421734465e-10, (11, 2) = 0.2028541175103088e-8, (12, 1) = 0.8354468676961248e-10, (12, 2) = 0.1937217968543841e-8, (13, 1) = 0.8649880027565613e-10, (13, 2) = 0.19333251286020524e-8, (14, 1) = 0.8940574977937043e-10, (14, 2) = 0.15160168692251884e-8, (15, 1) = 0.9188996181735388e-10, (15, 2) = 0.14735088369968248e-8, (16, 1) = 0.94191117130654e-10, (16, 2) = 0.12464816363704922e-8, (17, 1) = 0.9608714028928409e-10, (17, 2) = 0.10701622963881223e-8, (18, 1) = 0.9778104342513735e-10, (18, 2) = 0.10355020831958881e-8, (19, 1) = 0.995312239784579e-10, (19, 2) = 0.11078766659246384e-8, (20, 1) = 0.1013453521158331e-9, (20, 2) = 0.1083658467695548e-8, (21, 1) = 0.10309953045416797e-9, (21, 2) = 0.10535526325129998e-8, (22, 1) = 0.10479713163700592e-9, (22, 2) = 0.992013466494286e-9, (23, 1) = 0.10634813939614454e-9, (23, 2) = 0.8776230623788009e-9, (24, 1) = 0.10780270752166236e-9, (24, 2) = 0.8550369122887483e-9, (25, 1) = 0.10920504567861329e-9, (25, 2) = 0.8325755861906453e-9, (26, 1) = 0.11057896533563346e-9, (26, 2) = 0.8048675790133986e-9, (27, 1) = 0.11186527637729964e-9, (27, 2) = 0.7311835551613507e-9, (28, 1) = 0.11306972696613881e-9, (28, 2) = 0.7174220162605665e-9, (29, 1) = 0.114241975814458e-9, (29, 2) = 0.6954835347434e-9, (30, 1) = 0.11538830493187237e-9, (30, 2) = 0.6610366432857858e-9, (31, 1) = 0.11647099035164286e-9, (31, 2) = 0.6279944335675904e-9, (32, 1) = 0.1175132136689262e-9, (32, 2) = 0.6017917330130252e-9, (33, 1) = 0.1185154233592643e-9, (33, 2) = 0.5843873150224554e-9, (34, 1) = 0.1194866873619044e-9, (34, 2) = 0.5666029624070781e-9, (35, 1) = 0.12042797575658022e-9, (35, 2) = 0.5427394686070348e-9, (36, 1) = 0.1213517772657336e-9, (36, 2) = 0.533817435701165e-9, (37, 1) = 0.1222434720949681e-9, (37, 2) = 0.5092851838180783e-9, (38, 1) = 0.12310746546416638e-9, (38, 2) = 0.4978478528210585e-9, (39, 1) = 0.12395036604488718e-9, (39, 2) = 0.4867831881419308e-9, (40, 1) = 0.12477556518360088e-9, (40, 2) = 0.4697596147168694e-9, (41, 1) = 0.12557596890396535e-9, (41, 2) = 0.4560973949558534e-9, (42, 1) = 0.12635223166548033e-9, (42, 2) = 0.4384167451074847e-9, (43, 1) = 0.12711048298775955e-9, (43, 2) = 0.42889083667410355e-9, (44, 1) = 0.12784357476013238e-9, (44, 2) = 0.4119707573609822e-9, (45, 1) = 0.1285622377721097e-9, (45, 2) = 0.40264378399466534e-9, (46, 1) = 0.1292654468525978e-9, (46, 2) = 0.3937181789726958e-9, (47, 1) = 0.12995190868382547e-9, (47, 2) = 0.37918695824490137e-9, (48, 1) = 0.13062141755191356e-9, (48, 2) = 0.36999453909164137e-9, (49, 1) = 0.1312745259721413e-9, (49, 2) = 0.35771019643951154e-9, (50, 1) = 0.13190807791967123e-9, (50, 2) = 0.3443269891615897e-9, (51, 1) = 0.13252185128472693e-9, (51, 2) = 0.33176557536651465e-9, (52, 1) = 0.1331180960014748e-9, (52, 2) = 0.3212118788057865e-9, (53, 1) = 0.13370236815669886e-9, (53, 2) = 0.3111193758209748e-9, (54, 1) = 0.13427204157307295e-9, (54, 2) = 0.30277681741409533e-9, (55, 1) = 0.13482653489180127e-9, (55, 2) = 0.2922613770147601e-9, (56, 1) = 0.13536766963057763e-9, (56, 2) = 0.28198904643355514e-9, (57, 1) = 0.1358964506924581e-9, (57, 2) = 0.27386238593340363e-9, (58, 1) = 0.1364134547181195e-9, (58, 2) = 0.2651859801404068e-9, (59, 1) = 0.13691614481077628e-9, (59, 2) = 0.25510936018178266e-9, (60, 1) = 0.13740755121065104e-9, (60, 2) = 0.24591100303415436e-9, (61, 1) = 0.13788371502415191e-9, (61, 2) = 0.23685557662997546e-9, (62, 1) = 0.13834613546571035e-9, (62, 2) = 0.22758093709326893e-9, (63, 1) = 0.13879784522669758e-9, (63, 2) = 0.21877381995516132e-9, (64, 1) = 0.13923830785402788e-9, (64, 2) = 0.21128479486672138e-9, (65, 1) = 0.13966809857585072e-9, (65, 2) = 0.20471201164945568e-9, (66, 1) = 0.14008937522193296e-9, (66, 2) = 0.19783055046383375e-9, (67, 1) = 0.1405016184519593e-9, (67, 2) = 0.19071812054967575e-9, (68, 1) = 0.1409071100587197e-9, (68, 2) = 0.1842265135512411e-9, (69, 1) = 0.1413022639152057e-9, (69, 2) = 0.17789960734136491e-9, (70, 1) = 0.1416899226561393e-9, (70, 2) = 0.17144994213865875e-9, (71, 1) = 0.1420699405013175e-9, (71, 2) = 0.164915689054326e-9, (72, 1) = 0.14243926274373202e-9, (72, 2) = 0.15866152671510735e-9, (73, 1) = 0.14280639976899333e-9, (73, 2) = 0.15293914367398265e-9, (74, 1) = 0.14316234571407876e-9, (74, 2) = 0.14685924245240502e-9, (75, 1) = 0.14351203546155605e-9, (75, 2) = 0.1412064630772625e-9, (76, 1) = 0.1438541126905857e-9, (76, 2) = 0.13575632008985076e-9, (77, 1) = 0.14419172348317513e-9, (77, 2) = 0.13012146020690178e-9, (78, 1) = 0.14452217768309184e-9, (78, 2) = 0.12514475784613361e-9, (79, 1) = 0.14484753401719306e-9, (79, 2) = 0.12009099118924156e-9, (80, 1) = 0.14516719020474276e-9, (80, 2) = 0.11572049149876656e-9, (81, 1) = 0.1454837130366016e-9, (81, 2) = 0.11108637455442516e-9, (82, 1) = 0.14579553072933421e-9, (82, 2) = 0.10673352377294384e-9, (83, 1) = 0.1461006569840346e-9, (83, 2) = 0.10253354850619121e-9, (84, 1) = 0.14640548028592156e-9, (84, 2) = 0.9867791693628079e-10, (85, 1) = 0.14670626925167535e-9, (85, 2) = 0.9480687017503295e-10, (86, 1) = 0.14700583774830916e-9, (86, 2) = 0.9116116554923188e-10, (87, 1) = 0.1473049909397681e-9, (87, 2) = 0.877869966247201e-10, (88, 1) = 0.14760041098065547e-9, (88, 2) = 0.8464332937873904e-10, (89, 1) = 0.14789678566760437e-9, (89, 2) = 0.8140568540627396e-10, (90, 1) = 0.14819354000131068e-9, (90, 2) = 0.785731969475988e-10, (91, 1) = 0.14848991857465053e-9, (91, 2) = 0.757538450054471e-10, (92, 1) = 0.14878614045810977e-9, (92, 2) = 0.728059451158104e-10, (93, 1) = 0.14908555521160818e-9, (93, 2) = 0.7019108639773054e-10, (94, 1) = 0.14938803263731448e-9, (94, 2) = 0.6785871182608248e-10, (95, 1) = 0.14969571742819318e-9, (95, 2) = 0.6570314850552941e-10, (96, 1) = 0.15000665939816954e-9, (96, 2) = 0.6352981747903578e-10, (97, 1) = 0.1503233008628134e-9, (97, 2) = 0.6158620340441397e-10, (98, 1) = 0.1506454071567134e-9, (98, 2) = 0.600381866160094e-10, (99, 1) = 0.15098072954172405e-9, (99, 2) = 0.5876284495690779e-10, (100, 1) = 0.15131649362842804e-9, (100, 2) = 0.5785943062479622e-10, (101, 1) = 0.15166192024147255e-9, (101, 2) = 0.56983333902370786e-10, (102, 1) = 0.15201436806502833e-9, (102, 2) = 0.5663095967493995e-10, (103, 1) = 0.15237897517143947e-9, (103, 2) = 0.5675181383907271e-10, (104, 1) = 0.1527591712687427e-9, (104, 2) = 0.571542042713807e-10, (105, 1) = 0.153157231138773e-9, (105, 2) = 0.5779159951216207e-10, (106, 1) = 0.1535781995858007e-9, (106, 2) = 0.586881870917977e-10, (107, 1) = 0.15402308422391518e-9, (107, 2) = 0.6008035467798718e-10, (108, 1) = 0.1545014981960464e-9, (108, 2) = 0.6190903717956632e-10, (109, 1) = 0.1550226837737758e-9, (109, 2) = 0.6476364397730228e-10, (110, 1) = 0.15559148248518069e-9, (110, 2) = 0.6792728304923652e-10, (111, 1) = 0.15622732478860817e-9, (111, 2) = 0.7194894745539503e-10, (112, 1) = 0.15693747841982744e-9, (112, 2) = 0.7716184891982996e-10, (113, 1) = 0.15774343430632953e-9, (113, 2) = 0.8252894580087552e-10, (114, 1) = 0.1586626817554741e-9, (114, 2) = 0.8929058072254165e-10, (115, 1) = 0.1597251472433548e-9, (115, 2) = 0.975779133032407e-10, (116, 1) = 0.16096810637633238e-9, (116, 2) = 0.10713680678622781e-9, (117, 1) = 0.1624429732592064e-9, (117, 2) = 0.11829097937170303e-9, (118, 1) = 0.16421336863872674e-9, (118, 2) = 0.13343486818052482e-9, (119, 1) = 0.16640896558606782e-9, (119, 2) = 0.15438857743483395e-9, (120, 1) = 0.16920151692285782e-9, (120, 2) = 0.1799616287504575e-9, (121, 1) = 0.17287160288238618e-9, (121, 2) = 0.21739907195856502e-9, (122, 1) = 0.17778606270230984e-9, (122, 2) = 0.25840880287087396e-9, (123, 1) = 0.18447361064235885e-9, (123, 2) = 0.3154496892435486e-9, (124, 1) = 0.1928360460924727e-9, (124, 2) = 0.3678535668156288e-9, (125, 1) = 0.20275029947602662e-9, (125, 2) = 0.41267939176723456e-9, (126, 1) = 0.21259514620726693e-9, (126, 2) = 0.4514839327908819e-9, (127, 1) = 0.22206027873003437e-9, (127, 2) = 0.4652297617979372e-9, (128, 1) = 0.23103712682809456e-9, (128, 2) = 0.31458807900491405e-9, (129, 1) = 0.2413306468022318e-9, (129, 2) = 0.6146587943674196e-10, (130, 1) = 0.2374287319323687e-9, (130, 2) = -0.30248189102626667e-9, (131, 1) = 0.2281609004219964e-9, (131, 2) = -0.30838216198109124e-9, (132, 1) = 0.2187852801390259e-9, (132, 2) = -0.402643686064273e-9, (133, 1) = 0.20975781391329893e-9, (133, 2) = -0.3424746729205818e-9, (134, 1) = 0.20193562825995716e-9, (134, 2) = -0.34302491728505056e-9, (135, 1) = 0.19511756259532778e-9, (135, 2) = -0.2600189428793413e-9, (136, 1) = 0.18997659135865887e-9, (136, 2) = -0.2381569246329007e-9, (137, 1) = 0.18583894665214568e-9, (137, 2) = -0.18442974701411756e-9, (138, 1) = 0.18305922391915463e-9, (138, 2) = -0.14557853726221435e-9, (139, 1) = 0.18128284098517307e-9, (139, 2) = -0.8475523914546887e-10, (140, 1) = 0.18024608090837897e-9, (140, 2) = -0.6195245125227817e-10, (141, 1) = 0.17960816573837288e-9, (141, 2) = -0.32183825802087174e-10, (142, 1) = 0.17928086801377931e-9, (142, 2) = -0.3483505765024703e-10, (143, 1) = 0.17885351981472387e-9, (143, 2) = -0.34642142700136435e-10, (144, 1) = 0.1785542767244914e-9, (144, 2) = -0.21247896908335142e-10, (145, 1) = 0.17835793799213866e-9, (145, 2) = -0.11726685256897583e-10, (146, 1) = 0.1782680090867723e-9, (146, 2) = -0.11846396144205788e-10, (147, 1) = 0.17809907125905989e-9, (147, 2) = -0.30113614350165256e-10, (148, 1) = 0.17775054007955077e-9, (148, 2) = -0.4448148153058412e-10, (149, 1) = 0.17745595476712513e-9, (149, 2) = -0.268232131621915e-10, (150, 1) = 0.17738478724675014e-9, (150, 2) = 0.5478830046701785e-12, (151, 1) = 0.17738287754576913e-9, (151, 2) = 0.11752989133877892e-11, (152, 1) = 0.1773921433654561e-9, (152, 2) = -0.18415148066836067e-11, (153, 1) = 0.17736395967643572e-9, (153, 2) = 0.8201885316581704e-11, (154, 1) = 0.17748056023622617e-9, (154, 2) = 0.3157732758383743e-10, (155, 1) = 0.17761833634956764e-9, (155, 2) = 0.7303620199416457e-11, (156, 1) = 0.17755960451328362e-9, (156, 2) = -0.19645726102606908e-10, (157, 1) = 0.177490111160808e-9, (157, 2) = -0.6183092036826337e-11, (158, 1) = 0.1774860683177954e-9, (158, 2) = 0.13791199685361597e-10, (159, 1) = 0.17751007347546954e-9, (159, 2) = -0.1123658997823074e-11, (160, 1) = 0.17755374685089973e-9, (160, 2) = 0.9530905723236285e-11, (161, 1) = 0.17761328418355242e-9, (161, 2) = 0.3180032599835407e-10, (162, 1) = 0.1777804158043923e-9, (162, 2) = 0.3172129721923157e-10, (163, 1) = 0.1778891010668955e-9, (163, 2) = 0.1099360055708356e-10, (164, 1) = 0.17792174263627237e-9, (164, 2) = 0.6336900942903055e-11, (165, 1) = 0.17794532741586075e-9, (165, 2) = -0.8106825689249755e-11, (166, 1) = 0.1778612875625986e-9, (166, 2) = -0.317027679655097e-10, (167, 1) = 0.17772309218802811e-9, (167, 2) = -0.3604394611146823e-10, (168, 1) = 0.17753472151607115e-9, (168, 2) = -0.6067263218178792e-10, (169, 1) = 0.17734845788383116e-9, (169, 2) = -0.4301974601090625e-10, (170, 1) = 0.17717180728423692e-9, (170, 2) = -0.708673230717158e-10, (171, 1) = 0.17692909330780661e-9, (171, 2) = -0.7545885488672684e-10, (172, 1) = 0.17669107524190348e-9, (172, 2) = -0.7867451609850719e-10, (173, 1) = 0.17643592864261849e-9, (173, 2) = -0.8467122173832023e-10, (174, 1) = 0.1761626497964295e-9, (174, 2) = -0.10066116960930594e-9, (175, 1) = 0.17585144912895112e-9, (175, 2) = -0.10327533854387069e-9, (176, 1) = 0.17559282130767614e-9, (176, 2) = -0.8564068029823272e-10, (177, 1) = 0.17534767245626483e-9, (177, 2) = -0.9542740414368665e-10, (178, 1) = 0.175070872955065e-9, (178, 2) = -0.11141432025269159e-9, (179, 1) = 0.17472941681676618e-9, (179, 2) = -0.14401924343592074e-9, (180, 1) = 0.17434902748177944e-9, (180, 2) = -0.1374002367609609e-9, (181, 1) = 0.17397684310674838e-9, (181, 2) = -0.1514042023397739e-9, (182, 1) = 0.17359120757281704e-9, (182, 2) = -0.16687656138220841e-9, (183, 1) = 0.17313170857768555e-9, (183, 2) = -0.23765838734579775e-9, (184, 1) = 0.17253760117550773e-9, (184, 2) = -0.24804556507332825e-9, (185, 1) = 0.17197121854554688e-9, (185, 2) = -0.2478784774481122e-9, (186, 1) = 0.17140649552311378e-9, (186, 2) = -0.2248214763691401e-9, (187, 1) = 0.1709007043634424e-9, (187, 2) = -0.21100426153256604e-9, (188, 1) = 0.17042119686362235e-9, (188, 2) = -0.22494646702043228e-9, (189, 1) = 0.1698666780630662e-9, (189, 2) = -0.26753020861153144e-9, (190, 1) = 0.16928851840810036e-9, (190, 2) = -0.27526462995618593e-9, (191, 1) = 0.16872313536551076e-9, (191, 2) = -0.23658036064141335e-9, (192, 1) = 0.16824929688132656e-9, (192, 2) = -0.21785942537103216e-9, (193, 1) = 0.16780275183295847e-9, (193, 2) = -0.223064601469443e-9, (194, 1) = 0.16733906322733267e-9, (194, 2) = -0.2333692724310377e-9, (195, 1) = 0.16684008695267043e-9, (195, 2) = -0.2488801839151861e-9, (196, 1) = 0.16629562418352343e-9, (196, 2) = -0.29060115832163023e-9, (197, 1) = 0.1657485834859793e-9, (197, 2) = -0.25797855795615506e-9, (198, 1) = 0.16520385651821047e-9, (198, 2) = -0.28414245587093825e-9, (199, 1) = 0.16466234222347776e-9, (199, 2) = -0.26368827638414005e-9, (200, 1) = 0.16412831346804377e-9, (200, 2) = -0.2870411840885671e-9, (201, 1) = 0.16354950240127468e-9, (201, 2) = -0.30250781772573616e-9, (202, 1) = 0.1629334785707865e-9, (202, 2) = -0.36372184795261004e-9, (203, 1) = 0.16220060507478054e-9, (203, 2) = -0.38253906582633955e-9, (204, 1) = 0.1614337287419683e-9, (204, 2) = -0.4276495439190967e-9, (205, 1) = 0.16066818900676244e-9, (205, 2) = -0.40053038297561614e-9, (206, 1) = 0.1599513556001602e-9, (206, 2) = -0.395359534420508e-9, (207, 1) = 0.15922068345809328e-9, (207, 2) = -0.39003522154398776e-9, (208, 1) = 0.1584609126564144e-9, (208, 2) = -0.4486345987496402e-9, (209, 1) = 0.15764683019649017e-9, (209, 2) = -0.4673923746733245e-9, (210, 1) = 0.15679112151539502e-9, (210, 2) = -0.4688996721738172e-9, (211, 1) = 0.15595536017878682e-9, (211, 2) = -0.4788288367557785e-9, (212, 1) = 0.1550571038741057e-9, (212, 2) = -0.521898153737371e-9, (213, 1) = 0.15411959786796268e-9, (213, 2) = -0.5799873583276121e-9, (214, 1) = 0.15304138755347932e-9, (214, 2) = -0.6121049187787375e-9, (215, 1) = 0.15189795105220422e-9, (215, 2) = -0.7852360392693309e-9, (216, 1) = 0.15051718370584743e-9, (216, 2) = -0.7608401197568743e-9, (217, 1) = 0.14928155823030808e-9, (217, 2) = -0.718566229861273e-9, (218, 1) = 0.148017034735096e-9, (218, 2) = -0.7194579006760514e-9, (219, 1) = 0.14668417201808262e-9, (219, 2) = -0.8162091653252132e-9, (220, 1) = 0.14529092928060384e-9, (220, 2) = -0.7978579564310519e-9, (221, 1) = 0.14401410981433506e-9, (221, 2) = -0.7109197028545267e-9, (222, 1) = 0.14276148999897797e-9, (222, 2) = -0.8090086191747477e-9, (223, 1) = 0.1412293570053859e-9, (223, 2) = -0.10635261275332528e-8, (224, 1) = 0.1391633809659182e-9, (224, 2) = -0.1362658237052821e-8, (225, 1) = 0.13694246057394117e-9, (225, 2) = -0.12821506674772723e-8, (226, 1) = 0.13459809812027737e-9, (226, 2) = -0.1429939547251233e-8, (227, 1) = 0.132116701753709e-9, (227, 2) = -0.14602024092596638e-8, (228, 1) = 0.1296429147756651e-9, (228, 2) = -0.14848924130649073e-8, (229, 1) = 0.12670420482086657e-9, (229, 2) = -0.2024453530929389e-8, (230, 1) = 0.12359835382786773e-9, (230, 2) = -0.1710735271459598e-8, (231, 1) = 0.12104337913465696e-9, (231, 2) = -0.13854753794763311e-8, (232, 1) = 0.11878109025322994e-9, (232, 2) = -0.1280303923506126e-8, (233, 1) = 0.11669352532796897e-9, (233, 2) = -0.12544804052904891e-8, (234, 1) = 0.11444825006914873e-9, (234, 2) = -0.12984328101201121e-8, (235, 1) = 0.112579974860406e-9, (235, 2) = -0.10689472820984925e-8, (236, 1) = 0.1107091287309365e-9, (236, 2) = -0.1191109641758e-8, (237, 1) = 0.10865889457517803e-9, (237, 2) = -0.11486201657441699e-8, (238, 1) = 0.10626671818473344e-9, (238, 2) = -0.1925202629706879e-8, (239, 1) = 0.1030482856977682e-9, (239, 2) = -0.2018461401541499e-8, (240, 1) = 0.996347364950553e-10, (240, 2) = -0.19260738928663375e-8, (241, 1) = 0.9704899492491931e-10, (241, 2) = -0.15481075300795087e-8, (242, 1) = 0.9437332145766142e-10, (242, 2) = -0.184909221290761e-8, (243, 1) = 0.908939520489789e-10, (243, 2) = -0.2231650328894203e-8, (244, 1) = 0.8732950679214938e-10, (244, 2) = -0.21204959301359874e-8, (245, 1) = 0.8359287719772462e-10, (245, 2) = -0.2352542644486656e-8, (246, 1) = 0.7991776116656887e-10, (246, 2) = -0.22440616410190953e-8, (247, 1) = 0.7711091117822803e-10, (247, 2) = -0.13191753975313803e-8, (248, 1) = 0.7441529799946651e-10, (248, 2) = -0.17910242436330124e-8, (249, 1) = 0.7048259901959399e-10, (249, 2) = -0.28100392420676528e-8, (250, 1) = 0.6644564251098325e-10, (250, 2) = -0.17700391138996297e-8, (251, 1) = 0.6174743674733547e-10, (251, 2) = -0.35983309462523948e-8, (252, 1) = 0.53748800269876703e-10, (252, 2) = -0.6574229670441326e-8, (253, 1) = 0.41046774306620714e-10, (253, 2) = -0.9585281831683094e-8, (254, 1) = 0.2214825555039262e-10, (254, 2) = -0.12765752311713578e-7, (255, 1) = 0.33364537107475994e-11, (255, 2) = -0.12233796849054259e-7, (256, 1) = .0, (256, 2) = -0.9558323369337775e-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[256] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(1.2765752311713578e-8) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 256, [v(u), diff(v(u), u)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[256] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[256] 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`(256, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(256, 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[256] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(1.2765752311713578e-8) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 256, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[256] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[256] 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`(256, 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`(256, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893627908416226420, (2) = 36893627908416226860, (3) = 36893627908416227036}), (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(256, {(1) = -.615479708670389, (2) = -.6138337655059911, (3) = -.6121877371363221, (4) = -.610541623152404, (5) = -.6088953251908921, (6) = -.6072487671472097, (7) = -.6056019471744036, (8) = -.6039547492398832, (9) = -.6023071028585135, (10) = -.600659003239894, (11) = -.5990103110283401, (12) = -.5973609594036162, (13) = -.5957109382804167, (14) = -.5940600787075152, (15) = -.592408316893275, (16) = -.5907556337655888, (17) = -.589101824521824, (18) = -.5874468288606902, (19) = -.585790613017156, (20) = -.5841329309576447, (21) = -.5824737271461466, (22) = -.5808129444592497, (23) = -.5791502923727325, (24) = -.5774857217781857, (25) = -.5758191392268837, (26) = -.5741502104173669, (27) = -.5724788940395652, (28) = -.5708050411421474, (29) = -.5691282811123882, (30) = -.5674485804227406, (31) = -.5657657065322664, (32) = -.5640792708720453, (33) = -.5623892445543703, (34) = -.5606952706775499, (35) = -.5589969780179599, (36) = -.5572943246689157, (37) = -.555586796800204, (38) = -.5538740753768657, (39) = -.5521560662027295, (40) = -.5504321023790923, (41) = -.5487019283191328, (42) = -.5469653407777109, (43) = -.5452215561139513, (44) = -.5434703809718867, (45) = -.5417114118674226, (46) = -.5399438369309824, (47) = -.5381675001638607, (48) = -.5363816612793244, (49) = -.5345856438064434, (50) = -.5327791976962112, (51) = -.5309612570931616, (52) = -.5291313415384594, (53) = -.5272888957313684, (54) = -.525432745213056, (55) = -.523562514992632, (56) = -.5216770864410629, (57) = -.5197755400848111, (58) = -.5178572425620112, (59) = -.515920711401875, (60) = -.5139652765527121, (61) = -.5119895907876776, (62) = -.5099924034933055, (63) = -.5079727160294226, (64) = -.5059287438667803, (65) = -.5038594483715606, (66) = -.5017629397592426, (67) = -.4996377699518008, (68) = -.49748213518145645, (69) = -.49529405774722146, (70) = -.49307171190353477, (71) = -.4908127037482733, (72) = -.48851496049995186, (73) = -.48617577893132347, (74) = -.4837926795108566, (75) = -.48136264479140517, (76) = -.4788826875598093, (77) = -.47634940862604525, (78) = -.4737592248726671, (79) = -.47110824288051906, (80) = -.46839220670201365, (81) = -.46560652263193936, (82) = -.4627462688840759, (83) = -.45980582730548547, (84) = -.4567795100866846, (85) = -.4536605585746382, (86) = -.45044190982538507, (87) = -.44711596396700165, (88) = -.4436737732409932, (89) = -.44010588450370247, (90) = -.43640194597493315, (91) = -.4325503265005061, (92) = -.4285378041296347, (93) = -.4243499633478024, (94) = -.41997068666716125, (95) = -.415381857195644, (96) = -.41056307352817695, (97) = -.4054913072194831, (98) = -.40014286075850014, (99) = -.3945291762613631, (100) = -.3887243469845279, (101) = -.38272333283023513, (102) = -.37651248996445524, (103) = -.3700765357249298, (104) = -.3633984542976641, (105) = -.35645951516908386, (106) = -.3492382879874373, (107) = -.3417110407352021, (108) = -.33385046669876445, (109) = -.32562584741600087, (110) = -.3170017781423065, (111) = -.3079373927769954, (112) = -.29838534976786646, (113) = -.28829018526282596, (114) = -.2775863529897709, (115) = -.26619576640273657, (116) = -.25402428090287404, (117) = -.24095674999268518, (118) = -.22685076083627745, (119) = -.21152693593807945, (120) = -.19475483127449672, (121) = -.17623202423500914, (122) = -.15554979660920581, (123) = -.13228994492398807, (124) = -.1082372279662562, (125) = -0.8418451100852434e-1, (126) = -0.6013179405079247e-1, (127) = -0.360790770930606e-1, (128) = -0.12026360135328736e-1, (129) = 0.1202635682240313e-1, (130) = 0.36079073780135e-1, (131) = 0.6013179073786687e-1, (132) = 0.8418450769559874e-1, (133) = .1082372246533306, (134) = .13228994161106247, (135) = .15554979358804727, (136) = .17623202154579037, (137) = .1947548288517443, (138) = .21152693373373746, (139) = .22685075881419176, (140) = .24095674812499612, (141) = .25402427916759346, (142) = .266195764782475, (143) = .2775863514700435, (144) = .2882901838320805, (145) = .298385348416205, (146) = .30793739149611127, (147) = .31700177692513, (148) = .32562584625647806, (149) = .3338504655917917, (150) = .3417110396761509, (151) = .34923828697230785, (152) = .3564595141944389, (153) = .3633984533603477, (154) = .37007653482219466, (155) = .37651248909388624, (156) = .3827233319895611, (157) = .3887243461717439, (158) = .39452917547476085, (159) = .4001428600026771, (160) = .40549130650739146, (161) = .410563072857691, (162) = .4153818565630173, (163) = .4199706860690814, (164) = .4243499627813222, (165) = .42853780359211907, (166) = .4325503259895911, (167) = .4364019454885977, (168) = .44010588404014256, (169) = .4436737727984631, (170) = .447115963543925, (171) = .45044190942046414, (172) = .453660558186639, (173) = .45677950971441716, (174) = .4598058269479823, (175) = .46274626854038836, (176) = .4656065223011885, (177) = .468392206383466, (178) = .47110824257342615, (179) = .4737592245763975, (180) = .4763494083399846, (181) = .4788826872834117, (182) = .48136264452415733, (183) = .4837926792522918, (184) = .48617577868100653, (185) = .4885149602574814, (186) = .49081270351328304, (187) = .49307171167567043, (188) = .4952940575261847, (189) = .4974821349669204, (190) = .4996377697435383, (191) = .5017629395569352, (192) = .5038594481750222, (193) = .5059287436757538, (194) = .5079727158437204, (195) = .5099924033127412, (196) = .5119895906120454, (197) = .5139652763818926, (198) = .5159207112356502, (199) = .517857242400274, (200) = .5197755399274191, (201) = .5216770862878711, (202) = .5235625148435622, (203) = .5254327450679438, (204) = .527288895590138, (205) = .529131341401021, (206) = .5309612569593932, (207) = .5327791975660613, (208) = .5345856436798079, (209) = .5363816611561303, (210) = .5381675000440663, (211) = .5399438368144777, (212) = .5417114117541697, (213) = .5434703808618371, (214) = .5452215560070248, (215) = .5469653406738793, (216) = .5487019282183432, (217) = .550432102281291, (218) = .5521560661078934, (219) = .5538740752849417, (220) = .5555867967111572, (221) = .5572943245827272, (222) = .5589969779345795, (223) = .5606952705969559, (224) = .5623892444765469, (225) = .5640792707969473, (226) = .5657657064598809, (227) = .567448580353051, (228) = .5691282810453618, (229) = .5708050410777735, (230) = .572478893977828, (231) = .5741502103582431, (232) = .5758191391703643, (233) = .5774857217242565, (234) = .5791502923213769, (235) = .5808129444104603, (236) = .5824737270999113, (237) = .5841329309139516, (238) = .5857906129759993, (239) = .5874468288220598, (240) = .5891018244857117, (241) = .5907556337319899, (242) = .592408316862182, (243) = .5940600786789219, (244) = .59571093825432, (245) = .597360959380009, (246) = .5990103110072196, (247) = .6006590032212563, (248) = .602307102842355, (249) = .6039547492262015, (250) = .605601947163196, (251) = .6072487671384748, (252) = .60889532518463, (253) = .6105416231486125, (254) = .6121877371346346, (255) = .6138337655055719, (256) = .615479708670389}, datatype = float[8], order = C_order); Y := Matrix(256, 2, {(1, 1) = -2.35619449019234, (1, 2) = 12.118672760959774, (2, 1) = -2.337290286256281, (2, 2) = 10.914658446600086, (3, 1) = -2.3201008276005637, (3, 2) = 10.010693556288953, (4, 1) = -2.3042274489049164, (4, 2) = 9.301772103437811, (5, 1) = -2.2894019626109485, (5, 2) = 8.727840811274362, (6, 1) = -2.2754345312302515, (6, 2) = 8.25177412070392, (7, 1) = -2.2621856009081305, (7, 2) = 7.849239603358558, (8, 1) = -2.2495479912910765, (8, 2) = 7.503505631367268, (9, 1) = -2.237438216937433, (9, 2) = 7.202667464492366, (10, 1) = -2.2257900845870067, (10, 2) = 6.9380000914469795, (11, 1) = -2.2145489434481087, (11, 2) = 6.702920347222946, (12, 1) = -2.2036701874921634, (12, 2) = 6.492381622935028, (13, 1) = -2.1931169326136617, (13, 2) = 6.302442718336018, (14, 1) = -2.182857087056544, (14, 2) = 6.1299557556249535, (15, 1) = -2.1728639002327887, (15, 2) = 5.972396952904152, (16, 1) = -2.163114638683964, (16, 2) = 5.827713143173982, (17, 1) = -2.1535885656610416, (17, 2) = 5.694198333816598, (18, 1) = -2.1442683694669147, (18, 2) = 5.570445902587254, (19, 1) = -2.135139003947531, (19, 2) = 5.455278113161753, (20, 1) = -2.1261860618884074, (20, 2) = 5.347686388424327, (21, 1) = -2.117397725718667, (21, 2) = 5.246825138078152, (22, 1) = -2.1087634545082783, (22, 2) = 5.151970330277958, (23, 1) = -2.1002726297503918, (23, 2) = 5.062486400497311, (24, 1) = -2.09191686701165, (24, 2) = 4.977836260324988, (25, 1) = -2.0836883833144606, (25, 2) = 4.89755068349214, (26, 1) = -2.0755789618481537, (26, 2) = 4.821209181407477, (27, 1) = -2.0675824841724295, (27, 2) = 4.748456236732863, (28, 1) = -2.0596928691103513, (28, 2) = 4.678974379599474, (29, 1) = -2.051903519080722, (29, 2) = 4.612474707184249, (30, 1) = -2.0442098747249235, (30, 2) = 4.548714275787255, (31, 1) = -2.0366068506718946, (31, 2) = 4.487469833466657, (32, 1) = -2.029089044589754, (32, 2) = 4.428537179987267, (33, 1) = -2.021652996969941, (33, 2) = 4.37174600352715, (34, 1) = -2.0142940866632357, (34, 2) = 4.316933039412177, (35, 1) = -2.0070079294921044, (35, 2) = 4.263951400135515, (36, 1) = -1.9997918012046616, (36, 2) = 4.212678754210403, (37, 1) = -1.9926411949448875, (37, 2) = 4.1629910012947215, (38, 1) = -1.9855526610971537, (38, 2) = 4.114781573443895, (39, 1) = -1.9785238619833743, (39, 2) = 4.067959975624121, (40, 1) = -1.9715502957463595, (40, 2) = 4.022428994561768, (41, 1) = -1.9646293254778062, (41, 2) = 3.9781108598165833, (42, 1) = -1.957758660364256, (42, 2) = 3.934935932616207, (43, 1) = -1.9509338703093544, (43, 2) = 3.8928267394753386, (44, 1) = -1.944153004798682, (44, 2) = 3.851726365609299, (45, 1) = -1.9374134094480575, (45, 2) = 3.8115778491539154, (46, 1) = -1.930711011983108, (46, 2) = 3.772320003327631, (47, 1) = -1.9240443660461672, (47, 2) = 3.7339108293070433, (48, 1) = -1.9174099329338168, (48, 2) = 3.6962994182504065, (49, 1) = -1.9108045560622748, (49, 2) = 3.659440318691635, (50, 1) = -1.9042267545887381, (50, 2) = 3.6233001437964765, (51, 1) = -1.8976721834422676, (51, 2) = 3.5878322615247313, (52, 1) = -1.8911387498163468, (52, 2) = 3.5530048270523595, (53, 1) = -1.8846241810749393, (53, 2) = 3.5187870099890954, (54, 1) = -1.8781241357772231, (54, 2) = 3.485139202181243, (55, 1) = -1.8716371986951243, (55, 2) = 3.452038938466664, (56, 1) = -1.865159466522433, (56, 2) = 3.4194526469660533, (57, 1) = -1.8586878578861092, (57, 2) = 3.387352720953515, (58, 1) = -1.852220367454726, (58, 2) = 3.355718347457449, (59, 1) = -1.8457522424271995, (59, 2) = 3.324516730438481, (60, 1) = -1.8392815825813371, (60, 2) = 3.29373037446758, (61, 1) = -1.8328043493386406, (61, 2) = 3.2633328038479608, (62, 1) = -1.8263169664273664, (62, 2) = 3.2333011360701454, (63, 1) = -1.8198167981272089, (63, 2) = 3.203618031881599, (64, 1) = -1.813298813394356, (64, 2) = 3.1742564189641698, (65, 1) = -1.806760514416245, (65, 2) = 3.14520192132763, (66, 1) = -1.8001968467477523, (66, 2) = 3.1164298804842017, (67, 1) = -1.7936043097811496, (67, 2) = 3.087923727510235, (68, 1) = -1.7869784494621208, (68, 2) = 3.059663858549224, (69, 1) = -1.7803144554167043, (69, 2) = 3.0316303722528506, (70, 1) = -1.773608159705147, (70, 2) = 3.003807252664023, (71, 1) = -1.7668538681850854, (71, 2) = 2.976173342920477, (72, 1) = -1.7600470567674849, (72, 2) = 2.9487135554766004, (73, 1) = -1.7531815429128443, (73, 2) = 2.9214073446110134, (74, 1) = -1.7462520392971868, (74, 2) = 2.894239096407252, (75, 1) = -1.739251935110602, (75, 2) = 2.867189346904102, (76, 1) = -1.7321749778761224, (76, 2) = 2.840241498377158, (77, 1) = -1.7250140205120181, (77, 2) = 2.813377042640132, (78, 1) = -1.71776170736756, (78, 2) = 2.786578322127765, (79, 1) = -1.710410145187836, (79, 2) = 2.7598273981420816, (80, 1) = -1.702950796897438, (80, 2) = 2.7331058270979764, (81, 1) = -1.6953745919813825, (81, 2) = 2.706395235922123, (82, 1) = -1.6876719923104895, (82, 2) = 2.679677712979381, (83, 1) = -1.6798320535801188, (83, 2) = 2.652932785787809, (84, 1) = -1.6718441587879003, (84, 2) = 2.6261436160121594, (85, 1) = -1.6636954194758775, (85, 2) = 2.59928845114405, (86, 1) = -1.6553727854910854, (86, 2) = 2.5723481008907183, (87, 1) = -1.6468624877620444, (87, 2) = 2.545304290612758, (88, 1) = -1.6381480621612516, (88, 2) = 2.5181338444174726, (89, 1) = -1.629212624315195, (89, 2) = 2.490816474920481, (90, 1) = -1.6200379626559427, (90, 2) = 2.4633323383202774, (91, 1) = -1.610603726190067, (91, 2) = 2.435660225598683, (92, 1) = -1.600886842296156, (92, 2) = 2.407776753470986, (93, 1) = -1.590862673461241, (93, 2) = 2.379660658525142, (94, 1) = -1.5805039774298852, (94, 2) = 2.3512907600058233, (95, 1) = -1.5697804425895585, (95, 2) = 2.3226459265785855, (96, 1) = -1.5586583014691535, (96, 2) = 2.293705534146932, (97, 1) = -1.5470998615698928, (97, 2) = 2.264450008190539, (98, 1) = -1.5350682338848733, (98, 2) = 2.2348743168779803, (99, 1) = -1.5226063468150763, (99, 2) = 2.2051737248528798, (100, 1) = -1.5098914960211454, (100, 2) = 2.17583738657371, (101, 1) = -1.4969217602954346, (101, 2) = 2.1469084566347605, (102, 1) = -1.483676933938617, (102, 2) = 2.1183928671531187, (103, 1) = -1.4701342356942662, (103, 2) = 2.090298680436436, (104, 1) = -1.456268237054072, (104, 2) = 2.062637371249721, (105, 1) = -1.4420510120219698, (105, 2) = 2.0354256916943894, (106, 1) = -1.4274502395871247, (106, 2) = 2.0086839641858134, (107, 1) = -1.4124301696269619, (107, 2) = 1.982440430772687, (108, 1) = -1.396949207859653, (108, 2) = 1.9567299468981632, (109, 1) = -1.3809604090221987, (109, 2) = 1.9315987904171668, (110, 1) = -1.3644091203399373, (110, 2) = 1.90710568533949, (111, 1) = -1.3472316418753183, (111, 2) = 1.8833262710134948, (112, 1) = -1.3293533968260578, (112, 2) = 1.8603588503339894, (113, 1) = -1.3106858612504209, (113, 2) = 1.8383314042303163, (114, 1) = -1.2911228307959204, (114, 2) = 1.817412138903023, (115, 1) = -1.2705355796858275, (115, 2) = 1.7978248787898543, (116, 1) = -1.248765731648311, (116, 2) = 1.7798711356935655, (117, 1) = -1.225614926126585, (117, 2) = 1.763963185281574, (118, 1) = -1.200830935267974, (118, 2) = 1.7506757021906965, (119, 1) = -1.1740854857729608, (119, 2) = 1.7408255448851555, (120, 1) = -1.1449402048254178, (120, 2) = 1.7356000930834823, (121, 1) = -1.112792654079651, (121, 2) = 1.736765562026282, (122, 1) = -1.076783198309804, (122, 2) = 1.7470005348334907, (123, 1) = -1.0359027942603893, (123, 2) = 1.7701883209179174, (124, 1) = -.9929061378220345, (124, 2) = 1.8071518462503395, (125, 1) = -.9488753802410032, (125, 2) = 1.8556720762877739, (126, 1) = -.9035856416474204, (126, 2) = 1.9105602217533053, (127, 1) = -.8569996596327668, (127, 2) = 1.9612047634124612, (128, 1) = -.8093960435992642, (128, 2) = 1.9925954032717297, (129, 1) = -.761400289896857, (129, 2) = 1.9925954056751198, (130, 1) = -.7137966737557435, (130, 2) = 1.9612047696396848, (131, 1) = -.6672106915684193, (131, 2) = 1.9105602294964226, (132, 1) = -.6219209527887216, (132, 2) = 1.855672083763541, (133, 1) = -.5778901950429396, (133, 2) = 1.8071518523502108, (134, 1) = -.5348935384786714, (134, 2) = 1.7701883252585813, (135, 1) = -.49401313383975687, (135, 2) = 1.747000537150921, (136, 1) = -.45800367746021514, (136, 2) = 1.7367655628415017, (137, 1) = -.4258561262471038, (137, 2) = 1.7356000928289879, (138, 1) = -.39671084493089215, (138, 2) = 1.7408255438725242, (139, 1) = -.3699653951377459, (139, 2) = 1.7506757006156077, (140, 1) = -.3451814040331261, (140, 2) = 1.7639631832878049, (141, 1) = -.32203059830507375, (141, 2) = 1.7798711333745194, (142, 1) = -.30026075009166514, (142, 2) = 1.7978248762196696, (143, 1) = -.2796734988303415, (143, 2) = 1.8174121361251319, (144, 1) = -.2601104682438874, (144, 2) = 1.8383314012826037, (145, 1) = -.24144293255250612, (145, 2) = 1.8603588472423433, (146, 1) = -.22356468740089847, (146, 2) = 1.8833262678026457, (147, 1) = -.20638720884511483, (147, 2) = 1.9071056820325802, (148, 1) = -.18983592008109626, (148, 2) = 1.9315987870236686, (149, 1) = -.17384712116975945, (149, 2) = 1.9567299434167018, (150, 1) = -.15836615933579365, (150, 2) = 1.9824404272037903, (151, 1) = -.14334608931514567, (151, 2) = 2.0086839605395936, (152, 1) = -.12874531682500312, (152, 2) = 2.0354256879874106, (153, 1) = -.11452809174235111, (153, 2) = 2.062637367479104, (154, 1) = -.10066209305576505, (154, 2) = 2.0902986765983758, (155, 1) = -0.8711939476860638e-1, (155, 2) = 2.118392863260354, (156, 1) = -0.7387456837236098e-1, (156, 2) = 2.1469084526936144, (157, 1) = -0.60904832610221504e-1, (157, 2) = 2.175837382566909, (158, 1) = -0.4818998178237595e-1, (158, 2) = 2.2051737207834075, (159, 1) = -0.3572809466713802e-1, (159, 2) = 2.2348743127922583, (160, 1) = -0.23696466905448903e-1, (160, 2) = 2.2644500041646727, (161, 1) = -0.12138026931617684e-1, (161, 2) = 2.2937055301846807, (162, 1) = -0.10158857427529687e-2, (162, 2) = 2.3226459226924674, (163, 1) = 0.9707649160640567e-2, (163, 2) = 2.3512907561955467, (164, 1) = 0.20066345250206022e-1, (164, 2) = 2.3796606547873345, (165, 1) = 0.30090514138934432e-1, (165, 2) = 2.4077767498016844, (166, 1) = 0.39807398082675735e-1, (166, 2) = 2.435660221997729, (167, 1) = 0.4924163459500751e-1, (167, 2) = 2.463332334780739, (168, 1) = 0.5841629629769051e-1, (168, 2) = 2.490816471448168, (169, 1) = 0.6735173418411464e-1, (169, 2) = 2.5181338409954215, (170, 1) = 0.7606615982248231e-1, (170, 2) = 2.5453042872557936, (171, 1) = 0.8457645758690016e-1, (171, 2) = 2.5723480975870063, (172, 1) = 0.9289909160487612e-1, (172, 2) = 2.5992884478819875, (173, 1) = .10104783094790701, (173, 2) = 2.6261436128033866, (174, 1) = .10903572576945493, (174, 2) = 2.652932782626758, (175, 1) = .11687566452741904, (175, 2) = 2.679677709854055, (176, 1) = .12457826422424711, (176, 2) = 2.7063952328267518, (177, 1) = .13215446916492207, (177, 2) = 2.7331058240418673, (178, 1) = .13961381747853283, (178, 2) = 2.7598273951286862, (179, 1) = .14696537968035128, (179, 2) = 2.786578319164531, (180, 1) = .15421769284577339, (180, 2) = 2.813377039715548, (181, 1) = .16137865022983547, (181, 2) = 2.840241495490389, (182, 1) = .1684556074833026, (182, 2) = 2.8671893440509666, (183, 1) = .17545571168801935, (183, 2) = 2.8942390936057563, (184, 1) = .18238521532102625, (184, 2) = 2.921407341841214, (185, 1) = .1892507291922418, (185, 2) = 2.948713552731732, (186, 1) = .1960575406257235, (186, 2) = 2.976173340196842, (187, 1) = .20281183216095594, (187, 2) = 3.003807249950244, (188, 1) = .20951812788710494, (188, 2) = 3.031630369558518, (189, 1) = .21618212194647154, (189, 2) = 3.0596638558915292, (190, 1) = .22280798227907891, (190, 2) = 3.087923724878711, (191, 1) = .22940051925857516, (191, 2) = 3.116429877855737, (192, 1) = .23596418693963114, (192, 2) = 3.1452019187126066, (193, 1) = .24250248592976217, (193, 2) = 3.174256416366404, (194, 1) = .24902047067429922, (194, 2) = 3.203618029300584, (195, 1) = .25552063898580135, (195, 2) = 3.233301133512497, (196, 1) = .26200802190802075, (196, 2) = 3.2633328013174117, (197, 1) = .2684852551614961, (197, 2) = 3.293730371934068, (198, 1) = .2749559150176309, (198, 2) = 3.324516727923597, (199, 1) = .2814240400552919, (199, 2) = 3.355718344955579, (200, 1) = .2878915304965398, (200, 2) = 3.3873527184670316, (201, 1) = .2943631391424539, (201, 2) = 3.419452644495199, (202, 1) = .3008408713246704, (202, 2) = 3.452038936023861, (203, 1) = .3073278084159586, (203, 2) = 3.4851391997638705, (204, 1) = .31382785372281113, (204, 2) = 3.518787007595249, (205, 1) = .3203424224732208, (205, 2) = 3.5530048246636516, (206, 1) = .32687585610786957, (206, 2) = 3.5878322591378202, (207, 1) = .3334304272630384, (207, 2) = 3.6233001413972294, (208, 1) = .34000822874505454, (208, 2) = 3.6594403163130003, (209, 1) = .346613605625009, (209, 2) = 3.6962994158992246, (210, 1) = .3532480387458031, (210, 2) = 3.733910826968825, (211, 1) = .35991468469094073, (211, 2) = 3.772320000996824, (212, 1) = .36661708216412175, (212, 2) = 3.8115778468489965, (213, 1) = .3733566775229776, (213, 2) = 3.851726363332059, (214, 1) = .38013754304180297, (214, 2) = 3.8928267372315797, (215, 1) = .3869623331049322, (215, 2) = 3.934935930441873, (216, 1) = .39383299822677503, (216, 2) = 3.978110857651852, (217, 1) = .4007539685035025, (217, 2) = 4.022428992375078, (218, 1) = .4077275347487492, (218, 2) = 4.0679599734355065, (219, 1) = .41475633387072003, (219, 2) = 4.114781571285711, (220, 1) = .42184486772664703, (220, 2) = 4.162990999115868, (221, 1) = .4289954739946092, (221, 2) = 4.21267875197291, (222, 1) = .43621160229018285, (222, 2) = 4.263951397940499, (223, 1) = .44349775946952946, (223, 2) = 4.316933037240854, (224, 1) = .4508566697847075, (224, 2) = 4.371746001472759, (225, 1) = .4582927174130059, (225, 2) = 4.428537177892839, (226, 1) = .46581052350376145, (226, 2) = 4.487469831432685, (227, 1) = .4734135475655795, (227, 2) = 4.548714273764117, (228, 1) = .48110719193019813, (228, 2) = 4.612474705197783, (229, 1) = .4888965419689955, (229, 2) = 4.678974377813236, (230, 1) = .4967861570404521, (230, 2) = 4.7484562348806385, (231, 1) = .5047826347254658, (231, 2) = 4.8212091794085215, (232, 1) = .5128920562010075, (232, 2) = 4.897550681391886, (233, 1) = .5211205399075063, (233, 2) = 4.977836258214376, (234, 1) = .5294763026557, (234, 2) = 5.062486398380529, (235, 1) = .5379671274230966, (235, 2) = 5.151970328113153, (236, 1) = .54660139864321, (236, 2) = 5.246825135949528, (237, 1) = .5553897348228287, (237, 2) = 5.347686386243535, (238, 1) = .5643426768922236, (238, 2) = 5.45527811128566, (239, 1) = .5734720424222883, (239, 2) = 5.570445900590808, (240, 1) = .5827922386273318, (240, 2) = 5.694198331847795, (241, 1) = .5923183116613285, (241, 2) = 5.827713141100247, (242, 1) = .6020675732216765, (242, 2) = 5.97239695109456, (243, 1) = .612060760057737, (243, 2) = 6.129955753954183, (244, 1) = .622320605627775, (244, 2) = 6.302442716859202, (245, 1) = .6328738605195571, (245, 2) = 6.492381621232821, (246, 1) = .6437526164891595, (246, 2) = 6.702920345468326, (247, 1) = .654993757641648, (247, 2) = 6.938000089073476, (248, 1) = .6666418900060076, (248, 2) = 7.20266746245575, (249, 1) = .678751664374535, (249, 2) = 7.503505629494219, (250, 1) = .6913892740071063, (250, 2) = 7.849239600963847, (251, 1) = .7046382043460715, (251, 2) = 8.251774119315153, (252, 1) = .7186056357462011, (252, 2) = 8.727840810952246, (253, 1) = .7334311220622616, (253, 2) = 9.30177210389072, (254, 1) = .74930450078053, (254, 2) = 10.010693558249125, (255, 1) = .766493959452669, (255, 2) = 10.914658448521092, (256, 1) = .785398163397448, (256, 2) = 12.118672763119722}, datatype = float[8], order = C_order); YP := Matrix(256, 2, {(1, 1) = 12.118672760959774, (1, 2) = -856.132513417093, (2, 1) = 10.914658446600086, (2, 2) = -626.3138713842598, (3, 1) = 10.010693556288953, (3, 2) = -482.2028779602816, (4, 1) = 9.301772103437811, (4, 2) = -385.0044436179127, (5, 1) = 8.727840811274362, (5, 2) = -315.9004029643987, (6, 1) = 8.25177412070392, (6, 2) = -264.77471365782577, (7, 1) = 7.849239603358558, (7, 2) = -225.75521795738067, (8, 1) = 7.503505631367268, (8, 2) = -195.22011305001453, (9, 1) = 7.202667464492366, (9, 2) = -170.82915163273915, (10, 1) = 6.9380000914469795, (10, 2) = -151.0099936160739, (11, 1) = 6.702920347222946, (11, 2) = -134.66931195330426, (12, 1) = 6.492381622935028, (12, 2) = -121.02750817954177, (13, 1) = 6.302442718336018, (13, 2) = -109.51513905854112, (14, 1) = 6.1299557556249535, (14, 2) = -99.70639359539115, (15, 1) = 5.972396952904152, (15, 2) = -91.27855128798726, (16, 1) = 5.827713143173982, (16, 2) = -83.98275540857765, (17, 1) = 5.694198333816598, (17, 2) = -77.62352977596856, (18, 1) = 5.570445902587254, (18, 2) = -72.04656753943121, (19, 1) = 5.455278113161753, (19, 2) = -67.12825374413103, (20, 1) = 5.347686388424327, (20, 2) = -62.76794531415879, (21, 1) = 5.246825138078152, (21, 2) = -58.88393128604594, (22, 1) = 5.151970330277958, (22, 2) = -55.40885507068803, (23, 1) = 5.062486400497311, (23, 2) = -52.28635706995813, (24, 1) = 4.977836260324988, (24, 2) = -49.46978264124701, (25, 1) = 4.89755068349214, (25, 2) = -46.919784022075945, (26, 1) = 4.821209181407477, (26, 2) = -44.60273229586116, (27, 1) = 4.748456236732863, (27, 2) = -42.49042331959783, (28, 1) = 4.678974379599474, (28, 2) = -40.55859334357499, (29, 1) = 4.612474707184249, (29, 2) = -38.78617511212157, (30, 1) = 4.548714275787255, (30, 2) = -37.15534890860894, (31, 1) = 4.487469833466657, (31, 2) = -35.650486075426734, (32, 1) = 4.428537179987267, (32, 2) = -34.257886856585785, (33, 1) = 4.37174600352715, (33, 2) = -32.96589412256592, (34, 1) = 4.316933039412177, (34, 2) = -31.764062891704498, (35, 1) = 4.263951400135515, (35, 2) = -30.643234855887133, (36, 1) = 4.212678754210403, (36, 2) = -29.59556089722199, (37, 1) = 4.1629910012947215, (37, 2) = -28.613836903718852, (38, 1) = 4.114781573443895, (38, 2) = -27.691814535224786, (39, 1) = 4.067959975624121, (39, 2) = -26.824068766107406, (40, 1) = 4.022428994561768, (40, 2) = -26.00550522795828, (41, 1) = 3.9781108598165833, (41, 2) = -25.231789519785515, (42, 1) = 3.934935932616207, (42, 2) = -24.49907419157066, (43, 1) = 3.8928267394753386, (43, 2) = -23.80369093520492, (44, 1) = 3.851726365609299, (44, 2) = -23.142591975070513, (45, 1) = 3.8115778491539154, (45, 2) = -22.512964635975212, (46, 1) = 3.772320003327631, (46, 2) = -21.912148754190753, (47, 1) = 3.7339108293070433, (47, 2) = -21.337971601154468, (48, 1) = 3.6962994182504065, (48, 2) = -20.788292666653856, (49, 1) = 3.659440318691635, (49, 2) = -20.261207504959344, (50, 1) = 3.6233001437964765, (50, 2) = -19.755117660693415, (51, 1) = 3.5878322615247313, (51, 2) = -19.268358478843336, (52, 1) = 3.5530048270523595, (52, 2) = -18.79958066865422, (53, 1) = 3.5187870099890954, (53, 2) = -18.347541660541417, (54, 1) = 3.485139202181243, (54, 2) = -17.91097087199947, (55, 1) = 3.452038938466664, (55, 2) = -17.488900002083938, (56, 1) = 3.4194526469660533, (56, 2) = -17.08028657274201, (57, 1) = 3.387352720953515, (57, 2) = -16.68422876830327, (58, 1) = 3.355718347457449, (58, 2) = -16.299964121863187, (59, 1) = 3.324516730438481, (59, 2) = -15.92663575675902, (60, 1) = 3.29373037446758, (60, 2) = -15.563618180234197, (61, 1) = 3.2633328038479608, (61, 2) = -15.210220163284507, (62, 1) = 3.2333011360701454, (62, 2) = -14.865831987545663, (63, 1) = 3.203618031881599, (63, 2) = -14.529941407415382, (64, 1) = 3.1742564189641698, (64, 2) = -14.201957354118989, (65, 1) = 3.14520192132763, (65, 2) = -13.881460244621785, (66, 1) = 3.1164298804842017, (66, 2) = -13.567942167450001, (67, 1) = 3.087923727510235, (67, 2) = -13.26100834577326, (68, 1) = 3.059663858549224, (68, 2) = -12.960252417563783, (69, 1) = 3.0316303722528506, (69, 2) = -12.665285347917038, (70, 1) = 3.003807252664023, (70, 2) = -12.375777363409917, (71, 1) = 2.976173342920477, (71, 2) = -12.091361988533292, (72, 1) = 2.9487135554766004, (72, 2) = -11.811751212695286, (73, 1) = 2.9214073446110134, (73, 2) = -11.536615533261044, (74, 1) = 2.894239096407252, (74, 2) = -11.265688881896164, (75, 1) = 2.867189346904102, (75, 2) = -10.998678892210954, (76, 1) = 2.840241498377158, (76, 2) = -10.735333260527634, (77, 1) = 2.813377042640132, (77, 2) = -10.475391531295369, (78, 1) = 2.786578322127765, (78, 2) = -10.21861157410054, (79, 1) = 2.7598273981420816, (79, 2) = -9.964757766355802, (80, 1) = 2.7331058270979764, (80, 2) = -9.71359833404566, (81, 1) = 2.706395235922123, (81, 2) = -9.46491022905575, (82, 1) = 2.679677712979381, (82, 2) = -9.218482012351554, (83, 1) = 2.652932785787809, (83, 2) = -8.974085491703697, (84, 1) = 2.6261436160121594, (84, 2) = -8.731531933299696, (85, 1) = 2.59928845114405, (85, 2) = -8.490593473083779, (86, 1) = 2.5723481008907183, (86, 2) = -8.251070500116482, (87, 1) = 2.545304290612758, (87, 2) = -8.01277529384119, (88, 1) = 2.5181338444174726, (88, 2) = -7.775480109929202, (89, 1) = 2.490816474920481, (89, 2) = -7.538985060999222, (90, 1) = 2.4633323383202774, (90, 2) = -7.3030947650199955, (91, 1) = 2.435660225598683, (91, 2) = -7.067601252786613, (92, 1) = 2.407776753470986, (92, 2) = -6.8322757042522, (93, 1) = 2.379660658525142, (93, 2) = -6.59690256295987, (94, 1) = 2.3512907600058233, (94, 2) = -6.361258919987786, (95, 1) = 2.3226459265785855, (95, 2) = -6.1251103875231045, (96, 1) = 2.293705534146932, (96, 2) = -5.888209919491713, (97, 1) = 2.264450008190539, (97, 2) = -5.650295723583867, (98, 1) = 2.2348743168779803, (98, 2) = -5.4111914923081486, (99, 1) = 2.2051737248528798, (99, 2) = -5.172283622209372, (100, 1) = 2.17583738657371, (100, 2) = -4.937229804922309, (101, 1) = 2.1469084566347605, (101, 2) = -4.706035244109046, (102, 1) = 2.1183928671531187, (102, 2) = -4.478368789065424, (103, 1) = 2.090298680436436, (103, 2) = -4.253871611283983, (104, 1) = 2.062637371249721, (104, 2) = -4.032156660587268, (105, 1) = 2.0354256916943894, (105, 2) = -3.812810103274999, (106, 1) = 2.0086839641858134, (106, 2) = -3.5953604296843666, (107, 1) = 1.982440430772687, (107, 2) = -3.379291498088012, (108, 1) = 1.9567299468981632, (108, 2) = -3.1640031846243275, (109, 1) = 1.9315987904171668, (109, 2) = -2.9488131217385263, (110, 1) = 1.90710568533949, (110, 2) = -2.7329148766231843, (111, 1) = 1.8833262710134948, (111, 2) = -2.5153470973244274, (112, 1) = 1.8603588503339894, (112, 2) = -2.294949295598474, (113, 1) = 1.8383314042303163, (113, 2) = -2.0702924424068185, (114, 1) = 1.817412138903023, (114, 2) = -1.839587569353909, (115, 1) = 1.7978248787898543, (115, 2) = -1.600559568556263, (116, 1) = 1.7798711356935655, (116, 2) = -1.3502622211166015, (117, 1) = 1.763963185281574, (117, 2) = -1.0848103200422101, (118, 1) = 1.7506757021906965, (118, 2) = -.7990090369887971, (119, 1) = 1.7408255448851555, (119, 2) = -.4858210215775711, (120, 1) = 1.7356000930834823, (120, 2) = -.13568662798623501, (121, 1) = 1.736765562026282, (121, 2) = .2640804192804802, (122, 1) = 1.7470005348334907, (122, 2) = .7287233244901601, (123, 1) = 1.7701883209179174, (123, 2) = 1.2658292846577381, (124, 1) = 1.8071518462503395, (124, 2) = 1.7976303999609573, (125, 1) = 1.8556720762877739, (125, 2) = 2.2025007475300433, (126, 1) = 1.9105602217533053, (126, 2) = 2.2877562885792377, (127, 1) = 1.9612047634124612, (127, 2) = 1.8139958305815644, (128, 1) = 1.9925954032717297, (128, 2) = .7040111232714268, (129, 1) = 1.9925954056751198, (129, 2) = -.7040109350346981, (130, 1) = 1.9612047696396848, (130, 2) = -1.8139957173365475, (131, 1) = 1.9105602294964226, (131, 2) = -2.287756267663205, (132, 1) = 1.855672083763541, (132, 2) = -2.202500787900515, (133, 1) = 1.8071518523502108, (133, 2) = -1.7976304689619398, (134, 1) = 1.7701883252585813, (134, 2) = -1.2658293621623369, (135, 1) = 1.747000537150921, (135, 2) = -.7287233944999718, (136, 1) = 1.7367655628415017, (136, 2) = -.2640804788589072, (137, 1) = 1.7356000928289879, (137, 2) = .1356865758105073, (138, 1) = 1.7408255438725242, (138, 2) = .4858209759016318, (139, 1) = 1.7506757006156077, (139, 2) = .7990089952580139, (140, 1) = 1.7639631832878049, (140, 2) = 1.0848102821050365, (141, 1) = 1.7798711333745194, (141, 2) = 1.3502621854582824, (142, 1) = 1.7978248762196696, (142, 2) = 1.600559534758377, (143, 1) = 1.8174121361251319, (143, 2) = 1.8395875364259227, (144, 1) = 1.8383314012826037, (144, 2) = 2.0702924110591288, (145, 1) = 1.8603588472423433, (145, 2) = 2.294949264717166, (146, 1) = 1.8833262678026457, (146, 2) = 2.5153470671458207, (147, 1) = 1.9071056820325802, (147, 2) = 2.7329148466370925, (148, 1) = 1.9315987870236686, (148, 2) = 2.9488130917425766, (149, 1) = 1.9567299434167018, (149, 2) = 3.1640031545087486, (150, 1) = 1.9824404272037903, (150, 2) = 3.379291468729201, (151, 1) = 2.0086839605395936, (151, 2) = 3.5953603993348553, (152, 1) = 2.0354256879874106, (152, 2) = 3.812810073365731, (153, 1) = 2.062637367479104, (153, 2) = 4.0321566299589335, (154, 1) = 2.0902986765983758, (154, 2) = 4.253871580256697, (155, 1) = 2.118392863260354, (155, 2) = 4.478368757613599, (156, 1) = 2.1469084526936144, (156, 2) = 4.70603521310951, (157, 1) = 2.175837382566909, (157, 2) = 4.937229772383448, (158, 1) = 2.2051737207834075, (158, 2) = 5.172283590860779, (159, 1) = 2.2348743127922583, (159, 2) = 5.411191458744634, (160, 1) = 2.2644500041646727, (160, 2) = 5.650295690104134, (161, 1) = 2.2937055301846807, (161, 2) = 5.888209887887755, (162, 1) = 2.3226459226924674, (162, 2) = 6.1251103564798495, (163, 1) = 2.3512907561955467, (163, 2) = 6.361258888522481, (164, 1) = 2.3796606547873345, (164, 2) = 6.596902532692219, (165, 1) = 2.4077767498016844, (165, 2) = 6.832275673521365, (166, 1) = 2.435660221997729, (166, 2) = 7.067601221584761, (167, 1) = 2.463332334780739, (167, 2) = 7.303094734533151, (168, 1) = 2.490816471448168, (168, 2) = 7.53898503119106, (169, 1) = 2.5181338409954215, (169, 2) = 7.775480080904302, (170, 1) = 2.5453042872557936, (170, 2) = 8.012775265754804, (171, 1) = 2.5723480975870063, (171, 2) = 8.251070472146123, (172, 1) = 2.5992884478819875, (172, 2) = 8.490593445402647, (173, 1) = 2.6261436128033866, (173, 2) = 8.731531903994723, (174, 1) = 2.652932782626758, (174, 2) = 8.97408546295497, (175, 1) = 2.679677709854055, (175, 2) = 9.218481985306092, (176, 1) = 2.7063952328267518, (176, 2) = 9.464910199685786, (177, 1) = 2.7331058240418673, (177, 2) = 9.713598308240536, (178, 1) = 2.7598273951286862, (178, 2) = 9.964757740576728, (179, 1) = 2.786578319164531, (179, 2) = 10.218611547251097, (180, 1) = 2.813377039715548, (180, 2) = 10.475391505047558, (181, 1) = 2.840241495490389, (181, 2) = 10.735333231766598, (182, 1) = 2.8671893440509666, (182, 2) = 10.99867886771885, (183, 1) = 2.8942390936057563, (183, 2) = 11.26568885657173, (184, 1) = 2.921407341841214, (184, 2) = 11.536615508966532, (185, 1) = 2.948713552731732, (185, 2) = 11.811751185006424, (186, 1) = 2.976173340196842, (186, 2) = 12.091361959778359, (187, 1) = 3.003807249950244, (187, 2) = 12.375777335510161, (188, 1) = 3.031630369558518, (188, 2) = 12.665285319531382, (189, 1) = 3.0596638558915292, (189, 2) = 12.960252390051474, (190, 1) = 3.087923724878711, (190, 2) = 13.261008317004979, (191, 1) = 3.116429877855737, (191, 2) = 13.567942140361016, (192, 1) = 3.1452019187126066, (192, 2) = 13.88146022312268, (193, 1) = 3.174256416366404, (193, 2) = 14.201957328628339, (194, 1) = 3.203618029300584, (194, 2) = 14.529941381548007, (195, 1) = 3.233301133512497, (195, 2) = 14.865831959900095, (196, 1) = 3.2633328013174117, (196, 2) = 15.210220137300256, (197, 1) = 3.293730371934068, (197, 2) = 15.563618149340185, (198, 1) = 3.324516727923597, (198, 2) = 15.926635730295361, (199, 1) = 3.355718344955579, (199, 2) = 16.299964094964025, (200, 1) = 3.3873527184670316, (200, 2) = 16.684228740467564, (201, 1) = 3.419452644495199, (201, 2) = 17.080286540184286, (202, 1) = 3.452038936023861, (202, 2) = 17.48889997104073, (203, 1) = 3.4851391997638705, (203, 2) = 17.91097084002699, (204, 1) = 3.518787007595249, (204, 2) = 18.347541636478987, (205, 1) = 3.5530048246636516, (205, 2) = 18.799580647298527, (206, 1) = 3.5878322591378202, (206, 2) = 19.268358446676956, (207, 1) = 3.6233001413972294, (207, 2) = 19.755117615869175, (208, 1) = 3.6594403163130003, (208, 2) = 20.261207471088934, (209, 1) = 3.6962994158992246, (209, 2) = 20.788292629078093, (210, 1) = 3.733910826968825, (210, 2) = 21.337971563392305, (211, 1) = 3.772320000996824, (211, 2) = 21.912148706412534, (212, 1) = 3.8115778468489965, (212, 2) = 22.51296460441515, (213, 1) = 3.851726363332059, (213, 2) = 23.142591934457023, (214, 1) = 3.8928267372315797, (214, 2) = 23.803690911862482, (215, 1) = 3.934935930441873, (215, 2) = 24.499074151615474, (216, 1) = 3.978110857651852, (216, 2) = 25.231789480065938, (217, 1) = 4.022428992375078, (217, 2) = 26.005505178977995, (218, 1) = 4.0679599734355065, (218, 2) = 26.824068719118205, (219, 1) = 4.114781571285711, (219, 2) = 27.6918144881913, (220, 1) = 4.162990999115868, (220, 2) = 28.613836852058945, (221, 1) = 4.21267875197291, (221, 2) = 29.59556085655894, (222, 1) = 4.263951397940499, (222, 2) = 30.643234815437413, (223, 1) = 4.316933037240854, (223, 2) = 31.76406282895504, (224, 1) = 4.371746001472759, (224, 2) = 32.96589407146075, (225, 1) = 4.428537177892839, (225, 2) = 34.25788681492983, (226, 1) = 4.487469831432685, (226, 2) = 35.65048601879827, (227, 1) = 4.548714273764117, (227, 2) = 37.15534885284654, (228, 1) = 4.612474705197783, (228, 2) = 38.78617503669962, (229, 1) = 4.678974377813236, (229, 2) = 40.55859331572982, (230, 1) = 4.7484562348806385, (230, 2) = 42.49042323841533, (231, 1) = 4.8212091794085215, (231, 2) = 44.602732223421526, (232, 1) = 4.897550681391886, (232, 2) = 46.919783931576994, (233, 1) = 4.977836258214376, (233, 2) = 49.46978253948843, (234, 1) = 5.062486398380529, (234, 2) = 52.286357069382106, (235, 1) = 5.151970328113153, (235, 2) = 55.4088549802804, (236, 1) = 5.246825135949528, (236, 2) = 58.88393116379276, (237, 1) = 5.347686386243535, (237, 2) = 62.767945223547635, (238, 1) = 5.45527811128566, (238, 2) = 67.12825372875328, (239, 1) = 5.570445900590808, (239, 2) = 72.04656744895523, (240, 1) = 5.694198331847795, (240, 2) = 77.62352962526896, (241, 1) = 5.827713141100247, (241, 2) = 83.98275527140292, (242, 1) = 5.97239695109456, (242, 2) = 91.2785511743751, (243, 1) = 6.129955753954183, (243, 2) = 99.70639344239785, (244, 1) = 6.302442716859202, (244, 2) = 109.5151389785495, (245, 1) = 6.492381621232821, (245, 2) = 121.0275080010818, (246, 1) = 6.702920345468326, (246, 2) = 134.66931185772873, (247, 1) = 6.938000089073476, (247, 2) = 151.00999336614797, (248, 1) = 7.20266746245575, (248, 2) = 170.82915130447523, (249, 1) = 7.503505629494219, (249, 2) = 195.22011290049133, (250, 1) = 7.849239600963847, (250, 2) = 225.75521776054381, (251, 1) = 8.251774119315153, (251, 2) = 264.77471370518674, (252, 1) = 8.727840810952246, (252, 2) = 315.9004030601857, (253, 1) = 9.30177210389072, (253, 2) = 385.0044437469404, (254, 1) = 10.010693558249125, (254, 2) = 482.2028777737413, (255, 1) = 10.914658448521092, (255, 2) = 626.3138715247973, (256, 1) = 12.118672763119722, (256, 2) = 856.1325139105058}, 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(256, {(1) = -.615479708670389, (2) = -.6138337655059911, (3) = -.6121877371363221, (4) = -.610541623152404, (5) = -.6088953251908921, (6) = -.6072487671472097, (7) = -.6056019471744036, (8) = -.6039547492398832, (9) = -.6023071028585135, (10) = -.600659003239894, (11) = -.5990103110283401, (12) = -.5973609594036162, (13) = -.5957109382804167, (14) = -.5940600787075152, (15) = -.592408316893275, (16) = -.5907556337655888, (17) = -.589101824521824, (18) = -.5874468288606902, (19) = -.585790613017156, (20) = -.5841329309576447, (21) = -.5824737271461466, (22) = -.5808129444592497, (23) = -.5791502923727325, (24) = -.5774857217781857, (25) = -.5758191392268837, (26) = -.5741502104173669, (27) = -.5724788940395652, (28) = -.5708050411421474, (29) = -.5691282811123882, (30) = -.5674485804227406, (31) = -.5657657065322664, (32) = -.5640792708720453, (33) = -.5623892445543703, (34) = -.5606952706775499, (35) = -.5589969780179599, (36) = -.5572943246689157, (37) = -.555586796800204, (38) = -.5538740753768657, (39) = -.5521560662027295, (40) = -.5504321023790923, (41) = -.5487019283191328, (42) = -.5469653407777109, (43) = -.5452215561139513, (44) = -.5434703809718867, (45) = -.5417114118674226, (46) = -.5399438369309824, (47) = -.5381675001638607, (48) = -.5363816612793244, (49) = -.5345856438064434, (50) = -.5327791976962112, (51) = -.5309612570931616, (52) = -.5291313415384594, (53) = -.5272888957313684, (54) = -.525432745213056, (55) = -.523562514992632, (56) = -.5216770864410629, (57) = -.5197755400848111, (58) = -.5178572425620112, (59) = -.515920711401875, (60) = -.5139652765527121, (61) = -.5119895907876776, (62) = -.5099924034933055, (63) = -.5079727160294226, (64) = -.5059287438667803, (65) = -.5038594483715606, (66) = -.5017629397592426, (67) = -.4996377699518008, (68) = -.49748213518145645, (69) = -.49529405774722146, (70) = -.49307171190353477, (71) = -.4908127037482733, (72) = -.48851496049995186, (73) = -.48617577893132347, (74) = -.4837926795108566, (75) = -.48136264479140517, (76) = -.4788826875598093, (77) = -.47634940862604525, (78) = -.4737592248726671, (79) = -.47110824288051906, (80) = -.46839220670201365, (81) = -.46560652263193936, (82) = -.4627462688840759, (83) = -.45980582730548547, (84) = -.4567795100866846, (85) = -.4536605585746382, (86) = -.45044190982538507, (87) = -.44711596396700165, (88) = -.4436737732409932, (89) = -.44010588450370247, (90) = -.43640194597493315, (91) = -.4325503265005061, (92) = -.4285378041296347, (93) = -.4243499633478024, (94) = -.41997068666716125, (95) = -.415381857195644, (96) = -.41056307352817695, (97) = -.4054913072194831, (98) = -.40014286075850014, (99) = -.3945291762613631, (100) = -.3887243469845279, (101) = -.38272333283023513, (102) = -.37651248996445524, (103) = -.3700765357249298, (104) = -.3633984542976641, (105) = -.35645951516908386, (106) = -.3492382879874373, (107) = -.3417110407352021, (108) = -.33385046669876445, (109) = -.32562584741600087, (110) = -.3170017781423065, (111) = -.3079373927769954, (112) = -.29838534976786646, (113) = -.28829018526282596, (114) = -.2775863529897709, (115) = -.26619576640273657, (116) = -.25402428090287404, (117) = -.24095674999268518, (118) = -.22685076083627745, (119) = -.21152693593807945, (120) = -.19475483127449672, (121) = -.17623202423500914, (122) = -.15554979660920581, (123) = -.13228994492398807, (124) = -.1082372279662562, (125) = -0.8418451100852434e-1, (126) = -0.6013179405079247e-1, (127) = -0.360790770930606e-1, (128) = -0.12026360135328736e-1, (129) = 0.1202635682240313e-1, (130) = 0.36079073780135e-1, (131) = 0.6013179073786687e-1, (132) = 0.8418450769559874e-1, (133) = .1082372246533306, (134) = .13228994161106247, (135) = .15554979358804727, (136) = .17623202154579037, (137) = .1947548288517443, (138) = .21152693373373746, (139) = .22685075881419176, (140) = .24095674812499612, (141) = .25402427916759346, (142) = .266195764782475, (143) = .2775863514700435, (144) = .2882901838320805, (145) = .298385348416205, (146) = .30793739149611127, (147) = .31700177692513, (148) = .32562584625647806, (149) = .3338504655917917, (150) = .3417110396761509, (151) = .34923828697230785, (152) = .3564595141944389, (153) = .3633984533603477, (154) = .37007653482219466, (155) = .37651248909388624, (156) = .3827233319895611, (157) = .3887243461717439, (158) = .39452917547476085, (159) = .4001428600026771, (160) = .40549130650739146, (161) = .410563072857691, (162) = .4153818565630173, (163) = .4199706860690814, (164) = .4243499627813222, (165) = .42853780359211907, (166) = .4325503259895911, (167) = .4364019454885977, (168) = .44010588404014256, (169) = .4436737727984631, (170) = .447115963543925, (171) = .45044190942046414, (172) = .453660558186639, (173) = .45677950971441716, (174) = .4598058269479823, (175) = .46274626854038836, (176) = .4656065223011885, (177) = .468392206383466, (178) = .47110824257342615, (179) = .4737592245763975, (180) = .4763494083399846, (181) = .4788826872834117, (182) = .48136264452415733, (183) = .4837926792522918, (184) = .48617577868100653, (185) = .4885149602574814, (186) = .49081270351328304, (187) = .49307171167567043, (188) = .4952940575261847, (189) = .4974821349669204, (190) = .4996377697435383, (191) = .5017629395569352, (192) = .5038594481750222, (193) = .5059287436757538, (194) = .5079727158437204, (195) = .5099924033127412, (196) = .5119895906120454, (197) = .5139652763818926, (198) = .5159207112356502, (199) = .517857242400274, (200) = .5197755399274191, (201) = .5216770862878711, (202) = .5235625148435622, (203) = .5254327450679438, (204) = .527288895590138, (205) = .529131341401021, (206) = .5309612569593932, (207) = .5327791975660613, (208) = .5345856436798079, (209) = .5363816611561303, (210) = .5381675000440663, (211) = .5399438368144777, (212) = .5417114117541697, (213) = .5434703808618371, (214) = .5452215560070248, (215) = .5469653406738793, (216) = .5487019282183432, (217) = .550432102281291, (218) = .5521560661078934, (219) = .5538740752849417, (220) = .5555867967111572, (221) = .5572943245827272, (222) = .5589969779345795, (223) = .5606952705969559, (224) = .5623892444765469, (225) = .5640792707969473, (226) = .5657657064598809, (227) = .567448580353051, (228) = .5691282810453618, (229) = .5708050410777735, (230) = .572478893977828, (231) = .5741502103582431, (232) = .5758191391703643, (233) = .5774857217242565, (234) = .5791502923213769, (235) = .5808129444104603, (236) = .5824737270999113, (237) = .5841329309139516, (238) = .5857906129759993, (239) = .5874468288220598, (240) = .5891018244857117, (241) = .5907556337319899, (242) = .592408316862182, (243) = .5940600786789219, (244) = .59571093825432, (245) = .597360959380009, (246) = .5990103110072196, (247) = .6006590032212563, (248) = .602307102842355, (249) = .6039547492262015, (250) = .605601947163196, (251) = .6072487671384748, (252) = .60889532518463, (253) = .6105416231486125, (254) = .6121877371346346, (255) = .6138337655055719, (256) = .615479708670389}, datatype = float[8], order = C_order); Y := Matrix(256, 2, {(1, 1) = .0, (1, 2) = 0.8533209791759556e-8, (2, 1) = 0.2515757323757251e-10, (2, 2) = 0.4356551964865028e-8, (3, 1) = 0.34487300349660374e-10, (3, 2) = 0.525825041510047e-8, (4, 1) = 0.4265633390260554e-10, (4, 2) = 0.4300179557821988e-8, (5, 1) = 0.4988853704975202e-10, (5, 2) = 0.46849561392692534e-8, (6, 1) = 0.5728983001630832e-10, (6, 2) = 0.4143633727994945e-8, (7, 1) = 0.6307058723556879e-10, (7, 2) = 0.30236483071126253e-8, (8, 1) = 0.6790288105801636e-10, (8, 2) = 0.29093982078393968e-8, (9, 1) = 0.7243318083872604e-10, (9, 2) = 0.2700903327376346e-8, (10, 1) = 0.76580091870178e-10, (10, 2) = 0.2422176533714323e-8, (11, 1) = 0.8028890421734465e-10, (11, 2) = 0.2028541175103088e-8, (12, 1) = 0.8354468676961248e-10, (12, 2) = 0.1937217968543841e-8, (13, 1) = 0.8649880027565613e-10, (13, 2) = 0.19333251286020524e-8, (14, 1) = 0.8940574977937043e-10, (14, 2) = 0.15160168692251884e-8, (15, 1) = 0.9188996181735388e-10, (15, 2) = 0.14735088369968248e-8, (16, 1) = 0.94191117130654e-10, (16, 2) = 0.12464816363704922e-8, (17, 1) = 0.9608714028928409e-10, (17, 2) = 0.10701622963881223e-8, (18, 1) = 0.9778104342513735e-10, (18, 2) = 0.10355020831958881e-8, (19, 1) = 0.995312239784579e-10, (19, 2) = 0.11078766659246384e-8, (20, 1) = 0.1013453521158331e-9, (20, 2) = 0.1083658467695548e-8, (21, 1) = 0.10309953045416797e-9, (21, 2) = 0.10535526325129998e-8, (22, 1) = 0.10479713163700592e-9, (22, 2) = 0.992013466494286e-9, (23, 1) = 0.10634813939614454e-9, (23, 2) = 0.8776230623788009e-9, (24, 1) = 0.10780270752166236e-9, (24, 2) = 0.8550369122887483e-9, (25, 1) = 0.10920504567861329e-9, (25, 2) = 0.8325755861906453e-9, (26, 1) = 0.11057896533563346e-9, (26, 2) = 0.8048675790133986e-9, (27, 1) = 0.11186527637729964e-9, (27, 2) = 0.7311835551613507e-9, (28, 1) = 0.11306972696613881e-9, (28, 2) = 0.7174220162605665e-9, (29, 1) = 0.114241975814458e-9, (29, 2) = 0.6954835347434e-9, (30, 1) = 0.11538830493187237e-9, (30, 2) = 0.6610366432857858e-9, (31, 1) = 0.11647099035164286e-9, (31, 2) = 0.6279944335675904e-9, (32, 1) = 0.1175132136689262e-9, (32, 2) = 0.6017917330130252e-9, (33, 1) = 0.1185154233592643e-9, (33, 2) = 0.5843873150224554e-9, (34, 1) = 0.1194866873619044e-9, (34, 2) = 0.5666029624070781e-9, (35, 1) = 0.12042797575658022e-9, (35, 2) = 0.5427394686070348e-9, (36, 1) = 0.1213517772657336e-9, (36, 2) = 0.533817435701165e-9, (37, 1) = 0.1222434720949681e-9, (37, 2) = 0.5092851838180783e-9, (38, 1) = 0.12310746546416638e-9, (38, 2) = 0.4978478528210585e-9, (39, 1) = 0.12395036604488718e-9, (39, 2) = 0.4867831881419308e-9, (40, 1) = 0.12477556518360088e-9, (40, 2) = 0.4697596147168694e-9, (41, 1) = 0.12557596890396535e-9, (41, 2) = 0.4560973949558534e-9, (42, 1) = 0.12635223166548033e-9, (42, 2) = 0.4384167451074847e-9, (43, 1) = 0.12711048298775955e-9, (43, 2) = 0.42889083667410355e-9, (44, 1) = 0.12784357476013238e-9, (44, 2) = 0.4119707573609822e-9, (45, 1) = 0.1285622377721097e-9, (45, 2) = 0.40264378399466534e-9, (46, 1) = 0.1292654468525978e-9, (46, 2) = 0.3937181789726958e-9, (47, 1) = 0.12995190868382547e-9, (47, 2) = 0.37918695824490137e-9, (48, 1) = 0.13062141755191356e-9, (48, 2) = 0.36999453909164137e-9, (49, 1) = 0.1312745259721413e-9, (49, 2) = 0.35771019643951154e-9, (50, 1) = 0.13190807791967123e-9, (50, 2) = 0.3443269891615897e-9, (51, 1) = 0.13252185128472693e-9, (51, 2) = 0.33176557536651465e-9, (52, 1) = 0.1331180960014748e-9, (52, 2) = 0.3212118788057865e-9, (53, 1) = 0.13370236815669886e-9, (53, 2) = 0.3111193758209748e-9, (54, 1) = 0.13427204157307295e-9, (54, 2) = 0.30277681741409533e-9, (55, 1) = 0.13482653489180127e-9, (55, 2) = 0.2922613770147601e-9, (56, 1) = 0.13536766963057763e-9, (56, 2) = 0.28198904643355514e-9, (57, 1) = 0.1358964506924581e-9, (57, 2) = 0.27386238593340363e-9, (58, 1) = 0.1364134547181195e-9, (58, 2) = 0.2651859801404068e-9, (59, 1) = 0.13691614481077628e-9, (59, 2) = 0.25510936018178266e-9, (60, 1) = 0.13740755121065104e-9, (60, 2) = 0.24591100303415436e-9, (61, 1) = 0.13788371502415191e-9, (61, 2) = 0.23685557662997546e-9, (62, 1) = 0.13834613546571035e-9, (62, 2) = 0.22758093709326893e-9, (63, 1) = 0.13879784522669758e-9, (63, 2) = 0.21877381995516132e-9, (64, 1) = 0.13923830785402788e-9, (64, 2) = 0.21128479486672138e-9, (65, 1) = 0.13966809857585072e-9, (65, 2) = 0.20471201164945568e-9, (66, 1) = 0.14008937522193296e-9, (66, 2) = 0.19783055046383375e-9, (67, 1) = 0.1405016184519593e-9, (67, 2) = 0.19071812054967575e-9, (68, 1) = 0.1409071100587197e-9, (68, 2) = 0.1842265135512411e-9, (69, 1) = 0.1413022639152057e-9, (69, 2) = 0.17789960734136491e-9, (70, 1) = 0.1416899226561393e-9, (70, 2) = 0.17144994213865875e-9, (71, 1) = 0.1420699405013175e-9, (71, 2) = 0.164915689054326e-9, (72, 1) = 0.14243926274373202e-9, (72, 2) = 0.15866152671510735e-9, (73, 1) = 0.14280639976899333e-9, (73, 2) = 0.15293914367398265e-9, (74, 1) = 0.14316234571407876e-9, (74, 2) = 0.14685924245240502e-9, (75, 1) = 0.14351203546155605e-9, (75, 2) = 0.1412064630772625e-9, (76, 1) = 0.1438541126905857e-9, (76, 2) = 0.13575632008985076e-9, (77, 1) = 0.14419172348317513e-9, (77, 2) = 0.13012146020690178e-9, (78, 1) = 0.14452217768309184e-9, (78, 2) = 0.12514475784613361e-9, (79, 1) = 0.14484753401719306e-9, (79, 2) = 0.12009099118924156e-9, (80, 1) = 0.14516719020474276e-9, (80, 2) = 0.11572049149876656e-9, (81, 1) = 0.1454837130366016e-9, (81, 2) = 0.11108637455442516e-9, (82, 1) = 0.14579553072933421e-9, (82, 2) = 0.10673352377294384e-9, (83, 1) = 0.1461006569840346e-9, (83, 2) = 0.10253354850619121e-9, (84, 1) = 0.14640548028592156e-9, (84, 2) = 0.9867791693628079e-10, (85, 1) = 0.14670626925167535e-9, (85, 2) = 0.9480687017503295e-10, (86, 1) = 0.14700583774830916e-9, (86, 2) = 0.9116116554923188e-10, (87, 1) = 0.1473049909397681e-9, (87, 2) = 0.877869966247201e-10, (88, 1) = 0.14760041098065547e-9, (88, 2) = 0.8464332937873904e-10, (89, 1) = 0.14789678566760437e-9, (89, 2) = 0.8140568540627396e-10, (90, 1) = 0.14819354000131068e-9, (90, 2) = 0.785731969475988e-10, (91, 1) = 0.14848991857465053e-9, (91, 2) = 0.757538450054471e-10, (92, 1) = 0.14878614045810977e-9, (92, 2) = 0.728059451158104e-10, (93, 1) = 0.14908555521160818e-9, (93, 2) = 0.7019108639773054e-10, (94, 1) = 0.14938803263731448e-9, (94, 2) = 0.6785871182608248e-10, (95, 1) = 0.14969571742819318e-9, (95, 2) = 0.6570314850552941e-10, (96, 1) = 0.15000665939816954e-9, (96, 2) = 0.6352981747903578e-10, (97, 1) = 0.1503233008628134e-9, (97, 2) = 0.6158620340441397e-10, (98, 1) = 0.1506454071567134e-9, (98, 2) = 0.600381866160094e-10, (99, 1) = 0.15098072954172405e-9, (99, 2) = 0.5876284495690779e-10, (100, 1) = 0.15131649362842804e-9, (100, 2) = 0.5785943062479622e-10, (101, 1) = 0.15166192024147255e-9, (101, 2) = 0.56983333902370786e-10, (102, 1) = 0.15201436806502833e-9, (102, 2) = 0.5663095967493995e-10, (103, 1) = 0.15237897517143947e-9, (103, 2) = 0.5675181383907271e-10, (104, 1) = 0.1527591712687427e-9, (104, 2) = 0.571542042713807e-10, (105, 1) = 0.153157231138773e-9, (105, 2) = 0.5779159951216207e-10, (106, 1) = 0.1535781995858007e-9, (106, 2) = 0.586881870917977e-10, (107, 1) = 0.15402308422391518e-9, (107, 2) = 0.6008035467798718e-10, (108, 1) = 0.1545014981960464e-9, (108, 2) = 0.6190903717956632e-10, (109, 1) = 0.1550226837737758e-9, (109, 2) = 0.6476364397730228e-10, (110, 1) = 0.15559148248518069e-9, (110, 2) = 0.6792728304923652e-10, (111, 1) = 0.15622732478860817e-9, (111, 2) = 0.7194894745539503e-10, (112, 1) = 0.15693747841982744e-9, (112, 2) = 0.7716184891982996e-10, (113, 1) = 0.15774343430632953e-9, (113, 2) = 0.8252894580087552e-10, (114, 1) = 0.1586626817554741e-9, (114, 2) = 0.8929058072254165e-10, (115, 1) = 0.1597251472433548e-9, (115, 2) = 0.975779133032407e-10, (116, 1) = 0.16096810637633238e-9, (116, 2) = 0.10713680678622781e-9, (117, 1) = 0.1624429732592064e-9, (117, 2) = 0.11829097937170303e-9, (118, 1) = 0.16421336863872674e-9, (118, 2) = 0.13343486818052482e-9, (119, 1) = 0.16640896558606782e-9, (119, 2) = 0.15438857743483395e-9, (120, 1) = 0.16920151692285782e-9, (120, 2) = 0.1799616287504575e-9, (121, 1) = 0.17287160288238618e-9, (121, 2) = 0.21739907195856502e-9, (122, 1) = 0.17778606270230984e-9, (122, 2) = 0.25840880287087396e-9, (123, 1) = 0.18447361064235885e-9, (123, 2) = 0.3154496892435486e-9, (124, 1) = 0.1928360460924727e-9, (124, 2) = 0.3678535668156288e-9, (125, 1) = 0.20275029947602662e-9, (125, 2) = 0.41267939176723456e-9, (126, 1) = 0.21259514620726693e-9, (126, 2) = 0.4514839327908819e-9, (127, 1) = 0.22206027873003437e-9, (127, 2) = 0.4652297617979372e-9, (128, 1) = 0.23103712682809456e-9, (128, 2) = 0.31458807900491405e-9, (129, 1) = 0.2413306468022318e-9, (129, 2) = 0.6146587943674196e-10, (130, 1) = 0.2374287319323687e-9, (130, 2) = -0.30248189102626667e-9, (131, 1) = 0.2281609004219964e-9, (131, 2) = -0.30838216198109124e-9, (132, 1) = 0.2187852801390259e-9, (132, 2) = -0.402643686064273e-9, (133, 1) = 0.20975781391329893e-9, (133, 2) = -0.3424746729205818e-9, (134, 1) = 0.20193562825995716e-9, (134, 2) = -0.34302491728505056e-9, (135, 1) = 0.19511756259532778e-9, (135, 2) = -0.2600189428793413e-9, (136, 1) = 0.18997659135865887e-9, (136, 2) = -0.2381569246329007e-9, (137, 1) = 0.18583894665214568e-9, (137, 2) = -0.18442974701411756e-9, (138, 1) = 0.18305922391915463e-9, (138, 2) = -0.14557853726221435e-9, (139, 1) = 0.18128284098517307e-9, (139, 2) = -0.8475523914546887e-10, (140, 1) = 0.18024608090837897e-9, (140, 2) = -0.6195245125227817e-10, (141, 1) = 0.17960816573837288e-9, (141, 2) = -0.32183825802087174e-10, (142, 1) = 0.17928086801377931e-9, (142, 2) = -0.3483505765024703e-10, (143, 1) = 0.17885351981472387e-9, (143, 2) = -0.34642142700136435e-10, (144, 1) = 0.1785542767244914e-9, (144, 2) = -0.21247896908335142e-10, (145, 1) = 0.17835793799213866e-9, (145, 2) = -0.11726685256897583e-10, (146, 1) = 0.1782680090867723e-9, (146, 2) = -0.11846396144205788e-10, (147, 1) = 0.17809907125905989e-9, (147, 2) = -0.30113614350165256e-10, (148, 1) = 0.17775054007955077e-9, (148, 2) = -0.4448148153058412e-10, (149, 1) = 0.17745595476712513e-9, (149, 2) = -0.268232131621915e-10, (150, 1) = 0.17738478724675014e-9, (150, 2) = 0.5478830046701785e-12, (151, 1) = 0.17738287754576913e-9, (151, 2) = 0.11752989133877892e-11, (152, 1) = 0.1773921433654561e-9, (152, 2) = -0.18415148066836067e-11, (153, 1) = 0.17736395967643572e-9, (153, 2) = 0.8201885316581704e-11, (154, 1) = 0.17748056023622617e-9, (154, 2) = 0.3157732758383743e-10, (155, 1) = 0.17761833634956764e-9, (155, 2) = 0.7303620199416457e-11, (156, 1) = 0.17755960451328362e-9, (156, 2) = -0.19645726102606908e-10, (157, 1) = 0.177490111160808e-9, (157, 2) = -0.6183092036826337e-11, (158, 1) = 0.1774860683177954e-9, (158, 2) = 0.13791199685361597e-10, (159, 1) = 0.17751007347546954e-9, (159, 2) = -0.1123658997823074e-11, (160, 1) = 0.17755374685089973e-9, (160, 2) = 0.9530905723236285e-11, (161, 1) = 0.17761328418355242e-9, (161, 2) = 0.3180032599835407e-10, (162, 1) = 0.1777804158043923e-9, (162, 2) = 0.3172129721923157e-10, (163, 1) = 0.1778891010668955e-9, (163, 2) = 0.1099360055708356e-10, (164, 1) = 0.17792174263627237e-9, (164, 2) = 0.6336900942903055e-11, (165, 1) = 0.17794532741586075e-9, (165, 2) = -0.8106825689249755e-11, (166, 1) = 0.1778612875625986e-9, (166, 2) = -0.317027679655097e-10, (167, 1) = 0.17772309218802811e-9, (167, 2) = -0.3604394611146823e-10, (168, 1) = 0.17753472151607115e-9, (168, 2) = -0.6067263218178792e-10, (169, 1) = 0.17734845788383116e-9, (169, 2) = -0.4301974601090625e-10, (170, 1) = 0.17717180728423692e-9, (170, 2) = -0.708673230717158e-10, (171, 1) = 0.17692909330780661e-9, (171, 2) = -0.7545885488672684e-10, (172, 1) = 0.17669107524190348e-9, (172, 2) = -0.7867451609850719e-10, (173, 1) = 0.17643592864261849e-9, (173, 2) = -0.8467122173832023e-10, (174, 1) = 0.1761626497964295e-9, (174, 2) = -0.10066116960930594e-9, (175, 1) = 0.17585144912895112e-9, (175, 2) = -0.10327533854387069e-9, (176, 1) = 0.17559282130767614e-9, (176, 2) = -0.8564068029823272e-10, (177, 1) = 0.17534767245626483e-9, (177, 2) = -0.9542740414368665e-10, (178, 1) = 0.175070872955065e-9, (178, 2) = -0.11141432025269159e-9, (179, 1) = 0.17472941681676618e-9, (179, 2) = -0.14401924343592074e-9, (180, 1) = 0.17434902748177944e-9, (180, 2) = -0.1374002367609609e-9, (181, 1) = 0.17397684310674838e-9, (181, 2) = -0.1514042023397739e-9, (182, 1) = 0.17359120757281704e-9, (182, 2) = -0.16687656138220841e-9, (183, 1) = 0.17313170857768555e-9, (183, 2) = -0.23765838734579775e-9, (184, 1) = 0.17253760117550773e-9, (184, 2) = -0.24804556507332825e-9, (185, 1) = 0.17197121854554688e-9, (185, 2) = -0.2478784774481122e-9, (186, 1) = 0.17140649552311378e-9, (186, 2) = -0.2248214763691401e-9, (187, 1) = 0.1709007043634424e-9, (187, 2) = -0.21100426153256604e-9, (188, 1) = 0.17042119686362235e-9, (188, 2) = -0.22494646702043228e-9, (189, 1) = 0.1698666780630662e-9, (189, 2) = -0.26753020861153144e-9, (190, 1) = 0.16928851840810036e-9, (190, 2) = -0.27526462995618593e-9, (191, 1) = 0.16872313536551076e-9, (191, 2) = -0.23658036064141335e-9, (192, 1) = 0.16824929688132656e-9, (192, 2) = -0.21785942537103216e-9, (193, 1) = 0.16780275183295847e-9, (193, 2) = -0.223064601469443e-9, (194, 1) = 0.16733906322733267e-9, (194, 2) = -0.2333692724310377e-9, (195, 1) = 0.16684008695267043e-9, (195, 2) = -0.2488801839151861e-9, (196, 1) = 0.16629562418352343e-9, (196, 2) = -0.29060115832163023e-9, (197, 1) = 0.1657485834859793e-9, (197, 2) = -0.25797855795615506e-9, (198, 1) = 0.16520385651821047e-9, (198, 2) = -0.28414245587093825e-9, (199, 1) = 0.16466234222347776e-9, (199, 2) = -0.26368827638414005e-9, (200, 1) = 0.16412831346804377e-9, (200, 2) = -0.2870411840885671e-9, (201, 1) = 0.16354950240127468e-9, (201, 2) = -0.30250781772573616e-9, (202, 1) = 0.1629334785707865e-9, (202, 2) = -0.36372184795261004e-9, (203, 1) = 0.16220060507478054e-9, (203, 2) = -0.38253906582633955e-9, (204, 1) = 0.1614337287419683e-9, (204, 2) = -0.4276495439190967e-9, (205, 1) = 0.16066818900676244e-9, (205, 2) = -0.40053038297561614e-9, (206, 1) = 0.1599513556001602e-9, (206, 2) = -0.395359534420508e-9, (207, 1) = 0.15922068345809328e-9, (207, 2) = -0.39003522154398776e-9, (208, 1) = 0.1584609126564144e-9, (208, 2) = -0.4486345987496402e-9, (209, 1) = 0.15764683019649017e-9, (209, 2) = -0.4673923746733245e-9, (210, 1) = 0.15679112151539502e-9, (210, 2) = -0.4688996721738172e-9, (211, 1) = 0.15595536017878682e-9, (211, 2) = -0.4788288367557785e-9, (212, 1) = 0.1550571038741057e-9, (212, 2) = -0.521898153737371e-9, (213, 1) = 0.15411959786796268e-9, (213, 2) = -0.5799873583276121e-9, (214, 1) = 0.15304138755347932e-9, (214, 2) = -0.6121049187787375e-9, (215, 1) = 0.15189795105220422e-9, (215, 2) = -0.7852360392693309e-9, (216, 1) = 0.15051718370584743e-9, (216, 2) = -0.7608401197568743e-9, (217, 1) = 0.14928155823030808e-9, (217, 2) = -0.718566229861273e-9, (218, 1) = 0.148017034735096e-9, (218, 2) = -0.7194579006760514e-9, (219, 1) = 0.14668417201808262e-9, (219, 2) = -0.8162091653252132e-9, (220, 1) = 0.14529092928060384e-9, (220, 2) = -0.7978579564310519e-9, (221, 1) = 0.14401410981433506e-9, (221, 2) = -0.7109197028545267e-9, (222, 1) = 0.14276148999897797e-9, (222, 2) = -0.8090086191747477e-9, (223, 1) = 0.1412293570053859e-9, (223, 2) = -0.10635261275332528e-8, (224, 1) = 0.1391633809659182e-9, (224, 2) = -0.1362658237052821e-8, (225, 1) = 0.13694246057394117e-9, (225, 2) = -0.12821506674772723e-8, (226, 1) = 0.13459809812027737e-9, (226, 2) = -0.1429939547251233e-8, (227, 1) = 0.132116701753709e-9, (227, 2) = -0.14602024092596638e-8, (228, 1) = 0.1296429147756651e-9, (228, 2) = -0.14848924130649073e-8, (229, 1) = 0.12670420482086657e-9, (229, 2) = -0.2024453530929389e-8, (230, 1) = 0.12359835382786773e-9, (230, 2) = -0.1710735271459598e-8, (231, 1) = 0.12104337913465696e-9, (231, 2) = -0.13854753794763311e-8, (232, 1) = 0.11878109025322994e-9, (232, 2) = -0.1280303923506126e-8, (233, 1) = 0.11669352532796897e-9, (233, 2) = -0.12544804052904891e-8, (234, 1) = 0.11444825006914873e-9, (234, 2) = -0.12984328101201121e-8, (235, 1) = 0.112579974860406e-9, (235, 2) = -0.10689472820984925e-8, (236, 1) = 0.1107091287309365e-9, (236, 2) = -0.1191109641758e-8, (237, 1) = 0.10865889457517803e-9, (237, 2) = -0.11486201657441699e-8, (238, 1) = 0.10626671818473344e-9, (238, 2) = -0.1925202629706879e-8, (239, 1) = 0.1030482856977682e-9, (239, 2) = -0.2018461401541499e-8, (240, 1) = 0.996347364950553e-10, (240, 2) = -0.19260738928663375e-8, (241, 1) = 0.9704899492491931e-10, (241, 2) = -0.15481075300795087e-8, (242, 1) = 0.9437332145766142e-10, (242, 2) = -0.184909221290761e-8, (243, 1) = 0.908939520489789e-10, (243, 2) = -0.2231650328894203e-8, (244, 1) = 0.8732950679214938e-10, (244, 2) = -0.21204959301359874e-8, (245, 1) = 0.8359287719772462e-10, (245, 2) = -0.2352542644486656e-8, (246, 1) = 0.7991776116656887e-10, (246, 2) = -0.22440616410190953e-8, (247, 1) = 0.7711091117822803e-10, (247, 2) = -0.13191753975313803e-8, (248, 1) = 0.7441529799946651e-10, (248, 2) = -0.17910242436330124e-8, (249, 1) = 0.7048259901959399e-10, (249, 2) = -0.28100392420676528e-8, (250, 1) = 0.6644564251098325e-10, (250, 2) = -0.17700391138996297e-8, (251, 1) = 0.6174743674733547e-10, (251, 2) = -0.35983309462523948e-8, (252, 1) = 0.53748800269876703e-10, (252, 2) = -0.6574229670441326e-8, (253, 1) = 0.41046774306620714e-10, (253, 2) = -0.9585281831683094e-8, (254, 1) = 0.2214825555039262e-10, (254, 2) = -0.12765752311713578e-7, (255, 1) = 0.33364537107475994e-11, (255, 2) = -0.12233796849054259e-7, (256, 1) = .0, (256, 2) = -0.9558323369337775e-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[256] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(1.2765752311713578e-8) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 256, [v(u), diff(v(u), u)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[256] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[256] 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`(256, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(256, 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[256] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(1.2765752311713578e-8) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 256, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[256] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[256] 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`(256, 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`(256, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893627908416226420, (2) = 36893627908416226860, (3) = 36893627908416227036}), (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]

251.700

>

 

We plot the curve as a skinny tube because it looks better that way

eval(S(u,v(u)), dsol):
convert(%, list):
p3 := tubeplot(%, u=-arctan(sqrt(2)/2)..arctan(sqrt(2)/2), color="Black", radius=0.015):

display(p1,p2,p3,labels=['x', 'y', 'z'],
        lightmodel=light4, scaling=constrained, style=surface, axes=none);

 

 

Download geodesic-on-rounded-cube.mw

You want to find a curve of shortest length (a geodesic) that lies on a prescribed surface and connects a pair of prescribed points on the surface.  Your points P and Q are not on the surface.  I modified your data a little so that they now lie on the surface.  Once you see how this works, you should be able to change the surface and the points at will.

Note: The contents of vector quantities are shown as question marks on this web page.  That's due to this website's interface.  Vectors are shown properly in the actual worksheet.

 

 

Geodesic on a saddle

restart;

with(plots):

The surface

S := (x,y) -> < x, y, x^2 - y^2 >;

proc (x, y) options operator, arrow; `<,>`(x, y, x^2-y^2) end proc

Two arbitrary points on the surface

P, Q := S(-1,1), S(1,0);

Vector[column](%id = 36893627977232959836), Vector[column](%id = 36893627977232959956)

p1 := display(        
    pointplot3d([P, Q], symbol=solidsphere,  symbolsize=35,
        color=["Red", "Green"]),

    plot3d(S(x,y), x=-1..1, y=-1..1, color="Orange")):

Curve on the surface -- parametrized by x

C := S(x,y(x));

Vector(3, {(1) = x, (2) = y(x), (3) = x^2-y(x)^2})

Tangent vector to the curve

T := diff(C, x);

Vector(3, {(1) = 1, (2) = diff(y(x), x), (3) = 2*x-2*y(x)*(diff(y(x), x))})

The length of the tangent vector

T__len := sqrt(simplify(T^+ . T));

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

The shortest curve (the geodesic) is the solution of the Euler-Lagrange differential equation

VariationalCalculus:-EulerLagrange(T__len, x, y(x)):
simplify(%):
DE := numer(%)[];

-4*(diff(y(x), x))^3*x-4*(diff(diff(y(x), x), x))*y(x)^2-4*(diff(diff(y(x), x), x))*x^2-4*y(x)*(diff(y(x), x))^2+4*(diff(y(x), x))*x-(diff(diff(y(x), x), x))+4*y(x)

Boundary conditions correspond to the selected points P and Q

BC := y(P[1]) = P[2], y(Q[1]) = Q[2];

y(-1) = 1, y(1) = 0

Solve the boundary value problem numerically:

dsol := dsolve({DE,BC}, numeric, output=operator);

[x = proc (x) 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(17, {(1) = -1.0, (2) = -.881314573604071, (3) = -.7626137574478762, (4) = -.6438960128307195, (5) = -.5251419038775501, (6) = -.4061832322992237, (7) = -.2867715754446697, (8) = -.16605699133148072, (9) = -0.43592446844154975e-1, (10) = 0.8134598150489117e-1, (11) = .2090180658531396, (12) = .33965149776730164, (13) = .4725834570241455, (14) = .6074408231152467, (15) = .7434520012281486, (16) = .8768123081311927, (17) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(17, 2, {(1, 1) = 1.0, (1, 2) = -.9036114850020972, (2, 1) = .8939503318580311, (2, 2) = -.8825269753192191, (3, 1) = .7907593962496425, (3, 2) = -.8548795736098532, (4, 1) = .6913357467749914, (4, 2) = -.8183867564334204, (5, 1) = .5968756042543925, (5, 2) = -.7702964061041976, (6, 1) = .5088037667115055, (6, 2) = -.7078731241727911, (7, 1) = .42878479727508717, (7, 2) = -.6298882635983046, (8, 1) = .3581581279839408, (8, 2) = -.5388193010117547, (9, 1) = .2980303866929626, (9, 2) = -.44384965364984164, (10, 1) = .24808927311196535, (10, 2) = -.35871812789138824, (11, 1) = .2066283465239346, (11, 2) = -.2951873752097467, (12, 1) = .17083964102526264, (12, 2) = -.25700561428543883, (13, 1) = .13793815301961443, (13, 2) = -.24137492166248067, (14, 1) = .10544209718036258, (14, 2) = -.24299361177153342, (15, 1) = 0.7155577184259979e-1, (15, 2) = -.2569943799921452, (16, 1) = 0.3589027272772853e-1, (16, 2) = -.27900073590561947, (17, 1) = .0, (17, 2) = -.30435227224620726}, datatype = float[8], order = C_order); YP := Matrix(17, 2, {(1, 1) = -.9036114850020972, (1, 2) = .15523848795144785, (2, 1) = -.8825269753192191, (2, 2) = .202478308555027, (3, 1) = -.8548795736098532, (3, 2) = .26656134056583153, (4, 1) = -.8183867564334204, (4, 2) = .3521363993771173, (5, 1) = -.7702964061041976, (5, 2) = .46167002762658294, (6, 1) = -.7078731241727911, (6, 2) = .5895851966020256, (7, 1) = -.6298882635983046, (7, 2) = .7123238332721404, (8, 1) = -.5388193010117547, (8, 2) = .7827315098667857, (9, 1) = -.44384965364984164, (9, 2) = .7479826161460762, (10, 1) = -.35871812789138824, (10, 2) = .5994996231794513, (11, 1) = -.2951873752097467, (11, 2) = .39330188238770614, (12, 1) = -.25700561428543883, (12, 2) = .19776701672020852, (13, 1) = -.24137492166248067, (13, 2) = 0.4565287469614531e-1, (14, 1) = -.24299361177153342, (14, 2) = -0.6296221310076555e-1, (15, 1) = -.2569943799921452, (15, 2) = -.13816359005849788, (16, 1) = -.27900073590561947, (16, 2) = -.18870168484040642, (17, 1) = -.30435227224620726, (17, 2) = -.22092802260117167}, 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(17, {(1) = -1.0, (2) = -.881314573604071, (3) = -.7626137574478762, (4) = -.6438960128307195, (5) = -.5251419038775501, (6) = -.4061832322992237, (7) = -.2867715754446697, (8) = -.16605699133148072, (9) = -0.43592446844154975e-1, (10) = 0.8134598150489117e-1, (11) = .2090180658531396, (12) = .33965149776730164, (13) = .4725834570241455, (14) = .6074408231152467, (15) = .7434520012281486, (16) = .8768123081311927, (17) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(17, 2, {(1, 1) = .0, (1, 2) = -0.11468057454388334e-9, (2, 1) = -0.1867556707612165e-9, (2, 2) = -0.32688151463847745e-9, (3, 1) = -0.477963328042933e-9, (3, 2) = -0.5820363917180865e-9, (4, 1) = -0.825752736007871e-9, (4, 2) = -0.6354889892571108e-9, (5, 1) = -0.10831523837839e-8, (5, 2) = -0.13121650631496683e-9, (6, 1) = -0.10922484996893976e-8, (6, 2) = 0.5544178856842942e-9, (7, 1) = -0.4430272332201849e-9, (7, 2) = -0.4592445786786911e-9, (8, 1) = 0.27317590412696142e-8, (8, 2) = -0.3026289676052318e-8, (9, 1) = 0.6889580871116641e-8, (9, 2) = 0.32533657870168752e-8, (10, 1) = 0.20994059016674934e-8, (10, 2) = 0.14007480613345726e-7, (11, 1) = -0.4539008021021346e-8, (11, 2) = 0.7059799227649028e-9, (12, 1) = -0.3502145597380271e-8, (12, 2) = -0.8042569529160365e-8, (13, 1) = -0.937016818059331e-9, (13, 2) = -0.4924754438585803e-8, (14, 1) = 0.1495611110106997e-9, (14, 2) = -0.18876878645374402e-8, (15, 1) = 0.31044346251777496e-9, (15, 2) = -0.9291399022834447e-9, (16, 1) = 0.17057145255092576e-9, (16, 2) = -0.898226159089718e-9, (17, 1) = .0, (17, 2) = -0.10307528528540749e-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[17] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.4007480613345726e-8) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 17, [y(x), diff(y(x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[17] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[17] 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`(17, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(17, 2, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[y(x), diff(y(x), x)]'[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[17] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.4007480613345726e-8) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 17, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[17] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[17] 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`(17, 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`(17, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893627976949936124, (2) = 36893627976949936564, (3) = 36893627976949936740}), (3) = [x, y(x), diff(y(x), x)], (4) = 0}); _solnproc := _dat[1]; if member(x, ["last", 'last']) then _res := _solnproc("last"); if type(_res, 'list') then return _res[1] end if elif type(x, `=`) and member(lhs(x), ["initial", 'initial']) then if type(rhs(x), 'list') then _res := _solnproc("initial" = [0, op(rhs(x))]) else _res := _solnproc("initial" = [1, rhs(x)]) end if; if type(_res, 'list') then return _res[1] end if elif x = "sysvars" then return _dat[3] end if; x end proc, y = proc (x) local res, data, solnproc, y, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](x) else outpoint := evalf(x) 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(17, {(1) = -1.0, (2) = -.881314573604071, (3) = -.7626137574478762, (4) = -.6438960128307195, (5) = -.5251419038775501, (6) = -.4061832322992237, (7) = -.2867715754446697, (8) = -.16605699133148072, (9) = -0.43592446844154975e-1, (10) = 0.8134598150489117e-1, (11) = .2090180658531396, (12) = .33965149776730164, (13) = .4725834570241455, (14) = .6074408231152467, (15) = .7434520012281486, (16) = .8768123081311927, (17) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(17, 2, {(1, 1) = 1.0, (1, 2) = -.9036114850020972, (2, 1) = .8939503318580311, (2, 2) = -.8825269753192191, (3, 1) = .7907593962496425, (3, 2) = -.8548795736098532, (4, 1) = .6913357467749914, (4, 2) = -.8183867564334204, (5, 1) = .5968756042543925, (5, 2) = -.7702964061041976, (6, 1) = .5088037667115055, (6, 2) = -.7078731241727911, (7, 1) = .42878479727508717, (7, 2) = -.6298882635983046, (8, 1) = .3581581279839408, (8, 2) = -.5388193010117547, (9, 1) = .2980303866929626, (9, 2) = -.44384965364984164, (10, 1) = .24808927311196535, (10, 2) = -.35871812789138824, (11, 1) = .2066283465239346, (11, 2) = -.2951873752097467, (12, 1) = .17083964102526264, (12, 2) = -.25700561428543883, (13, 1) = .13793815301961443, (13, 2) = -.24137492166248067, (14, 1) = .10544209718036258, (14, 2) = -.24299361177153342, (15, 1) = 0.7155577184259979e-1, (15, 2) = -.2569943799921452, (16, 1) = 0.3589027272772853e-1, (16, 2) = -.27900073590561947, (17, 1) = .0, (17, 2) = -.30435227224620726}, datatype = float[8], order = C_order); YP := Matrix(17, 2, {(1, 1) = -.9036114850020972, (1, 2) = .15523848795144785, (2, 1) = -.8825269753192191, (2, 2) = .202478308555027, (3, 1) = -.8548795736098532, (3, 2) = .26656134056583153, (4, 1) = -.8183867564334204, (4, 2) = .3521363993771173, (5, 1) = -.7702964061041976, (5, 2) = .46167002762658294, (6, 1) = -.7078731241727911, (6, 2) = .5895851966020256, (7, 1) = -.6298882635983046, (7, 2) = .7123238332721404, (8, 1) = -.5388193010117547, (8, 2) = .7827315098667857, (9, 1) = -.44384965364984164, (9, 2) = .7479826161460762, (10, 1) = -.35871812789138824, (10, 2) = .5994996231794513, (11, 1) = -.2951873752097467, (11, 2) = .39330188238770614, (12, 1) = -.25700561428543883, (12, 2) = .19776701672020852, (13, 1) = -.24137492166248067, (13, 2) = 0.4565287469614531e-1, (14, 1) = -.24299361177153342, (14, 2) = -0.6296221310076555e-1, (15, 1) = -.2569943799921452, (15, 2) = -.13816359005849788, (16, 1) = -.27900073590561947, (16, 2) = -.18870168484040642, (17, 1) = -.30435227224620726, (17, 2) = -.22092802260117167}, 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(17, {(1) = -1.0, (2) = -.881314573604071, (3) = -.7626137574478762, (4) = -.6438960128307195, (5) = -.5251419038775501, (6) = -.4061832322992237, (7) = -.2867715754446697, (8) = -.16605699133148072, (9) = -0.43592446844154975e-1, (10) = 0.8134598150489117e-1, (11) = .2090180658531396, (12) = .33965149776730164, (13) = .4725834570241455, (14) = .6074408231152467, (15) = .7434520012281486, (16) = .8768123081311927, (17) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(17, 2, {(1, 1) = .0, (1, 2) = -0.11468057454388334e-9, (2, 1) = -0.1867556707612165e-9, (2, 2) = -0.32688151463847745e-9, (3, 1) = -0.477963328042933e-9, (3, 2) = -0.5820363917180865e-9, (4, 1) = -0.825752736007871e-9, (4, 2) = -0.6354889892571108e-9, (5, 1) = -0.10831523837839e-8, (5, 2) = -0.13121650631496683e-9, (6, 1) = -0.10922484996893976e-8, (6, 2) = 0.5544178856842942e-9, (7, 1) = -0.4430272332201849e-9, (7, 2) = -0.4592445786786911e-9, (8, 1) = 0.27317590412696142e-8, (8, 2) = -0.3026289676052318e-8, (9, 1) = 0.6889580871116641e-8, (9, 2) = 0.32533657870168752e-8, (10, 1) = 0.20994059016674934e-8, (10, 2) = 0.14007480613345726e-7, (11, 1) = -0.4539008021021346e-8, (11, 2) = 0.7059799227649028e-9, (12, 1) = -0.3502145597380271e-8, (12, 2) = -0.8042569529160365e-8, (13, 1) = -0.937016818059331e-9, (13, 2) = -0.4924754438585803e-8, (14, 1) = 0.1495611110106997e-9, (14, 2) = -0.18876878645374402e-8, (15, 1) = 0.31044346251777496e-9, (15, 2) = -0.9291399022834447e-9, (16, 1) = 0.17057145255092576e-9, (16, 2) = -0.898226159089718e-9, (17, 1) = .0, (17, 2) = -0.10307528528540749e-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[17] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.4007480613345726e-8) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 17, [y(x), diff(y(x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[17] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[17] 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`(17, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(17, 2, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[y(x), diff(y(x), x)]'[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[17] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.4007480613345726e-8) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 17, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[17] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[17] 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`(17, 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`(17, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893627976949936124, (2) = 36893627976949936564, (3) = 36893627976949936740}), (3) = [x, y(x), diff(y(x), x)], (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(x) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(x) else y := pointto(data[2][2]); return ('y')(x) end if end if; try res := solnproc(outpoint); res[2] catch: error  end try end proc, D(y) = proc (x) local res, data, solnproc, `D(y)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](x) else outpoint := evalf(x) 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(17, {(1) = -1.0, (2) = -.881314573604071, (3) = -.7626137574478762, (4) = -.6438960128307195, (5) = -.5251419038775501, (6) = -.4061832322992237, (7) = -.2867715754446697, (8) = -.16605699133148072, (9) = -0.43592446844154975e-1, (10) = 0.8134598150489117e-1, (11) = .2090180658531396, (12) = .33965149776730164, (13) = .4725834570241455, (14) = .6074408231152467, (15) = .7434520012281486, (16) = .8768123081311927, (17) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(17, 2, {(1, 1) = 1.0, (1, 2) = -.9036114850020972, (2, 1) = .8939503318580311, (2, 2) = -.8825269753192191, (3, 1) = .7907593962496425, (3, 2) = -.8548795736098532, (4, 1) = .6913357467749914, (4, 2) = -.8183867564334204, (5, 1) = .5968756042543925, (5, 2) = -.7702964061041976, (6, 1) = .5088037667115055, (6, 2) = -.7078731241727911, (7, 1) = .42878479727508717, (7, 2) = -.6298882635983046, (8, 1) = .3581581279839408, (8, 2) = -.5388193010117547, (9, 1) = .2980303866929626, (9, 2) = -.44384965364984164, (10, 1) = .24808927311196535, (10, 2) = -.35871812789138824, (11, 1) = .2066283465239346, (11, 2) = -.2951873752097467, (12, 1) = .17083964102526264, (12, 2) = -.25700561428543883, (13, 1) = .13793815301961443, (13, 2) = -.24137492166248067, (14, 1) = .10544209718036258, (14, 2) = -.24299361177153342, (15, 1) = 0.7155577184259979e-1, (15, 2) = -.2569943799921452, (16, 1) = 0.3589027272772853e-1, (16, 2) = -.27900073590561947, (17, 1) = .0, (17, 2) = -.30435227224620726}, datatype = float[8], order = C_order); YP := Matrix(17, 2, {(1, 1) = -.9036114850020972, (1, 2) = .15523848795144785, (2, 1) = -.8825269753192191, (2, 2) = .202478308555027, (3, 1) = -.8548795736098532, (3, 2) = .26656134056583153, (4, 1) = -.8183867564334204, (4, 2) = .3521363993771173, (5, 1) = -.7702964061041976, (5, 2) = .46167002762658294, (6, 1) = -.7078731241727911, (6, 2) = .5895851966020256, (7, 1) = -.6298882635983046, (7, 2) = .7123238332721404, (8, 1) = -.5388193010117547, (8, 2) = .7827315098667857, (9, 1) = -.44384965364984164, (9, 2) = .7479826161460762, (10, 1) = -.35871812789138824, (10, 2) = .5994996231794513, (11, 1) = -.2951873752097467, (11, 2) = .39330188238770614, (12, 1) = -.25700561428543883, (12, 2) = .19776701672020852, (13, 1) = -.24137492166248067, (13, 2) = 0.4565287469614531e-1, (14, 1) = -.24299361177153342, (14, 2) = -0.6296221310076555e-1, (15, 1) = -.2569943799921452, (15, 2) = -.13816359005849788, (16, 1) = -.27900073590561947, (16, 2) = -.18870168484040642, (17, 1) = -.30435227224620726, (17, 2) = -.22092802260117167}, 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(17, {(1) = -1.0, (2) = -.881314573604071, (3) = -.7626137574478762, (4) = -.6438960128307195, (5) = -.5251419038775501, (6) = -.4061832322992237, (7) = -.2867715754446697, (8) = -.16605699133148072, (9) = -0.43592446844154975e-1, (10) = 0.8134598150489117e-1, (11) = .2090180658531396, (12) = .33965149776730164, (13) = .4725834570241455, (14) = .6074408231152467, (15) = .7434520012281486, (16) = .8768123081311927, (17) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(17, 2, {(1, 1) = .0, (1, 2) = -0.11468057454388334e-9, (2, 1) = -0.1867556707612165e-9, (2, 2) = -0.32688151463847745e-9, (3, 1) = -0.477963328042933e-9, (3, 2) = -0.5820363917180865e-9, (4, 1) = -0.825752736007871e-9, (4, 2) = -0.6354889892571108e-9, (5, 1) = -0.10831523837839e-8, (5, 2) = -0.13121650631496683e-9, (6, 1) = -0.10922484996893976e-8, (6, 2) = 0.5544178856842942e-9, (7, 1) = -0.4430272332201849e-9, (7, 2) = -0.4592445786786911e-9, (8, 1) = 0.27317590412696142e-8, (8, 2) = -0.3026289676052318e-8, (9, 1) = 0.6889580871116641e-8, (9, 2) = 0.32533657870168752e-8, (10, 1) = 0.20994059016674934e-8, (10, 2) = 0.14007480613345726e-7, (11, 1) = -0.4539008021021346e-8, (11, 2) = 0.7059799227649028e-9, (12, 1) = -0.3502145597380271e-8, (12, 2) = -0.8042569529160365e-8, (13, 1) = -0.937016818059331e-9, (13, 2) = -0.4924754438585803e-8, (14, 1) = 0.1495611110106997e-9, (14, 2) = -0.18876878645374402e-8, (15, 1) = 0.31044346251777496e-9, (15, 2) = -0.9291399022834447e-9, (16, 1) = 0.17057145255092576e-9, (16, 2) = -0.898226159089718e-9, (17, 1) = .0, (17, 2) = -0.10307528528540749e-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[17] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.4007480613345726e-8) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 17, [y(x), diff(y(x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[17] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[17] 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`(17, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(17, 2, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[y(x), diff(y(x), x)]'[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[17] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.4007480613345726e-8) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 17, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[17] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[17] 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`(17, 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`(17, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 36893627976949936124, (2) = 36893627976949936564, (3) = 36893627976949936740}), (3) = [x, y(x), diff(y(x), x)], (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(x) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(x) else `D(y)` := pointto(data[2][3]); return ('`D(y)`')(x) end if end if; try res := solnproc(outpoint); res[3] catch: error  end try end proc]

Plot the curve as a skinny tube because it looks better that way


 

eval(S(x,y(x)), dsol):
convert(%, list):
p2 := tubeplot(%, x=P[1]..Q[1], color="Black", radius=0.015):

Put everything together:

display(p1,p2,labels=['x', 'y', 'z'],
        lightmodel=light4, scaling=constrained, style=surface);

 

 

 

Download geodesic-on-saddle.mw

 

 

Your expr is already in the form 1 - numer/denom, so you need do nothing to reduce it to that form.

But I suspect you meant to ask something else.  Maybe this?

restart;

expr:= 1 - (x__1*x__2 + y__1*y__2 - z__1*z__2)^2/((x__1^2 + y__1^2 - z__1^2)*(x__2^2 + y__2^2 - z__2^2));

1-(x__1*x__2+y__1*y__2-z__1*z__2)^2/((x__1^2+y__1^2-z__1^2)*(x__2^2+y__2^2-z__2^2))

mess := normal(expr);

(x__1^2*y__2^2-x__1^2*z__2^2-2*x__1*x__2*y__1*y__2+2*x__1*x__2*z__1*z__2+x__2^2*y__1^2-x__2^2*z__1^2-y__1^2*z__2^2+2*y__1*y__2*z__1*z__2-y__2^2*z__1^2)/((x__1^2+y__1^2-z__1^2)*(x__2^2+y__2^2-z__2^2))

simplify(mess-1) + 1;

1-(x__1*x__2+y__1*y__2-z__1*z__2)^2/((x__1^2+y__1^2-z__1^2)*(x__2^2+y__2^2-z__2^2))

Download mw.mw

@goebeld You did not answer my questions, but perhaps this is what you want:

restart;
with(plots):
p := [1,2,3]:
the_point := pointplot3d(p, color=red, symbol=solidsphere, symbolsize=20):
the_tag := textplot3d([ seq(p), p ], align={above, right}):
display(the_point, the_tag);

 

See if you can make sense of this.

restart;

with(plots):

eq := x*y^2 - x^2 - y^2;

x*y^2-x^2-y^2

p1 := plots:-contourplot(eq, x=-2..4, y=-4..4, contours=20);

de1 := diff(x(t),t) = subs(x=x(t), y=y(t), diff(eq, x));
de2 := diff(y(t),t) = subs(x=x(t), y=y(t), diff(eq, y));

diff(x(t), t) = y(t)^2-2*x(t)

diff(y(t), t) = 2*x(t)*y(t)-2*y(t)

ic := x(0)=2, y(0)=2;

x(0) = 2, y(0) = 2

dsol := dsolve({de1,de2, ic}, numeric):

p2 := odeplot(dsol, [x(t), y(t)], t=-0.5..0.28, color="Green", thickness=4);

subs(ic, [x(0),y(0)]):
p3 := pointplot(%, symbol=solidcircle, symbolsize=20, color="Black"):

display(p1,p2,p3);


 

Download mw.mw

Note added later: If you look very closely, you may notice that the green curve in the diagram above is not really orthogonal to the contour lines.  That's true, and that's because the drawing is scaled/stretched differently in the x and y directions.  To get the correct picture, add scaling=constrained to the display command, as in:
display(p1,p2,p3, scaling=constrained);

num := int(x*(1-x^2)*BesselJ(0,alpha[n]*x)^2, x=0..1);
den := int(x*BesselJ(0,alpha[n]*x)^2, x=0..1);
A[n] := num/den;

 

This worksheet shows how to animate the motion of a double-pendulum.  You should be able to extend it to the case of a triple-pendulum in the obvious way.

The animation of a double-pendulum

restart;

with(plots):

Link lengths: a and b.

Angles relative to the vertical: phi and psi

Masses: m[1] and m[2]

Gravitational acceleration: g

Differential equations of motion: de1 and de2

de1 := -g*m[2]*b*sin(psi(t)) - m[2]*(a*diff(phi(t), t, t)*cos(phi(t)) - a*diff(phi(t), t)^2*sin(phi(t)) + b*diff(psi(t), t, t)*cos(psi(t)) - b*diff(psi(t), t)^2*sin(psi(t)))*b*cos(psi(t)) + m[2]*(-a*diff(phi(t), t, t)*sin(phi(t)) - a*diff(phi(t), t)^2*cos(phi(t)) - b*diff(psi(t), t, t)*sin(psi(t)) - b*diff(psi(t), t)^2*cos(psi(t)))*b*sin(psi(t));

-g*m[2]*b*sin(psi(t))-m[2]*(a*(diff(diff(phi(t), t), t))*cos(phi(t))-a*(diff(phi(t), t))^2*sin(phi(t))+b*(diff(diff(psi(t), t), t))*cos(psi(t))-b*(diff(psi(t), t))^2*sin(psi(t)))*b*cos(psi(t))+m[2]*(-a*(diff(diff(phi(t), t), t))*sin(phi(t))-a*(diff(phi(t), t))^2*cos(phi(t))-b*(diff(diff(psi(t), t), t))*sin(psi(t))-b*(diff(psi(t), t))^2*cos(psi(t)))*b*sin(psi(t))

de2 := -g*m[1]*a*sin(phi(t)) - g*m[2]*a*sin(phi(t)) - m[1]*a^2*diff(phi(t), t, t)*cos(phi(t))^2 - m[1]*a^2*diff(phi(t), t, t)*sin(phi(t))^2 - m[2]*(a*diff(phi(t), t, t)*cos(phi(t)) - a*diff(phi(t), t)^2*sin(phi(t)) + b*diff(psi(t), t, t)*cos(psi(t)) - b*diff(psi(t), t)^2*sin(psi(t)))*a*cos(phi(t)) + m[2]*(-a*diff(phi(t), t, t)*sin(phi(t)) - a*diff(phi(t), t)^2*cos(phi(t)) - b*diff(psi(t), t, t)*sin(psi(t)) - b*diff(psi(t), t)^2*cos(psi(t)))*a*sin(phi(t));

-g*m[1]*a*sin(phi(t))-g*m[2]*a*sin(phi(t))-m[1]*a^2*(diff(diff(phi(t), t), t))*cos(phi(t))^2-m[1]*a^2*(diff(diff(phi(t), t), t))*sin(phi(t))^2-m[2]*(a*(diff(diff(phi(t), t), t))*cos(phi(t))-a*(diff(phi(t), t))^2*sin(phi(t))+b*(diff(diff(psi(t), t), t))*cos(psi(t))-b*(diff(psi(t), t))^2*sin(psi(t)))*a*cos(phi(t))+m[2]*(-a*(diff(diff(phi(t), t), t))*sin(phi(t))-a*(diff(phi(t), t))^2*cos(phi(t))-b*(diff(diff(psi(t), t), t))*sin(psi(t))-b*(diff(psi(t), t))^2*cos(psi(t)))*a*sin(phi(t))

params := m[1] = 1, m[2] = 1, a = 1, b = 1, g = 1;

m[1] = 1, m[2] = 1, a = 1, b = 1, g = 1

ic := phi(0)=Pi/2, psi(0)=Pi/2, D(phi)(0)=0, D(psi)(0)=0;

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

subs(params, {de1,de2,ic}):
dsol := dsolve(%, 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.5047658755841546e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..4, {(1) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (4) = .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..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) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (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) = -1.0, (3) = .0, (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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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) = 1.57079632679490, (3) = 0., (4) = 1.57079632679490}); _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) = 36893627905163028276, (2) = 36893627905163028452, (3) = 36893627905163028628, (4) = 36893627905163028804, (5) = 36893627905163028980}), (3) = [t, phi(t), diff(phi(t), t), psi(t), diff(psi(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, 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) = 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.5047658755841546e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..4, {(1) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (4) = .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..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) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (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) = -1.0, (3) = .0, (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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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) = 1.57079632679490, (3) = 0., (4) = 1.57079632679490}); _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) = 36893627905163028276, (2) = 36893627905163028452, (3) = 36893627905163028628, (4) = 36893627905163028804, (5) = 36893627905163028980}), (3) = [t, phi(t), diff(phi(t), t), psi(t), diff(psi(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`("phi"); 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(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) = 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.5047658755841546e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..4, {(1) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (4) = .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..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) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (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) = -1.0, (3) = .0, (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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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) = 1.57079632679490, (3) = 0., (4) = 1.57079632679490}); _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) = 36893627905163028276, (2) = 36893627905163028452, (3) = 36893627905163028628, (4) = 36893627905163028804, (5) = 36893627905163028980}), (3) = [t, phi(t), diff(phi(t), t), psi(t), diff(psi(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(phi)"); 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, psi = 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.5047658755841546e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..4, {(1) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (4) = .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..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) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (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) = -1.0, (3) = .0, (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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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) = 1.57079632679490, (3) = 0., (4) = 1.57079632679490}); _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) = 36893627905163028276, (2) = 36893627905163028452, (3) = 36893627905163028628, (4) = 36893627905163028804, (5) = 36893627905163028980}), (3) = [t, phi(t), diff(phi(t), t), psi(t), diff(psi(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`("psi"); 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(psi) = 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.5047658755841546e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..4, {(1) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (4) = .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..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) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (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) = -1.0, (3) = .0, (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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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) = 1.57079632679490, (3) = 0., (4) = 1.57079632679490}); _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) = 36893627905163028276, (2) = 36893627905163028452, (3) = 36893627905163028628, (4) = 36893627905163028804, (5) = 36893627905163028980}), (3) = [t, phi(t), diff(phi(t), t), psi(t), diff(psi(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(psi)"); 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]

my_phi := subs(dsol, 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) = 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.5047658755841546e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..4, {(1) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (4) = .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..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) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (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) = -1.0, (3) = .0, (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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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) = 1.57079632679490, (3) = 0., (4) = 1.57079632679490}); _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) = 36893627905163028276, (2) = 36893627905163028452, (3) = 36893627905163028628, (4) = 36893627905163028804, (5) = 36893627905163028980}), (3) = [t, phi(t), diff(phi(t), t), psi(t), diff(psi(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`("phi"); 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

my_psi := subs(dsol, psi);

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.5047658755841546e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..4, {(1) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (4) = .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..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) = 1.5707963267949, (2) = .0, (3) = 1.5707963267949, (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) = -1.0, (3) = .0, (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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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] = phi(t), Y[2] = diff(phi(t),t), Y[3] = psi(t), Y[4] = diff(psi(t),t)]`; YP[2] := (sin(Y[3])^3*cos(Y[1])*Y[4]^2+sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[2]^2-sin(Y[3])^2*sin(Y[1])*cos(Y[3])*Y[4]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[2]^2+sin(Y[3])*cos(Y[1])*cos(Y[3])^2*Y[4]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[2]^2-sin(Y[1])*cos(Y[3])^3*Y[4]^2-sin(Y[3])^2*sin(Y[1])+sin(Y[3])*cos(Y[1])*cos(Y[3])-2*sin(Y[1])*cos(Y[3])^2)/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^2); YP[4] := -(sin(Y[3])^2*cos(Y[1])*sin(Y[1])*Y[4]^2+2*sin(Y[3])*cos(Y[1])^3*Y[2]^2+sin(Y[3])*cos(Y[1])^2*cos(Y[3])*Y[4]^2+2*sin(Y[3])*cos(Y[1])*sin(Y[1])^2*Y[2]^2-sin(Y[3])*sin(Y[1])^2*cos(Y[3])*Y[4]^2-2*cos(Y[1])^2*sin(Y[1])*cos(Y[3])*Y[2]^2-cos(Y[1])*sin(Y[1])*cos(Y[3])^2*Y[4]^2-2*sin(Y[1])^3*cos(Y[3])*Y[2]^2+2*sin(Y[3])*cos(Y[1])^2-2*cos(Y[1])*sin(Y[1])*cos(Y[3]))/(2*cos(Y[1])^2*sin(Y[3])^2+cos(Y[1])^2*cos(Y[3])^2-2*cos(Y[1])*sin(Y[1])*sin(Y[3])*cos(Y[3])+sin(Y[1])^2*sin(Y[3])^2+2*sin(Y[1])^2*cos(Y[3])^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) = 1.57079632679490, (3) = 0., (4) = 1.57079632679490}); _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) = 36893627905163028276, (2) = 36893627905163028452, (3) = 36893627905163028628, (4) = 36893627905163028804, (5) = 36893627905163028980}), (3) = [t, phi(t), diff(phi(t), t), psi(t), diff(psi(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`("psi"); 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

frame := proc(t)
        local P1, P2;
        a * < sin(my_phi(t)), - cos(my_phi(t)) >;
        P1 := subs(params, %);
        P1 + b * < sin(my_psi(t)), - cos(my_psi(t)) >;
        P2 := subs(params, %);
        display(
                pointplot([ <0,0>, P1, P2 ], connect),
                pointplot(<0,0>, symbol=soliddiamond, symbolsize=30, color=black),
                pointplot(P1, symbol=solidcircle, symbolsize=30, color=red),
                pointplot(P2, symbol=solidcircle, symbolsize=30, color=blue)
        );
end proc:

animate(frame, [t], t=0..60, scaling=constrained, frames=200, tickmarks=[0,0]);

 

 

Download double-pendulum.mw

 

I can't tell which graphics format you wish to export to.  Let's say it's the PNG format.  Will this do?

restart;
p := plot(x^2, x=-1..1);
plotsetup(png, plotoutput = `/tmp/plot.png`, plotoptions = `portrait, noborder, width=1000, height=500`);
p;
plotsetup(default);

Here is one way of doing it.  This may need adjustments in various ways depending on your specific application.

restart;

z := alpha__1*x^2*y + alpha__2*x^4*t + alpha__3*t*y;

t*x^4*alpha__2+x^2*y*alpha__1+t*y*alpha__3

T := proc(e)
        local c, C, i;
        if type(e, monomial) then return 'procname'(e) end if;
        C := coeffs(e,x,c);
        add( C[i]*'procname'(c[i]), i=1..nops([c]));
end proc:
        

T(z);

t*alpha__2*T(x^4)+y*alpha__1*T(x^2)+alpha__3*t*y*T(1)

Remark: It's possible to replace the add(...) line in the proc with the shorter but more cryptic
add([C] *~ 'procname'~([c]));


Download mw.mw

I see that you enter angles in degree units.  Maple expects angles to be entered in the
radian units which is the natural unit for measuring angles.  To convert from degrees

to radians, multiply by Pi/180.

Here are the numerator and denominator of the fraction in your screenshot:

num := polar(230,0);
den := polar(92,53.13*Pi/180);

polar(230, 0)

polar(92, .9272934317)

Then the fraction evaluates to

F := num/den;

polar(230, 0)/polar(92, .9272934317)

That simplifies to

ans := simplify(F);

polar(5/2, -.9272934317)

The two parts of the answer may be extracted through

abs(ans);

5/2

argument(ans);

-.9272934318

To get the resulting angle in degrees, mutiply by 180/Pi:

180/Pi*argument(ans);

-53.13000001

 

Download mw.mw

1 2 3 4 5 6 7 Last Page 3 of 57