gkokovidis

2370 Reputation

13 Badges

20 years, 288 days
Draeger Medical Systems, Inc.

 

 

Regards,
Georgios Kokovidis
Dräger Medical

MaplePrimes Activity


These are answers submitted by gkokovidis

See ?solve help page for details and examples.

restart:

eqn:=(z^(1+I))+I=0;

z^(1+I)+I = 0

(1)

ans:=solve(eqn,z);

exp((-1/4-(1/4)*I)*Pi)

(2)

evalc(subs(z=ans,eqn));

0 = 0

(3)

 

Download solve.mw

 

Regards,

Georgios Kokovidis

Dräger Medical

For the "set the tolerance zero to some vale" part of your question, see the help page for ?fnormal.  You can use it for each of your results with the optional error tolerance.  This shouldl give you what you are looking for.

restart:

a:=1e-5;

0.1e-4

(1)

b:=1e-6;

0.1e-5

(2)

c:=1e-12;

0.1e-11

(3)

d:=1e-13;

0.1e-12

(4)

fnormal([a,b,c,d],20,1e-4);

[0., 0., 0., 0.]

(5)

fnormal([a,b,c,d],20,1e-5);

[0.1e-4, 0., 0., 0.]

(6)

fnormal([a,b,c,d],20,1e-12);

[0.1e-4, 0.1e-5, 0.1e-11, 0.]

(7)

fnormal([a,b,c,d],20,1e-3);

[0., 0., 0., 0.]

(8)

 

Download fnormal.mw

 

Regards,

Georgios Kokovidis

Dräger Medical

Thanks for the correction.  In my haste, I did not pay attention to the exp() when looking @ the help file.

 

Regards,

Georgios Kokovidis

Dräger Medical

In this particular case, the compelx argument to fsolve causes it to look for an answer that is greater than zero, whereas the version without uses a seed value that is different causing it to find -2.753166165 as the root.  Both are real and both are correct.  You can try this with a given range that you define, with and without the complex option to see that you get the same answer.

fsolve(EQ1,T,complex,300..400);
                        351.311867751985
fsolve(EQ1,T,complex,-3..3);
                       -2.75316616485215
fsolve(EQ1,T,300..400);
                        351.311867751985
fsolve(EQ1,T,-3..3);
                       -2.75316616485215

From the help file: 

For a single polynomial equation of one variable with real coefficients, by default the fsolve command computes all real (non-complex) roots. It may not return all roots for exceptionally ill-conditioned polynomials.

Your equation is very sensitive to small variations in x.  A plot will show you this. 

Regards,

Georgios Kokovidis

Dräger Medical

See the help page for ?plot, or ?plot/detials.

restart:

plot(x,x,color=blue,style=line,thickness=5);

 

?plot/details

 

Download line.mw

Regards,

Georgios Kokovidis

Dräger Medical

One method is the use of ArrayTools:-NumElems(f), where f is your array.  If it returns 0, then it is empty.
 

Regards,

Georgios Kokovidis

Dräger Medical

See the help page for ?convert.  The following link has more help as well.

http://www.maplesoft.com/support/help/Maple/view.aspx?path=convert%2fto_special_function

 

Regards,

Georgios Kokovidis

Dräger Medical

To combine more than one plot structure, you can use ?display.

restart:with(plots):with(geometry):

point(A, 0, 0); point(B, 0, -15);

A

 

B

(1)

line(facade, [A, B]);

facade

(2)

 point(C, -3, 0); point(d, -3, -15);

C

 

d

(3)

line(facadepar, [C, d]);

facadepar

(4)

segment(facade, [A, B]);

facade

(5)

segment(facadepar, [C, d]);

facadepar

(6)

draw(facadepar,color=green,thickness=3);

 

circle(bletr, (x-3)^2+(y+.5)^2 = 1.5^2, [x, y]);

bletr

(7)

draw(bletr,color=blue);

 

aa:=draw(facadepar,color=green,thickness=3):bb:=draw(bletr,color=blue):

display(aa,bb);

 

 

Download display.mw

Regards,

Georgios Kokovidis

Dräger Medical

You can use ?plot for this.  Your 4 points are p0..p3  The second part shows where each of the points are located so you can visualize the problem and see how the points connect.

restart:with(plots):

p0:= [2,0]; p1:= [2,1]; p2:= [0,1]; p3:=[0,0];

[2, 0]

 

[2, 1]

 

[0, 1]

 

[0, 0]

(1)

plot([[ p0, p1, p2, p3, p0 ]],thickness=3,scaling=constrained,axes=framed);

 

plot1:=plot([[ p0, p1, p2, p3, p0 ]],thickness=3,scaling=constrained,axes=framed):

