Markiyan Hirnyk

Markiyan Hirnyk
9 years, 187 days


These are answers submitted by Markiyan Hirnyk

is as follows.

plots:-contourplot3d(4*x^2+9*y^2, x = -7 .. 7, y = -5 .. 5, contours = [160], numpoints = 3*10^3, filledregions = true, axes = frame);

 

20th power

May 20 2015 Markiyan Hirnyk 6448

Here is my solution done with the DirectSearch (The DirectSearch package should be downloaded from http://www.maplesoft.com/applications/view.aspx?SID=101333 and installed in your Maple.).

First, we detemine the maximum possible number of the digits of the number under investigation.

restart; fsolve(9^20*n = 10^n, n = 1 .. infinity);

                          20.39436028

In view of it, we represent the number in the form

and solve the integer programming problem

DirectSearch:-GlobalOptima(add(x[j]*10^j, j = 1 .. 20), {add(x[j]^20, j = 1 .. 20) >= add(x[j]*10^j, j = 1 .. 20), seq(x[k] <= 9, k = 1 .. 20)}, assume = nonnegint, maximize);

[HFloat(2.0e20), [x[1] = 0, x[2] = 9, x[3] = 9, x[4] = 9,

  x[5] = 9, x[6] = 9, x[7] = 9, x[8] = 9, x[9] = 9, x[10] = 9,

  x[11] = 9, x[12] = 9, x[13] = 9, x[14] = 9, x[15] = 9,

  x[16] = 9, x[17] = 9, x[18] = 9, x[19] = 9, x[20] = 1], 3055]

maximum.mw

I obtain in Maple 2015 and Maple 16.02 Standard on Windows 7 HB, 32-bit

> restart; assume(x, 'real'): verify(abs(x), sqrt(x^2), {'equal'});

                              FAIL,

not false. There is a workaround:

restart; assume(x, real); abs(x);

                              |x~|
simplify(sqrt(x^2));

                              |x~|.

abs.mw

Following http://www.mapleprimes.com/questions/127594-How-To-Get-A-List-Of-Power-Of-Differential,

p := x^(n-1)+3*y^k:
a := convert(indets(p, `^`), list);
map(c ->`tools/symbolic_degree`(c, x), a);
                           [n - 1, 0]

Some results

May 14 2015 Markiyan Hirnyk 6448

In essence, this is  problems 1, 2 in Chap.1, Vol.1 of Polya G. Aufgaben und Lehrsätze aus der Analysis, 1st edn. 1925.[11] ("Problems and theorems in analysis“). Springer, Berlin 1975 (with Gábor Szegő). This math (not Maple) problem is solved through generating functions. The solution of problem 1 is the theme of a scientific article (see the reference in the cited book).

Here are some results obtained with Maple.

restart; eqn1 := 30*a+75*b+110*c+85*d+255*e+160*f+15*g+12*h+120*i-800000:
DirectSearch:-SolveEquations(eqn1, assume = posint, AllSolutions, method = quadratic, number = 800, evaluationlimit = 20000);

produces 219 solutions (see the attached file).

The result of

floor(800000*(1/30))*floor(800000*(1/75))*floor(800000*(1/110))*floor(800000*(1/85))*floor(800000*(1/255))*floor(800000*(1/160))*floor(800000*(1/15))*floor(800000*(1/12))*floor(800000*(1/120));

             7236013054105619739485107639205760000

evalf(log[10](%));

                          36.85949934

clearly shows the futility of applying the enumeration of possibilities.

Next,

with(Optimization):
LPSolve(30*a+75*b+110*c+85*d+255*t+160*f+15*g+12*h+120*i, {30*a+75*b+110*c+85*d+255*t+160*f+15*g+12*h+120 <= 800000}, assume = {integer, nonnegative}, maximize);
produces an incorrect result
Warning, problem appears to be unbounded
[0,   [a = 0, b = 0, c = 0, d = 0, f = 0, g = 0, h = 0, i = 0, t = 0]  ].

An SCR was submitted by me.

solve.mw

Edit. The numbers of the problems.

 

This can be done as follows. The simpleminded approach
M := Matrix([[plot(x^2)]])

Matrix([[INTERFACE_PLOT(CURVES(Matrix(200, 2, {(1, 1) = -10.0, (1, 2) = 100.0, (2, 1) = -9.894847899497487, (2, 2) = 97.90801495418982, (3, 1) = -9.803355619095477, (3, 2) = 96.10578139445086, (4, 1) = -9.700462980904522, (4, 2) = 94.09898204389904, (5, 1) = -9.596888303517588, (5, 2) = 92.10026511019268, (6, 1) = -9.493805898492463, (6, 2) = 90.13235043825027, (7, 1) = -9.39823531356784, (7, 2) = 88.3268270091936, (8, 1) = -9.299277508542714, (8, 2) = 86.47656218088838, (9, 1) = -9.196935205025126, (9, 2) = 84.58361716543055, (10, 1) = -9.094921114572864, (10, 2) = 82.71759008030331, (11, 1) = -8.989987083417086, (11, 2) = 80.81986776000605, (12, 1) = -8.897561131658291, (12, 2) = 79.16659409159637, (13, 1) = -8.793511401005025, (13, 2) = 77.32584275960537, (14, 1) = -8.689034432160804, (14, 2) = 75.49931936327603, (15, 1) = -8.588351513567838, (15, 2) = 73.75978172060297, (16, 1) = -8.496921777889447, (16, 2) = 72.19767969957196, (17, 1) = -8.388202978894473, (17, 2) = 70.3619492151341, (18, 1) = -8.296103895477387, (18, 2) = 68.82533984455507, (19, 1) = -8.18897076683417, (19, 2) = 67.05924222006463, (20, 1) = -8.094139794974874, (20, 2) = 65.51509902059588, (21, 1) = -7.990095188944723, (21, 2) = 63.84162112839761, (22, 1) = -7.891020119597989, (22, 2) = 62.26819852790027, (23, 1) = -7.787645678391959, (23, 2) = 60.647425212176955, (24, 1) = -7.692715671356783, (24, 2) = 59.17787440033825, (25, 1) = -7.590320834170854, (25, 2) = 57.61297036564813, (26, 1) = -7.483961375879397, (26, 2) = 56.00967787565463, (27, 1) = -7.391375154773869, (27, 2) = 54.63242667860844, (28, 1) = -7.291379499497487, (28, 2) = 53.16421500569222, (29, 1) = -7.188074203015075, (29, 2) = 51.66841074805081, (30, 1) = -7.087010124623116, (30, 2) = 50.22571250651055, (31, 1) = -6.989225432160804, (31, 2) = 48.84927214156338, (32, 1) = -6.880652203015075, (32, 2) = 47.34337473885621, (33, 1) = -6.7830943276381905, (33, 2) = 46.01036865763739, (34, 1) = -6.678930472361809, (34, 2) = 44.60811225464313, (35, 1) = -6.584542537688442, (35, 2) = 43.35620043062855, (36, 1) = -6.481351593969849, (36, 2) = 42.007918484655505, (37, 1) = -6.384256957788945, (37, 2) = 40.75873690307655, (38, 1) = -6.2827650864321605, (38, 2) = 39.47313713129091, (39, 1) = -6.183538231155779, (39, 2) = 38.23614505616514, (40, 1) = -6.079656909547738, (40, 2) = 36.96222813781156, (41, 1) = -5.979606850251256, (41, 2) = 35.755698083571744, (42, 1) = -5.877291214070351, (42, 2) = 34.542552014988544, (43, 1) = -5.775822803015075, (43, 2) = 33.36012905182891, (44, 1) = -5.682583871356783, (44, 2) = 32.29175945500425, (45, 1) = -5.575721533668341, (45, 2) = 31.088670621012838, (46, 1) = -5.480142584924623, (46, 2) = 30.03196275110433, (47, 1) = -5.378235490452261, (47, 2) = 28.925416990760272, (48, 1) = -5.280697397989949, (48, 2) = 27.885765009137824, (49, 1) = -5.172393881407035, (49, 2) = 26.753658464416933, (50, 1) = -5.078610993969849, (50, 2) = 25.792289628071416, (51, 1) = -4.972166577889447, (51, 2) = 24.722440478280856, (52, 1) = -4.875154048241206, (52, 2) = 23.76712699408262, (53, 1) = -4.769037586934673, (53, 2) = 22.743719505595692, (54, 1) = -4.677477027135678, (54, 2) = 21.878791339382023, (55, 1) = -4.5732002371859295, (55, 2) = 20.914160409397443, (56, 1) = -4.472474006030151, (56, 2) = 20.003023734615383, (57, 1) = -4.3718135768844215, (57, 2) = 19.11275395103096, (58, 1) = -4.271523459296482, (58, 2) = 18.245912663320183, (59, 1) = -4.175176053266331, (59, 2) = 17.43209507576862, (60, 1) = -4.071021955778894, (60, 2) = 16.573219764433812, (61, 1) = -3.971755548743718, (61, 2) = 15.774842138976512, (62, 1) = -3.8672823296482406, (62, 2) = 14.955872617209524, (63, 1) = -3.7727089085427137, (63, 2) = 14.233332508597554, (64, 1) = -3.6681875738693464, (64, 2) = 13.455600077089482, (65, 1) = -3.5680743487437185, (65, 2) = 12.731154558162912, (66, 1) = -3.4682048020100504, (66, 2) = 12.028444548685574, (67, 1) = -3.363890673366833, (67, 2) = 11.315760462364365, (68, 1) = -3.267813552763819, (68, 2) = 10.678605415626892, (69, 1) = -3.1694174391959793, (69, 2) = 10.045206903879599, (70, 1) = -3.0607764381909544, (70, 2) = 9.368352404584906, (71, 1) = -2.962410910552764, (71, 2) = 8.775878402962057, (72, 1) = -2.861813733668341, (72, 2) = 8.189977846212729, (73, 1) = -2.759508995979899, (73, 2) = 7.614889898893989, (74, 1) = -2.665471034170854, (74, 2) = 7.104735834003841, (75, 1) = -2.5652296120603006, (75, 2) = 6.580402962591041, (76, 1) = -2.4657512341708543, (76, 2) = 6.079929148815091, (77, 1) = -2.3593402914572854, (77, 2) = 5.566486610893748, (78, 1) = -2.265437244221106, (78, 2) = 5.132205907504119, (79, 1) = -2.1570926211055275, (79, 2) = 4.653048576027914, (80, 1) = -2.059319951758794, (80, 2) = 4.240798663711841, (81, 1) = -1.9625790060301505, (81, 2) = 3.8517163549102933, (82, 1) = -1.8585514110552772, (82, 2) = 3.454213347535562, (83, 1) = -1.754103003015075, (83, 2) = 3.0768773451865044, (84, 1) = -1.6590704170854274, (84, 2) = 2.7525146488480137, (85, 1) = -1.5581500321608033, (85, 2) = 2.427831522722712, (86, 1) = -1.4596615999999987, (86, 2) = 2.1306119865145563, (87, 1) = -1.352899100502512, (87, 2) = 1.8303359761405058, (88, 1) = -1.2605198552763817, (88, 2) = 1.58891030554599, (89, 1) = -1.1544189336683406, (89, 2) = 1.3326830744119484, (90, 1) = -1.0546784894472356, (90, 2) = 1.1123467161027027, (91, 1) = -.9559014291457277, (91, 2) = .9137475422428447, (92, 1) = -.8570457909547731, (92, 2) = .7345274877932926, (93, 1) = -.7562192974874371, (93, 2) = .5718676258923929, (94, 1) = -.6493449035175889, (94, 2) = .42164880372426683, (95, 1) = -.5513515497487429, (95, 2) = .3039885314103405, (96, 1) = -.4546195266331665, (96, 2) = .2066789139961644, (97, 1) = -.3512145859296485, (97, 2) = .12335168536973444, (98, 1) = -.24803474874371823, (98, 2) = 0.6152123658435943e-1, (99, 1) = -.1554247175879393, (99, 2) = 0.24156842837290686e-1, (100, 1) = -0.4572145728643129e-1, (100, 2) = 0.20904516563949606e-2, (101, 1) = 0.4607314371859239e-1, (101, 2) = 0.21227345721140695e-2, (102, 1) = .15343724020100424, (102, 2) = 0.2354298668050067e-1, (103, 1) = .25590586934673354, (103, 2) = 0.6548781396610745e-1, (104, 1) = .3473981497487433, (104, 2) = .12068547444885026, (105, 1) = .4502907879397, (105, 2) = .2027617937033559, (106, 1) = .5538654653266342, (106, 2) = .306766953681489, (107, 1) = .6569478703517593, (107, 2) = .4315805043597119, (108, 1) = .7525184552763822, (108, 2) = .5662840255315524, (109, 1) = .8514762603015082, (109, 2) = .7250118218570418, (110, 1) = .9538185638190946, (110, 2) = .9097698526859201, (111, 1) = 1.0558326542713576, (111, 2) = 1.1147825938257003, (112, 1) = 1.1607666854271361, (112, 2) = 1.3473792979975, (113, 1) = 1.2531926371859292, (113, 2) = 1.570491785897024, (114, 1) = 1.3572423678391967, (114, 2) = 1.8421068450577494, (115, 1) = 1.4617193366834176, (115, 2) = 2.13662341923421, (116, 1) = 1.5624022552763837, (116, 2) = 2.44110080729273, (117, 1) = 1.6538319909547745, (117, 2) = 2.735160254305433, (118, 1) = 1.7625507899497492, (118, 2) = 3.106585287152485, (119, 1) = 1.8546498733668333, (119, 2) = 3.4397261527796106, (120, 1) = 1.9617830020100513, (120, 2) = 3.848592546975569, (121, 1) = 2.0566139738693465, (121, 2) = 4.229661037514665, (122, 1) = 2.160658579899497, (122, 2) = 4.668445498893312, (123, 1) = 2.2597336492462308, (123, 2) = 5.1063961655356875, (124, 1) = 2.3631080904522612, (124, 2) = 5.584279847160932, (125, 1) = 2.4580380974874387, (125, 2) = 6.041951288699668, (126, 1) = 2.5604329346733685, (126, 2) = 6.555816812960078, (127, 1) = 2.6667923929648243, (127, 2) = 7.111781667175054, (128, 1) = 2.7593786140703536, (128, 2) = 7.614170335788825, (129, 1) = 2.859374269346734, (129, 2) = 8.17602121220217, (130, 1) = 2.962679565829145, (130, 2) = 8.77747020978157, (131, 1) = 3.0637436442211072, (131, 2) = 9.386525117505231, (132, 1) = 3.1615283366834177, (132, 2) = 9.995261423652218, (133, 1) = 3.2701015658291475, (133, 2) = 10.693564250838243, (134, 1) = 3.3676594412060297, (134, 2) = 11.341130111944109, (135, 1) = 3.4718232964824125, (135, 2) = 12.053557001998005, (136, 1) = 3.56621123115578, (136, 2) = 12.717862545221623, (137, 1) = 3.669402174874371, (137, 2) = 13.464512320972762, (138, 1) = 3.766496811055278, (138, 2) = 14.18649822768958, (139, 1) = 3.8679886824120615, (139, 2) = 14.961336447267795, (140, 1) = 3.9672155376884426, (140, 2) = 15.738799122476598, (141, 1) = 4.071096859296484, (141, 2) = 16.57382963777369, (142, 1) = 4.1711469185929655, (142, 2) = 17.398466616487593, (143, 1) = 4.273462554773868, (143, 2) = 18.262482207054394, (144, 1) = 4.374930965829147, (144, 2) = 19.140020955770755, (145, 1) = 4.468169897487437, (145, 2) = 19.964542232812892, (146, 1) = 4.575032235175879, (146, 2) = 20.9309199528984, (147, 1) = 4.6706111839196005, (147, 2) = 21.814608831354853, (148, 1) = 4.77251827839196, (148, 2) = 22.77693071758536, (149, 1) = 4.8700563708542735, (149, 2) = 23.717449055298296, (150, 1) = 4.978359887437186, (150, 2) = 24.784067168843592, (151, 1) = 5.072142774874372, (151, 2) = 25.726632328710295, (152, 1) = 5.178587190954774, (152, 2) = 26.817765294320857, (153, 1) = 5.275599720603015, (153, 2) = 27.831952412026613, (154, 1) = 5.381716181909548, (154, 2) = 28.96286906262708, (155, 1) = 5.473276741708544, (155, 2) = 29.95675829132769, (156, 1) = 5.5775535316582925, (156, 2) = 31.10910339851389, (157, 1) = 5.678279762814071, (157, 2) = 32.242861064783824, (158, 1) = 5.7789401919598, (158, 2) = 33.39614974224836, (159, 1) = 5.879230309547738, (159, 2) = 34.565349032704795, (160, 1) = 5.9755777155778915, (160, 2) = 35.70752903491109, (161, 1) = 6.0797318130653295, (161, 2) = 36.96313891879864, (162, 1) = 6.178998220100503, (162, 2) = 38.18001900400519, (163, 1) = 6.283471439195981, (163, 2) = 39.482013327191616, (164, 1) = 6.378044860301507, (164, 2) = 40.679456240018474, (165, 1) = 6.482566194974876, (165, 2) = 42.02366447223104, (166, 1) = 6.582679420100504, (166, 2) = 43.33166834781471, (167, 1) = 6.682548966834172, (167, 2) = 44.65646069413646, (168, 1) = 6.786863095477386, (168, 2) = 46.06151067675289, (169, 1) = 6.882940216080403, (169, 2) = 47.37486601813694, (170, 1) = 6.981336329648244, (170, 2) = 48.73905694766641, (171, 1) = 7.089977330653266, (171, 2) = 50.26777854917721, (172, 1) = 7.18834285829146, (172, 2) = 51.67227304834983, (173, 1) = 7.28894003517588, (173, 2) = 53.12864683638976, (174, 1) = 7.391244772864322, (174, 2) = 54.63049929239417, (175, 1) = 7.485282734673369, (175, 2) = 56.02945761799923, (176, 1) = 7.585524156783922, (176, 2) = 57.540176733152435, (177, 1) = 7.6850025346733695, (177, 2) = 59.05926395793611, (178, 1) = 7.791413477386936, (178, 2) = 60.70612397560678, (179, 1) = 7.885316524623114, (179, 2) = 62.17821669349435, (180, 1) = 7.993661147738695, (180, 2) = 63.89861854486712, (181, 1) = 8.091433817085427, (181, 2) = 65.47130121627364, (182, 1) = 8.188174762814072, (182, 2) = 67.04620594638527, (183, 1) = 8.292202357788948, (183, 2) = 68.76061994252059, (184, 1) = 8.396650765829147, (184, 2) = 70.5037440832992, (185, 1) = 8.491683351758795, (185, 2) = 72.10868614653748, (186, 1) = 8.592603736683419, (186, 2) = 73.83283897566585, (187, 1) = 8.691092168844222, (187, 2) = 75.53508308734536, (188, 1) = 8.79785466834171, (188, 2) = 77.40224676526202, (189, 1) = 8.89023391356784, (189, 2) = 79.03625903795175, (190, 1) = 8.99633483517588, (190, 2) = 80.93404046659901, (191, 1) = 9.096075279396988, (191, 2) = 82.73858548845699, (192, 1) = 9.194852339698496, (192, 2) = 84.54530954885891, (193, 1) = 9.293707977889447, (193, 2) = 86.37300797828595, (194, 1) = 9.394534471356785, (194, 2) = 88.2572779335109, (195, 1) = 9.501408865326635, (195, 2) = 90.27677042610757, (196, 1) = 9.599402219095477, (196, 2) = 92.14852296397517, (197, 1) = 9.696134242211055, (197, 2) = 94.01501924297776, (198, 1) = 9.799539182914575, (198, 2) = 96.03096819747806, (199, 1) = 9.902719020100502, (199, 2) = 98.06384399106025, (200, 1) = 10.0, (200, 2) = 100.0}, datatype = float[8]), COLOUR(RGB, .47058824, 0., 0.54901961e-1, _ATTRIBUTE("source" = "mathdefault"))), AXESLABELS(x, ""), VIEW(-10. .. 10., DEFAULT, _ATTRIBUTE("source" = "mathdefault")))]])

(1)

with(ExcelTools):

ExcelTools:-Export(M, "plot.xls");

does not succeed:

This works well.

N := plottools:-getdata(M[1, 1])[3]:

``

``

 

Download Export.mw

One way

May 11 2015 Markiyan Hirnyk 6448

After correcting your syntax (diff (y(t),t) instead of d*y(t)/dt), the following works, but the answer is too long. You have to evaluate parameters.

 

sys_ode := diff(ph(t), t) = (1-yc)*pc(t)+yh*prj(t)+urd*prd(t)+ugd*pgd(t)-yc*ph(t), diff(pc(t), t) = yc*ph(t)-(2-yc)*pc(t), diff(pa(t), t) = ya*pc(t)-pf(t), diff(prj(t), t) = yrj*pa(t)+prj(t), diff(prd(t), t) = -urd*prd(t)+yrd*pa(t), diff(pgd(t), t) = -ugd*pgd(t)+ygd*pa(t), diff(pf(t), t) = (1-ygd-yrj-yrd)*pa(t)+(1-yh)*prj(t); ics := ph(0) = 1, pc(0) = 0, pa(0) = 0, prj(0) = 0, prd(0) = 0, pgd(0) = 0, pf(0) = 0

sol := dsolve({ics, sys_ode}, {pa(t), pc(t), pf(t), pgd(t), ph(t), prd(t), prj(t)}, method = laplace):

sol1 := allvalues(sol)

`[Length of output exceeds limit of 1000000]`

(1)

``

 

Download dsolve.mw

Another way

May 08 2015 Markiyan Hirnyk 6448

The DirectSearch package should be downloaded from http://www.maplesoft.com/applications/view.aspx?SID=101333 and installed in your Maple.

>restart; a = 1-(1+x)*exp(-x): sol := solve(%, x, allsolutions);
              -LambertW(_Z2, (a - 1) exp(-1)) - 1
>DirectSearch:-SolveEquations(eval([sol, a = .3) = Re(eval(sol, a = .3)), assume = integer, AllSolutions, solutions = 3);

 

 

As usually, your question is inaccurately formulated: it should be written that x tends to infinity and 2x^3 instead of 2^3. Up to  Wiki, it is enough to find

limit(abs(2*x^3+x^2-3*x+2)/abs(x^3), x = infinity);

                               2
to this end.

How about this ( The DirectSearch package should be downloaded from http://www.maplesoft.com/applications/view.aspx?SID=101333 and installed in your Maple.)

F := x^2+x:

f := x+sin(x)+ln(t) = 0:

X := proc (T) options operator, arrow; DirectSearch:-SolveEquations([eval(f, t = T)]) end proc:

rhs(X(2)[3][1])

HFloat(-0.35012858586212914)

(1)

plot(proc (t) options operator, arrow; eval(F, x = rhs(X(t)[3][1])) end proc, .5 .. 7, thickness = 3)

 

ff := diff(x(t), t)+1/t+(diff(x(t), t))*cos(x(t)) = 0

diff(x(t), t)+1/t+(diff(x(t), t))*cos(x(t)) = 0

(2)

dsolve({ff, x(1) = 1}, numeric)

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( [( "complex" ) = false ] ) _xout := _xin; _pars := []; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 21, [( 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..28, {(1) = 1.0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = 1.0, (6) = 0.8552412462944062e-1, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 4 ) = (Array(1..53, {(1) = 1, (2) = 1, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0}, 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] = x(t)]`; YP[1] := -1/(X*(1+cos(Y[1]))); 0 end proc, -1, 0, 0, 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) = 1.0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = -.6492232052047624}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..1, {(1) = .1}, datatype = float[8], order = C_order), 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) = .0}, 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) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = 0}, datatype = integer[4]), 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) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order)]), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 13 ) = (), ( 12 ) = (), ( 21 ) = (0), ( 20 ) = ([]), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = x(t)]`; YP[1] := -1/(X*(1+cos(Y[1]))); 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 18 ) = ([]), ( 19 ) = (0)  ] ))  ] ); _y0 := Array(0..1, {(1) = 1.}); _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), {"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] < 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 ?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 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 ?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 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) = [t, x(t)], (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

(3)

``


Download implicit.mw

?

 

sum(Q*exp(-n*c*T), n = 0 .. k-1);



maximize(-exp(c*T)*Q*exp(-c*T*k)/(exp(c*T)-1)+exp(c*T)*Q/(exp(c*T)-1), k = 1 .. infinity, location) assuming positive;


solve(exp(c*T)*Q/(exp(c*T)-1) = M, T) assumingM > Q;


Edit. k-1 instead of k in the sum.

 

Download drugsb&c.mw

is an  unbounded target function if the variables are  arbitrary reals.


randomize():

with(RandomTools):

f := select(proc (c) options operator, arrow; degree(c) = 2 end proc, RandomTools:-Generate(polynom(integer, {seq(x || j, j = 1 .. 10)}, degree = 2))):

constr1 := add(x || j, j = 1 .. 10) = 1:

constr2 := RandomTools:-Generate(polynom(integer, {seq(x || j, j = 1 .. 10)}, degree = 1)) = 0:

Optimization[QPSolve](f, {constr1, constr2});

Warning, problem appears to be unbounded

[-112697584251.319, [x1 = HFloat(3.2615521322504337e-4), x10 = HFloat(1.3457008849237367e-4), x2 = HFloat(0.7104300694610263), x3 = HFloat(3.501740036293416e-4), x4 = HFloat(-2.097735910305265e-4), x5 = HFloat(-1.471994477677263e-4), x6 = HFloat(-2.0515330411445543e-4), x7 = HFloat(1.4627976343078303e-4), x8 = HFloat(-5.166692838860093e-5), x9 = HFloat(0.28922654474149734)]]

(1)

f

-136065926516*x1^2-448228265588*x1*x10+176448470363*x1*x2-152354668236*x1*x3+421063855332*x1*x4-524697424013*x1*x5-137140102169*x1*x6+830567505498*x1*x7+757635394263*x1*x8+466976388356*x1*x9+292149477709*x10^2-144378664736*x10*x2+283341720731*x10*x3-414275841209*x10*x4-81399887494*x10*x5-382799517493*x10*x6+658114545574*x10*x7-7615660117*x10*x8+505006714170*x10*x9-461679372935*x2^2-685939699925*x2*x3+166455020345*x2*x4-722655825345*x2*x5-362576456783*x2*x6-323798996402*x2*x7+620746187977*x2*x8+493646214185*x2*x9+344015038897*x3^2+665361162349*x3*x4+184319235271*x3*x5-786768083913*x3*x6+498615534236*x3*x7-600705226953*x3*x8+43542087266*x3*x9-201792810189*x4^2-181748924034*x4*x5-122052710886*x4*x6-799121213302*x4*x7+840808299*x4*x8+159528999059*x4*x9-352583439124*x5^2-383627310575*x5*x6+741741467744*x5*x7-850323301349*x5*x8+227528827853*x5*x9+130787391728*x6^2+291096825743*x6*x7-606966731013*x6*x8-75215269047*x6*x9-109671897404*x7^2-89484094361*x7*x8+578886572286*x7*x9-493340156842*x8^2-466850609339*x8*x9+225895278620*x9^2

(2)

constr2

-244380529252+335691472844*x1+138504703819*x10+465702476165*x2+360412534473*x3-215907037145*x4-151503325470*x5-211151660389*x6+150556751026*x7-53177587188*x8-300313129003*x9 = 0

(3)

Optimization[QPSolve](f, {constr1, constr2}, assume = nonnegative);

[-182135971391.043, [x1 = HFloat(0.8125781639951961), x10 = HFloat(0.0), x2 = HFloat(0.0), x3 = HFloat(0.0), x4 = HFloat(0.0), x5 = HFloat(0.18742183600480394), x6 = HFloat(0.0), x7 = HFloat(0.0), x8 = HFloat(0.0), x9 = HFloat(0.0)]]

(4)

``


Download typical_result.mw

 

Numerically

May 02 2015 Markiyan Hirnyk 6448

Maple can dsolve it numerically by

restart;sol:= dsolve({diff(y(x), x, x) = lambda*x*y(x)/sqrt(-1+x), y(a) = b, (D(y))(a) = c}, y(x), numeric, parameters = [lambda, a, b, c]);

proc... end proc

sol(parameters = [1, 2, -1, 1]);
             [lambda = 1., a = 2., b = -1., c = 1.]
sol(3);
                                               
      
plots:-odeplot(t -> sol(t) , 2 .. 3);


 

Megahit of 10s

April 30 2015 Markiyan Hirnyk 6448

convert(indets((2*b+c)^(1/2)+c-(c-2*b)^(1/3), `^`),list);


How about this?

eq := (4*a^3*b)^(1/2)/(-(a/(4*b))^(1/2))+(4*a^3*b*(4*b/a))^(1/2) = 0;
simplify(eq, symbolic);

                             0 = 0

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