tomleslie

13876 Reputation

20 Badges

15 years, 175 days

MaplePrimes Activity


These are answers submitted by tomleslie

Buried deep within Maple is a "built-in" list of primes. Think of it as a table. If your prime is "small enough" that exists within this stored table, then ithprime() is a simple lookup - ie pretty much instantaneous.

If it is too big to be in the list of stored values - then you are at the mercy of algorithms for verifying primality. So things start to get really slow!

You can get some idea about this behaviour by executing showstat(ithprime) which returns the code for the command ithprime(). This shows three possibilities

  1. if the argument is <= 25, then the primes are builtin to the procedure - so blindingly quick.
  2. If the argument is less than something returned  by ithprime/global/magicNumber, then the response is still pretty quick. I assume that this condition is equivalent to "go check a file somewhere" and the existence of the 'magicNumber' just covers the case where Maple may want to increase the list of stored primes (ie maybe in the next software release). So we are still basically talknig about a look-up, albeit having to load a file for checking
  3. if the argument is greater than whatever is returned by ithprime/global/magicNumber, then this basically means that no lookup is possible, so start checking for primality the hard way - so really slow

So the following is based on a quick google/read - and I may be very wrong. It is also difficult to describe the required operations - I aplogise for that

  1. You can't plot in Maple with two different y-axes and two different x-axes - although I can think of ways to 'spoof' it if I had to.
  2. So consider the problem where everything is defined in terms of a single set of axes
  3. Draw both plots on with same set of axes
  4. Select one plot, rotate it by Pi and translate it to an appropriate point (think upper right hand corner. Both the translate and rotate functions are available in the ptottools package
  5. Toy example, implemented in the attached. Take the curve for 1/x defined in the region x=0.1..0.9. As a second curve, rotate the first by Pi, and translate it to the point [1,10]
  6. No reason why the two curvs have to be the same. Define two completely different curves and perform the rotate+translate operation to one of them. This is also shown in the attached

This may not be *exactly* what you want, but I think the process woul work with some minor revisions, because to produce an Edgeworth diagram, all you really need is rotate+translate.

NB plots 'render' better in Maple than they do on this site

  restart;
  with(plottools):
  with(plots):
#
# Original "toy" curve
#
  p1:=plot(1/x, x=0.1..0.9):
#
# Rotate by Pi, and shift the origin
# to [1,10]
#
  p2:=translate(rotate(p1, Pi), 1,10):
#
# Display both curves
#
  display([p1,p2], color=[red,blue]);

 

#
# No reason why the two curves have to be the
# same function: the translate/rotate process
# doesn't change
#
 p3:=plot(1/sqrt(x), x=0.1..0.9):
 p4:=translate(rotate(p3, Pi), 1,10):
 display([p1,p4], color=[red,blue]);
 

 

 


 

Download edgeworth.mw

I deleted the 'range' option in the dsolve() command, because neither of the range endpoints evaluated to a number

I fixed a syntax error in the definition of the 'events option

The attached now executes correctly, and the dsolve() solution process 'halts' at tau=.56659478, becuase s(tau) hits the value defined by the variable 'const', which is 10.64177772. The include plot demonstrates the behaviour of s(tau) up to this halt point


 

restart;

odex := diff(v(tau), tau)+sin(alpha)*g = 0:
odes := diff(s(tau), tau)-v(tau) = 0:
ic := s(0) = s0, v(0) = 0.:
alpha:= (20*(1/180))*Pi:   L:= 10:
    h:= 5:                 g:= 9.81:
   s0:= sqrt(L^2+h^2): const:= L/cos(alpha):

#
# Op has not defined either of the variables 'ta'
# or 'te', which makes the range option incorrect
# and/or superfluous
#
# lp:=dsolve`( [odex, odes, ic],
#               type = numeric,
#               range = ta .. te,
#               output = listprocedure,
#               events = [[s(tau)-const], halt]);
#
  lp := dsolve( [odex, odes, ic],
                type = numeric,
                output = listprocedure,
                events = [[s(tau)-const, halt]]
              );

[tau = proc (tau) 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](tau) else _xout := evalf(tau) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 26, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([Array(1..2, 1..21, {(1, 1) = 1.0, (1, 2) = .0, (1, 3) = 1.0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (1, 7) = 1.0, (1, 8) = undefined, (1, 9) = .5385621627398809, (1, 10) = 1.0, (1, 11) = undefined, (1, 12) = undefined, (1, 13) = undefined, (1, 14) = undefined, (1, 15) = undefined, (1, 16) = undefined, (1, 17) = undefined, (1, 18) = undefined, (1, 19) = undefined, (1, 20) = undefined, (1, 21) = undefined, (2, 1) = 1.0, (2, 2) = .0, (2, 3) = 100.0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (2, 7) = .0, (2, 8) = undefined, (2, 9) = undefined, (2, 10) = 0.10e-6, (2, 11) = undefined, (2, 12) = .0, (2, 13) = undefined, (2, 14) = .0, (2, 15) = .0, (2, 16) = undefined, (2, 17) = undefined, (2, 18) = undefined, (2, 19) = undefined, (2, 20) = undefined, (2, 21) = undefined}, datatype = float[8], order = C_order), proc (tau, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[1]-10/cos(.349065850398865916); EA[1, 8+2*n] := 1; 0 end proc, proc (e, tau, Y, Ypre) return 0 end proc, Array(1..1, 1..2, {(1, 1) = undefined, (1, 2) = undefined}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..63, {(1) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 1, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0, (54) = 0, (55) = 0, (56) = 0, (57) = 0, (58) = 0, (59) = 10000, (60) = 0, (61) = 1000, (62) = 0, (63) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.15044206810245968e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = 11.180339887499, (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..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)]), ( 8 ) = ([Array(1..2, {(1) = 11.180339887499, (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) = -3.3552176060248}, 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] = s(tau), Y[2] = v(tau)]`; YP[2] := -3.35521760602480; YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (tau, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[1]-10/cos(.349065850398865916); EA[1, 8+2*n] := 1; 0 end proc, proc (e, tau, Y, Ypre) return 0 end proc, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = s(tau), Y[2] = v(tau)]`; YP[2] := -3.35521760602480; YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (tau, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[1]-10/cos(.349065850398865916); EA[1, 8+2*n] := 1; 0 end proc, proc (e, tau, Y, Ypre) return 0 end proc, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] ))  ] ); _y0 := Array(0..2, {(1) = 0., (2) = 11.1803398874990}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 100 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _dat[17] <> _dtbl[1][17] then _dtbl[1][17] := _dat[17]; _dtbl[1][10] := _dat[10] end if; if _src = 0 and 100 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..3, {(1) = 18446744074176568942, (2) = 18446744074176569206, (3) = 18446744074176569430}), (3) = [tau, s(tau), v(tau)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(tau, ["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(tau, '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(tau, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(tau, 'string')); if type(_res, 'list') then return _res[1] else return NULL end if elif member(tau, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(tau, '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(tau), 'string') = rhs(tau); 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(tau), 'string') = rhs(tau)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(tau) else _ndsol := 1; _ndsol := `tools/gensym`("tau"); 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(tau)))) end if end if; try _res := _solnproc(_xout); _res[1] catch: error  end try end proc, s(tau) = proc (tau) 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](tau) else _xout := evalf(tau) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 26, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([Array(1..2, 1..21, {(1, 1) = 1.0, (1, 2) = .0, (1, 3) = 1.0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (1, 7) = 1.0, (1, 8) = undefined, (1, 9) = .5385621627398809, (1, 10) = 1.0, (1, 11) = undefined, (1, 12) = undefined, (1, 13) = undefined, (1, 14) = undefined, (1, 15) = undefined, (1, 16) = undefined, (1, 17) = undefined, (1, 18) = undefined, (1, 19) = undefined, (1, 20) = undefined, (1, 21) = undefined, (2, 1) = 1.0, (2, 2) = .0, (2, 3) = 100.0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (2, 7) = .0, (2, 8) = undefined, (2, 9) = undefined, (2, 10) = 0.10e-6, (2, 11) = undefined, (2, 12) = .0, (2, 13) = undefined, (2, 14) = .0, (2, 15) = .0, (2, 16) = undefined, (2, 17) = undefined, (2, 18) = undefined, (2, 19) = undefined, (2, 20) = undefined, (2, 21) = undefined}, datatype = float[8], order = C_order), proc (tau, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[1]-10/cos(.349065850398865916); EA[1, 8+2*n] := 1; 0 end proc, proc (e, tau, Y, Ypre) return 0 end proc, Array(1..1, 1..2, {(1, 1) = undefined, (1, 2) = undefined}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..63, {(1) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 1, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0, (54) = 0, (55) = 0, (56) = 0, (57) = 0, (58) = 0, (59) = 10000, (60) = 0, (61) = 1000, (62) = 0, (63) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.15044206810245968e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = 11.180339887499, (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..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)]), ( 8 ) = ([Array(1..2, {(1) = 11.180339887499, (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) = -3.3552176060248}, 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] = s(tau), Y[2] = v(tau)]`; YP[2] := -3.35521760602480; YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (tau, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[1]-10/cos(.349065850398865916); EA[1, 8+2*n] := 1; 0 end proc, proc (e, tau, Y, Ypre) return 0 end proc, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = s(tau), Y[2] = v(tau)]`; YP[2] := -3.35521760602480; YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (tau, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[1]-10/cos(.349065850398865916); EA[1, 8+2*n] := 1; 0 end proc, proc (e, tau, Y, Ypre) return 0 end proc, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] ))  ] ); _y0 := Array(0..2, {(1) = 0., (2) = 11.1803398874990}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 100 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _dat[17] <> _dtbl[1][17] then _dtbl[1][17] := _dat[17]; _dtbl[1][10] := _dat[10] end if; if _src = 0 and 100 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..3, {(1) = 18446744074176568942, (2) = 18446744074176569206, (3) = 18446744074176569430}), (3) = [tau, s(tau), v(tau)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(tau, ["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(tau, '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(tau, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(tau, 'string')); if type(_res, 'list') then return _res[2] else return NULL end if elif member(tau, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(tau, '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(tau), 'string') = rhs(tau); 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(tau), 'string') = rhs(tau)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(tau) else _ndsol := 1; _ndsol := `tools/gensym`("s(tau)"); 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(tau)))) end if end if; try _res := _solnproc(_xout); _res[2] catch: error  end try end proc, v(tau) = proc (tau) 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](tau) else _xout := evalf(tau) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 26, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([Array(1..2, 1..21, {(1, 1) = 1.0, (1, 2) = .0, (1, 3) = 1.0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (1, 7) = 1.0, (1, 8) = undefined, (1, 9) = .5385621627398809, (1, 10) = 1.0, (1, 11) = undefined, (1, 12) = undefined, (1, 13) = undefined, (1, 14) = undefined, (1, 15) = undefined, (1, 16) = undefined, (1, 17) = undefined, (1, 18) = undefined, (1, 19) = undefined, (1, 20) = undefined, (1, 21) = undefined, (2, 1) = 1.0, (2, 2) = .0, (2, 3) = 100.0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (2, 7) = .0, (2, 8) = undefined, (2, 9) = undefined, (2, 10) = 0.10e-6, (2, 11) = undefined, (2, 12) = .0, (2, 13) = undefined, (2, 14) = .0, (2, 15) = .0, (2, 16) = undefined, (2, 17) = undefined, (2, 18) = undefined, (2, 19) = undefined, (2, 20) = undefined, (2, 21) = undefined}, datatype = float[8], order = C_order), proc (tau, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[1]-10/cos(.349065850398865916); EA[1, 8+2*n] := 1; 0 end proc, proc (e, tau, Y, Ypre) return 0 end proc, Array(1..1, 1..2, {(1, 1) = undefined, (1, 2) = undefined}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..63, {(1) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 1, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0, (54) = 0, (55) = 0, (56) = 0, (57) = 0, (58) = 0, (59) = 10000, (60) = 0, (61) = 1000, (62) = 0, (63) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.15044206810245968e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = 11.180339887499, (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..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)]), ( 8 ) = ([Array(1..2, {(1) = 11.180339887499, (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) = -3.3552176060248}, 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] = s(tau), Y[2] = v(tau)]`; YP[2] := -3.35521760602480; YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (tau, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[1]-10/cos(.349065850398865916); EA[1, 8+2*n] := 1; 0 end proc, proc (e, tau, Y, Ypre) return 0 end proc, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = s(tau), Y[2] = v(tau)]`; YP[2] := -3.35521760602480; YP[1] := Y[2]; 0 end proc, -1, 0, 0, proc (tau, Y, Ypre, n, EA) EA[1, 7+2*n] := Y[1]-10/cos(.349065850398865916); EA[1, 8+2*n] := 1; 0 end proc, proc (e, tau, Y, Ypre) return 0 end proc, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 26 ) = (Array(1..0, {})), ( 25 ) = (Array(1..0, {})), ( 24 ) = (0)  ] ))  ] ); _y0 := Array(0..2, {(1) = 0., (2) = 11.1803398874990}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 100 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _dat[17] <> _dtbl[1][17] then _dtbl[1][17] := _dat[17]; _dtbl[1][10] := _dat[10] end if; if _src = 0 and 100 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(1..3, {(1) = 18446744074176568942, (2) = 18446744074176569206, (3) = 18446744074176569430}), (3) = [tau, s(tau), v(tau)], (4) = []}); _solnproc := _dat[1]; _pars := map(rhs, _dat[4]); if not type(_xout, 'numeric') then if member(tau, ["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(tau, '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(tau, ["last", 'last', "initial", 'initial', NULL]) then _res := _solnproc(convert(tau, 'string')); if type(_res, 'list') then return _res[3] else return NULL end if elif member(tau, ["parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(tau, '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(tau), 'string') = rhs(tau); 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(tau), 'string') = rhs(tau)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _dat[3] end if; if procname <> unknown then return ('procname')(tau) else _ndsol := 1; _ndsol := `tools/gensym`("v(tau)"); 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(tau)))) end if end if; try _res := _solnproc(_xout); _res[3] catch: error  end try end proc]

(1)

#
# So try plotting the solution of the ode. The 'halt'
# event kicks in at tau=0.56659478, becuase at this
# value s(tau)-const=0, with const defined as above
#
  plots:-odeplot( lp, [tau, s(tau)], tau=0..1);
#
# Check the value of const
#
  evalf(const);
#
# So solution will stop when s(tau) hits 10.64177772
#
# Absolutely everything working as expected
#

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

 

 

10.64177772

(2)

 


 

Download eventProb.mw

and maybe more?

  1. When you use 'pi', do you mean the ratio of circumference to diameter of a circle (which would be 'Pi'), or do you mean a Greeak letter with no specific value?
  2. When you use 'b[n]' are you referring to the n-th entry in the indexable quantity (eg list Vector, whatever), or do you mean the function 'b', evaluated with the argument 'n'
  3. When you use 'k[n]' are you referring to the n-th entry in the indexable quantity (eg list Vector, whatever), or do you mean the function 'k', evaluated with the argument 'n'

If I make guesses as to your intent, then I end up with a single expression which contains

  1. two unknown functions, q() and f()
  2. two unknown variables(?), 'x' and 't'
  3. a parameter(?) 'b', which may or may not be related to the function/indexable quantity mentioned above

Do you really expect to be able to solve this??

See the attached

restart:

Digits:= 4:

phi:= x->16*x^2*(1-x)^2:
a1:= int((diff(phi(x), x$4))*phi(x), x = 0 .. L):
a3:= int(phi(x)*phi(x), x = 0 .. L): # a3 is never used!!

lambda:= 0.170e-1:      B:= 0.223e11:       A:= 0.346e11:
     w:= 1:             L:= 3.5:           Ra:= 9:
    Rb:= 5:             W:= 1:              G:= 0.5e-3:
     R:= Ra+Rb:         C:= 0.2e-1:         h:= 0.250e-1:
    nu:= .22:          I1:= (1/3)*w*h^3: E[0]:= A+B:
    nu1:= (1-nu)/((1+nu)*(1-2*nu)):

k:= n -> W*(4*R*G*L^2+Pi^2*(2*n-1)^2)/(C*(Pi^2*(2*n-1)^2+4*R*L^2*(G+W))):
b:= n -> 4*Pi*(2*n-1)/(4*R*G*L^2+Pi^2*(2*n-1)^2):
U:= Heaviside(t):

beta:= (x,t)->(W*(sum(-(1/8)*Pi^3*b(n)*(2*n-1)^3*cos((1/2)*(2*n-1)*Pi*x/L)*exp(-k(n)*t)/(k(n)*L^3), n = 1 .. 8))+R*G*(R*G)^.5*sinh((R*G)^.5*(x-L))*t/cosh((R*G)^.5*L)+C*U*R*G*(R*G)^.5*sinh((R*G)^.5*(x-L))/cosh((R*G)^.5*L))*exp(-W*t/C)/(w*h):
eq:= -nu1*I1*a1*((1/2)*E[0]*q(t)+B*lambda*(int(exp(-lambda*(t-s))*f(s), s = 0 .. t)))+2*b*h^2*beta(x, t);

-0.4603e11*q(t)-0.6134e9*(int(exp(-0.170e-1*t+0.170e-1*s)*f(s), s = 0 .. t))+0.5000e-1*b*(-.1515*cos(.4488*x)*exp(-.7345*t)-.1794*cos(1.346*x)*exp(-5.755*t)-.2171*cos(2.244*x)*exp(-13.24*t)-.2727*cos(3.142*x)*exp(-20.68*t)-.3466*cos(4.039*x)*exp(-26.92*t)-.4384*cos(4.937*x)*exp(-31.76*t)-.5495*cos(5.834*x)*exp(-35.43*t)-.6782*cos(6.732*x)*exp(-38.20*t)+0.5616e-3*sinh(0.8367e-1*x-.2928)*t+0.1123e-4*Heaviside(t)*sinh(0.8367e-1*x-.2928))*exp(-50.00*t)

(1)

 


 

Download eqProb.mw

only works for polynomials.  Your expression HPMEq1 contains the variable 'p' in both numerator and denominator. Since 'p' is the denominator, it does not really make sense to ask for the coefficient of 'p'

I executed your worksheet, and it completes with no error (see below). Output is lengthy, but it works!

Can only think that this may be a Maple version issue. Which version of Maple are you running?

"f(w):=-B1+(A1-C1)*w+(B1-D1)*w^(2)-A1*w^(3)"

proc (w) options operator, arrow, function_assign; -B1+(A1-C1)*w+(B1-D1)*w^2-A1*w^3 end proc

(1)

"f1(w):=(A1-C1)+2*(B1-D1)*w-3*A1*w^(2)"

proc (w) options operator, arrow, function_assign; A1-C1+(2*B1-2*D1)*w-3*A1*w^2 end proc

(2)

w1 := (B1-D1+sqrt((B1-D1)^2+3*A1*(A1-C1)))/(3*A1)

(1/3)*(B1-D1+((B1-D1)^2+3*A1*(A1-C1))^(1/2))/A1

(3)

f(w1)

-B1+(1/3)*(A1-C1)*(B1-D1+((B1-D1)^2+3*A1*(A1-C1))^(1/2))/A1+(1/9)*(B1-D1)*(B1-D1+((B1-D1)^2+3*A1*(A1-C1))^(1/2))^2/A1^2-(1/27)*(B1-D1+((B1-D1)^2+3*A1*(A1-C1))^(1/2))^3/A1^2

(4)

s := eps4*sin(l*tau)+(4*(l*sqrt(k/(1-k))+l*eps3)+2*l*((1-2*k)/sqrt(k*(1-k))+eps1))/l^2

eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2

(5)

A1 := (2*(l*sqrt(k/(1-k))+l*eps3)+l*((1-2*k)/sqrt(k*(1-k))+eps1))/s

(2*l*(k/(1-k))^(1/2)+2*l*eps3+l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)

(6)

A1 := (2*(l*sqrt(k/(1-k))+l*eps3)+l*((1-2*k)/sqrt(k*(1-k))+eps1))/s

(2*l*(k/(1-k))^(1/2)+2*l*eps3+l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)

(7)

B1 := 4/s^2

4/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)^2

(8)

C1 := (((1-2*k)/sqrt(k*(1-k))+eps1)^2+(-(1-2*k)/sqrt(k*(1-k))+eps2)^2)/s^2

(((1-2*k)/(k*(1-k))^(1/2)+eps1)^2+(-(1-2*k)/(k*(1-k))^(1/2)+eps2)^2)/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)^2

(9)

D1 := (2*((1-2*k)/sqrt(k*(1-k))+eps1))*(-(1-2*k)/sqrt(k*(1-k))+eps2)/s^2

2*((1-2*k)/(k*(1-k))^(1/2)+eps1)*(-(1-2*k)/(k*(1-k))^(1/2)+eps2)/(eps4*sin(l*tau)+(4*l*(k/(1-k))^(1/2)+4*l*eps3+2*l*((1-2*k)/(k*(1-k))^(1/2)+eps1))/l^2)^2

(10)

l := 1

1

(11)

f(w1)

-4/(eps4*sin(tau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+1)^(1/2)+44160*(1-k)^(1/2)*k^12+5280*k^(13/2)*(k*(1-k))^(3/2)-39424*k^(17/2)*(1-k)^2*(k/(1-k))^(1/2)-15360*k^(17/2)*(k*(1-k))^(3/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)/(1-k)-69120*k^(21/2)*(k/(1-k))^(1/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-52032*(1-k)^(1/2)*k^11+4*k^(5/2)*(k*(1-k))^(3/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(3/2)+4640*k^(11/2)*(k*(1-k))^(3/2)-10240*k^(23/2)*(k*(1-k))^(3/2)-4096*k^(27/2)*(1-k)^2*(k/(1-k))^(1/2)+17920*k^(21/2)*(k*(1-k))^(3/2)+22528*k^(25/2)*(1-k)^2*(k/(1-k))^(1/2)-10240*k^(19/2)*(k*(1-k))^(3/2)-46080*k^(23/2)*(1-k)^2*(k/(1-k))^(1/2)+3072*k^(23/2)*(k*(1-k))^(3/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)/(1-k)+3072*(1-k)^(1/2)*k^14+2048*k^(25/2)*(k*(1-k))^(3/2)+36*k^(1/2)*(k*(1-k))^(3/2)-36*(1-k)^(1/2)*k^3+12*(1-k)^(1/2)*k^2-8064*k^(19/2)*(k*(1-k))^(1/2)-128640*k^(17/2)*(k*(1-k))^(1/2)+157440*k^(15/2)*(k*(1-k))^(1/2)+216*k^(3/2)*(1-k)*(k*(1-k))^(3/2)-102720*k^(13/2)*(k*(1-k))^(1/2)+40896*k^(11/2)*(k*(1-k))^(1/2)-8*k^(3/2)*(1-k)*(k*(1-k))^(1/2)-9312*k^(9/2)*(k*(1-k))^(1/2)+36*k^(1/2)*(k*(1-k))^(3/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-72*k^(3/2)*(k*(1-k))^(3/2)+768*k^(7/2)*(k*(1-k))^(1/2)-12*(1-k)^(1/2)*(4*k^4-8*k^3-4*k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k^2+8*k+1)^(1/2)+2048*(1-k)^(1/2)*(k/(1-k))^(1/2)*(k*(1-k))^(3/2)*k^4-29568*(1-k)^(1/2)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)*k^6+7936*(1-k)^(3/2)*k^7+352*k^(7/2)*(1-k)*(k*(1-k))^(1/2)+2048*k^(27/2)*(1-k)*(k*(1-k))^(1/2)-12288*k^(25/2)*(1-k)*(k*(1-k))^(1/2)+28672*k^(23/2)*(1-k)*(k*(1-k))^(1/2)+512*(1-k)^(1/2)*(k/(1-k))^(1/2)*(k*(1-k))^(3/2)*k^11-3072*(1-k)^(1/2)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)*k^13-30720*k^(21/2)*(1-k)*(k*(1-k))^(1/2)+3072*k^(25/2)*(k*(1-k))^(1/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-2560*(1-k)^(1/2)*(k/(1-k))^(1/2)*(k*(1-k))^(3/2)*k^10+18432*(1-k)^(1/2)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)*k^12-512*(1-k)^(3/2)*k^13+1152*k^(15/2)*(1-k)*(k*(1-k))^(3/2)+7040*k^(19/2)*(1-k)*(k*(1-k))^(1/2)-18432*k^(23/2)*(k*(1-k))^(1/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+4864*(1-k)^(1/2)*(k/(1-k))^(1/2)*(k*(1-k))^(3/2)*k^9-43776*(1-k)^(1/2)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)*k^11+2816*(1-k)^(3/2)*k^12-3456*k^(13/2)*(1-k)*(k*(1-k))^(3/2)+20992*k^(17/2)*(1-k)*(k*(1-k))^(1/2)+43008*k^(21/2)*(k*(1-k))^(1/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+10992*(1-k)^(1/2)*k^7*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-480*k^(7/2)*(1-k)^2*(k/(1-k))^(1/2)*(4*k^4-8*k^3-4*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(1-k))^(3/2)/(1-k)^(1/2)-13440*k^(9/2)*(1-k)*(k/(1-k))^(3/2)*(k*(1-k))^(3/2)+10944*k^(13/2)*(1-k)*(k/(1-k))^(1/2)*(k*(1-k))^(3/2)+10368*k^(19/2)*(1-k)^2+67584*k^(13/2)*(k/(1-k))^(3/2)*(k*(1-k))^(3/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+8192*k^9*(k*(1-k))^(3/2)/(1-k)^(1/2)+6144*k^(25/2)*(1-k)*(k/(1-k))^(3/2)*(k*(1-k))^(3/2)-36864*k^(23/2)*(1-k)*(k/(1-k))^(3/2)*(k*(1-k))^(3/2)+86016*k^(21/2)*(1-k)*(k/(1-k))^(3/2)*(k*(1-k))^(3/2)+18432*k^(29/2)*(1-k)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)-92160*k^(19/2)*(1-k)*(k/(1-k))^(3/2)*(k*(1-k))^(3/2)-129024*k^(27/2)*(1-k)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)+6144*k^(23/2)*(k/(1-k))^(3/2)*(k*(1-k))^(3/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+21504*k^(17/2)*(1-k)*(k/(1-k))^(3/2)*(k*(1-k))^(3/2)-36864*k^(21/2)*(k/(1-k))^(3/2)*(k*(1-k))^(3/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+1024*k^13*(k*(1-k))^(3/2)/(1-k)^(1/2)+61440*k^(15/2)*(1-k)*(k/(1-k))^(3/2)*(k*(1-k))^(3/2)+84480*k^(19/2)*(k/(1-k))^(3/2)*(k*(1-k))^(3/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+18432*k^(27/2)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-6144*k^12*(k*(1-k))^(3/2)/(1-k)^(1/2)+382464*k^(13/2)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)*(4*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(3/2)*(k/(1-k))^(1/2)*k^12-412416*k^(17/2)*(1-k)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)-534528*k^(21/2)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+50688*(1-k)^(3/2)*(k/(1-k))^(1/2)*k^11+433152*k^(15/2)*(1-k)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)-15552*k^(17/2)*(1-k)^2+342144*k^(19/2)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-34304*(1-k)^(3/2)*(k/(1-k))^(1/2)*k^10-244224*k^(13/2)*(1-k)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)+6048*k^(15/2)*(1-k)^2+114048*k^(17/2)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-6144*(1-k)^(3/2)*(k/(1-k))^(1/2)*k^9+78336*k^(11/2)*(1-k)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)+8928*k^(13/2)*(1-k)^2-418752*k^(15/2)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-18*k^(3/2)*(1-k)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(3/2)-11232*k^(9/2)*(1-k)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)-13248*k^(11/2)*(1-k)^2+373248*k^(25/2)*(1-k)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)-24576*k^(31/2)*(1-k)+165888*k^(29/2)*(1-k)-24576*k^(29/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+165888*k^(27/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+287520*k^(15/2)*(1-k)-171072*k^(19/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+54*k^(7/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(3/2)-154800*k^(13/2)*(1-k)+482304*k^(17/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+62880*k^(11/2)*(1-k)-417888*k^(15/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+1374*k^(7/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-15576*k^(9/2)*(1-k)+204960*k^(13/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-60240*k^(11/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+9696*k^(9/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-408*k^(7/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-459264*k^(27/2)*(1-k)+655104*k^(25/2)*(1-k)-438528*k^(23/2)*(1-k)-63360*k^(21/2)*(1-k)-453120*k^(25/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+406848*k^(19/2)*(1-k)+619776*k^(23/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-423648*k^(17/2)*(1-k)-355200*k^(21/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+192*k^(3/2)*(k/(1-k))^(3/2)*(k*(1-k))^(3/2)-22032*k^(7/2)*(k/(1-k))^(1/2)*(k*(1-k))^(3/2)+720*(1-k)^(1/2)*(k*(1-k))^(3/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)*k^3+3456*k^(5/2)*(k/(1-k))^(1/2)*(k*(1-k))^(3/2)-576*(1-k)^(1/2)*(k*(1-k))^(3/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)*k^2-72*k^(1/2)*(k/(1-k))^(1/2)*(k*(1-k))^(3/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+216*k^(3/2)*(k/(1-k))^(1/2)*(k*(1-k))^(3/2)+72*(1-k)^(1/2)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))^(1/2)*(k*(1-k))^(1/2)-272*(1-k)^(1/2)*(k*(1-k))^(1/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(3/2)*k^6+4416*(1-k)^(1/2)*(k*(1-k))^(1/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)*k^8-1560960*k^(15/2)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)+1013760*k^(27/2)*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)-192*k^(11/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(3/2)+18*(1-k)^(1/2)*(k*(1-k))^(3/2)-36*k^(3/2)*(1-k)+21248*(1-k)^(1/2)*(k*(1-k))^(1/2)*k^12-34304*(1-k)^(1/2)*(k*(1-k))^(1/2)*k^11+29824*(1-k)^(1/2)*(k*(1-k))^(1/2)*k^10-5504*(1-k)^(1/2)*(k*(1-k))^(1/2)*k^9-19968*(1-k)^(1/2)*(k*(1-k))^(1/2)*k^8+28416*(1-k)^(1/2)*(k*(1-k))^(1/2)*k^7-3*k^(3/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(3/2)-20672*(1-k)^(1/2)*(k*(1-k))^(1/2)*k^6+9280*(1-k)^(1/2)*(k*(1-k))^(1/2)*k^5-33*k^(3/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+228*k^(5/2)*(1-k)-2480*(1-k)^(1/2)*(k*(1-k))^(1/2)*k^4+288*(1-k)^(1/2)*(k*(1-k))^(1/2)*k^3-144*k^(5/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+24*k^(3/2)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-8*(k*(1-k))^(1/2)*k*(1-k)^(1/2)+988032*k^(23/2)-1971456*k^(19/2)+1728000*k^(17/2)+951552*k^(21/2)-948288*k^(15/2)+344832*k^(13/2)-80448*k^(11/2)-1080*k^(9/2)*(1-k)^2*(4*k^4-8*k^3-4*k^2+8*k+1)^(3/2)+4608*k^(21/2)*(1-k)^2*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-17280*k^(19/2)*(1-k)^2*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-1152*k^(13/2)*(1-k)^2*(4*k^4-8*k^3-4*k^2+8*k+1)^(3/2)+2016*k^(11/2)*(1-k)^2*(4*k^4-8*k^3-4*k^2+8*k+1)^(3/2)-6144*k^(27/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+35328*k^(25/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-1536*k^(19/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(3/2)+5760*k^(17/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(3/2)-64128*k^(23/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+11328*k^(21/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-7584*k^(15/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(3/2)+115200*k^(19/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)-182016*k^(17/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+135336*k^(15/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2)+3792*k^(13/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(3/2)-58884*k^(13/2)*(1-k)*(4*k^4-8*k^3-4*k^2+8*k+1)^(1/2))*sin(tau)/((2*(k/(1-k))^(1/2)*(k*(1-k))^(1/2)-2*k+1)*k*(1-k)^(3/2)*(4*k^4-8*k^3-4*k^2+8*k+1))

(13)

NULL


 

Download mtaylProb.mw

gives a technically correct answer - but I'm betting that it isn't the one you want! All variables are equal to 1! This satisfies all the constraints and ensures that p=0. So it is technically correct, and you can't complain! If this isn't the answer you want then maybe you can add further constraints restricting the range of the variables? Otherwise.....

with(Optimization):
nlc:={ 0<=d*(c-a) + c*(b-d),
       0<=d*(c-e)+ c*(f-d),
       0>=f*(e-a)+e*(b-f),
       (b-d)<=d*(c-a)+c*(b-d),
       (f-d)<=d*(c-e)+c*(f-d),
       (b-f)>=f*(e-a)+e*(b-f),
       (c-a)<=d*(c-a) + c*(b-d),
       (c-e)<=d*(c-e)+ c*(f-d),
       (e-a)>=f*(e-a)+e*(b-f),
       (c-a)+(b-d)<=d*(c-a) + c*(b-d),
       (c-e)+(f-d)<=d*(c-e)+ c*(f-d),
       (e-a)+(b-f)>=f*(e-a)+e*(b-f),
        2*(c-a)+(b-d)<=d*(c-a) + c*(b-d),
       2*(c-e)+(f-d)<=d*(c-e)+ c*(f-d),
       2*(e-a)+(b-f)>=f*(e-a)+e*(b-f)
     }:

p:=2*(f-a)*(d-b) - ((d-b)*(c-a) + (d-f)*(e-c) + (f-b)*(e-a));

sol:=NLPSolve(p,nlc);

2*(f-a)*(d-b)-(d-b)*(c-a)-(d-f)*(e-c)-(f-b)*(e-a)

 

Warning, no iterations performed as initial point satisfies first-order conditions

 

[0., [a = HFloat(1.0), b = HFloat(1.0), c = HFloat(1.0), d = HFloat(1.0), e = HFloat(1.0), f = HFloat(1.0)]]

(1)

 

Download optProb.mw

OrthogonalSeries package available from the Maple application centre. With this package, then "validating" Parseval's Identity is reasonably simple. See the attached


 

  restart;
#
# OP may not have the OrthogonalExpansions loaded
#
# It is available from
#
# https://www.maplesoft.com/applications/view.aspx?sid=33406
#
  with(OrthogonalExpansions):
#
# Define some parameters
#
  T:=1:
  alpha:=1:
  tau:=1:
#
# Define the "test" function
#
  fx:=piecewise( x<-T/2,
                 undefined,
                 x<=0,
                -(1+x/(alpha*tau))*exp(x/(alpha*tau)),
                 x<=T/2,
                 (1-x/(alpha*tau))*exp(-x/(alpha*tau)),
                 undefined
               );
#
# Compute the 'general' fourier series for the
# function fx
#
  Fseries:= FourierSeries
            ( fx,
              x = -T/2 .. T/2,
              -n..n,
              'Coefficients'
            );
#
# Extract the coefficients (as functions) for this
# general Fourier series. Express as functions, for
# convenient later use
#
  a:=j->evalf(eval(op([2,1,1], Coefficients), i=j));
  b:=j->evalf(eval(op([2,1,2], Coefficients), i=j));

fx := piecewise(x < -1/2, undefined, x <= 0, -(1+x)*exp(x), x <= 1/2, (1-x)*exp(-x), undefined)

 

Sum(((-16*Pi^2*i^2+12*exp(-1/2)*Pi^2*i^2*(-1)^i-exp(-1/2)*(-1)^i)/(16*Pi^4*i^4+8*Pi^2*i^2+1)+(16*Pi^2*i^2+12*(-1)^(1+i)*exp(-1/2)*Pi^2*i^2+exp(-1/2)*(-1)^i)/(16*Pi^4*i^4+8*Pi^2*i^2+1))*cos(2*Pi*i*x)-4*Pi*i*(4*exp(-1/2)*Pi^2*i^2*(-1)^i-8*Pi^2*i^2+3*(-1)^(1+i)*exp(-1/2)+2)*sin(2*Pi*i*x)/(16*Pi^4*i^4+8*Pi^2*i^2+1), i = -n .. n)

 

proc (j) options operator, arrow; evalf(eval(op([2, 1, 1], Coefficients), i = j)) end proc

 

proc (j) options operator, arrow; evalf(eval(op([2, 1, 2], Coefficients), i = j)) end proc

(1)

#
# Check Parseval's identity for the function fx,
# using increasing numbers of terms in the Fourier
# series.
#
# Takes ~20secs on my machine, so just wait
#
# Agreement gets pretty good if the number of terms
# is sufficient
#
  evalf((2/T)*int(fx^2, x=-T/2..T/2));
  nterms:= [  10,    20,   50,  100,    200,   500,
             1000, 2000, 5000, 10000, 20000, 50000, 100000]:
  seq( (1/2)*add( a(k)^2+b(k)^2, k=-p..p), p in nterms);
 

.8160602794

 

.7728585700, .7941872645, .8072490330, .8116446010, .8138499530, .8151755550, .8156178185, .8158390240, .8159717710, .8160160235, .8160381510, .8160514275, .8160558530

(2)

#
# As a check that everything has been
# defined more-or-less correctly.
#
# Compute the finite fourier series for
# different numbers of terms, and plot it
# along with the original function.
#
  tr:=[ seq
        ( FourierSeries
          ( fx,
            x = -T/2 .. T/2,
            1..k
          ),
          k=5..20,5
        )
     ]:
   plot([tr[],fx], x=-T/2..T/2);

 

``

``


 

Download parseval.mw

the 'explicit=true' option to your solve() command, then you will get more solutions than anyone could possibly want. See the attached

 


 

restart

sys := {T = (1/16)*(12*sqrt(A)+epsilon/sqrt(A)-4*Pi^2/A^(3/2))/Pi^(3/2), T = (1/16)*(12*sqrt(B)+epsilon/sqrt(B)-4*Pi^2/B^(3/2))/Pi^(3/2), T*(B-A) = (1/8)*(4*B^(3/2)+epsilon*sqrt(B)+4*Pi^2/sqrt(B)-4*A^(3/2)-epsilon*sqrt(A)-4*Pi^2/sqrt(A))/Pi^(3/2)}

{T = (1/16)*(12*A^(1/2)+varepsilon/A^(1/2)-4*Pi^2/A^(3/2))/Pi^(3/2), T = (1/16)*(12*B^(1/2)+varepsilon/B^(1/2)-4*Pi^2/B^(3/2))/Pi^(3/2), T*(B-A) = (1/8)*(4*B^(3/2)+varepsilon*B^(1/2)+4*Pi^2/B^(1/2)-4*A^(3/2)-varepsilon*A^(1/2)-4*Pi^2/A^(1/2))/Pi^(3/2)}

(1)

solve(sys, {A, B, T})

{A = B, B = B, T = (1/16)*(12*B^2+B*varepsilon-4*Pi^2)/(Pi^(3/2)*B^(3/2))}, {A = Pi^2/RootOf(4*_Z^4+(16*Pi-varepsilon)*_Z^2+4*Pi^2)^2, B = RootOf(4*_Z^4+(16*Pi-varepsilon)*_Z^2+4*Pi^2)^2, T = -(1/4)*((12*Pi-varepsilon)*RootOf(4*_Z^4+(16*Pi-varepsilon)*_Z^2+4*Pi^2)^2+4*Pi^2)/(RootOf(4*_Z^4+(16*Pi-varepsilon)*_Z^2+4*Pi^2)^3*Pi^(3/2))}, {A = Pi^2/RootOf(4*_Z^4+(-16*Pi-varepsilon)*_Z^2+4*Pi^2)^2, B = RootOf(4*_Z^4+(-16*Pi-varepsilon)*_Z^2+4*Pi^2)^2, T = -(1/4)*((-12*Pi-varepsilon)*RootOf(4*_Z^4+(-16*Pi-varepsilon)*_Z^2+4*Pi^2)^2+4*Pi^2)/(RootOf(4*_Z^4+(-16*Pi-varepsilon)*_Z^2+4*Pi^2)^3*Pi^(3/2))}

(2)

solve(sys, {A, B, T}, explicit = true)

{A = B, B = B, T = (1/16)*(12*B^2+B*varepsilon-4*Pi^2)/(Pi^(3/2)*B^(3/2))}, {A = Pi^2/((1/4)*(-8*Pi+varepsilon)^(1/2)+(1/4)*(-24*Pi+varepsilon)^(1/2))^2, B = ((1/4)*(-8*Pi+varepsilon)^(1/2)+(1/4)*(-24*Pi+varepsilon)^(1/2))^2, T = -(1/4)*((12*Pi-varepsilon)*((1/4)*(-8*Pi+varepsilon)^(1/2)+(1/4)*(-24*Pi+varepsilon)^(1/2))^2+4*Pi^2)/(((1/4)*(-8*Pi+varepsilon)^(1/2)+(1/4)*(-24*Pi+varepsilon)^(1/2))^3*Pi^(3/2))}, {A = Pi^2/((1/4)*(-8*Pi+varepsilon)^(1/2)-(1/4)*(-24*Pi+varepsilon)^(1/2))^2, B = ((1/4)*(-8*Pi+varepsilon)^(1/2)-(1/4)*(-24*Pi+varepsilon)^(1/2))^2, T = -(1/4)*((12*Pi-varepsilon)*((1/4)*(-8*Pi+varepsilon)^(1/2)-(1/4)*(-24*Pi+varepsilon)^(1/2))^2+4*Pi^2)/(((1/4)*(-8*Pi+varepsilon)^(1/2)-(1/4)*(-24*Pi+varepsilon)^(1/2))^3*Pi^(3/2))}, {A = Pi^2/(-(1/4)*(-8*Pi+varepsilon)^(1/2)+(1/4)*(-24*Pi+varepsilon)^(1/2))^2, B = (-(1/4)*(-8*Pi+varepsilon)^(1/2)+(1/4)*(-24*Pi+varepsilon)^(1/2))^2, T = -(1/4)*((12*Pi-varepsilon)*(-(1/4)*(-8*Pi+varepsilon)^(1/2)+(1/4)*(-24*Pi+varepsilon)^(1/2))^2+4*Pi^2)/((-(1/4)*(-8*Pi+varepsilon)^(1/2)+(1/4)*(-24*Pi+varepsilon)^(1/2))^3*Pi^(3/2))}, {A = Pi^2/(-(1/4)*(-8*Pi+varepsilon)^(1/2)-(1/4)*(-24*Pi+varepsilon)^(1/2))^2, B = (-(1/4)*(-8*Pi+varepsilon)^(1/2)-(1/4)*(-24*Pi+varepsilon)^(1/2))^2, T = -(1/4)*((12*Pi-varepsilon)*(-(1/4)*(-8*Pi+varepsilon)^(1/2)-(1/4)*(-24*Pi+varepsilon)^(1/2))^2+4*Pi^2)/((-(1/4)*(-8*Pi+varepsilon)^(1/2)-(1/4)*(-24*Pi+varepsilon)^(1/2))^3*Pi^(3/2))}, {A = Pi^2/((1/4)*(24*Pi+varepsilon)^(1/2)+(1/4)*(8*Pi+varepsilon)^(1/2))^2, B = ((1/4)*(24*Pi+varepsilon)^(1/2)+(1/4)*(8*Pi+varepsilon)^(1/2))^2, T = -(1/4)*((-12*Pi-varepsilon)*((1/4)*(24*Pi+varepsilon)^(1/2)+(1/4)*(8*Pi+varepsilon)^(1/2))^2+4*Pi^2)/(((1/4)*(24*Pi+varepsilon)^(1/2)+(1/4)*(8*Pi+varepsilon)^(1/2))^3*Pi^(3/2))}, {A = Pi^2/((1/4)*(24*Pi+varepsilon)^(1/2)-(1/4)*(8*Pi+varepsilon)^(1/2))^2, B = ((1/4)*(24*Pi+varepsilon)^(1/2)-(1/4)*(8*Pi+varepsilon)^(1/2))^2, T = -(1/4)*((-12*Pi-varepsilon)*((1/4)*(24*Pi+varepsilon)^(1/2)-(1/4)*(8*Pi+varepsilon)^(1/2))^2+4*Pi^2)/(((1/4)*(24*Pi+varepsilon)^(1/2)-(1/4)*(8*Pi+varepsilon)^(1/2))^3*Pi^(3/2))}, {A = Pi^2/(-(1/4)*(24*Pi+varepsilon)^(1/2)+(1/4)*(8*Pi+varepsilon)^(1/2))^2, B = (-(1/4)*(24*Pi+varepsilon)^(1/2)+(1/4)*(8*Pi+varepsilon)^(1/2))^2, T = -(1/4)*((-12*Pi-varepsilon)*(-(1/4)*(24*Pi+varepsilon)^(1/2)+(1/4)*(8*Pi+varepsilon)^(1/2))^2+4*Pi^2)/((-(1/4)*(24*Pi+varepsilon)^(1/2)+(1/4)*(8*Pi+varepsilon)^(1/2))^3*Pi^(3/2))}, {A = Pi^2/(-(1/4)*(24*Pi+varepsilon)^(1/2)-(1/4)*(8*Pi+varepsilon)^(1/2))^2, B = (-(1/4)*(24*Pi+varepsilon)^(1/2)-(1/4)*(8*Pi+varepsilon)^(1/2))^2, T = -(1/4)*((-12*Pi-varepsilon)*(-(1/4)*(24*Pi+varepsilon)^(1/2)-(1/4)*(8*Pi+varepsilon)^(1/2))^2+4*Pi^2)/((-(1/4)*(24*Pi+varepsilon)^(1/2)-(1/4)*(8*Pi+varepsilon)^(1/2))^3*Pi^(3/2))}

(3)

NULL

NULL

NULL

NULL

 


 

Download solveAll.mw

your starting point would probably be

CodeGeneration:-Matlab()

but before you get too excited, there are a lot of restrictions on what can and cannot be translated successfully. For example, functions defined within procedures will almost certainly fail - and you have a few in fdsolve(). Some Maple constructions will fail, because there is no equivalent in Matlab. Graphics (ie plot() commands) will cause a lot of trouble.

You could (probably?) restructure your Maple code so that it will be handled by the above CodeGeneration() command, but this is not a trivial exercise. In fact it would probably(?) be faster to retype the whole thing in Matlab

My advice would be to to reassess the whole "translation" requirement. eg

  1. Why are you doing it?
  2. Should you have written the code in Matlab in the first place?
  3. If you absolutely need some symbolic computation in a predominantly numerical calculation, consider (re)writng the code in Matlab with appropriate calls to the Maple toolbox. (i'm assuming that you set up the Maple-Matlab link on installation)
  4. Do you believe that you will be able to perform some computation in Matlab which you can't do in Maple? Unlikely!

as far as I know. However it is pretty trivial to write using evalb~() for all sorts of test conditions.

Consider the following

  restart;
  data:=[1,2,3,4,5,6]:
#
# All entries = 0?
#
  evalb(evalb~({data[]} =~ 0)={true});
#
# All entries positive integer?
#
  evalb( evalb~({data[]} ::~ posint)={true});
#
# All entries = 3?
#
  evalb( evalb~({data[]} =~ 3)={true});
#
# All entries <=6?
#
  evalb( evalb~({data[]} <=~ 6)={true});
#
# All entries = 0?
#
  check:=[0,0,0]:
  evalb(evalb~( {check[]} =~ 0)={true});
#
# or even
#
  evalb(ListTools:-Occurrences(0, check)=numelems(check));

 

I suspect (but can't definitively prove) that patmatch() uses expression 'types' as part of the matching process.

There are only two expression types ('+' and '*') involving arithmetic operators: so (for example)

  1. the expression a-b is classified as type '+' with arguments 'a' and '-b'
  2. the expression a/b is cllassified as type '*' with arguments 'a' and '1/b'

You can verify these interpretations using op([0..-1], expr). Applying the same command to your test expression 1-3*y, as in

op([0..-1], 1-3*y);

returns

`+`, 1, -3*y

So if I wanted to "tighten-up" the pattern match for your original expression, I would probably use

expr:=1-3*y;
patmatch(expr, b::posint + a::negint*y,'la');

or even

expr:=1-3*y;
patmatch(expr, b::posint + a::negint*y::name,'la');

A lot depends on just how restrictive you want to make the pattern match!

 

 

As in the attached
 

finalsol := exp(I*(-k*x+t*(k^2+2*rho^2-2*sigma^2)+theta))*rho*tanh(-2*k*rho*t+rho*x)

-exp(I*(-k*x+t*(k^2+2*rho^2-2*sigma^2)+theta))*rho*tanh(2*k*rho*t-rho*x)

(1)

sol1 := eval(finalsol, [rho = .5, theta = .5, sigma = .5, k = .5])

-.5*exp(I*(-.5*x+.25*t+.5))*tanh(.50*t-.5*x)

(2)

graph1 := plot3d(abs(sol1), t = -5 .. 5, x = -5 .. 5, numpoints = 300, frames = 50, axes = framed, color = x, thickness = 5, axesfont = ["HELVETICA", "ROMAN", 24], labelfont = ["HELVETICA", "ROMAN", 24], orientation = [-144, 77, -5])

 

ContPlot1 := plots:-contourplot3d(abs(sol1), t = -20 .. 20, x = -20 .. 20, frames = 50, axes = framed, thickness = 5, numpoints = 300, axesfont = ["HELVETICA", "ROMAN", 24], labelfont = ["HELVETICA", "ROMAN", 24])

 

plot3d(abs(sol1), t = -5 .. .5, x = -5 .. 5)

 

 

Download plotprob.mw

Or Re(), Im() whatever, cos you can't plot a complex "(two dimensiona"l) expression as a function of two variables - That would require 4 dimensions!!

 

  1. LSsolve is one of the commands in the Optimization() package
  2. The first line in the Description section of the help page for the Optimization() package states (my emphasis added)

The Optimization package is a collection of commands for numerically solving optimization problems.....

 

Even the definition of divisor in Maple's help states

2. another word for factor.

Hovever, as a practical(?) matter, many people associate the word "factor" with "prime factor". Any number will have far fewer prime factors than divisors - because any product of any number of prime factors will be a divisor.

Your test number has 25 prime factors, each of multiplicity 1. These can be calculated quickly (see attached)  It is therefore reasonably rapid to compute (see attached) that there are 33554432 divisors (that's 33.5... million, gulp!!).

You can use the Divisors() command to generate all 33.5 million divisors, but

  1. it will take a while (about 4.5 minutes on my machine)
  2. you really don't want to output  33.5 million numbers to screen. Thhis may (or may not) trigger the "Length of output exceeds..."  warning - I dind't even try in the attached

Hoever you can check that the number of divisors is the same as that given by the number of combinations of prime factors, as shown in the attached

  restart;
  with(NumberTheory):
  X:= 89733992396903316277681863138688595394562888838833;
#
# Generate the prime factors
#
  ifX:= CodeTools:-Usage(ifactors(X));
#
# From the prime factors, generate the number
# of divisors (allowing for their multiplicity)
#
   combinat:-numbcomb(add( ifX[2][i], i=1..numelems(ifX[2]))[2]);
#
# That is a lot of divisors!!!
#
# Now compute all of these divisors, but TRUST ME
# given the number computed above, you really don't
# want to output the result of this to screen
#
  ifD:= CodeTools:-Usage(Divisors(X)):
#
# But we can check how many there are
#
  numelems(ifD)

89733992396903316277681863138688595394562888838833

 

memory used=85.18KiB, alloc change=0 bytes, cpu time=0ns, real time=4.00ms, gc time=0ns

 

[1, [[31, 1], [47, 1], [59, 1], [61, 1], [67, 1], [71, 1], [73, 1], [79, 1], [89, 1], [97, 1], [101, 1], [103, 1], [107, 1], [109, 1], [113, 1], [127, 1], [131, 1], [137, 1], [139, 1], [149, 1], [151, 1], [157, 1], [163, 1], [167, 1], [173, 1]]]

 

33554432

 

memory used=8.15GiB, alloc change=7.27GiB, cpu time=21.49m, real time=4.13m, gc time=20.44m

 

33554432

(1)

 

Download divFact.mw

First 132 133 134 135 136 137 138 Last Page 134 of 207