plot2:=pointplot([p0, p1, p2, p3],color=[blue,green,yellow,brown],symbol=solidcircle,symbolsize=30):

display(plot1,plot2,title=Rectangle);

 

Download rect.mw

 

Regards,

Georgios Kokovidis

Dräger Medical

restart:with(plots):

ode:=(D(y))(x) = y(x);

(D(y))(x) = y(x)

(1)

ans:= dsolve({ode, y(0) = 1, (D(y))(x) = y(x)}, y(x),type=numeric,range=0..7);

proc (x_rkf45) local _res, _dat, _vars, _solnproc, _xout, _ndsol, _pars, _n, _i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; if 1 < nargs then error "invalid input: too many arguments" end if; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then _xout := evalf[_EnvDSNumericSaveDigits](x_rkf45) else _xout := evalf(x_rkf45) end if; _dat := Array(1..4, {(1) = proc (_xin) local _xout, _dtbl, _dat, _vmap, _x0, _y0, _val, _dig, _n, _ne, _nd, _nv, _pars, _ini, _par, _i, _j, _k, _src; option `Copyright (c) 2002 by Waterloo Maple Inc. All rights reserved.`; table( [( "right" ) = 7., ( "complex" ) = false, ( "left" ) = 0. ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 19, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 5 ) = (Array(1..25, {(1) = 7.0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.5552424631425701e-1, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .5, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = .0}, datatype = float[8], order = C_order)), ( 4 ) = (Array(1..49, {(1) = 1, (2) = 1, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 1, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0}, datatype = integer[4])), ( 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)]), ( 6 ) = (Array(1..1, {(1) = 1.0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = y(x)]`; YP[1] := Y[1]; 0 end proc, -1, 0, 0, 0, 0]), ( 11 ) = (Array(1..6, 0..1, {(1, 1) = .0, (2, 0) = .0, (2, 1) = .0, (3, 0) = .0, (3, 1) = .0, (4, 0) = .0, (4, 1) = .0, (5, 0) = .0, (5, 1) = .0, (6, 0) = .0, (6, 1) = .0}, datatype = float[8], order = C_order)), ( 8 ) = ([Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 1.0}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..1, {(1) = .1}, datatype = float[8], order = C_order), Array(1..1, {(1) = 1031.5218257764263}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 1111.8830345661984}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..6, {(1, 1) = 1111.8830345661984, (1, 2) = 964.955594122477, (1, 3) = 988.8442102279557, (1, 4) = 1096.54422300394, (1, 5) = 1113.2990689782885, (1, 6) = 1011.9656447067769}, datatype = float[8], order = C_order), Array(1..1, {(1) = 0}, datatype = integer[4]), Array(1..1, {(1) = 1096.631751745884}, datatype = float[8], order = C_order), Array(1..1, {(1) = 1111.8830345661984}, datatype = float[8], order = C_order), Array(1..1, {(1) = 0.4174764142074998e-3}, datatype = float[8], order = C_order), Array(1..1, {(1) = 1036.369714085639}, datatype = float[8], order = C_order)]), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 13 ) = (), ( 12 ) = (), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = y(x)]`; YP[1] := Y[1]; 0 end proc, -1, 0, 0, 0, 0]), ( 18 ) = ([]), ( 19 ) = (0)  ] )), ( 3 ) = (array( 1 .. 19, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 5 ) = (Array(1..25, {(1) = 7.0, (2) = 0.10e-5, (3) = .18754883581288073, (4) = 0.500001e-14, (5) = .0, (6) = 0.5552424631425701e-1, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .5, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = .0}, datatype = float[8], order = C_order)), ( 4 ) = (Array(1..49, {(1) = 1, (2) = 1, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 1, (9) = 0, (10) = 1, (11) = 153, (12) = 153, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 267, (19) = 30000, (20) = 5, (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}, datatype = integer[4])), ( 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)]), ( 6 ) = (Array(1..1, {(1) = 1.0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = y(x)]`; YP[1] := Y[1]; 0 end proc, -1, 0, 0, 0, 0]), ( 11 ) = (Array(1..6, 0..1, {(1, 1) = 6.826261947842478, (2, 0) = 6.826261947842478, (2, 1) = 921.7377049382327, (3, 0) = 921.7377049382327, (3, 1) = 6.873149352960771, (4, 0) = 6.873149352960771, (4, 1) = 965.9848501129891, (5, 0) = 965.9848501129891, (5, 1) = 6.920036758079064, (6, 0) = 6.920036758079064, (6, 1) = 1012.3559844153592}, datatype = float[8], order = C_order)), ( 8 ) = ([Array(1..1, {(1) = 1.0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 1111.8830345661984}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..1, {(1) = .1}, datatype = float[8], order = C_order), Array(1..1, {(1) = 1031.5218257764263}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 1111.8830345661984}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..1, {(1, 1) = .0}, datatype = float[8], order = C_order), Array(1..1, 1..6, {(1, 1) = 1111.8830345661984, (1, 2) = 964.955594122477, (1, 3) = 988.8442102279557, (1, 4) = 1096.54422300394, (1, 5) = 1113.2990689782885, (1, 6) = 1011.9656447067769}, datatype = float[8], order = C_order), Array(1..1, {(1) = 0}, datatype = integer[4]), Array(1..1, {(1) = 1096.631751745884}, datatype = float[8], order = C_order), Array(1..1, {(1) = 1111.8830345661984}, datatype = float[8], order = C_order), Array(1..1, {(1) = 0.4174764142074998e-3}, datatype = float[8], order = C_order), Array(1..1, {(1) = 1036.369714085639}, datatype = float[8], order = C_order)]), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 13 ) = (), ( 12 ) = (Array(1..153, 0..1, {(1, 1) = .0, (2, 0) = .0, (2, 1) = 1.0, (3, 0) = 1.0, (3, 1) = 0.13881061578564252e-1, (4, 0) = 0.13881061578564252e-1, (4, 1) = 1.0139778509731394, (5, 0) = 1.0139778509731394, (5, 1) = 0.27762123157128504e-1, (6, 0) = 0.27762123157128504e-1, (6, 1) = 1.02815108215469, (7, 0) = 1.02815108215469, (7, 1) = 0.41643184735692756e-1, (8, 0) = 0.41643184735692756e-1, (8, 1) = 1.042522424497017, (9, 0) = 1.042522424497017, (9, 1) = 0.5552424631425701e-1, (10, 0) = 0.5552424631425701e-1, (10, 1) = 1.0570946473837868, (11, 0) = 1.0570946473837868, (11, 1) = .1024952164857874, (12, 0) = .1024952164857874, (12, 1) = 1.1079320553083518, (13, 0) = 1.1079320553083518, (13, 1) = .14946618665731778, (14, 0) = .14946618665731778, (14, 1) = 1.161214255674714, (15, 0) = 1.161214255674714, (15, 1) = .19643715682884816, (16, 0) = .19643715682884816, (16, 1) = 1.2170588185351745, (17, 0) = 1.2170588185351745, (17, 1) = .24340812700037856, (18, 0) = .24340812700037856, (18, 1) = 1.275589076223439, (19, 0) = 1.275589076223439, (19, 1) = .2910742985882352, (20, 0) = .2910742985882352, (20, 1) = 1.3378640043967749, (21, 0) = 1.3378640043967749, (21, 1) = .3387404701760918, (22, 0) = .3387404701760918, (22, 1) = 1.4031791470760218, (23, 0) = 1.4031791470760218, (23, 1) = .38640664176394846, (24, 0) = .38640664176394846, (24, 1) = 1.4716829243666918, (25, 0) = 1.4716829243666918, (25, 1) = .43407281335180514, (26, 0) = .43407281335180514, (26, 1) = 1.5435311423983853, (27, 0) = 1.5435311423983853, (27, 1) = .4816260745650258, (28, 0) = .4816260745650258, (28, 1) = 1.6187043631041826, (29, 0) = 1.6187043631041826, (29, 1) = .5291793357782465, (30, 0) = .5291793357782465, (30, 1) = 1.697538582322118, (31, 0) = 1.697538582322118, (31, 1) = .5767325969914672, (32, 0) = .5767325969914672, (32, 1) = 1.7802120926169605, (33, 0) = 1.7802120926169605, (33, 1) = .6242858582046877, (34, 0) = .6242858582046877, (34, 1) = 1.866912037351233, (35, 0) = 1.866912037351233, (35, 1) = .6717265046984456, (36, 0) = .6717265046984456, (36, 1) = 1.9576141197035275, (37, 0) = 1.9576141197035275, (37, 1) = .7191671511922035, (38, 0) = .7191671511922035, (38, 1) = 2.052722758918827, (39, 0) = 2.052722758918827, (39, 1) = .7666077976859613, (40, 0) = .7666077976859613, (40, 1) = 2.152452036209294, (41, 0) = 2.152452036209294, (41, 1) = .8140484441797192, (42, 0) = .8140484441797192, (42, 1) = 2.2570266340907947, (43, 0) = 2.2570266340907947, (43, 1) = .8613949482932629, (44, 0) = .8613949482932629, (44, 1) = 2.3664592541402683, (45, 0) = 2.3664592541402683, (45, 1) = .9087414524068066, (46, 0) = .9087414524068066, (46, 1) = 2.4811976109701614, (47, 0) = 2.4811976109701614, (47, 1) = .9560879565203503, (48, 0) = .9560879565203503, (48, 1) = 2.601498946338711, (49, 0) = 2.601498946338711, (49, 1) = 1.003434460633894, (50, 0) = 1.003434460633894, (50, 1) = 2.727633214390756, (51, 0) = 2.727633214390756, (51, 1) = 1.0507027080120932, (52, 0) = 1.0507027080120932, (52, 1) = 2.8596595395544373, (53, 0) = 2.8596595395544373, (53, 1) = 1.0979709553902923, (54, 0) = 1.0979709553902923, (54, 1) = 2.9980762044778144, (55, 0) = 2.9980762044778144, (55, 1) = 1.1452392027684914, (56, 0) = 1.1452392027684914, (56, 1) = 3.1431925121175217, (57, 0) = 3.1431925121175217, (57, 1) = 1.1925074501466906, (58, 0) = 1.1925074501466906, (58, 1) = 3.295333024368449, (59, 0) = 3.295333024368449, (59, 1) = 1.2397106841411143, (60, 0) = 1.2397106841411143, (60, 1) = 3.4546132635116553, (61, 0) = 3.4546132635116553, (61, 1) = 1.286913918135538, (62, 0) = 1.286913918135538, (62, 1) = 3.621592131544302, (63, 0) = 3.621592131544302, (63, 1) = 1.3341171521299617, (64, 0) = 1.3341171521299617, (64, 1) = 3.796641729991258, (65, 0) = 3.796641729991258, (65, 1) = 1.3813203861243855, (66, 0) = 1.3813203861243855, (66, 1) = 3.980152491182559, (67, 0) = 3.980152491182559, (67, 1) = 1.4284696284876823, (68, 0) = 1.4284696284876823, (68, 1) = 4.1723082682996475, (69, 0) = 4.1723082682996475, (69, 1) = 1.4756188708509792, (70, 0) = 1.4756188708509792, (70, 1) = 4.373740801087314, (71, 0) = 4.373740801087314, (71, 1) = 1.5227681132142759, (72, 0) = 1.5227681132142759, (72, 1) = 4.584897942313216, (73, 0) = 4.584897942313216, (73, 1) = 1.5699173555775727, (74, 0) = 1.5699173555775727, (74, 1) = 4.806249581097181, (75, 0) = 4.806249581097181, (75, 1) = 1.6170217729280516, (76, 0) = 1.6170217729280516, (76, 1) = 5.038062246099688, (77, 0) = 5.038062246099688, (77, 1) = 1.6641261902785303, (78, 0) = 1.6641261902785303, (78, 1) = 5.281055301579998, (79, 0) = 5.281055301579998, (79, 1) = 1.711230607629009, (80, 0) = 1.711230607629009, (80, 1) = 5.535767976446111, (81, 0) = 5.535767976446111, (81, 1) = 1.7583350249794878, (82, 0) = 1.7583350249794878, (82, 1) = 5.802766005903514, (83, 0) = 5.802766005903514, (83, 1) = 1.8054022369421259, (84, 0) = 1.8054022369421259, (84, 1) = 6.082415856841877, (85, 0) = 6.082415856841877, (85, 1) = 1.8524694489047637, (86, 0) = 1.8524694489047637, (86, 1) = 6.375542394262556, (87, 0) = 6.375542394262556, (87, 1) = 1.8995366608674016, (88, 0) = 1.8995366608674016, (88, 1) = 6.682795071525746, (89, 0) = 6.682795071525746, (89, 1) = 1.9466038728300397, (90, 0) = 1.9466038728300397, (90, 1) = 7.00485524031624, (91, 0) = 7.00485524031624, (91, 1) = 1.9936402101858677, (92, 0) = 1.9936402101858677, (92, 1) = 7.342210094630848, (93, 0) = 7.342210094630848, (93, 1) = 2.040676547541696, (94, 0) = 2.040676547541696, (94, 1) = 7.695811597452143, (95, 0) = 7.695811597452143, (95, 1) = 2.087712884897524, (96, 0) = 2.087712884897524, (96, 1) = 8.066442163216424, (97, 0) = 8.066442163216424, (97, 1) = 2.134749222253352, (98, 0) = 2.134749222253352, (98, 1) = 8.454922609004427, (99, 0) = 8.454922609004427, (99, 1) = 2.181759943023145, (100, 0) = 2.181759943023145, (100, 1) = 8.861885904901447, (101, 0) = 8.861885904901447, (101, 1) = 2.228770663792938, (102, 0) = 2.228770663792938, (102, 1) = 9.288437191446876, (103, 0) = 9.288437191446876, (103, 1) = 2.275781384562731, (104, 0) = 2.275781384562731, (104, 1) = 9.735519271157928, (105, 0) = 9.735519271157928, (105, 1) = 2.322792105332524, (106, 0) = 2.322792105332524, (106, 1) = 10.20412119525758, (107, 0) = 10.20412119525758, (107, 1) = 2.3697815751165208, (108, 0) = 2.3697815751165208, (108, 1) = 10.695051901239905, (109, 0) = 10.695051901239905, (109, 1) = 2.4167710449005178, (110, 0) = 2.4167710449005178, (110, 1) = 11.209601190392068, (111, 0) = 11.209601190392068, (111, 1) = 2.463760514684515, (112, 0) = 2.463760514684515, (112, 1) = 11.74890533821884, (113, 0) = 11.74890533821884, (113, 1) = 2.510749984468512, (114, 0) = 2.510749984468512, (114, 1) = 12.314156333513775, (115, 0) = 12.314156333513775, (115, 1) = 2.557721827031433, (116, 0) = 2.557721827031433, (116, 1) = 12.906375481192162, (117, 0) = 12.906375481192162, (117, 1) = 2.604693669594354, (118, 0) = 2.604693669594354, (118, 1) = 13.527075239520398, (119, 0) = 13.527075239520398, (119, 1) = 2.6516655121572748, (120, 0) = 2.6516655121572748, (120, 1) = 14.17762526691933, (121, 0) = 14.17762526691933, (121, 1) = 2.6986373547201956, (122, 0) = 2.6986373547201956, (122, 1) = 14.859462352079401, (123, 0) = 14.859462352079401, (123, 1) = 2.745594577342147, (124, 0) = 2.745594577342147, (124, 1) = 15.573864058472228, (125, 0) = 15.573864058472228, (125, 1) = 2.792551799964099, (126, 0) = 2.792551799964099, (126, 1) = 16.32261135247373, (127, 0) = 16.32261135247373, (127, 1) = 2.839509022586051, (128, 0) = 2.839509022586051, (128, 1) = 17.107355418243895, (129, 0) = 17.107355418243895, (129, 1) = 2.8864662452080023, (130, 0) = 2.8864662452080023, (130, 1) = 17.92982834234024, (131, 0) = 17.92982834234024, (131, 1) = 2.9334113431102984, (132, 0) = 2.9334113431102984, (132, 1) = 18.79161687795776, (133, 0) = 18.79161687795776, (133, 1) = 2.980356441012595, (134, 0) = 2.980356441012595, (134, 1) = 19.694825822533478, (135, 0) = 19.694825822533478, (135, 1) = 3.027301538914891, (136, 0) = 3.027301538914891, (136, 1) = 20.641445959986797, (137, 0) = 20.641445959986797, (137, 1) = 3.074246636817187, (138, 0) = 3.074246636817187, (138, 1) = 21.633565589739902, (139, 0) = 21.633565589739902, (139, 1) = 3.1211816800326497, (140, 0) = 3.1211816800326497, (140, 1) = 22.673144492902143, (141, 0) = 22.673144492902143, (141, 1) = 3.168116723248112, (142, 0) = 3.168116723248112, (142, 1) = 23.76267804454279, (143, 0) = 23.76267804454279, (143, 1) = 3.2150517664635743, (144, 0) = 3.2150517664635743, (144, 1) = 24.90456668219574, (145, 0) = 24.90456668219574, (145, 1) = 3.261986809679037, (146, 0) = 3.261986809679037, (146, 1) = 26.101328399029725, (147, 0) = 26.101328399029725, (147, 1) = 3.308913515337352, (148, 0) = 3.308913515337352, (148, 1) = 27.35537300267221, (149, 0) = 27.35537300267221, (149, 1) = 3.355840220995667, (150, 0) = 3.355840220995667, (150, 1) = 28.669666969313703, (151, 0) = 28.669666969313703, (151, 1) = 3.402766926653982, (152, 0) = 3.402766926653982, (152, 1) = 30.047104895044566, (153, 0) = 30.047104895044566, (153, 1) = 3.449693632312297}, datatype = float[8], order = C_order)), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = y(x)]`; YP[1] := Y[1]; 0 end proc, -1, 0, 0, 0, 0]), ( 19 ) = (0)  ] )), ( 4 ) = (3)  ] ); _y0 := Array(0..1, {(1) = 0.}); _vmap := array( 1 .. 1, [( 1 ) = (1)  ] ); _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] < 10 and 10 <= _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 10 <= _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] < 10 and 10 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 10 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-10 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-10; 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), {"eventenable", "eventdisable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('set')('posint'), ('list')('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] < 10 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 _src = 0 and 10 < _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 <a href='http://www.maplesoft.com/support/help/search.aspx?term=dsolve,maxfun' target='_new'>?dsolve,maxfun</a> 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 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _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]-10, 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 <a href='http://www.maplesoft.com/support/help/search.aspx?term=dsolve,maxfun' target='_new'>?dsolve,maxfun</a> 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 10 < _dat[4][9] then if _dat[4][9]-10 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-10 = _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]-10, 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(0..0, {}), (3) = [x, y(x)], (4) = []}); _vars := _dat[3]; _pars := map(rhs, _dat[4]); _n := nops(_vars)-1; _solnproc := _dat[1]; if not type(_xout, 'numeric') then if member(x_rkf45, ["start", 'start', "method", 'method', "left", 'left', "right", 'right', "leftdata", "rightdata", "enginedata", "eventstop", 'eventstop', "eventclear", 'eventclear', "eventstatus", 'eventstatus', "eventcount", 'eventcount', "laxtol", 'laxtol', "numfun", 'numfun', NULL]) then _res := _solnproc(convert(x_rkf45, 'string')); if 1 < nops([_res]) then return _res elif type(_res, 'array') then return eval(_res, 1) elif _res <> "procname" then return _res end if elif member(x_rkf45, ["last", 'last', "initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(x_rkf45, 'string'); _res := _solnproc(_xout); if _xout = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return [seq(_vars[_i+1] = [_res][1][_i+1], _i = 0 .. _n), seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] else return [seq(_vars[_i+1] = _res[_i+1], _i = 0 .. _n)] end if elif type(_xout, `=`) and member(lhs(_xout), ["initial", 'initial', "parameters", 'parameters', "initial_and_parameters", 'initial_and_parameters', NULL]) then _xout := convert(lhs(x_rkf45), 'string') = rhs(x_rkf45); if type(rhs(_xout), 'list') then _res := _solnproc(_xout) else error "initial and/or parameter values must be specified in a list" end if; if lhs(_xout) = "initial" then return [seq(_vars[_i+1] = _res[_i+1], _i = 0 .. _n)] elif lhs(_xout) = "parameters" then return [seq(_pars[_i] = _res[_i], _i = 1 .. nops(_pars))] else return [seq(_vars[_i+1] = [_res][1][_i+1], _i = 0 .. _n), seq(_pars[_i] = [_res][2][_i], _i = 1 .. nops(_pars))] end if elif type(_xout, `=`) and member(lhs(_xout), ["eventdisable", 'eventdisable', "eventenable", 'eventenable', "eventfired", 'eventfired', "direction", 'direction', NULL]) then return _solnproc(convert(lhs(x_rkf45), 'string') = rhs(x_rkf45)) elif _xout = "solnprocedure" then return eval(_solnproc) elif _xout = "sysvars" then return _vars end if; if procname <> unknown then return ('procname')(x_rkf45) else _ndsol; _ndsol := pointto(_dat[2][0]); return ('_ndsol')(x_rkf45) end if end if; try _res := _solnproc(_xout); [seq(_vars[_i+1] = _res[_i+1], _i = 0 .. _n)] catch: error  end try end proc

(2)

p:=odeplot(ans,x=0..7):

p1:=(ans(2.2));p2:=ans(3.4);p3:=ans(5.1);

[x = 2.2, y(x) = HFloat(9.025010468703147)]

 

[x = 3.4, y(x) = HFloat(29.96408175947838)]

 

[x = 5.1, y(x) = HFloat(164.02175489483204)]

(3)

p2:=pointplot([[2.2,9.02],[3.4,29.96],[6.2,492]],symbolsize=20,color=blue):

display(p,p2);

 

seq(ans(i),i=0..7,.5);

[x = HFloat(0.0), y(x) = HFloat(1.0)], [x = .5, y(x) = HFloat(1.6487212515896756)], [x = 1.0, y(x) = HFloat(2.7182813341196352)], [x = 1.5, y(x) = HFloat(4.481687999193567)], [x = 2.0, y(x) = HFloat(7.38905384345778)], [x = 2.5, y(x) = HFloat(12.182488333567818)], [x = 3.0, y(x) = HFloat(20.085526652065617)], [x = 3.5, y(x) = HFloat(33.11543262345352)], [x = 4.0, y(x) = HFloat(54.598109829842926)], [x = 4.5, y(x) = HFloat(90.0170607315041)], [x = 5.0, y(x) = HFloat(148.413031698896)], [x = 5.5, y(x) = HFloat(244.6916852080704)], [x = 6.0, y(x) = HFloat(403.4283672479379)], [x = 6.5, y(x) = HFloat(665.1408800602615)], [x = 7.0, y(x) = HFloat(1096.631751745884)]

(4)
   
   

Download odeplot.mw

Regards,

Georgios Kokovidis

Dräger Medical

The procedure "factrix", from the Maple Advisor Database can be used to do this.  Find it here.

restart:with(LinearAlgebra):

M:= Matrix(3, 3, [0, sqrt(h/m*omega), 0, sqrt(h/m*omega),0,(sqrt(2)*sqrt(3)*sqrt(h/m*omega))/2,0,(sqrt(2)*sqrt(3)*sqrt(h/m*omega))/2,0]);

M := Matrix(3, 3, {(1, 1) = 0, (1, 2) = (h*omega/m)^(1/2), (1, 3) = 0, (2, 1) = (h*omega/m)^(1/2), (2, 2) = 0, (2, 3) = (1/2)*2^(1/2)*3^(1/2)*(h*omega/m)^(1/2), (3, 1) = 0, (3, 2) = (1/2)*2^(1/2)*3^(1/2)*(h*omega/m)^(1/2), (3, 3) = 0})

(1)

read "C://temp//Maple//factrix.m";

M2:=factrix(M,sqrt(h/m*omega));

M2 := (1/2)*sqrt(h*omega/m).(Matrix(3, 3, {(1, 1) = 0, (1, 2) = 2, (1, 3) = 0, (2, 1) = 2, (2, 2) = 0, (2, 3) = 2^(1/2)*3^(1/2), (3, 1) = 0, (3, 2) = 2^(1/2)*3^(1/2), (3, 3) = 0}))

(2)

 

Download factrix.mw

 

Regards,

Georgios Kokovidis

Dräger Medical

See link here

 

Regards,

Georgios Kokovidis

Dräger Medical

You can use textplot, but the symbol can not be rotated to match the angle of the perpendicular line  of interest (as far as I know - I might be mistaken).  See ?textplot for more details with respect to position and size of font

restart:with(plots):

textplot([1, 2, "&bot;", font = [TIMES, ROMAN, 20]], align = {above, right});

 

``

Download perp.mw

Regards,

Georgios Kokovidis

Dräger Medical

restart:with(RealDomain):

EQ1 :=-380617410575325000*alpha+24073215344640*alpha^13+289227008581632*alpha^12-616698114981888*alpha^11+84620461342720*alpha^10-12328393665418240*alpha^9-7882708713679360*alpha^8+6458245507660032*alpha^7-35445643270557568*alpha^6+67420715289746880*alpha^5+267032846897456000*alpha^4+129576591405350000*alpha^3-269278959376325000*alpha^2-145333678970812500+11101888512000*alpha^14 = 67516416000*alpha^13+2918130511872*alpha^12-34317627242496*alpha^11+84033122004992*alpha^10-313340481118720*alpha^9+1318493341300480*alpha^8-18141737713408*alpha^7+2712218889556224*alpha^6+836823373780672*alpha^5-13386042843531280*alpha^4-3768020736711800*alpha^3+9907301520442000*alpha^2+2072131876601250*alpha-1800642141140625:

EQ2 := 1169014505440*alpha^4*beta+1317863241360*alpha*beta-809254850360*alpha^2*beta-1275285350720*alpha^3*beta-261738451200*alpha^5*beta-618857233362*beta+318795043200*alpha^6*beta-181216742400*beta*alpha^7-400204800*alpha^8*beta+525513892419+83842905600*alpha^8+578953481418*alpha-1451091498604*alpha^2+60759303880*alpha^3+726167274160*alpha^4-597786176800*alpha^5+413668478400*alpha^6-178951977600*alpha^7 = 0:

EM := solve({EQ1, EQ2}, {alpha, beta}): map(`@`(evalf, allvalues), [EM]);

[{alpha = HFloat(-0.938908651245894), beta = HFloat(1.2776812791610155)}, {alpha = HFloat(-0.9415604888175434), beta = HFloat(1.9156285753451883)}, {alpha = HFloat(-1.4253981566281189), beta = HFloat(-0.9421211251978474)}, {alpha = HFloat(3.4698601878322606), beta = HFloat(2.0892187308215853)}, {alpha = HFloat(1.5139564543376625), beta = HFloat(4.311747642049322)}, {alpha = HFloat(1.4662781902245647), beta = HFloat(3.5093326081554324)}]

(1)

EQ3 := 788235028663101953062500*alpha+304814061123714426912768*alpha^13-480849031207850888798208*alpha^12+967041381254249715326976*alpha^11-4021107633233603228467200*alpha^10-2588147209642517719053312*alpha^9+5715333418617553840833024*alpha^8+1759166203862418452559360*alpha^7+20346297431348258497559040*alpha^6+10496123519840497858670400*alpha^5-35268893147755769736108000*alpha^4-19717307326310929257300000*alpha^3+8349200788267279320450000*alpha^2-2589636577607956042031250+11853978154449302323200*alpha^15-46672505673144242798592*alpha^14-116952557229463044096*alpha^18-147967114843429797888*alpha^17-4872568403149496254464*alpha^16 = -150937297675596978890625-501033833494266747712500*alpha-480102537210614726656*alpha^13-3010023079690590765056*alpha^12-3306530622020430524416*alpha^11+16632346111381338619904*alpha^10+33202344087630047760384*alpha^9+95529324551618188221440*alpha^8-229932826241799652286464*alpha^7-494525264091372413081984*alpha^6+420359628327407463636800*alpha^5+926812327428351959480000*alpha^4+29898885469292629950000*alpha^3-641583192648362354760000*alpha^2+44177541159934230528*alpha^15+79227033701844746240*alpha^14+769433134694400000*alpha^18-839497511109132288*alpha^17+30821455435353882624*alpha^16:

EQ4 := -17241559330856975208*alpha+519487102085529600*alpha^12-340162372047974400*alpha^11+4056607982279808000*alpha^10-1615374246634321920*alpha^9+8545160797018374400*alpha^8-25574730748520020480*alpha^7-39165707210999255424*alpha^6+49514069516614234112*alpha^5+57826367000364070432*alpha^4-2587119783432023856*alpha^3-34571804046712191036*alpha^2+6954015812781328200*beta-3133183735880405760*alpha^4*beta+18270099660771295344*alpha*beta-175663249947253152*alpha^2*beta-44351200621916403936*alpha^3*beta+47825483048005404672*alpha^5*beta-17295192225858720768*alpha^6*beta-19030000889200788480*beta*alpha^7+13383245619273492480*alpha^8*beta+5106520780746720021-1558530367057735680*beta*alpha^9+1804492578592972800*beta*alpha^10-1254921256066867200*beta*alpha^11 = 0:

EM1 := solve({EQ3, EQ4}, {alpha, beta}): map(`@`(evalf, allvalues), [EM1]);

[{alpha = HFloat(-0.6757286534530367), beta = HFloat(-4.8881083711593885)}, {alpha = HFloat(-0.9262676839778495), beta = HFloat(1.105954326945037)}, {alpha = HFloat(-0.9381918496617435), beta = HFloat(1.1650565401043445)}, {alpha = HFloat(-0.9387888276835398), beta = HFloat(1.2601517435224572)}, {alpha = HFloat(1.4590451499151815), beta = HFloat(7.936121643595366)}, {alpha = HFloat(1.409704395304377), beta = HFloat(6.786629830347009)}]

(2)

 

Download RealDomain2.mw

Regards,

Georgios Kokovidis

Dräger Medical

One more option is the use of ?RealDomain.

restart:

S := [solve( x^3+x+1=0, x )];

remove( has, S, I );

[-(1/6)*(108+12*93^(1/2))^(1/3)+2/(108+12*93^(1/2))^(1/3), (1/12)*(108+12*93^(1/2))^(1/3)-1/(108+12*93^(1/2))^(1/3)+((1/2)*I)*3^(1/2)*(-(1/6)*(108+12*93^(1/2))^(1/3)-2/(108+12*93^(1/2))^(1/3)), (1/12)*(108+12*93^(1/2))^(1/3)-1/(108+12*93^(1/2))^(1/3)-((1/2)*I)*3^(1/2)*(-(1/6)*(108+12*93^(1/2))^(1/3)-2/(108+12*93^(1/2))^(1/3))]

 

[-(1/6)*(108+12*93^(1/2))^(1/3)+2/(108+12*93^(1/2))^(1/3)]

(1)

evalf(%);

[-.6823278040]

                                                                                 (2)

 

with(RealDomain):

S := [solve( x^3+x+1=0, x )];

[-(1/6)*(108+12*93^(1/2))^(1/3)+2/(108+12*93^(1/2))^(1/3)]

(3)

evalf(%);

[-.6823278040]

                                                                                (4)

 

Download Real.mw

Regards,

Georgios Kokovidis

Dräger Medical

First 9 10 11 12 13 14 15 Last Page 11 of 75