mmcdara

6149 Reputation

17 Badges

9 years, 115 days

MaplePrimes Activity


These are answers submitted by mmcdara


... if I understand your problem correctly...

(in this worksheet z__p means z' and beta__p means beta')
 

restart

f     := 12:
f__kr := 7:
z__m  := 350:
y__m  := 200:

epsilon := unapply(1-(f__kr/f)^2*exp(-((phi-z__m)/y__m)^2), phi)

proc (phi) options operator, arrow; 1-(49/144)*exp(-(1/40000)*(phi-350)^2) end proc

(1)

sys := diff(z(x), x) = cot(beta(x)),
       diff(beta(x), x) = eval(1/2/epsilon(phi)*diff(epsilon(phi), phi), phi=z(x)),
       diff(z__p(x), x) = -beta__p(x)/sin(beta(x))^2,
       diff(beta__p(x),x) = eval(
                              z__p(x)/2/epsilon(phi)
                              *(
                                 1/epsilon(phi)*diff(epsilon(phi), phi)^2
                                 -diff(epsilon(phi), phi$2)
                               ), phi=z(x)
                             ):

sys_1 := {sys[1..2], z(0)=0, beta(0)=beta__n};
sol_1 := dsolve(sys_1, numeric, parameters=[beta__n])

{beta(0) = beta__n, diff(beta(x), x) = -(49/288)*(-(1/20000)*z(x)+7/400)*exp(-(1/40000)*(z(x)-350)^2)/(1-(49/144)*exp(-(1/40000)*(z(x)-350)^2)), diff(z(x), x) = cot(beta(x)), z(0) = 0}

 

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 := [beta__n = beta__n]; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 24, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..54, {(1) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 1, (6) = 0, (7) = 0, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 0, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0, (54) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = .0, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..3, {(1) = beta__n, (2) = 0., (3) = Float(undefined)})), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8], order = C_order), Array(1..3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8], order = C_order), Array(1..3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8], order = C_order), Array(1..3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8], order = C_order), Array(1..3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = beta(x), Y[2] = z(x)]`; YP[1] := -(49/288)*(-(1/20000)*Y[2]+7/400)*exp(-(1/40000)*(Y[2]-350)^2)/(1-(49/144)*exp(-(1/40000)*(Y[2]-350)^2)); YP[2] := cot(Y[1]); 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = beta(x), Y[2] = z(x)]`; YP[1] := -(49/288)*(-(1/20000)*Y[2]+7/400)*exp(-(1/40000)*(Y[2]-350)^2)/(1-(49/144)*exp(-(1/40000)*(Y[2]-350)^2)); YP[2] := cot(Y[1]); 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 24 ) = (0)  ] ))  ] ); _y0 := Array(0..3, {(1) = 0., (2) = beta__n, (3) = 0.}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 100 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 100 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(0..0, {}), (3) = [x, beta(x), z(x)], (4) = [beta__n = beta__n]}); _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)

# Fix beta__n to some value

B := 2:
sol_1(parameters=[B]);

[beta__n = 2.]

(3)

# Build 2 procedures that return z(x) and beta(x)

__z := proc(__x);
   if not type(evalf(__x),'numeric') then
      'procname'(__x);
   else
      eval(z(x), sol_1(__x));
   end if;
end proc:

__beta := proc(__x);
   if not type(evalf(__x),'numeric') then
      'procname'(__x);
   else
      eval(beta(x), sol_1(__x));
   end if;
end proc:
 

sys_2 := {eval(sys[3..4], [z=(x -> __z(x)), beta=(x -> __beta(x))]), z__p(0)=0, beta__p(0)=1};
sol_2 := dsolve(sys_2, numeric, known=[__z, __beta])

{beta__p(0) = 1, diff(beta__p(x), x) = (1/2)*z__p(x)*((2401/20736)*(-(1/20000)*__z(x)+7/400)^2*(exp(-(1/40000)*(__z(x)-350)^2))^2/(1-(49/144)*exp(-(1/40000)*(__z(x)-350)^2))-(49/2880000)*exp(-(1/40000)*(__z(x)-350)^2)+(49/144)*(-(1/20000)*__z(x)+7/400)^2*exp(-(1/40000)*(__z(x)-350)^2))/(1-(49/144)*exp(-(1/40000)*(__z(x)-350)^2)), diff(z__p(x), x) = -beta__p(x)/sin(__beta(x))^2, z__p(0) = 0}

 

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 .. 24, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..54, {(1) = 2, (2) = 2, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 1, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 1, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0, (54) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = .0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = .0, (6) = 0.4173514350946864e-2, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = 1.0, (2) = .0}, datatype = float[8], order = C_order)), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..2, {(1) = .1, (2) = .1}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0}, datatype = float[8], order = C_order), Array(1..2, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = 0, (2) = 0}, datatype = integer[8]), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..2, {(1) = 1.0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = -1.209450437063038}, datatype = float[8], order = C_order), 0, 0]), ( 11 ) = (Array(1..6, 0..2, {(1, 1) = .0, (1, 2) = .0, (2, 0) = .0, (2, 1) = .0, (2, 2) = .0, (3, 0) = .0, (3, 1) = .0, (3, 2) = .0, (4, 0) = .0, (4, 1) = .0, (4, 2) = .0, (5, 0) = .0, (5, 1) = .0, (5, 2) = .0, (6, 0) = .0, (6, 1) = .0, (6, 2) = .0}, datatype = float[8], order = C_order)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = beta__p(x), Y[2] = z__p(x)]`; YP[1] := (1/2)*Y[2]*((2401/20736)*(-(1/20000)*__z(X)+7/400)^2*(exp(-(1/40000)*(__z(X)-350)^2))^2/(1-(49/144)*exp(-(1/40000)*(__z(X)-350)^2))-(49/2880000)*exp(-(1/40000)*(__z(X)-350)^2)+(49/144)*(-(1/20000)*__z(X)+7/400)^2*exp(-(1/40000)*(__z(X)-350)^2))/(1-(49/144)*exp(-(1/40000)*(__z(X)-350)^2)); YP[2] := -Y[1]/sin(__beta(X))^2; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = beta__p(x), Y[2] = z__p(x)]`; YP[1] := (1/2)*Y[2]*((2401/20736)*(-(1/20000)*__z(X)+7/400)^2*(exp(-(1/40000)*(__z(X)-350)^2))^2/(1-(49/144)*exp(-(1/40000)*(__z(X)-350)^2))-(49/2880000)*exp(-(1/40000)*(__z(X)-350)^2)+(49/144)*(-(1/20000)*__z(X)+7/400)^2*exp(-(1/40000)*(__z(X)-350)^2))/(1-(49/144)*exp(-(1/40000)*(__z(X)-350)^2)); YP[2] := -Y[1]/sin(__beta(X))^2; 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 24 ) = (0)  ] ))  ] ); _y0 := Array(0..2, {(1) = 0., (2) = 1.}); _vmap := array( 1 .. 2, [( 1 ) = (1), ( 2 ) = (2)  ] ); _x0 := _dtbl[1][5][5]; _n := _dtbl[1][4][1]; _ne := _dtbl[1][4][3]; _nd := _dtbl[1][4][4]; _nv := _dtbl[1][4][16]; if not type(_xout, 'numeric') then if member(_xout, ["start", "left", "right"]) then if _Env_smart_dsolve_numeric = true or _dtbl[1][4][10] = 1 then if _xout = "left" then if type(_dtbl[2], 'table') then return _dtbl[2][5][1] end if elif _xout = "right" then if type(_dtbl[3], 'table') then return _dtbl[3][5][1] end if end if end if; return _dtbl[1][5][5] elif _xout = "method" then return _dtbl[1][15] elif _xout = "storage" then return evalb(_dtbl[1][4][10] = 1) elif _xout = "leftdata" then if not type(_dtbl[2], 'array') then return NULL else return eval(_dtbl[2]) end if elif _xout = "rightdata" then if not type(_dtbl[3], 'array') then return NULL else return eval(_dtbl[3]) end if elif _xout = "enginedata" then return eval(_dtbl[1]) elif _xout = "enginereset" then _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); return NULL elif _xout = "initial" then return procname(_y0[0]) elif _xout = "laxtol" then return _dtbl[`if`(member(_dtbl[4], {2, 3}), _dtbl[4], 1)][5][18] elif _xout = "numfun" then return `if`(member(_dtbl[4], {2, 3}), _dtbl[_dtbl[4]][4][18], 0) elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "initial_and_parameters" then return procname(_y0[0]), [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] elif _xout = "last" then if _dtbl[4] <> 2 and _dtbl[4] <> 3 or _x0-_dtbl[_dtbl[4]][5][1] = 0. then error "no information is available on last computed point" else _xout := _dtbl[_dtbl[4]][5][1] end if elif _xout = "function" then if _dtbl[1][4][33]-2. = 0 then return eval(_dtbl[1][10], 1) else return eval(_dtbl[1][10][1], 1) end if elif _xout = "map" then return copy(_vmap) elif type(_xin, `=`) and type(rhs(_xin), 'list') and member(lhs(_xin), {"initial", "parameters", "initial_and_parameters"}) then _ini, _par := [], []; if lhs(_xin) = "initial" then _ini := rhs(_xin) elif lhs(_xin) = "parameters" then _par := rhs(_xin) elif select(type, rhs(_xin), `=`) <> [] then _par, _ini := selectremove(type, rhs(_xin), `=`) elif nops(rhs(_xin)) < nops(_pars)+1 then error "insufficient data for specification of initial and parameters" else _par := rhs(_xin)[-nops(_pars) .. -1]; _ini := rhs(_xin)[1 .. -nops(_pars)-1] end if; _xout := lhs(_xout); if _par <> [] then `dsolve/numeric/process_parameters`(_n, _pars, _par, _y0) end if; if _ini <> [] then `dsolve/numeric/process_initial`(_n-_ne, _ini, _y0, _pars, _vmap) end if; `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars); if _Env_smart_dsolve_numeric = true and type(_y0[0], 'numeric') and _dtbl[1][4][10] <> 1 then procname("right") := _y0[0]; procname("left") := _y0[0] end if; if _xout = "initial" then return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)] elif _xout = "parameters" then return [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] else return [_y0[0], seq(_y0[_vmap[_i]], _i = 1 .. _n-_ne)], [seq(_y0[_n+_i], _i = 1 .. nops(_pars))] end if elif _xin = "eventstop" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then return 0 end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 100 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 100 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(0..0, {}), (3) = [x, beta__p(x), z__p(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

(4)

with(plots):

xmax := 1;
display(
  odeplot(sol_1, [x, z(x)], x=0..xmax, color=red, linestyle=1, legend=typeset('z(x)')),
  odeplot(sol_2, [x, z__p(x)], x=0..xmax, color=red, linestyle=3, legend=typeset('z__p(x)')),
  odeplot(sol_1, [x, beta(x)], x=0..xmax, color=blue, linestyle=1, legend=typeset('beta(x)')),
  odeplot(sol_2, [x, beta__p(x)], x=0..xmax, color=blue, linestyle=3, legend=typeset('beta__p(x)')),
  title=typeset(beta__n=B)
)

1

 

 

 


 

Download Solution_mmcdra.mw


UPDATED VERSION OF THE PREVIOUS WORKSHEET
(values of the parameter have been changed to obtain more complex figures)
Solution_2_mmcdara.mw


Begin to observe what happens here:

  • when theta(x) is aliased as theta, dsolve can't solve equation b5 even after f(=f(x)) has been set to an explicit expression (which is of course necessary because dsolve/bvp doesn't handle the parameters option);
  • but as soon as theta is "unaliased", the solution is computed.

 

restart

alias(theta=theta(x))

theta

(1)

# Equation b5 with f set to 1

b5 := {1.116150082*(diff(theta, x, x))+3.100000000*(diff(theta, x)) = 0, theta(0) = 1, theta(10) = 0};
dsolve(%, numeric)

{1.116150082*(diff(diff(theta, x), x))+3.100000000*(diff(theta, x)) = 0, theta(0) = 1, theta(10) = 0}

 

Error, (in dsolve/numeric/type_check) insufficient initial/boundary value information for procedure defined problem

 

alias(theta=theta)

b5 := {1.116150082*(diff(theta(x), x, x))+3.100000000*(diff(theta(x), x)) = 0, theta(0) = 1, theta(10) = 0};
dsolve(%, numeric)

{1.116150082*(diff(diff(theta(x), x), x))+3.100000000*(diff(theta(x), x)) = 0, theta(0) = 1, theta(10) = 0}

 

proc (x_bvp) local res, data, solnproc, _ndsol, outpoint, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](x_bvp) else outpoint := evalf(x_bvp) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(29, {(1) = .0, (2) = .24374318067304568, (3) = .49274258355762024, (4) = .7473536706781976, (5) = 1.0079738719876108, (6) = 1.2750498684188607, (7) = 1.5495922123637438, (8) = 1.8365692463351309, (9) = 2.1388880659925067, (10) = 2.459308706102226, (11) = 2.8015337294128964, (12) = 3.165425757696352, (13) = 3.5454274940529715, (14) = 3.943679148413142, (15) = 4.362789400269794, (16) = 4.793431473452039, (17) = 5.229970482881859, (18) = 5.67265552097828, (19) = 6.119529799129436, (20) = 6.567544795324417, (21) = 7.016685779715024, (22) = 7.466703281363788, (23) = 7.916902261881447, (24) = 8.367243768736527, (25) = 8.80161892669395, (26) = 9.162214840757322, (27) = 9.472273694773964, (28) = 9.74849145932385, (29) = 10.0}, datatype = float[8], order = C_order); Y := Matrix(29, 2, {(1, 1) = 1.0, (1, 2) = -2.7774042666805845, (2, 1) = .508152675715705, (2, 2) = -1.4113454096591374, (3, 1) = .25447686909782924, (3, 2) = -.7067851420056209, (4, 1) = .12546815948499368, (4, 2) = -.3484758014882851, (5, 1) = 0.60837376408102974e-1, (5, 2) = -.16896998881177702, (6, 1) = 0.28974795019104462e-1, (6, 2) = -0.8047471931459176e-1, (7, 1) = 0.13516500838472782e-1, (7, 2) = -0.3754078710173882e-1, (8, 1) = 0.6091290595553212e-2, (8, 2) = -0.169179764920715e-1, (9, 1) = 0.26305643698211712e-2, (9, 2) = -0.7306140706918243e-2, (10, 1) = 0.10803237905302751e-2, (10, 2) = -0.30004959076180542e-2, (11, 1) = 0.4175978688863679e-3, (11, 2) = -0.11598381052060388e-2, (12, 1) = 0.1519944214917592e-3, (12, 2) = -0.4221499571678193e-3, (13, 1) = 0.5290117663947534e-4, (13, 2) = -0.14692795611610045e-3, (14, 1) = 0.17502082688580547e-4, (14, 2) = -0.48610361540343545e-4, (15, 1) = 0.5464545779075538e-5, (15, 2) = -0.15177255167588248e-4, (16, 1) = 0.16523725776950877e-5, (16, 2) = -0.4589309052757969e-5, (17, 1) = 0.4915270467377551e-6, (17, 2) = -0.13651717221227766e-5, (18, 1) = 0.14373746579469595e-6, (18, 2) = -0.3992194561053079e-6, (19, 1) = 0.41546199234580085e-7, (19, 2) = -0.11539299634399499e-6, (20, 1) = 0.1197003903545623e-7, (20, 2) = -0.33248042814991e-7, (21, 1) = 0.34374706753914073e-8, (21, 2) = -0.9549651046023708e-8, (22, 1) = 0.9842865766510807e-9, (22, 2) = -0.27361670632352488e-8, (23, 1) = 0.28125060673050934e-9, (23, 2) = -0.7835519607496222e-9, (24, 1) = 0.7988887568723668e-10, (24, 2) = -0.22428902980433255e-9, (25, 1) = 0.23297431915229132e-10, (25, 2) = -0.6711171241448045e-10, (26, 1) = 0.8008779251018597e-11, (26, 2) = -0.24648943273141375e-10, (27, 1) = 0.2884816962118233e-11, (27, 2) = -0.10417628549651404e-10, (28, 1) = 0.8754822865787816e-12, (28, 2) = -0.4836893848623719e-11, (29, 1) = .0, (29, 2) = -0.24053256104786425e-11}, datatype = float[8], order = C_order); YP := Matrix(29, 2, {(1, 1) = -2.7774042666805845, (1, 2) = 7.713974460568838, (2, 1) = -1.4113454096591374, (2, 2) = 3.9198767625439523, (3, 1) = -.7067851420056209, (3, 2) = 1.963028069031155, (4, 1) = -.3484758014882851, (4, 2) = .9678581778876616, (5, 1) = -.16896998881177702, (5, 2) = .4692979678663939, (6, 1) = -0.8047471931459176e-1, (6, 2) = .2235108287840761, (7, 1) = -0.3754078710173882e-1, (7, 2) = .10426594227082658, (8, 1) = -0.169179764920715e-1, (8, 2) = 0.4698806009264053e-1, (9, 1) = -0.7306140706918243e-2, (9, 2) = 0.20292106372345863e-1, (10, 1) = -0.30004959076180542e-2, (10, 2) = 0.8333590135968802e-2, (11, 1) = -0.11598381052060388e-2, (11, 2) = 0.32213393020551883e-2, (12, 1) = -0.4221499571678193e-3, (12, 2) = 0.11724810922159124e-2, (13, 1) = -0.14692795611610045e-3, (13, 2) = 0.4080783322111618e-3, (14, 1) = -0.48610361540343545e-4, (14, 2) = 0.13501062554691908e-3, (15, 1) = -0.15177255167588248e-4, (15, 2) = 0.4215337325892306e-4, (16, 1) = -0.4589309052757969e-5, (16, 2) = 0.1274636654423478e-4, (17, 1) = -0.13651717221227766e-5, (17, 2) = 0.37916337657721987e-5, (18, 1) = -0.3992194561053079e-6, (18, 2) = 0.11087938207278246e-5, (19, 1) = -0.11539299634399499e-6, (19, 2) = 0.3204930003905913e-6, (20, 1) = -0.33248042814991e-7, (20, 2) = 0.9234325597305482e-7, (21, 1) = -0.9549651046023708e-8, (21, 2) = 0.26523241560513994e-7, (22, 1) = -0.27361670632352488e-8, (22, 2) = 0.7599442075773886e-8, (23, 1) = -0.7835519607496222e-9, (23, 2) = 0.21762405589500546e-8, (24, 1) = -0.22428902980433255e-9, (24, 2) = 0.6229413083476627e-9, (25, 1) = -0.6711171241448045e-10, (25, 2) = 0.18639635640405699e-9, (26, 1) = -0.24648943273141375e-10, (26, 2) = 0.6846008021593128e-10, (27, 1) = -0.10417628549651404e-10, (27, 2) = 0.28933965982470232e-10, (28, 1) = -0.4836893848623719e-11, (28, 2) = 0.13434009612636961e-10, (29, 1) = -0.24053256104786425e-11, (29, 2) = 0.668056161329368e-11}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(29, {(1) = .0, (2) = .24374318067304568, (3) = .49274258355762024, (4) = .7473536706781976, (5) = 1.0079738719876108, (6) = 1.2750498684188607, (7) = 1.5495922123637438, (8) = 1.8365692463351309, (9) = 2.1388880659925067, (10) = 2.459308706102226, (11) = 2.8015337294128964, (12) = 3.165425757696352, (13) = 3.5454274940529715, (14) = 3.943679148413142, (15) = 4.362789400269794, (16) = 4.793431473452039, (17) = 5.229970482881859, (18) = 5.67265552097828, (19) = 6.119529799129436, (20) = 6.567544795324417, (21) = 7.016685779715024, (22) = 7.466703281363788, (23) = 7.916902261881447, (24) = 8.367243768736527, (25) = 8.80161892669395, (26) = 9.162214840757322, (27) = 9.472273694773964, (28) = 9.74849145932385, (29) = 10.0}, datatype = float[8], order = C_order); Y := Matrix(29, 2, {(1, 1) = .0, (1, 2) = -0.31693074070918097e-14, (2, 1) = -0.8243242401984923e-8, (2, 2) = 0.2289481322531172e-7, (3, 1) = -0.49004930607605776e-8, (3, 2) = 0.13610648375542583e-7, (4, 1) = -0.1482142899585946e-8, (4, 2) = 0.4116508265787089e-8, (5, 1) = 0.1568678759376235e-9, (5, 2) = -0.4356874594753211e-9, (6, 1) = 0.5634571260431073e-9, (6, 2) = -0.15649501243504979e-8, (7, 1) = 0.45119030505136056e-9, (7, 2) = -0.12531398378009672e-8, (8, 1) = 0.23371097033722147e-9, (8, 2) = -0.6491117443051906e-9, (9, 1) = 0.6776214667421635e-10, (9, 2) = -0.18820480945831416e-9, (10, 1) = -0.19051746353603593e-10, (10, 2) = 0.5291246663229192e-10, (11, 1) = -0.46410867369253413e-10, (11, 2) = 0.12889981062099028e-9, (12, 1) = -0.4151473514184431e-10, (12, 2) = 0.11530127227904955e-9, (13, 1) = -0.25900002434956175e-10, (13, 2) = 0.7193284673686757e-10, (14, 1) = -0.11713699078368515e-10, (14, 2) = 0.3253174735405454e-10, (15, 1) = -0.27124714163739563e-11, (15, 2) = 0.7531699243385192e-11, (16, 1) = 0.13799130331293455e-11, (16, 2) = -0.3834506794712402e-11, (17, 1) = 0.2355274387904194e-11, (17, 2) = -0.6543479578650267e-11, (18, 1) = 0.19701608920243074e-11, (18, 2) = -0.547386371195775e-11, (19, 1) = 0.12788816288556007e-11, (19, 2) = -0.35539017366550764e-11, (20, 1) = 0.7145061767316719e-12, (20, 2) = -0.19864029478984788e-11, (21, 1) = 0.3596424654902743e-12, (21, 2) = -0.10008029622618168e-11, (22, 1) = 0.16727966544831917e-12, (22, 2) = -0.4665337006953898e-12, (23, 1) = 0.7302291972677383e-13, (23, 2) = -0.20474461296145014e-12, (24, 1) = 0.3013170464138281e-13, (24, 2) = -0.856183691803639e-13, (25, 1) = 0.11914618066995778e-13, (25, 2) = -0.3502215520236234e-13, (26, 1) = 0.4847317767785468e-14, (26, 2) = -0.153934051974487e-13, (27, 1) = 0.19278929262192103e-14, (27, 2) = -0.728498218625995e-14, (28, 1) = 0.6227825505178523e-15, (28, 2) = -0.3660163060293613e-14, (29, 1) = .0, (29, 2) = -0.19304441472717095e-14}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[29] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(2.289481322531172e-8) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 29, [theta(x), diff(theta(x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[29] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[29] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(29, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(29, 2, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[theta(x), diff(theta(x), x)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[29] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(2.289481322531172e-8) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 29, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[29] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[29] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(29, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(29, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(0..0, {}), (3) = [x, theta(x), diff(theta(x), x)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(x_bvp) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(x_bvp) else _ndsol := pointto(data[2][0]); return ('_ndsol')(x_bvp) end if end if; try res := solnproc(outpoint); [x = res[1], seq('[theta(x), diff(theta(x), x)]'[i] = res[i+1], i = 1 .. 2)] catch: error  end try end proc

(2)

 

 

Download Aliased_vs_Unaliased.mw

With this in mind you can rewrite your code this way (I did not do the job for all your equations, only b1 and b5).
I assumed that the function f you use in b5 is the solution of equation b1.
There are two ways to plug this solution into b5:

  1. One is to post-processd this solution by constructing a (for instance) Spline approximation; this is the "Method 1".
  2. More elegant is "Method 2" based on the use of the known option.


 

restart

with(PDETools, declare):

with(LinearAlgebra):

with(PolynomialIdeals):

with(plots):

alias(f=f(x), theta=theta(x));

f, theta

(1)

eq1 := diff(f, x, x, x)+(1/2)*(1-phi)^2.5*(1-phi+phi*rho[s]/rho[fl])*(eta*cos(omega)+f*sin(omega))*(diff(f, x, x))+(1-phi)^2.5*M*sin(alpha)^2*(1-(diff(f, x)))+(1-phi)^2.5*(1-phi+phi*`&rho;&beta;`[s]/`&rho;&beta;`[fl])*Gr[x]*`cos&gamma;`*theta = 0:

eq2 := K[nf]*(diff(theta, x, x))/K[f]+(1/2)*Pr*(eta*cos(omega)+f*sin(omega))*(diff(theta, x)) = 0:

bcs := f(0) = 0, (D(f))(0) = 0, (D(f))(10) = 1:

a1 := [phi = .1, rho[s] = 5200, rho[fl] = 997.1, `&rho;&beta;`[s] = 6500, `&rho;&beta;`[fl] = 20939.1, M = 0, sin(alpha) = 0, cos(omega) = 1, sin(omega) = 0, Gr[x] = 0, Pr = 6.2, cos*gamma = 1, eta = 3]:

b1 := subs(a1, eq1):

alias(theta=theta, f=f);
b5;
bcs1; # wrong expression

# Redefine bcs1
bcs1 := theta(0) = 1, theta(10) = 0;


# 1st try (fails because f(x) is undefined)
dsolve({b5, bcs1}, numeric);

# 2nd try: give f(x) an explicit expression, for instance f(x)=x

{eval(b5, f=(x-> x)), bcs1};
dsolve(%, numeric)

1.116150082*(diff(diff(theta(x), x), x))+3.100000000*f(x)*(diff(theta(x), x)) = 0

 

(theta(x))(0) = 1, (theta(x))(10) = 0

 

theta(0) = 1, theta(10) = 0

 

Error, (in dsolve/numeric/bvp/convertsys) the ODE system does not contain derivatives of the unknown function f

 

{1.116150082*(diff(diff(theta(x), x), x))+3.100000000*x*(diff(theta(x), x)) = 0, theta(0) = 1, theta(10) = 0}

 

proc (x_bvp) local res, data, solnproc, _ndsol, outpoint, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](x_bvp) else outpoint := evalf(x_bvp) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(35, {(1) = .0, (2) = .2427328648224338, (3) = .48735863201069407, (4) = .7359461415582672, (5) = .9897901295169931, (6) = 1.2502025649411728, (7) = 1.5181834925133584, (8) = 1.794267229767137, (9) = 2.078582328214079, (10) = 2.3702560725449464, (11) = 2.6676604337931513, (12) = 2.9692476686888374, (13) = 3.273517057716359, (14) = 3.5793933611415785, (15) = 3.886242838752695, (16) = 4.19370608862414, (17) = 4.501550367396039, (18) = 4.809634641228868, (19) = 5.117862003643149, (20) = 5.426168486674517, (21) = 5.734509596432851, (22) = 6.042867134137938, (23) = 6.351236001902038, (24) = 6.659611337370647, (25) = 6.9679863294987765, (26) = 7.276350813373745, (27) = 7.584694336942331, (28) = 7.893019634939578, (29) = 8.201339875813002, (30) = 8.509678007900146, (31) = 8.818051148007882, (32) = 9.126467394183015, (33) = 9.434927187905142, (34) = 9.738519730173229, (35) = 10.0}, datatype = float[8], order = C_order); Y := Matrix(35, 2, {(1, 1) = 1.0, (1, 2) = -1.329718192803346, (2, 1) = .6858248045701448, (2, 2) = -1.2252510417869678, (3, 1) = .4166712714730749, (3, 2) = -.9561166782027788, (4, 1) = .22001266888905546, (4, 2) = -.6267689775726901, (5, 1) = 0.9903719876120984e-1, (5, 2) = -.3411193321077973, (6, 1) = 0.3720286208685336e-1, (6, 2) = -.15174051187414864, (7, 1) = 0.11401841206463462e-1, (7, 2) = -0.54159257640465114e-1, (8, 1) = 0.27875447327001786e-2, (8, 2) = -0.15209830699141344e-1, (9, 1) = 0.5320670264751371e-3, (9, 2) = -0.3296396467297987e-2, (10, 1) = 0.7809833406022415e-4, (10, 2) = -0.5438038828922491e-3, (11, 1) = 0.8756226240778076e-5, (11, 2) = -0.6788938334468882e-4, (12, 1) = 0.7482809107822378e-6, (12, 2) = -0.640557746592634e-5, (13, 1) = 0.4887533339771034e-7, (13, 2) = -0.4583564802915334e-6, (14, 1) = 0.2437801946825723e-8, (14, 2) = -0.24867889694913757e-7, (15, 1) = 0.9161263335918904e-10, (15, 2) = -0.10102136355576419e-8, (16, 1) = 0.25578760529215827e-11, (16, 2) = -0.3030868671679089e-10, (17, 1) = 0.4603441111620771e-13, (17, 2) = -0.5869979980334518e-12, (18, 1) = 0.19129211666581337e-14, (18, 2) = -0.24914448970721944e-13, (19, 1) = -0.37482167080075273e-15, (19, 2) = 0.5068146954423413e-14, (20, 1) = 0.12915954784076187e-15, (20, 2) = -0.18505763365322117e-14, (21, 1) = -0.46854903611428463e-16, (21, 2) = 0.7085349115339349e-15, (22, 1) = 0.18064057760519244e-16, (22, 2) = -0.28747358389025184e-15, (23, 1) = -0.7340774262153665e-17, (23, 2) = 0.1227044688635285e-15, (24, 1) = 0.313127779787792e-17, (24, 2) = -0.5478689664355503e-16, (25, 1) = -0.13894479510369669e-17, (25, 2) = 0.25467231532462892e-16, (26, 1) = 0.644528506668701e-18, (26, 2) = -0.12275203500269613e-16, (27, 1) = -0.30535143800889083e-18, (27, 2) = 0.6114023698701317e-17, (28, 1) = 0.15349284252835988e-18, (28, 2) = -0.31376589078930027e-17, (29, 1) = -0.7509013692023456e-19, (29, 2) = 0.16548955395131925e-17, (30, 1) = 0.4204603976519501e-19, (30, 2) = -0.8951051373819569e-18, (31, 1) = -0.19561570763375146e-19, (31, 2) = 0.4955397893296053e-18, (32, 1) = 0.13628819583128876e-19, (32, 2) = -0.2803086479217416e-18, (33, 1) = -0.46545549684332235e-20, (33, 2) = 0.16176240673458255e-18, (34, 1) = 0.5579532777811873e-20, (34, 2) = -0.9434251776242529e-19, (35, 1) = .0, (35, 2) = 0.51666006976289026e-19}, datatype = float[8], order = C_order); YP := Matrix(35, 2, {(1, 1) = -1.329718192803346, (1, 2) = .0, (2, 1) = -1.2252510417869678, (2, 2) = .8260241798278425, (3, 1) = -.9561166782027788, (3, 2) = 1.2941918330905053, (4, 1) = -.6267689775726901, (4, 2) = 1.281128296461863, (5, 1) = -.3411193321077973, (5, 2) = .9377531887454125, (6, 1) = -.15174051187414864, (6, 2) = .5268913013139895, (7, 1) = -0.54159257640465114e-1, (7, 2) = .22836842997360424, (8, 1) = -0.15209830699141344e-1, (8, 2) = 0.7579675334441632e-1, (9, 1) = -0.3296396467297987e-2, (9, 2) = 0.19030305886327963e-1, (10, 1) = -0.5438038828922491e-3, (10, 2) = 0.3579947604811905e-2, (11, 1) = -0.6788938334468882e-4, (11, 2) = 0.5030040822521309e-3, (12, 1) = -0.640557746592634e-5, (12, 2) = 0.5282552357296102e-4, (13, 1) = -0.4583564802915334e-6, (13, 2) = 0.4167322227480173e-5, (14, 1) = -0.24867889694913757e-7, (14, 2) = 0.24722219548847705e-6, (15, 1) = -0.10102136355576419e-8, (15, 2) = 0.1090391002727916e-7, (16, 1) = -0.3030868671679089e-10, (16, 2) = 0.353023980219054e-9, (17, 1) = -0.5869979980334518e-12, (17, 2) = 0.7339015960844142e-11, (18, 1) = -0.24914448970721944e-13, (18, 2) = 0.33281467804776e-12, (19, 1) = 0.5068146954423413e-14, (19, 2) = -0.7204052497078285e-13, (20, 1) = -0.18505763365322117e-14, (20, 2) = 0.27889413261161828e-13, (21, 1) = 0.7085349115339349e-15, (21, 2) = -0.11284871969177581e-13, (22, 1) = -0.28747358389025184e-15, (22, 2) = 0.4824808571999971e-14, (23, 1) = 0.1227044688635285e-15, (23, 2) = -0.21645006918925813e-14, (24, 1) = -0.5478689664355503e-16, (24, 2) = 0.10133621599133621e-14, (25, 1) = 0.25467231532462892e-16, (25, 2) = -0.4928651661578098e-15, (26, 1) = -0.12275203500269613e-16, (26, 2) = 0.24807410229433347e-15, (27, 1) = 0.6114023698701317e-17, (27, 2) = -0.12879657062351977e-15, (28, 1) = -0.31376589078930027e-17, (28, 2) = 0.6878409246042765e-16, (29, 1) = 0.16548955395131925e-17, (29, 2) = -0.3769593273514208e-16, (30, 1) = -0.8951051373819569e-18, (30, 2) = 0.2115564522912144e-16, (31, 1) = 0.4955397893296053e-18, (31, 2) = -0.12136410115286525e-16, (32, 1) = -0.2803086479217416e-18, (32, 2) = 0.7105232627893527e-17, (33, 1) = 0.16176240673458255e-18, (33, 2) = -0.4238920300300043e-17, (34, 1) = -0.9434251776242529e-19, (34, 2) = 0.25517581415481644e-17, (35, 1) = 0.51666006976289026e-19, (35, 2) = -0.14349738821816977e-17}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(35, {(1) = .0, (2) = .2427328648224338, (3) = .48735863201069407, (4) = .7359461415582672, (5) = .9897901295169931, (6) = 1.2502025649411728, (7) = 1.5181834925133584, (8) = 1.794267229767137, (9) = 2.078582328214079, (10) = 2.3702560725449464, (11) = 2.6676604337931513, (12) = 2.9692476686888374, (13) = 3.273517057716359, (14) = 3.5793933611415785, (15) = 3.886242838752695, (16) = 4.19370608862414, (17) = 4.501550367396039, (18) = 4.809634641228868, (19) = 5.117862003643149, (20) = 5.426168486674517, (21) = 5.734509596432851, (22) = 6.042867134137938, (23) = 6.351236001902038, (24) = 6.659611337370647, (25) = 6.9679863294987765, (26) = 7.276350813373745, (27) = 7.584694336942331, (28) = 7.893019634939578, (29) = 8.201339875813002, (30) = 8.509678007900146, (31) = 8.818051148007882, (32) = 9.126467394183015, (33) = 9.434927187905142, (34) = 9.738519730173229, (35) = 10.0}, datatype = float[8], order = C_order); Y := Matrix(35, 2, {(1, 1) = .0, (1, 2) = 0.9322860662476395e-10, (2, 1) = 0.23552156665027704e-9, (2, 2) = -0.19395450767685846e-9, (3, 1) = 0.22856005569205564e-9, (3, 2) = -0.574987450992247e-9, (4, 1) = -0.5097474744153764e-9, (4, 2) = 0.8700060984334014e-9, (5, 1) = -0.5603656722080146e-9, (5, 2) = 0.20004740656351813e-8, (6, 1) = 0.8416861821739159e-9, (6, 2) = -0.2130381427590431e-8, (7, 1) = 0.8427208209568499e-9, (7, 2) = -0.3690785565037934e-8, (8, 1) = -0.8903265489524921e-9, (8, 2) = 0.3288234436892247e-8, (9, 1) = -0.8999082960675877e-9, (9, 2) = 0.4624477399506359e-8, (10, 1) = 0.2472640919488809e-9, (10, 2) = -0.12102799435273939e-8, (11, 1) = 0.24175235121057535e-9, (11, 2) = -0.1449984732752724e-8, (12, 1) = -0.7328781844480877e-10, (12, 2) = 0.5781195596509252e-9, (13, 1) = -0.39043418896305955e-10, (13, 2) = 0.28965937122420823e-9, (14, 1) = 0.492157646297709e-11, (14, 2) = -0.6467592134220928e-10, (15, 1) = 0.21879315251971158e-11, (15, 2) = -0.25277832889771064e-10, (16, 1) = 0.2024855740349173e-12, (16, 2) = -0.24703506291125855e-11, (17, 1) = 0.16003107647479276e-13, (17, 2) = -0.20145031092680016e-12, (18, 1) = -0.9253845503146431e-15, (18, 2) = 0.1149387381259964e-13, (19, 1) = 0.4034834220553831e-15, (19, 2) = -0.546696985736166e-14, (20, 1) = -0.13442704331956957e-15, (20, 2) = 0.19259457160288285e-14, (21, 1) = 0.48807891894688016e-16, (21, 2) = -0.7380684557384003e-15, (22, 1) = -0.18816723869927514e-16, (22, 2) = 0.299451599770376e-15, (23, 1) = 0.7646639864929445e-17, (23, 2) = -0.12781715521740927e-15, (24, 1) = -0.32617477061064784e-17, (24, 2) = 0.5706968400339933e-16, (25, 1) = 0.1447341615663568e-17, (25, 2) = -0.2652836617965026e-16, (26, 1) = -0.6713838611132635e-18, (26, 2) = 0.12786670312781307e-16, (27, 1) = 0.31807441459260812e-18, (27, 2) = -0.6368774686147445e-17, (28, 1) = -0.15988837763371426e-18, (28, 2) = 0.32683946957219826e-17, (29, 1) = 0.78218892625248e-19, (29, 2) = -0.17238495203263485e-17, (30, 1) = -0.4379795808874651e-19, (30, 2) = 0.932401184772898e-18, (31, 1) = 0.20376636211849666e-19, (31, 2) = -0.516187280551683e-18, (32, 1) = -0.14196687065760115e-19, (32, 2) = 0.2919881749184929e-18, (33, 1) = 0.4848494758784855e-20, (33, 2) = -0.16850250701519606e-18, (34, 1) = -0.58120133102209794e-20, (34, 2) = 0.9827345600253129e-19, (35, 1) = .0, (35, 2) = -0.53818757266969385e-19}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[35] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(4.624477399506359e-9) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 35, [theta(x), diff(theta(x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[35] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[35] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(35, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(35, 2, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[theta(x), diff(theta(x), x)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[35] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(4.624477399506359e-9) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 35, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[35] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[35] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(35, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(35, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(0..0, {}), (3) = [x, theta(x), diff(theta(x), x)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(x_bvp) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(x_bvp) else _ndsol := pointto(data[2][0]); return ('_ndsol')(x_bvp) end if end if; try res := solnproc(outpoint); [x = res[1], seq('[theta(x), diff(theta(x), x)]'[i] = res[i+1], i = 1 .. 2)] catch: error  end try end proc

(2)

# If f(x) is the solution from another ode, for instance
#
# Method 1


bcs := f(0) = 0, (D(f))(0) = 0, (D(f))(10) = 1;
c1  := dsolve({b1, bcs}, numeric);

__f := proc(__x);
   if not type(evalf(__x),'numeric') then
      'procname'(__x);
   else
      eval(f(x), c1(__x));
   end if;
end proc:

# usage

c1(2);
'f(2)' = __f(2);
plot(__f(x), x=0..10, title="f as the solution of b1");

# Represent __f(x) by a spline function (the higher the number of discretizationpoints
# the higher the cvalue of maxmesh).

F := unapply( CurveFitting:-Spline([seq([__x, __f(__x)], __x in [seq](0..10, 0.1))], x, degree=3), x):
{eval(b5, f=(x-> F(x))), bcs1}:
c5 := dsolve(%, numeric, maxmesh=1024, abserr=1e-4):

odeplot(c5, [x, theta(x)], 0 .. 7, colour = blue, title="solution of b5 with f solution of b1")

f(0) = 0, (D(f))(0) = 0, (D(f))(10) = 1

 

proc (x_bvp) local res, data, solnproc, _ndsol, outpoint, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](x_bvp) else outpoint := evalf(x_bvp) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(18, {(1) = .0, (2) = .5484314081865154, (3) = 1.1031257206438942, (4) = 1.6646772880487695, (5) = 2.2366376010334714, (6) = 2.8203948925988187, (7) = 3.4135959755145016, (8) = 4.012694132365692, (9) = 4.617073093079587, (10) = 5.222947664591086, (11) = 5.82977930750296, (12) = 6.436995581743898, (13) = 7.044308271902464, (14) = 7.6516849455373706, (15) = 8.259066764177797, (16) = 8.863066973830218, (17) = 9.443565381178733, (18) = 10.0}, datatype = float[8], order = C_order); Y := Matrix(18, 3, {(1, 1) = .0, (1, 2) = .0, (1, 3) = 1.6385066714568874, (2, 1) = .1865994181937416, (2, 2) = .5928641529598639, (2, 3) = .6670948759434057, (3, 1) = .5929461137706181, (3, 2) = .8359327638922891, (3, 3) = .26882536580349964, (4, 1) = 1.0942658621489547, (4, 2) = .9346230640952723, (4, 3) = .10712066289420687, (5, 1) = 1.641956359720967, (5, 2) = .9743893872755373, (5, 3) = 0.41963282052991345e-1, (6, 1) = 2.2160890406100706, (6, 2) = .9901594481076353, (6, 3) = 0.16123934148780324e-1, (7, 1) = 2.8055565667142535, (7, 2) = .9962769798043033, (7, 3) = 0.6100318418427125e-2, (8, 1) = 3.4032339344695086, (8, 2) = .998605027199471, (8, 3) = 0.22857975220465423e-2, (9, 1) = 4.0070778042330675, (9, 2) = .9994818530478067, (9, 3) = 0.849112629846561e-3, (10, 1) = 4.612753345419058, (10, 2) = .9998080415501446, (10, 3) = 0.3146506335361642e-3, (11, 1) = 5.2195111960586535, (11, 2) = .99992902680252, (11, 3) = 0.11641550554964439e-3, (12, 1) = 5.826700187574041, (12, 2) = .9999738059063931, (12, 3) = 0.4304465072985871e-4, (13, 1) = 6.434002818309967, (13, 2) = .9999903645277998, (13, 3) = 0.15913241162221728e-4, (14, 1) = 7.041375802144528, (14, 2) = .999996486489409, (14, 3) = 0.5882366991142752e-5, (15, 1) = 7.64875628614861, (15, 2) = .9999987495000272, (15, 3) = 0.21744092796990014e-5, (16, 1) = 8.252756033173478, (16, 2) = .9999995832942872, (16, 3) = 0.8082319266162002e-6, (17, 1) = 8.833254300212813, (17, 2) = .9999998860193208, (17, 3) = 0.3122149768237039e-6, (18, 1) = 9.389688892075311, (18, 2) = 1.0, (18, 3) = 0.12545688814716578e-6}, datatype = float[8], order = C_order); YP := Matrix(18, 3, {(1, 1) = .0, (1, 2) = 1.6385066714568874, (1, 3) = -2.684703906846781, (2, 1) = .5928641529598639, (2, 2) = .6670948759434057, (2, 3) = -1.093039321036328, (3, 1) = .8359327638922891, (3, 2) = .26882536580349964, (3, 3) = -.4404721215998787, (4, 1) = .9346230640952723, (4, 2) = .10712066289420687, (4, 3) = -.17551790736401723, (5, 1) = .9743893872755373, (5, 2) = 0.41963282052991345e-1, (5, 3) = -0.6875711233547063e-1, (6, 1) = .9901594481076353, (6, 2) = 0.16123934148780324e-1, (6, 3) = -0.264191716500495e-1, (7, 1) = .9962769798043033, (7, 2) = 0.6100318418427125e-2, (7, 3) = -0.9995411661277211e-2, (8, 1) = .998605027199471, (8, 2) = 0.22857975220465423e-2, (8, 3) = -0.37452942027038387e-2, (9, 1) = .9994818530478067, (9, 2) = 0.849112629846561e-3, (9, 3) = -0.13912766022948651e-2, (10, 1) = .9998080415501446, (10, 2) = 0.3146506335361642e-3, (10, 3) = -0.5155571227520522e-3, (11, 1) = .99992902680252, (11, 2) = 0.11641550554964439e-3, (11, 3) = -0.19074756789899165e-3, (12, 1) = .9999738059063931, (12, 2) = 0.4304465072985871e-4, (12, 3) = -0.7052894199115717e-4, (13, 1) = .9999903645277998, (13, 2) = 0.15913241162221728e-4, (13, 3) = -0.2607394981237695e-4, (14, 1) = .999996486489409, (14, 2) = 0.5882366991142752e-5, (14, 3) = -0.9638296820961723e-5, (15, 1) = .9999987495000272, (15, 2) = 0.21744092796990014e-5, (15, 3) = -0.35627838384699585e-5, (16, 1) = .9999995832942872, (16, 2) = 0.8082319266162002e-6, (16, 3) = -0.13242933024468355e-5, (17, 1) = .9999998860193208, (17, 2) = 0.3122149768237039e-6, (17, 3) = -0.5115662832848772e-6, (18, 1) = 1.0, (18, 2) = 0.12545688814716578e-6, (18, 3) = -0.20556193246992092e-6}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(18, {(1) = .0, (2) = .5484314081865154, (3) = 1.1031257206438942, (4) = 1.6646772880487695, (5) = 2.2366376010334714, (6) = 2.8203948925988187, (7) = 3.4135959755145016, (8) = 4.012694132365692, (9) = 4.617073093079587, (10) = 5.222947664591086, (11) = 5.82977930750296, (12) = 6.436995581743898, (13) = 7.044308271902464, (14) = 7.6516849455373706, (15) = 8.259066764177797, (16) = 8.863066973830218, (17) = 9.443565381178733, (18) = 10.0}, datatype = float[8], order = C_order); Y := Matrix(18, 3, {(1, 1) = .0, (1, 2) = .0, (1, 3) = 0.2946023868864439e-11, (2, 1) = -0.47774203028197214e-7, (2, 2) = 0.782799596177991e-7, (2, 3) = -0.128259281465364e-6, (3, 1) = -0.14644880503753375e-7, (3, 2) = 0.23998981563602782e-7, (3, 3) = -0.39319542968475e-7, (4, 1) = 0.6768906668526081e-9, (4, 2) = -0.11041862608122967e-8, (4, 3) = 0.18121607643070676e-8, (5, 1) = 0.2994857118580283e-8, (5, 2) = -0.4900506572558289e-8, (5, 3) = 0.803245612956675e-8, (6, 1) = 0.1720978279117689e-8, (6, 2) = -0.28115248152417434e-8, (6, 3) = 0.4609646547825811e-8, (7, 1) = 0.5033000952078005e-9, (7, 2) = -0.8146063617863207e-9, (7, 3) = 0.13376830814079997e-8, (8, 1) = -0.38815334729871443e-10, (8, 2) = 0.7541690966830913e-10, (8, 3) = -0.12062518485027127e-9, (9, 1) = -0.15399062952597835e-9, (9, 2) = 0.26590700251366544e-9, (9, 3) = -0.4327446320103398e-9, (10, 1) = -0.11430815959127977e-9, (10, 2) = 0.20266873889877397e-9, (10, 3) = -0.32912919659250085e-9, (11, 1) = -0.54630659643753844e-10, (11, 2) = 0.10669434249675227e-9, (11, 3) = -0.17187484620088734e-9, (12, 1) = -0.14273514094803324e-10, (12, 2) = 0.4234544692474086e-10, (12, 3) = -0.6643916595339093e-10, (13, 1) = 0.6056124951499228e-11, (13, 2) = 0.10828655975493386e-10, (13, 3) = -0.1479861935288903e-10, (14, 1) = 0.14259060119068991e-10, (14, 2) = -0.8307793632436555e-12, (14, 3) = 0.4305309198788365e-11, (15, 1) = 0.16865703949895138e-10, (15, 2) = -0.33158266910753918e-11, (15, 3) = 0.837636658403607e-11, (16, 1) = 0.1748551880835066e-10, (16, 2) = -0.25516372473542857e-11, (16, 3) = 0.7125069288186768e-11, (17, 1) = 0.17671657793034712e-10, (17, 2) = -0.11464248008960765e-11, (17, 3) = 0.4823460413032649e-11, (18, 1) = 0.17975640844382702e-10, (18, 2) = .0, (18, 3) = 0.2944653219022549e-11}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[18] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(1.28259281465364e-7) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [3, 18, [f(x), diff(f(x), x), diff(diff(f(x), x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[18] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[18] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(3, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(18, 3, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(3, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(18, 3, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[f(x), diff(f(x), x), diff(diff(f(x), x), x)]'[i] = yout[i], i = 1 .. 3)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[18] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(1.28259281465364e-7) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [3, 18, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[18] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[18] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(18, 3, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(3, {(1) = 0., (2) = 0., (3) = 0.}); `dsolve/numeric/hermite`(18, 3, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 3)] end proc, (2) = Array(0..0, {}), (3) = [x, f(x), diff(f(x), x), diff(diff(f(x), x), x)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(x_bvp) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(x_bvp) else _ndsol := pointto(data[2][0]); return ('_ndsol')(x_bvp) end if end if; try res := solnproc(outpoint); [x = res[1], seq('[f(x), diff(f(x), x), diff(diff(f(x), x), x)]'[i] = res[i+1], i = 1 .. 3)] catch: error  end try end proc

 

[x = 2., f(x) = HFloat(1.412721902088078), diff(f(x), x) = HFloat(0.9622592586648903), diff(diff(f(x), x), x) = HFloat(0.06183857718535878)]

 

f(2) = HFloat(1.412721902088078)

 

 

 

# If f(x) is the solution from another ode, for instance
#
# Method 2: use optio known 

c5 := dsolve({eval(b5, f=__f), bcs1}, numeric, known=__f);
odeplot(c5, [x, theta(x)], 0 .. 7, colour = blue, title="solution of b5 with f solution of b1")

proc (x_bvp) local res, data, solnproc, _ndsol, outpoint, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](x_bvp) else outpoint := evalf(x_bvp) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(33, {(1) = .0, (2) = .28233496496470245, (3) = .5658952869558942, (4) = .8519883779158955, (5) = 1.1415062842989359, (6) = 1.4351451304095157, (7) = 1.733419997003576, (8) = 2.0364801144877913, (9) = 2.3442169724464077, (10) = 2.6561367742708955, (11) = 2.9713075044778314, (12) = 3.2888150379618755, (13) = 3.6078656622419722, (14) = 3.927799466451855, (15) = 4.248248454734752, (16) = 4.5690132642794, (17) = 4.889960432688388, (18) = 5.211017055510866, (19) = 5.532140607350383, (20) = 5.853305107785229, (21) = 6.174491973151275, (22) = 6.495692055882912, (23) = 6.816897584684449, (24) = 7.138099869835251, (25) = 7.459286674103036, (26) = 7.780454001865076, (27) = 8.101610883576061, (28) = 8.422778379870405, (29) = 8.743976754956115, (30) = 9.065216808588955, (31) = 9.386501674602233, (32) = 9.705336219112802, (33) = 10.0}, datatype = float[8], order = C_order); Y := Matrix(33, 2, {(1, 1) = 1.0, (1, 2) = -.8772924552331877, (2, 1) = .7532717259476802, (2, 2) = -.864002150268244, (3, 1) = .5174249135482837, (3, 2) = -.7853649036057604, (4, 1) = .31423378869995183, (4, 2) = -.6230347230247992, (5, 1) = .16375995113733796, (5, 2) = -.41451793276646715, (6, 1) = 0.7119757945613565e-1, (6, 2) = -.2243678996909551, (7, 1) = 0.25158326951573336e-1, (7, 2) = -0.963835497013202e-1, (8, 1) = 0.70608944026935095e-2, (8, 2) = -0.32194483355498904e-1, (9, 1) = 0.15432596154012065e-2, (9, 2) = -0.822153935364156e-2, (10, 1) = 0.2587302280393987e-3, (10, 2) = -0.15850701513114474e-2, (11, 1) = 0.3297216499370152e-4, (11, 2) = -0.22911633649960213e-3, (12, 1) = 0.31781730424411226e-5, (12, 2) = -0.24753042799688467e-4, (13, 1) = 0.23132909598555663e-6, (13, 2) = -0.1998661164665881e-5, (14, 1) = 0.12715549881422354e-7, (14, 2) = -0.1207616150564729e-6, (15, 1) = 0.52178541274423e-9, (15, 2) = -0.5404475947358991e-8, (16, 1) = 0.15778348161257118e-10, (16, 2) = -0.17692612071304702e-9, (17, 1) = 0.307466608296045e-12, (17, 2) = -0.3732656707319858e-11, (18, 1) = 0.11631647320858e-13, (18, 2) = -0.14511575347757843e-12, (19, 1) = -0.2066120597895542e-14, (19, 2) = 0.26751567148550323e-13, (20, 1) = 0.7113253503153256e-15, (20, 2) = -0.9806192937337492e-14, (21, 1) = -0.2579309444800299e-15, (21, 2) = 0.3768351479875404e-14, (22, 1) = 0.9987165048972809e-16, (22, 2) = -0.15404505533281173e-14, (23, 1) = -0.40833246469920144e-16, (23, 2) = 0.6643454522363756e-15, (24, 1) = 0.17625402423139746e-16, (24, 2) = -0.3003464921471493e-15, (25, 1) = -0.786919032600911e-17, (25, 2) = 0.14159406265505698e-15, (26, 1) = 0.373949019007683e-17, (26, 2) = -0.6930351805341326e-16, (27, 1) = -0.17548637809431955e-17, (27, 2) = 0.35087505357383474e-16, (28, 1) = 0.9380368338531094e-18, (28, 2) = -0.18318058599121008e-16, (29, 1) = -0.42436483692446576e-18, (29, 2) = 0.9834817235187775e-17, (30, 1) = 0.28516238110336396e-18, (30, 2) = -0.5417390391904137e-17, (31, 1) = -0.9429304468171444e-19, (31, 2) = 0.3055278347887694e-17, (32, 1) = 0.11316527493049244e-18, (32, 2) = -0.17539242557164286e-17, (33, 1) = .0, (33, 2) = 0.985826632114588e-18}, datatype = float[8], order = C_order); YP := Matrix(33, 2, {(1, 1) = -.8772924552331877, (1, 2) = .0, (2, 1) = -.864002150268244, (2, 2) = .1351013128641334, (3, 1) = -.7853649036057604, (3, 2) = .4298288883360616, (4, 1) = -.6230347230247992, (4, 2) = .6796785089085157, (5, 1) = -.41451793276646715, (5, 2) = .7198098458000008, (6, 1) = -.2243678996909551, (6, 2) = .5502202676455906, (7, 1) = -0.963835497013202e-1, (7, 2) = .3101950423844574, (8, 1) = -0.32194483355498904e-1, (8, 2) = .12946393377087215, (9, 1) = -0.822153935364156e-2, (9, 2) = 0.39892160778379045e-1, (10, 1) = -0.15850701513114474e-2, (10, 2) = 0.9041106228810243e-2, (11, 1) = -0.22911633649960213e-3, (11, 2) = 0.1505401159651923e-2, (12, 1) = -0.24753042799688467e-4, (12, 2) = 0.18433663547198184e-3, (13, 1) = -0.1998661164665881e-5, (13, 2) = 0.16648867002077256e-4, (14, 1) = -0.1207616150564729e-6, (14, 2) = 0.11130262988584572e-5, (15, 1) = -0.5404475947358991e-8, (15, 2) = 0.5461562829303927e-7, (16, 1) = -0.17692612071304702e-9, (16, 2) = 0.1945455804923299e-8, (17, 1) = -0.3732656707319858e-11, (17, 2) = 0.44369630423885995e-10, (18, 1) = -0.14511575347757843e-12, (18, 2) = 0.18543400511974227e-11, (19, 1) = 0.26751567148550323e-13, (19, 2) = -0.3656967399934146e-12, (20, 1) = -0.9806192937337492e-14, (20, 2) = 0.14279806372564047e-12, (21, 1) = 0.3768351479875404e-14, (21, 2) = -0.5823628161975935e-13, (22, 1) = -0.15404505533281173e-14, (22, 2) = 0.25180392261547706e-13, (23, 1) = 0.6643454522363756e-15, (23, 2) = -0.114521349559479e-13, (24, 1) = -0.3003464921471493e-15, (24, 2) = 0.5445378535648286e-14, (25, 1) = 0.14159406265505698e-15, (25, 2) = -0.2693456296440379e-14, (26, 1) = -0.6930351805341326e-16, (26, 2) = 0.13801372725032498e-14, (27, 1) = 0.35087505357383474e-16, (27, 2) = -0.7300436307002091e-15, (28, 1) = -0.18318058599121008e-16, (28, 2) = 0.39747221813386455e-15, (29, 1) = 0.9834817235187775e-17, (29, 2) = -0.2221732252495002e-15, (30, 1) = -0.5417390391904137e-17, (30, 2) = 0.12721490697874184e-15, (31, 1) = 0.3055278347887694e-17, (31, 2) = -0.7447249900337262e-16, (32, 1) = -0.17539242557164286e-17, (32, 2) = 0.44305111645855503e-16, (33, 1) = 0.985826632114588e-18, (33, 2) = -0.2570933526925362e-16}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(33, {(1) = .0, (2) = .28233496496470245, (3) = .5658952869558942, (4) = .8519883779158955, (5) = 1.1415062842989359, (6) = 1.4351451304095157, (7) = 1.733419997003576, (8) = 2.0364801144877913, (9) = 2.3442169724464077, (10) = 2.6561367742708955, (11) = 2.9713075044778314, (12) = 3.2888150379618755, (13) = 3.6078656622419722, (14) = 3.927799466451855, (15) = 4.248248454734752, (16) = 4.5690132642794, (17) = 4.889960432688388, (18) = 5.211017055510866, (19) = 5.532140607350383, (20) = 5.853305107785229, (21) = 6.174491973151275, (22) = 6.495692055882912, (23) = 6.816897584684449, (24) = 7.138099869835251, (25) = 7.459286674103036, (26) = 7.780454001865076, (27) = 8.101610883576061, (28) = 8.422778379870405, (29) = 8.743976754956115, (30) = 9.065216808588955, (31) = 9.386501674602233, (32) = 9.705336219112802, (33) = 10.0}, datatype = float[8], order = C_order); Y := Matrix(33, 2, {(1, 1) = .0, (1, 2) = 0.14669478714556444e-9, (2, 1) = -0.1320349829409252e-9, (2, 2) = 0.18351137059203102e-9, (3, 1) = 0.6992228386771754e-11, (3, 2) = 0.22755699987587638e-10, (4, 1) = 0.29277225606276225e-9, (4, 2) = -0.5106736112367138e-9, (5, 1) = -0.1898523690495055e-9, (5, 2) = 0.16927709921890168e-10, (6, 1) = -0.8846183458401529e-9, (6, 2) = 0.24406010637764106e-8, (7, 1) = 0.5099594781145903e-9, (7, 2) = -0.6580495685568509e-9, (8, 1) = 0.11127454329484344e-8, (8, 2) = -0.43358703200253965e-8, (9, 1) = -0.7335220888709085e-9, (9, 2) = 0.24966378626939707e-8, (10, 1) = -0.6786499395706225e-9, (10, 2) = 0.3448808260379694e-8, (11, 1) = 0.34316274325041773e-9, (11, 2) = -0.18148373204801812e-8, (12, 1) = 0.13521011553266648e-9, (12, 2) = -0.7902805925000925e-9, (13, 1) = -0.7764324575855586e-10, (13, 2) = 0.5901645483530738e-9, (14, 1) = -0.14100667803985136e-10, (14, 2) = 0.8986738664486018e-10, (15, 1) = 0.48600179783131e-11, (15, 2) = -0.55115096829304256e-10, (16, 1) = 0.6764817169802964e-12, (16, 2) = -0.7969354349574233e-11, (17, 1) = 0.7905182793622629e-13, (17, 2) = -0.946270891053416e-12, (18, 1) = -0.5253014845203794e-14, (18, 2) = 0.6209294293120555e-13, (19, 1) = 0.2237031281255525e-14, (19, 2) = -0.2904094929530438e-13, (20, 1) = -0.7402308834923597e-15, (20, 2) = 0.10203992630860957e-13, (21, 1) = 0.26868238067487595e-15, (21, 2) = -0.3925433401246394e-14, (22, 1) = -0.10403295235872169e-15, (22, 2) = 0.16046357146302695e-14, (23, 1) = 0.4253463178280752e-16, (23, 2) = -0.6920265134976699e-15, (24, 1) = -0.18359794190699864e-16, (24, 2) = 0.31286092931866044e-15, (25, 1) = 0.8197073256259701e-17, (25, 2) = -0.14749381526569245e-15, (26, 1) = -0.3895302281330191e-17, (26, 2) = 0.7219116463897593e-16, (27, 1) = 0.18279831051492376e-17, (27, 2) = -0.3654948474727552e-16, (28, 1) = -0.9771217019303491e-18, (28, 2) = 0.19081311040751836e-16, (29, 1) = 0.4420467051296714e-18, (29, 2) = -0.10244601286654223e-16, (30, 1) = -0.2970441469826846e-18, (30, 2) = 0.5643114991567017e-17, (31, 1) = 0.9822192154345644e-19, (31, 2) = -0.31825816123831257e-17, (32, 1) = -0.11788049471926902e-18, (32, 2) = 0.1827004433038027e-17, (33, 1) = .0, (33, 2) = -0.10269027417860591e-17}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[33] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(4.3358703200253965e-9) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 33, [theta(x), diff(theta(x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[33] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[33] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(33, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(33, 2, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[theta(x), diff(theta(x), x)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[33] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(4.3358703200253965e-9) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 33, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[33] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[33] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(33, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(33, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(0..0, {}), (3) = [x, theta(x), diff(theta(x), x)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(x_bvp) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(x_bvp) else _ndsol := pointto(data[2][0]); return ('_ndsol')(x_bvp) end if end if; try res := solnproc(outpoint); [x = res[1], seq('[theta(x), diff(theta(x), x)]'[i] = res[i+1], i = 1 .. 2)] catch: error  end try end proc

 

 

 


 

Download IP-TEMP_mmcdara.mw

The possibility that a solution exists in the range -(1+x^2/2)..+(1+x^2/2) seems very small if we randomly choose the values of k, x and beta.

You will find in the attached file the "classical" dsolve/numeric method (look to the continuation option, it could help), and further an alternative method which seems more promising.
But the problem is far from being completely solved.

restart;

kernelopts(version):

de := diff(u(y), y, y) + 4*beta*diff(u(y), y)^(4 - 1)*diff(u(y), y, y)+3=0;
de := isolate(de, diff(u(y), y, y)):

de := unapply(de, beta);

diff(diff(u(y), y), y)+4*beta*(diff(u(y), y))^3*(diff(diff(u(y), y), y))+3 = 0

 

proc (beta) options operator, arrow; diff(diff(u(y), y), y) = -3/(4*beta*(diff(u(y), y))^3+1) end proc

(1)

desol := proc(x, k, beta, N, e)
  local sigma := 1+x^2/2:
  dsolve({de(beta), u(-sigma)=1, u(sigma)=k}, numeric, output=listprocedure, maxmesh=N, abserr=e):
end proc:

# Data for which the Newton converges

X   := 0:
r   := -(1+X^2/2)..(1+X^2/2);
sol := desol(X, 3, 3/2, 10^4, 1e-6);
f1  := eval(u(y), sol):
f2  := eval(diff(u(y), y), sol):
plots:-dualaxisplot(plot(f1(y), y=r, color=blue), plot(f2(y), y=r, color=red))

-1 .. 1

 

[y = proc (y) local _res, _dat, _solnproc; option `Copyright (c) 1993 by the University of Waterloo. All rights reserved.`; _dat := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(33, {(1) = -1.0, (2) = -.9458237203209267, (3) = -.8833630821725733, (4) = -.8202835535984881, (5) = -.756998214608357, (6) = -.693497339143695, (7) = -.6297616335570171, (8) = -.5657527546155252, (9) = -.5014532814936776, (10) = -.43685151757840085, (11) = -.37193725679169987, (12) = -.30670114550426375, (13) = -.24113562010242523, (14) = -.17524043355031438, (15) = -.10901230687751673, (16) = -0.42445726882400274e-1, (17) = 0.24454802356500084e-1, (18) = 0.9165104365169818e-1, (19) = .159087205170514, (20) = .22667268475501368, (21) = .2942466246367966, (22) = .3615615510986431, (23) = .42840829102523054, (24) = .4943840805083813, (25) = .5589971745924702, (26) = .6217192632450719, (27) = .6820627227515441, (28) = .7397944949099737, (29) = .7950154929196104, (30) = .848093904895967, (31) = .8995681973776464, (32) = .9500119511244636, (33) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(33, 2, {(1, 1) = 1.0, (1, 2) = 1.3363521043188489, (2, 1) = 1.0721090308189354, (2, 2) = 1.3256223638771518, (3, 1) = 1.1545140200940989, (3, 2) = 1.3129422573726228, (4, 1) = 1.2369205934812009, (4, 2) = 1.2997794687530284, (5, 1) = 1.3187496464691046, (5, 2) = 1.2861892928864853, (6, 1) = 1.3999799599748963, (6, 2) = 1.2721390351452777, (7, 1) = 1.4805994543861765, (7, 2) = 1.2575899473949241, (8, 1) = 1.5606159256208683, (8, 2) = 1.2424939373383608, (9, 1) = 1.6400060793913456, (9, 2) = 1.2268018374557819, (10, 1) = 1.7187350038406513, (10, 2) = 1.2104592737268622, (11, 1) = 1.7967611076083612, (11, 2) = 1.1934045191013942, (12, 1) = 1.8740363279643568, (12, 2) = 1.1755668155752497, (13, 1) = 1.9505043254495205, (13, 2) = 1.1568647054587482, (14, 1) = 2.0260934090823004, (14, 2) = 1.13720528856234, (15, 1) = 2.1007276793555016, (15, 2) = 1.116478168491131, (16, 1) = 2.174324454638837, (16, 2) = 1.094551239538847, (17, 1) = 2.2467791187732518, (17, 2) = 1.071269119225075, (18, 1) = 2.317939248331829, (18, 2) = 1.046455414760916, (19, 1) = 2.3876227791536064, (19, 2) = 1.019899902278849, (20, 1) = 2.455600357117798, (20, 2) = .9913551014193845, (21, 1) = 2.521562933811539, (21, 2) = .960540605714957, (22, 1) = 2.5851141229057544, (22, 2) = .9271415673688796, (23, 1) = 2.6458934140049903, (23, 2) = .8907285595127856, (24, 1) = 2.7033686316790333, (24, 2) = .8508551428375233, (25, 1) = 2.756957138181792, (25, 2) = .8069983367424449, (26, 1) = 2.8060879246634367, (26, 2) = .7585058534506953, (27, 1) = 2.8502713490817806, (27, 2) = .7044947232385035, (28, 1) = 2.889234791497566, (28, 2) = .6435309492162128, (29, 1) = 2.9228937633575036, (29, 2) = .5732001163967434, (30, 1) = 2.951183634049377, (30, 2) = .489659128459701, (31, 1) = 2.973864534993095, (31, 2) = .38760934801125446, (32, 1) = 2.990376431636008, (32, 2) = .26296404254458466, (33, 1) = 3.0, (33, 2) = .11986289594785787}, datatype = float[8], order = C_order); YP := Matrix(33, 2, {(1, 1) = 1.3363521043188489, (1, 2) = -.19583470330480324, (2, 1) = 1.3256223638771518, (2, 2) = -.2003085356928717, (3, 1) = 1.3129422573726228, (3, 2) = -.20576645364131696, (4, 1) = 1.2997794687530284, (4, 2) = -.2116358433951971, (5, 1) = 1.2861892928864853, (5, 2) = -.21792307299474237, (6, 1) = 1.2721390351452777, (6, 2) = -.2246769670372416, (7, 1) = 1.2575899473949241, (7, 2) = -.2319554857707718, (8, 1) = 1.2424939373383608, (8, 2) = -.23982910502790494, (9, 1) = 1.2268018374557819, (9, 2) = -.2483785999197207, (10, 1) = 1.2104592737268622, (10, 2) = -.257699321218442, (11, 1) = 1.1934045191013942, (11, 2) = -.2679053892299843, (12, 1) = 1.1755668155752497, (12, 2) = -.27913470529486034, (13, 1) = 1.1568647054587482, (13, 2) = -.29155534081661294, (14, 1) = 1.13720528856234, (14, 2) = -.30537310037977394, (15, 1) = 1.116478168491131, (15, 2) = -.3208454010959337, (16, 1) = 1.094551239538847, (16, 2) = -.33829831714247927, (17, 1) = 1.071269119225075, (17, 2) = -.3581472343121855, (18, 1) = 1.046455414760916, (18, 2) = -.38092118653421203, (19, 1) = 1.019899902278849, (19, 2) = -.4073113122446764, (20, 1) = .9913551014193845, (20, 2) = -.4382291753487525, (21, 1) = .960540605714957, (21, 2) = -.47487972890233343, (22, 1) = .9271415673688796, (22, 2) = -.5188715318283793, (23, 1) = .8907285595127856, (23, 2) = -.5724961227733896, (24, 1) = .8508551428375233, (24, 2) = -.63885757617328, (25, 1) = .8069983367424449, (25, 2) = -.7223122960779227, (26, 1) = .7585058534506953, (26, 2) = -.8291066908163034, (27, 1) = .7044947232385035, (27, 2) = -.9683983984638299, (28, 1) = .6435309492162128, (28, 2) = -1.1542719588692818, (29, 1) = .5732001163967434, (29, 2) = -1.408465127844524, (30, 1) = .489659128459701, (30, 2) = -1.7601276392352694, (31, 1) = .38760934801125446, (31, 2) = -2.223195633066229, (32, 1) = .26296404254458466, (32, 2) = -2.704886302395077, (33, 1) = .11986289594785787, (33, 2) = -2.969319496747946}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(33, {(1) = -1.0, (2) = -.9458237203209267, (3) = -.8833630821725733, (4) = -.8202835535984881, (5) = -.756998214608357, (6) = -.693497339143695, (7) = -.6297616335570171, (8) = -.5657527546155252, (9) = -.5014532814936776, (10) = -.43685151757840085, (11) = -.37193725679169987, (12) = -.30670114550426375, (13) = -.24113562010242523, (14) = -.17524043355031438, (15) = -.10901230687751673, (16) = -0.42445726882400274e-1, (17) = 0.24454802356500084e-1, (18) = 0.9165104365169818e-1, (19) = .159087205170514, (20) = .22667268475501368, (21) = .2942466246367966, (22) = .3615615510986431, (23) = .42840829102523054, (24) = .4943840805083813, (25) = .5589971745924702, (26) = .6217192632450719, (27) = .6820627227515441, (28) = .7397944949099737, (29) = .7950154929196104, (30) = .848093904895967, (31) = .8995681973776464, (32) = .9500119511244636, (33) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(33, 2, {(1, 1) = .0, (1, 2) = 0.2530972060632872e-9, (2, 1) = 0.13849467702830243e-10, (2, 2) = 0.2590654789650105e-9, (3, 1) = 0.30191183319124696e-10, (3, 2) = 0.26637147750259445e-9, (4, 1) = 0.4716003062802634e-10, (4, 2) = 0.2742498508200518e-9, (5, 1) = 0.6468458852543919e-10, (5, 2) = 0.2827104658855037e-9, (6, 1) = 0.828071398408526e-10, (6, 2) = 0.2918261678004611e-9, (7, 1) = 0.10157402287488117e-9, (7, 2) = 0.3016807236308871e-9, (8, 1) = 0.1210430755189599e-9, (8, 2) = 0.31237951195205355e-9, (9, 1) = 0.14127504203720697e-9, (9, 2) = 0.3240398148692722e-9, (10, 1) = 0.16232924991820434e-9, (10, 2) = 0.3368017093074951e-9, (11, 1) = 0.18427386305946326e-9, (11, 2) = 0.3508356769677666e-9, (12, 1) = 0.20717745361774073e-9, (12, 2) = 0.3663426312772277e-9, (13, 1) = 0.23111503274302897e-9, (13, 2) = 0.38356658306617057e-9, (14, 1) = 0.25615856570455645e-9, (14, 2) = 0.4027953585330765e-9, (15, 1) = 0.2823754619834763e-9, (15, 2) = 0.42438090508498705e-9, (16, 1) = 0.3098141601595754e-9, (16, 2) = 0.44873246295371593e-9, (17, 1) = 0.33848370221495083e-9, (17, 2) = 0.4763122179931222e-9, (18, 1) = 0.36832307015743584e-9, (18, 2) = 0.5075909155393642e-9, (19, 1) = 0.39912694763274873e-9, (19, 2) = 0.542944265395166e-9, (20, 1) = 0.43047980282076466e-9, (20, 2) = 0.5824049389153127e-9, (21, 1) = 0.4616357628278712e-9, (21, 2) = 0.625116429978663e-9, (22, 1) = 0.4914430988281275e-9, (22, 2) = 0.6682760797209705e-9, (23, 1) = 0.5183930270947873e-9, (23, 2) = 0.7049675854461973e-9, (24, 1) = 0.5415198212998602e-9, (24, 2) = 0.721143088229846e-9, (25, 1) = 0.5635382382002747e-9, (25, 2) = 0.6934464140488544e-9, (26, 1) = 0.6002639062718956e-9, (26, 2) = 0.5989210661963517e-9, (27, 1) = 0.706098567596946e-9, (27, 2) = 0.4809828861155193e-9, (28, 1) = 0.10421392991659514e-8, (28, 2) = 0.7253655635047217e-9, (29, 1) = 0.20265104122627437e-8, (29, 2) = 0.2957165045513383e-8, (30, 1) = 0.4269667485564131e-8, (30, 2) = 0.10940520569194152e-7, (31, 1) = 0.5656402540311171e-8, (31, 2) = 0.20993295699570182e-7, (32, 1) = -0.17310141265090707e-8, (32, 2) = 0.9759760596876067e-8, (33, 1) = .0, (33, 2) = -0.8332371640072365e-8}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[33] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(2.0993295699570182e-8) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 33, [u(y), diff(u(y), y)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[33] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[33] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(33, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(33, 2, X, Y, outpoint, yout, L, V) end if; [y = outpoint, seq('[u(y), diff(u(y), y)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[33] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(2.0993295699570182e-8) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 33, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[33] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[33] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(33, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(33, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 18446744078115923854, (2) = 18446744078115924382, (3) = 18446744078115924558}), (3) = [y, u(y), diff(u(y), y)], (4) = 0}); _solnproc := _dat[1]; if member(y, ["last", 'last']) then _res := _solnproc("last"); if type(_res, 'list') then return _res[1] end if elif type(y, `=`) and member(lhs(y), ["initial", 'initial']) then if type(rhs(y), 'list') then _res := _solnproc("initial" = [0, op(rhs(y))]) else _res := _solnproc("initial" = [1, rhs(y)]) end if; if type(_res, 'list') then return _res[1] end if elif y = "sysvars" then return _dat[3] end if; y end proc, u(y) = proc (y) local res, data, solnproc, `u(y)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](y) else outpoint := evalf(y) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(33, {(1) = -1.0, (2) = -.9458237203209267, (3) = -.8833630821725733, (4) = -.8202835535984881, (5) = -.756998214608357, (6) = -.693497339143695, (7) = -.6297616335570171, (8) = -.5657527546155252, (9) = -.5014532814936776, (10) = -.43685151757840085, (11) = -.37193725679169987, (12) = -.30670114550426375, (13) = -.24113562010242523, (14) = -.17524043355031438, (15) = -.10901230687751673, (16) = -0.42445726882400274e-1, (17) = 0.24454802356500084e-1, (18) = 0.9165104365169818e-1, (19) = .159087205170514, (20) = .22667268475501368, (21) = .2942466246367966, (22) = .3615615510986431, (23) = .42840829102523054, (24) = .4943840805083813, (25) = .5589971745924702, (26) = .6217192632450719, (27) = .6820627227515441, (28) = .7397944949099737, (29) = .7950154929196104, (30) = .848093904895967, (31) = .8995681973776464, (32) = .9500119511244636, (33) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(33, 2, {(1, 1) = 1.0, (1, 2) = 1.3363521043188489, (2, 1) = 1.0721090308189354, (2, 2) = 1.3256223638771518, (3, 1) = 1.1545140200940989, (3, 2) = 1.3129422573726228, (4, 1) = 1.2369205934812009, (4, 2) = 1.2997794687530284, (5, 1) = 1.3187496464691046, (5, 2) = 1.2861892928864853, (6, 1) = 1.3999799599748963, (6, 2) = 1.2721390351452777, (7, 1) = 1.4805994543861765, (7, 2) = 1.2575899473949241, (8, 1) = 1.5606159256208683, (8, 2) = 1.2424939373383608, (9, 1) = 1.6400060793913456, (9, 2) = 1.2268018374557819, (10, 1) = 1.7187350038406513, (10, 2) = 1.2104592737268622, (11, 1) = 1.7967611076083612, (11, 2) = 1.1934045191013942, (12, 1) = 1.8740363279643568, (12, 2) = 1.1755668155752497, (13, 1) = 1.9505043254495205, (13, 2) = 1.1568647054587482, (14, 1) = 2.0260934090823004, (14, 2) = 1.13720528856234, (15, 1) = 2.1007276793555016, (15, 2) = 1.116478168491131, (16, 1) = 2.174324454638837, (16, 2) = 1.094551239538847, (17, 1) = 2.2467791187732518, (17, 2) = 1.071269119225075, (18, 1) = 2.317939248331829, (18, 2) = 1.046455414760916, (19, 1) = 2.3876227791536064, (19, 2) = 1.019899902278849, (20, 1) = 2.455600357117798, (20, 2) = .9913551014193845, (21, 1) = 2.521562933811539, (21, 2) = .960540605714957, (22, 1) = 2.5851141229057544, (22, 2) = .9271415673688796, (23, 1) = 2.6458934140049903, (23, 2) = .8907285595127856, (24, 1) = 2.7033686316790333, (24, 2) = .8508551428375233, (25, 1) = 2.756957138181792, (25, 2) = .8069983367424449, (26, 1) = 2.8060879246634367, (26, 2) = .7585058534506953, (27, 1) = 2.8502713490817806, (27, 2) = .7044947232385035, (28, 1) = 2.889234791497566, (28, 2) = .6435309492162128, (29, 1) = 2.9228937633575036, (29, 2) = .5732001163967434, (30, 1) = 2.951183634049377, (30, 2) = .489659128459701, (31, 1) = 2.973864534993095, (31, 2) = .38760934801125446, (32, 1) = 2.990376431636008, (32, 2) = .26296404254458466, (33, 1) = 3.0, (33, 2) = .11986289594785787}, datatype = float[8], order = C_order); YP := Matrix(33, 2, {(1, 1) = 1.3363521043188489, (1, 2) = -.19583470330480324, (2, 1) = 1.3256223638771518, (2, 2) = -.2003085356928717, (3, 1) = 1.3129422573726228, (3, 2) = -.20576645364131696, (4, 1) = 1.2997794687530284, (4, 2) = -.2116358433951971, (5, 1) = 1.2861892928864853, (5, 2) = -.21792307299474237, (6, 1) = 1.2721390351452777, (6, 2) = -.2246769670372416, (7, 1) = 1.2575899473949241, (7, 2) = -.2319554857707718, (8, 1) = 1.2424939373383608, (8, 2) = -.23982910502790494, (9, 1) = 1.2268018374557819, (9, 2) = -.2483785999197207, (10, 1) = 1.2104592737268622, (10, 2) = -.257699321218442, (11, 1) = 1.1934045191013942, (11, 2) = -.2679053892299843, (12, 1) = 1.1755668155752497, (12, 2) = -.27913470529486034, (13, 1) = 1.1568647054587482, (13, 2) = -.29155534081661294, (14, 1) = 1.13720528856234, (14, 2) = -.30537310037977394, (15, 1) = 1.116478168491131, (15, 2) = -.3208454010959337, (16, 1) = 1.094551239538847, (16, 2) = -.33829831714247927, (17, 1) = 1.071269119225075, (17, 2) = -.3581472343121855, (18, 1) = 1.046455414760916, (18, 2) = -.38092118653421203, (19, 1) = 1.019899902278849, (19, 2) = -.4073113122446764, (20, 1) = .9913551014193845, (20, 2) = -.4382291753487525, (21, 1) = .960540605714957, (21, 2) = -.47487972890233343, (22, 1) = .9271415673688796, (22, 2) = -.5188715318283793, (23, 1) = .8907285595127856, (23, 2) = -.5724961227733896, (24, 1) = .8508551428375233, (24, 2) = -.63885757617328, (25, 1) = .8069983367424449, (25, 2) = -.7223122960779227, (26, 1) = .7585058534506953, (26, 2) = -.8291066908163034, (27, 1) = .7044947232385035, (27, 2) = -.9683983984638299, (28, 1) = .6435309492162128, (28, 2) = -1.1542719588692818, (29, 1) = .5732001163967434, (29, 2) = -1.408465127844524, (30, 1) = .489659128459701, (30, 2) = -1.7601276392352694, (31, 1) = .38760934801125446, (31, 2) = -2.223195633066229, (32, 1) = .26296404254458466, (32, 2) = -2.704886302395077, (33, 1) = .11986289594785787, (33, 2) = -2.969319496747946}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(33, {(1) = -1.0, (2) = -.9458237203209267, (3) = -.8833630821725733, (4) = -.8202835535984881, (5) = -.756998214608357, (6) = -.693497339143695, (7) = -.6297616335570171, (8) = -.5657527546155252, (9) = -.5014532814936776, (10) = -.43685151757840085, (11) = -.37193725679169987, (12) = -.30670114550426375, (13) = -.24113562010242523, (14) = -.17524043355031438, (15) = -.10901230687751673, (16) = -0.42445726882400274e-1, (17) = 0.24454802356500084e-1, (18) = 0.9165104365169818e-1, (19) = .159087205170514, (20) = .22667268475501368, (21) = .2942466246367966, (22) = .3615615510986431, (23) = .42840829102523054, (24) = .4943840805083813, (25) = .5589971745924702, (26) = .6217192632450719, (27) = .6820627227515441, (28) = .7397944949099737, (29) = .7950154929196104, (30) = .848093904895967, (31) = .8995681973776464, (32) = .9500119511244636, (33) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(33, 2, {(1, 1) = .0, (1, 2) = 0.2530972060632872e-9, (2, 1) = 0.13849467702830243e-10, (2, 2) = 0.2590654789650105e-9, (3, 1) = 0.30191183319124696e-10, (3, 2) = 0.26637147750259445e-9, (4, 1) = 0.4716003062802634e-10, (4, 2) = 0.2742498508200518e-9, (5, 1) = 0.6468458852543919e-10, (5, 2) = 0.2827104658855037e-9, (6, 1) = 0.828071398408526e-10, (6, 2) = 0.2918261678004611e-9, (7, 1) = 0.10157402287488117e-9, (7, 2) = 0.3016807236308871e-9, (8, 1) = 0.1210430755189599e-9, (8, 2) = 0.31237951195205355e-9, (9, 1) = 0.14127504203720697e-9, (9, 2) = 0.3240398148692722e-9, (10, 1) = 0.16232924991820434e-9, (10, 2) = 0.3368017093074951e-9, (11, 1) = 0.18427386305946326e-9, (11, 2) = 0.3508356769677666e-9, (12, 1) = 0.20717745361774073e-9, (12, 2) = 0.3663426312772277e-9, (13, 1) = 0.23111503274302897e-9, (13, 2) = 0.38356658306617057e-9, (14, 1) = 0.25615856570455645e-9, (14, 2) = 0.4027953585330765e-9, (15, 1) = 0.2823754619834763e-9, (15, 2) = 0.42438090508498705e-9, (16, 1) = 0.3098141601595754e-9, (16, 2) = 0.44873246295371593e-9, (17, 1) = 0.33848370221495083e-9, (17, 2) = 0.4763122179931222e-9, (18, 1) = 0.36832307015743584e-9, (18, 2) = 0.5075909155393642e-9, (19, 1) = 0.39912694763274873e-9, (19, 2) = 0.542944265395166e-9, (20, 1) = 0.43047980282076466e-9, (20, 2) = 0.5824049389153127e-9, (21, 1) = 0.4616357628278712e-9, (21, 2) = 0.625116429978663e-9, (22, 1) = 0.4914430988281275e-9, (22, 2) = 0.6682760797209705e-9, (23, 1) = 0.5183930270947873e-9, (23, 2) = 0.7049675854461973e-9, (24, 1) = 0.5415198212998602e-9, (24, 2) = 0.721143088229846e-9, (25, 1) = 0.5635382382002747e-9, (25, 2) = 0.6934464140488544e-9, (26, 1) = 0.6002639062718956e-9, (26, 2) = 0.5989210661963517e-9, (27, 1) = 0.706098567596946e-9, (27, 2) = 0.4809828861155193e-9, (28, 1) = 0.10421392991659514e-8, (28, 2) = 0.7253655635047217e-9, (29, 1) = 0.20265104122627437e-8, (29, 2) = 0.2957165045513383e-8, (30, 1) = 0.4269667485564131e-8, (30, 2) = 0.10940520569194152e-7, (31, 1) = 0.5656402540311171e-8, (31, 2) = 0.20993295699570182e-7, (32, 1) = -0.17310141265090707e-8, (32, 2) = 0.9759760596876067e-8, (33, 1) = .0, (33, 2) = -0.8332371640072365e-8}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[33] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(2.0993295699570182e-8) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 33, [u(y), diff(u(y), y)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[33] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[33] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(33, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(33, 2, X, Y, outpoint, yout, L, V) end if; [y = outpoint, seq('[u(y), diff(u(y), y)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[33] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(2.0993295699570182e-8) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 33, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[33] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[33] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(33, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(33, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 18446744078115923854, (2) = 18446744078115924382, (3) = 18446744078115924558}), (3) = [y, u(y), diff(u(y), y)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(y) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(y) else `u(y)` := pointto(data[2][2]); return ('`u(y)`')(y) end if end if; try res := solnproc(outpoint); res[2] catch: error  end try end proc, diff(u(y), y) = proc (y) local res, data, solnproc, `diff(u(y),y)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](y) else outpoint := evalf(y) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(33, {(1) = -1.0, (2) = -.9458237203209267, (3) = -.8833630821725733, (4) = -.8202835535984881, (5) = -.756998214608357, (6) = -.693497339143695, (7) = -.6297616335570171, (8) = -.5657527546155252, (9) = -.5014532814936776, (10) = -.43685151757840085, (11) = -.37193725679169987, (12) = -.30670114550426375, (13) = -.24113562010242523, (14) = -.17524043355031438, (15) = -.10901230687751673, (16) = -0.42445726882400274e-1, (17) = 0.24454802356500084e-1, (18) = 0.9165104365169818e-1, (19) = .159087205170514, (20) = .22667268475501368, (21) = .2942466246367966, (22) = .3615615510986431, (23) = .42840829102523054, (24) = .4943840805083813, (25) = .5589971745924702, (26) = .6217192632450719, (27) = .6820627227515441, (28) = .7397944949099737, (29) = .7950154929196104, (30) = .848093904895967, (31) = .8995681973776464, (32) = .9500119511244636, (33) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(33, 2, {(1, 1) = 1.0, (1, 2) = 1.3363521043188489, (2, 1) = 1.0721090308189354, (2, 2) = 1.3256223638771518, (3, 1) = 1.1545140200940989, (3, 2) = 1.3129422573726228, (4, 1) = 1.2369205934812009, (4, 2) = 1.2997794687530284, (5, 1) = 1.3187496464691046, (5, 2) = 1.2861892928864853, (6, 1) = 1.3999799599748963, (6, 2) = 1.2721390351452777, (7, 1) = 1.4805994543861765, (7, 2) = 1.2575899473949241, (8, 1) = 1.5606159256208683, (8, 2) = 1.2424939373383608, (9, 1) = 1.6400060793913456, (9, 2) = 1.2268018374557819, (10, 1) = 1.7187350038406513, (10, 2) = 1.2104592737268622, (11, 1) = 1.7967611076083612, (11, 2) = 1.1934045191013942, (12, 1) = 1.8740363279643568, (12, 2) = 1.1755668155752497, (13, 1) = 1.9505043254495205, (13, 2) = 1.1568647054587482, (14, 1) = 2.0260934090823004, (14, 2) = 1.13720528856234, (15, 1) = 2.1007276793555016, (15, 2) = 1.116478168491131, (16, 1) = 2.174324454638837, (16, 2) = 1.094551239538847, (17, 1) = 2.2467791187732518, (17, 2) = 1.071269119225075, (18, 1) = 2.317939248331829, (18, 2) = 1.046455414760916, (19, 1) = 2.3876227791536064, (19, 2) = 1.019899902278849, (20, 1) = 2.455600357117798, (20, 2) = .9913551014193845, (21, 1) = 2.521562933811539, (21, 2) = .960540605714957, (22, 1) = 2.5851141229057544, (22, 2) = .9271415673688796, (23, 1) = 2.6458934140049903, (23, 2) = .8907285595127856, (24, 1) = 2.7033686316790333, (24, 2) = .8508551428375233, (25, 1) = 2.756957138181792, (25, 2) = .8069983367424449, (26, 1) = 2.8060879246634367, (26, 2) = .7585058534506953, (27, 1) = 2.8502713490817806, (27, 2) = .7044947232385035, (28, 1) = 2.889234791497566, (28, 2) = .6435309492162128, (29, 1) = 2.9228937633575036, (29, 2) = .5732001163967434, (30, 1) = 2.951183634049377, (30, 2) = .489659128459701, (31, 1) = 2.973864534993095, (31, 2) = .38760934801125446, (32, 1) = 2.990376431636008, (32, 2) = .26296404254458466, (33, 1) = 3.0, (33, 2) = .11986289594785787}, datatype = float[8], order = C_order); YP := Matrix(33, 2, {(1, 1) = 1.3363521043188489, (1, 2) = -.19583470330480324, (2, 1) = 1.3256223638771518, (2, 2) = -.2003085356928717, (3, 1) = 1.3129422573726228, (3, 2) = -.20576645364131696, (4, 1) = 1.2997794687530284, (4, 2) = -.2116358433951971, (5, 1) = 1.2861892928864853, (5, 2) = -.21792307299474237, (6, 1) = 1.2721390351452777, (6, 2) = -.2246769670372416, (7, 1) = 1.2575899473949241, (7, 2) = -.2319554857707718, (8, 1) = 1.2424939373383608, (8, 2) = -.23982910502790494, (9, 1) = 1.2268018374557819, (9, 2) = -.2483785999197207, (10, 1) = 1.2104592737268622, (10, 2) = -.257699321218442, (11, 1) = 1.1934045191013942, (11, 2) = -.2679053892299843, (12, 1) = 1.1755668155752497, (12, 2) = -.27913470529486034, (13, 1) = 1.1568647054587482, (13, 2) = -.29155534081661294, (14, 1) = 1.13720528856234, (14, 2) = -.30537310037977394, (15, 1) = 1.116478168491131, (15, 2) = -.3208454010959337, (16, 1) = 1.094551239538847, (16, 2) = -.33829831714247927, (17, 1) = 1.071269119225075, (17, 2) = -.3581472343121855, (18, 1) = 1.046455414760916, (18, 2) = -.38092118653421203, (19, 1) = 1.019899902278849, (19, 2) = -.4073113122446764, (20, 1) = .9913551014193845, (20, 2) = -.4382291753487525, (21, 1) = .960540605714957, (21, 2) = -.47487972890233343, (22, 1) = .9271415673688796, (22, 2) = -.5188715318283793, (23, 1) = .8907285595127856, (23, 2) = -.5724961227733896, (24, 1) = .8508551428375233, (24, 2) = -.63885757617328, (25, 1) = .8069983367424449, (25, 2) = -.7223122960779227, (26, 1) = .7585058534506953, (26, 2) = -.8291066908163034, (27, 1) = .7044947232385035, (27, 2) = -.9683983984638299, (28, 1) = .6435309492162128, (28, 2) = -1.1542719588692818, (29, 1) = .5732001163967434, (29, 2) = -1.408465127844524, (30, 1) = .489659128459701, (30, 2) = -1.7601276392352694, (31, 1) = .38760934801125446, (31, 2) = -2.223195633066229, (32, 1) = .26296404254458466, (32, 2) = -2.704886302395077, (33, 1) = .11986289594785787, (33, 2) = -2.969319496747946}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(33, {(1) = -1.0, (2) = -.9458237203209267, (3) = -.8833630821725733, (4) = -.8202835535984881, (5) = -.756998214608357, (6) = -.693497339143695, (7) = -.6297616335570171, (8) = -.5657527546155252, (9) = -.5014532814936776, (10) = -.43685151757840085, (11) = -.37193725679169987, (12) = -.30670114550426375, (13) = -.24113562010242523, (14) = -.17524043355031438, (15) = -.10901230687751673, (16) = -0.42445726882400274e-1, (17) = 0.24454802356500084e-1, (18) = 0.9165104365169818e-1, (19) = .159087205170514, (20) = .22667268475501368, (21) = .2942466246367966, (22) = .3615615510986431, (23) = .42840829102523054, (24) = .4943840805083813, (25) = .5589971745924702, (26) = .6217192632450719, (27) = .6820627227515441, (28) = .7397944949099737, (29) = .7950154929196104, (30) = .848093904895967, (31) = .8995681973776464, (32) = .9500119511244636, (33) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(33, 2, {(1, 1) = .0, (1, 2) = 0.2530972060632872e-9, (2, 1) = 0.13849467702830243e-10, (2, 2) = 0.2590654789650105e-9, (3, 1) = 0.30191183319124696e-10, (3, 2) = 0.26637147750259445e-9, (4, 1) = 0.4716003062802634e-10, (4, 2) = 0.2742498508200518e-9, (5, 1) = 0.6468458852543919e-10, (5, 2) = 0.2827104658855037e-9, (6, 1) = 0.828071398408526e-10, (6, 2) = 0.2918261678004611e-9, (7, 1) = 0.10157402287488117e-9, (7, 2) = 0.3016807236308871e-9, (8, 1) = 0.1210430755189599e-9, (8, 2) = 0.31237951195205355e-9, (9, 1) = 0.14127504203720697e-9, (9, 2) = 0.3240398148692722e-9, (10, 1) = 0.16232924991820434e-9, (10, 2) = 0.3368017093074951e-9, (11, 1) = 0.18427386305946326e-9, (11, 2) = 0.3508356769677666e-9, (12, 1) = 0.20717745361774073e-9, (12, 2) = 0.3663426312772277e-9, (13, 1) = 0.23111503274302897e-9, (13, 2) = 0.38356658306617057e-9, (14, 1) = 0.25615856570455645e-9, (14, 2) = 0.4027953585330765e-9, (15, 1) = 0.2823754619834763e-9, (15, 2) = 0.42438090508498705e-9, (16, 1) = 0.3098141601595754e-9, (16, 2) = 0.44873246295371593e-9, (17, 1) = 0.33848370221495083e-9, (17, 2) = 0.4763122179931222e-9, (18, 1) = 0.36832307015743584e-9, (18, 2) = 0.5075909155393642e-9, (19, 1) = 0.39912694763274873e-9, (19, 2) = 0.542944265395166e-9, (20, 1) = 0.43047980282076466e-9, (20, 2) = 0.5824049389153127e-9, (21, 1) = 0.4616357628278712e-9, (21, 2) = 0.625116429978663e-9, (22, 1) = 0.4914430988281275e-9, (22, 2) = 0.6682760797209705e-9, (23, 1) = 0.5183930270947873e-9, (23, 2) = 0.7049675854461973e-9, (24, 1) = 0.5415198212998602e-9, (24, 2) = 0.721143088229846e-9, (25, 1) = 0.5635382382002747e-9, (25, 2) = 0.6934464140488544e-9, (26, 1) = 0.6002639062718956e-9, (26, 2) = 0.5989210661963517e-9, (27, 1) = 0.706098567596946e-9, (27, 2) = 0.4809828861155193e-9, (28, 1) = 0.10421392991659514e-8, (28, 2) = 0.7253655635047217e-9, (29, 1) = 0.20265104122627437e-8, (29, 2) = 0.2957165045513383e-8, (30, 1) = 0.4269667485564131e-8, (30, 2) = 0.10940520569194152e-7, (31, 1) = 0.5656402540311171e-8, (31, 2) = 0.20993295699570182e-7, (32, 1) = -0.17310141265090707e-8, (32, 2) = 0.9759760596876067e-8, (33, 1) = .0, (33, 2) = -0.8332371640072365e-8}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[33] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(2.0993295699570182e-8) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 33, [u(y), diff(u(y), y)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[33] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[33] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(33, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(33, 2, X, Y, outpoint, yout, L, V) end if; [y = outpoint, seq('[u(y), diff(u(y), y)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[33] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(2.0993295699570182e-8) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 33, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[33] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[33] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(33, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(33, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 18446744078115923854, (2) = 18446744078115924382, (3) = 18446744078115924558}), (3) = [y, u(y), diff(u(y), y)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(y) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(y) else `diff(u(y),y)` := pointto(data[2][3]); return ('`diff(u(y),y)`')(y) end if end if; try res := solnproc(outpoint); res[3] catch: error  end try end proc]

 

 

# Another data for which the Newton still converges


X   := 0:
r   := -(1+X^2/2)..(1+X^2/2);
sol := desol(X, -5, 1/2, 10^4, 1e-6);
f1  := eval(u(y), sol):
f2  := eval(diff(u(y), y), sol):
plots:-dualaxisplot(plot(f1(y), y=r, color=blue), plot(f2(y), y=r, color=red))

-1 .. 1

 

[y = proc (y) local _res, _dat, _solnproc; option `Copyright (c) 1993 by the University of Waterloo. All rights reserved.`; _dat := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = -1.0, (2) = -.7168751416903357, (3) = -.4330566056110218, (4) = -.14814426160629363, (5) = .13799752611323132, (6) = .4254039189214197, (7) = .7139977024276131, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = 1.0, (1, 2) = -3.055556208188536, (2, 1) = .13705199705608748, (2, 2) = -3.040287843587664, (3, 1) = -.7236378942464567, (3, 2) = -3.0247433282398206, (4, 1) = -1.5831721731327253, (4, 2) = -3.008889488245128, (5, 1) = -2.4418321743415667, (5, 2) = -2.9927060610954594, (6, 1) = -3.29958648818893, (6, 2) = -2.9761772451876283, (7, 1) = -4.156063429318509, (7, 2) = -2.9592927749240108, (8, 1) = -5.0, (8, 2) = -2.9422640420696937}, datatype = float[8], order = C_order); YP := Matrix(8, 2, {(1, 1) = -3.055556208188536, (1, 2) = 0.53517972669454114e-1, (2, 1) = -3.040287843587664, (2, 2) = 0.54343011686857234e-1, (3, 1) = -3.0247433282398206, (3, 2) = 0.5520064586162285e-1, (4, 1) = -3.008889488245128, (4, 2) = 0.5609420935860491e-1, (5, 1) = -2.9927060610954594, (5, 2) = 0.5702654021646268e-1, (6, 1) = -2.9761772451876283, (6, 2) = 0.58000424209347715e-1, (7, 1) = -2.9592927749240108, (7, 2) = 0.59018519259218555e-1, (8, 1) = -2.9422640420696937, (8, 2) = 0.6006983083228045e-1}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = -1.0, (2) = -.7168751416903357, (3) = -.4330566056110218, (4) = -.14814426160629363, (5) = .13799752611323132, (6) = .4254039189214197, (7) = .7139977024276131, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .0, (1, 2) = -0.8429929421232053e-9, (2, 1) = -0.679848427556603e-10, (2, 2) = -0.8574034149384255e-9, (3, 1) = -0.11970074931302716e-9, (3, 2) = -0.8717471078387462e-9, (4, 1) = -0.15090015903551692e-9, (4, 2) = -0.8858575206768151e-9, (5, 1) = -0.1572896146668349e-9, (5, 2) = -0.8995178935094313e-9, (6, 1) = -0.13411202148861663e-9, (6, 2) = -0.9124538458186702e-9, (7, 1) = -0.7628198073235423e-10, (7, 2) = -0.9243209198090386e-9, (8, 1) = .0, (8, 2) = -0.9353527286084252e-9}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 4 elif outpoint = "error" then return HFloat(9.353527286084252e-10) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 8, [u(y), diff(u(y), y)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, yout, L, V) end if; [y = outpoint, seq('[u(y), diff(u(y), y)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 4 elif outpoint = "error" then return HFloat(9.353527286084252e-10) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 18446744078181100198, (2) = 18446744078181100374, (3) = 18446744078181100550}), (3) = [y, u(y), diff(u(y), y)], (4) = 0}); _solnproc := _dat[1]; if member(y, ["last", 'last']) then _res := _solnproc("last"); if type(_res, 'list') then return _res[1] end if elif type(y, `=`) and member(lhs(y), ["initial", 'initial']) then if type(rhs(y), 'list') then _res := _solnproc("initial" = [0, op(rhs(y))]) else _res := _solnproc("initial" = [1, rhs(y)]) end if; if type(_res, 'list') then return _res[1] end if elif y = "sysvars" then return _dat[3] end if; y end proc, u(y) = proc (y) local res, data, solnproc, `u(y)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](y) else outpoint := evalf(y) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = -1.0, (2) = -.7168751416903357, (3) = -.4330566056110218, (4) = -.14814426160629363, (5) = .13799752611323132, (6) = .4254039189214197, (7) = .7139977024276131, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = 1.0, (1, 2) = -3.055556208188536, (2, 1) = .13705199705608748, (2, 2) = -3.040287843587664, (3, 1) = -.7236378942464567, (3, 2) = -3.0247433282398206, (4, 1) = -1.5831721731327253, (4, 2) = -3.008889488245128, (5, 1) = -2.4418321743415667, (5, 2) = -2.9927060610954594, (6, 1) = -3.29958648818893, (6, 2) = -2.9761772451876283, (7, 1) = -4.156063429318509, (7, 2) = -2.9592927749240108, (8, 1) = -5.0, (8, 2) = -2.9422640420696937}, datatype = float[8], order = C_order); YP := Matrix(8, 2, {(1, 1) = -3.055556208188536, (1, 2) = 0.53517972669454114e-1, (2, 1) = -3.040287843587664, (2, 2) = 0.54343011686857234e-1, (3, 1) = -3.0247433282398206, (3, 2) = 0.5520064586162285e-1, (4, 1) = -3.008889488245128, (4, 2) = 0.5609420935860491e-1, (5, 1) = -2.9927060610954594, (5, 2) = 0.5702654021646268e-1, (6, 1) = -2.9761772451876283, (6, 2) = 0.58000424209347715e-1, (7, 1) = -2.9592927749240108, (7, 2) = 0.59018519259218555e-1, (8, 1) = -2.9422640420696937, (8, 2) = 0.6006983083228045e-1}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = -1.0, (2) = -.7168751416903357, (3) = -.4330566056110218, (4) = -.14814426160629363, (5) = .13799752611323132, (6) = .4254039189214197, (7) = .7139977024276131, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .0, (1, 2) = -0.8429929421232053e-9, (2, 1) = -0.679848427556603e-10, (2, 2) = -0.8574034149384255e-9, (3, 1) = -0.11970074931302716e-9, (3, 2) = -0.8717471078387462e-9, (4, 1) = -0.15090015903551692e-9, (4, 2) = -0.8858575206768151e-9, (5, 1) = -0.1572896146668349e-9, (5, 2) = -0.8995178935094313e-9, (6, 1) = -0.13411202148861663e-9, (6, 2) = -0.9124538458186702e-9, (7, 1) = -0.7628198073235423e-10, (7, 2) = -0.9243209198090386e-9, (8, 1) = .0, (8, 2) = -0.9353527286084252e-9}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 4 elif outpoint = "error" then return HFloat(9.353527286084252e-10) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 8, [u(y), diff(u(y), y)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, yout, L, V) end if; [y = outpoint, seq('[u(y), diff(u(y), y)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 4 elif outpoint = "error" then return HFloat(9.353527286084252e-10) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 18446744078181100198, (2) = 18446744078181100374, (3) = 18446744078181100550}), (3) = [y, u(y), diff(u(y), y)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(y) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(y) else `u(y)` := pointto(data[2][2]); return ('`u(y)`')(y) end if end if; try res := solnproc(outpoint); res[2] catch: error  end try end proc, diff(u(y), y) = proc (y) local res, data, solnproc, `diff(u(y),y)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](y) else outpoint := evalf(y) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = -1.0, (2) = -.7168751416903357, (3) = -.4330566056110218, (4) = -.14814426160629363, (5) = .13799752611323132, (6) = .4254039189214197, (7) = .7139977024276131, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = 1.0, (1, 2) = -3.055556208188536, (2, 1) = .13705199705608748, (2, 2) = -3.040287843587664, (3, 1) = -.7236378942464567, (3, 2) = -3.0247433282398206, (4, 1) = -1.5831721731327253, (4, 2) = -3.008889488245128, (5, 1) = -2.4418321743415667, (5, 2) = -2.9927060610954594, (6, 1) = -3.29958648818893, (6, 2) = -2.9761772451876283, (7, 1) = -4.156063429318509, (7, 2) = -2.9592927749240108, (8, 1) = -5.0, (8, 2) = -2.9422640420696937}, datatype = float[8], order = C_order); YP := Matrix(8, 2, {(1, 1) = -3.055556208188536, (1, 2) = 0.53517972669454114e-1, (2, 1) = -3.040287843587664, (2, 2) = 0.54343011686857234e-1, (3, 1) = -3.0247433282398206, (3, 2) = 0.5520064586162285e-1, (4, 1) = -3.008889488245128, (4, 2) = 0.5609420935860491e-1, (5, 1) = -2.9927060610954594, (5, 2) = 0.5702654021646268e-1, (6, 1) = -2.9761772451876283, (6, 2) = 0.58000424209347715e-1, (7, 1) = -2.9592927749240108, (7, 2) = 0.59018519259218555e-1, (8, 1) = -2.9422640420696937, (8, 2) = 0.6006983083228045e-1}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = -1.0, (2) = -.7168751416903357, (3) = -.4330566056110218, (4) = -.14814426160629363, (5) = .13799752611323132, (6) = .4254039189214197, (7) = .7139977024276131, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .0, (1, 2) = -0.8429929421232053e-9, (2, 1) = -0.679848427556603e-10, (2, 2) = -0.8574034149384255e-9, (3, 1) = -0.11970074931302716e-9, (3, 2) = -0.8717471078387462e-9, (4, 1) = -0.15090015903551692e-9, (4, 2) = -0.8858575206768151e-9, (5, 1) = -0.1572896146668349e-9, (5, 2) = -0.8995178935094313e-9, (6, 1) = -0.13411202148861663e-9, (6, 2) = -0.9124538458186702e-9, (7, 1) = -0.7628198073235423e-10, (7, 2) = -0.9243209198090386e-9, (8, 1) = .0, (8, 2) = -0.9353527286084252e-9}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 4 elif outpoint = "error" then return HFloat(9.353527286084252e-10) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 8, [u(y), diff(u(y), y)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, yout, L, V) end if; [y = outpoint, seq('[u(y), diff(u(y), y)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 4 elif outpoint = "error" then return HFloat(9.353527286084252e-10) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 18446744078181100198, (2) = 18446744078181100374, (3) = 18446744078181100550}), (3) = [y, u(y), diff(u(y), y)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(y) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(y) else `diff(u(y),y)` := pointto(data[2][3]); return ('`diff(u(y),y)`')(y) end if end if; try res := solnproc(outpoint); res[3] catch: error  end try end proc]

 

 

# And a non convergent case

X   := 0:
r   := -(1+X^2/2)..(1+X^2/2);
sol := desol(X, 1, 1/2, 10^4, 1e-6);

-1 .. 1

 

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

 


REMARK

DE := Diff(u(y), y, y) + 4*beta*Diff(u(y), y)^(4 - 1)*Diff(u(y), y, y)+3=0;

Diff(u(y), y, y)+4*beta*(Diff(u(y), y))^3*(Diff(u(y), y, y))+3 = 0

(2)

DE := Diff(u(y), y, y) + beta*Diff(Diff(u(y), y)^4, y)+3=0;

Diff(u(y), y, y)+beta*(Diff((Diff(u(y), y))^4, y))+3 = 0

(3)

DE := Diff(u(y), y) + beta*(Diff(u(y), y)^4)+3*y=C;

Diff(u(y), y)+beta*(Diff(u(y), y))^4+3*y = C

(4)

#------------------------------------------------------------
#
# Procedures
Xsol := proc(__beta, __k, X, i)
  local data, sols, usol, csol, T, Left_bc, Right_bc, check_de:
  data := [beta=__beta, k=__k, L=1+X^2/2];
  eval({diff(u(y), y)=ade[i], u(-L)=1}, data), data
end proc:


Cstart := proc()
  local c := 0;
  local StartNotFound := true:
  while StartNotFound do
    try
      sol(parameters=[c]);
      sol(eval(L, data));
      StartNotFound := false:
    catch:
      c := c+0.1
    end try:
  end do:
  c
end proc:


FindC := proc(c)
  sol(parameters=[c]);
  eval(u(y), sol(eval(L, data)))
end proc:


f := proc(__y)
  eval(u(y), sol(__y))
end proc:

#------------------------------------------------------------

solve(DE, Diff(u(y), y));
ade := [allvalues(%)]:

# Select the 3rd solution delivered by allvalues(...)

sys, data := Xsol(1/2, 4, 0, 3):
sol := dsolve(sys, numeric, parameters=[C]);

# Find the smaller value oc C such that the solution might be
# constructed up to L.

c0 := Cstart();

# Check if c0 is admissible.

sol(parameters=[c0]):
eval(u(y), sol(eval(L, data)));
if % < eval(k, data) then
  admissible := true
else
  admissible := false
end if;


if admissible then
  # From C=c0 find the value ck of C such that y(L)=k.

  ck := fsolve('FindC(c)'=eval(k, data), c=c0..10);

  # Instanciate the solution with C=ck

  sol(parameters=[ck]):

  # Plot it.

  plot('f(__y)', __y=eval(-L..L, data))
end if;

RootOf(_Z^4*beta-C+_Z+3*y)

 

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 := [C = C]; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 24, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..54, {(1) = 1, (2) = 1, (3) = 0, (4) = 0, (5) = 1, (6) = 0, (7) = 0, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 0, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0, (54) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = -1.0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = -1.0, (6) = .0, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = 1., (2) = Float(undefined)})), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..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[8]), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), 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)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(y)]`; if -3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3 < -27 then YP[1] := undefined; return 0 end if; if .866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2)) < -9/2 then YP[1] := undefined; return 0 end if; if .866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2)) < -9/2 then YP[1] := undefined; return 0 end if; if .866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2)) < -9/2 then YP[1] := undefined; return 0 end if; if -27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)) < 0 then YP[1] := undefined; return 0 end if; if -27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)) < 0 then YP[1] := undefined; return 0 end if; if (10.4829655768356*Y[2]*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))-31.4488967305067*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))*X-2.28942848510666*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3))*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))+72*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3))*evalf(1/(-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2)) < 0 then YP[1] := undefined; return 0 end if; YP[1] := -(1/12)*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))+.288675134594814*evalf(((10.4829655768356*Y[2]*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))-31.4488967305067*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))*X-2.28942848510666*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3))*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))+72*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3))*evalf(1/(-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2)))^(1/2)); 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(y)]`; if -3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3 < -27 then YP[1] := undefined; return 0 end if; if .866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2)) < -9/2 then YP[1] := undefined; return 0 end if; if .866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2)) < -9/2 then YP[1] := undefined; return 0 end if; if .866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2)) < -9/2 then YP[1] := undefined; return 0 end if; if -27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)) < 0 then YP[1] := undefined; return 0 end if; if -27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)) < 0 then YP[1] := undefined; return 0 end if; if (10.4829655768356*Y[2]*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))-31.4488967305067*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))*X-2.28942848510666*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3))*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))+72*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3))*evalf(1/(-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2)) < 0 then YP[1] := undefined; return 0 end if; YP[1] := -(1/12)*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))+.288675134594814*evalf(((10.4829655768356*Y[2]*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))-31.4488967305067*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))*X-2.28942848510666*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3))*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))+72*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3))*evalf(1/(-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2)))^(1/2)); 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 24 ) = (0)  ] ))  ] ); _y0 := Array(0..2, {(1) = -1., (2) = 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] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 100 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 100 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(0..0, {}), (3) = [y, u(y)], (4) = [C = C]}); _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.5

 

HFloat(3.121002019164313)

 

true

 

4.384334827

 

[C = 4.384334827]

 

 

# For k=2, and X=0 (==> 1+X^2/2 = 1) thesmallest value c9 of C
# such that the solution can be computed up to y=1 is c0=2.4.
# But y(1) = 3.12 being already larger then 2, there is no value
# of C such that y(1) = 2.

sys, data := Xsol(1/2, 2, 0, 3):
sol := dsolve(sys, numeric, parameters=[C]);

# Find the smaller value oc C such that the solution might be
# constructed up to L.

c0 := Cstart();

# Check if c0 is admissible.

sol(parameters=[c0]):
eval(u(y), sol(eval(L, data)));
if % < eval(k, data) then
  admissible := true
else
  admissible := false
end if;


if admissible then
  # From C=c0 find the value ck of C such that y(L)=k.

  ck := fsolve('FindC(c)'=eval(k, data), c=c0..10);

  # Instanciate the solution with C=ck

  sol(parameters=[ck]):

  # Plot it.

  plot('f(__y)', __y=eval(-L..L, data))
end if;

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 := [C = C]; _dtbl := array( 1 .. 4, [( 1 ) = (array( 1 .. 24, [( 1 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 2 ) = (datatype = float[8], order = C_order, storage = rectangular), ( 3 ) = ([0, 0, 0, Array(1..0, 1..2, {}, datatype = float[8], order = C_order)]), ( 4 ) = (Array(1..54, {(1) = 1, (2) = 1, (3) = 0, (4) = 0, (5) = 1, (6) = 0, (7) = 0, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0, (15) = 0, (16) = 0, (17) = 0, (18) = 0, (19) = 30000, (20) = 0, (21) = 0, (22) = 1, (23) = 4, (24) = 0, (25) = 1, (26) = 15, (27) = 1, (28) = 0, (29) = 1, (30) = 3, (31) = 3, (32) = 0, (33) = 1, (34) = 0, (35) = 0, (36) = 0, (37) = 0, (38) = 0, (39) = 0, (40) = 0, (41) = 0, (42) = 0, (43) = 1, (44) = 0, (45) = 0, (46) = 0, (47) = 0, (48) = 0, (49) = 0, (50) = 50, (51) = 1, (52) = 0, (53) = 0, (54) = 0}, datatype = integer[8])), ( 5 ) = (Array(1..28, {(1) = -1.0, (2) = 0.10e-5, (3) = .0, (4) = 0.500001e-14, (5) = -1.0, (6) = .0, (7) = .0, (8) = 0.10e-5, (9) = .0, (10) = .0, (11) = .0, (12) = .0, (13) = 1.0, (14) = .0, (15) = .49999999999999, (16) = .0, (17) = 1.0, (18) = 1.0, (19) = .0, (20) = .0, (21) = 1.0, (22) = 1.0, (23) = .0, (24) = .0, (25) = 0.10e-14, (26) = .0, (27) = .0, (28) = .0}, datatype = float[8], order = C_order)), ( 6 ) = (Array(1..2, {(1) = 1., (2) = Float(undefined)})), ( 7 ) = ([Array(1..4, 1..7, {(1, 1) = .0, (1, 2) = .203125, (1, 3) = .3046875, (1, 4) = .75, (1, 5) = .8125, (1, 6) = .40625, (1, 7) = .8125, (2, 1) = 0.6378173828125e-1, (2, 2) = .0, (2, 3) = .279296875, (2, 4) = .27237892150878906, (2, 5) = -0.9686851501464844e-1, (2, 6) = 0.1956939697265625e-1, (2, 7) = .5381584167480469, (3, 1) = 0.31890869140625e-1, (3, 2) = .0, (3, 3) = -.34375, (3, 4) = -.335235595703125, (3, 5) = .2296142578125, (3, 6) = .41748046875, (3, 7) = 11.480712890625, (4, 1) = 0.9710520505905151e-1, (4, 2) = .0, (4, 3) = .40350341796875, (4, 4) = 0.20297467708587646e-1, (4, 5) = -0.6054282188415527e-2, (4, 6) = -0.4770040512084961e-1, (4, 7) = .77858567237854}, datatype = float[8], order = C_order), Array(1..6, 1..6, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = 1.0, (2, 1) = .25, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = 1.0, (3, 1) = .1875, (3, 2) = .5625, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = 2.0, (4, 1) = .23583984375, (4, 2) = -.87890625, (4, 3) = .890625, (4, 4) = .0, (4, 5) = .0, (4, 6) = .2681884765625, (5, 1) = .1272735595703125, (5, 2) = -.5009765625, (5, 3) = .44921875, (5, 4) = -0.128936767578125e-1, (5, 5) = .0, (5, 6) = 0.626220703125e-1, (6, 1) = -0.927734375e-1, (6, 2) = .626220703125, (6, 3) = -.4326171875, (6, 4) = .1418304443359375, (6, 5) = -0.861053466796875e-1, (6, 6) = .3131103515625}, datatype = float[8], order = C_order), Array(1..6, {(1) = .0, (2) = .386, (3) = .21, (4) = .63, (5) = 1.0, (6) = 1.0}, datatype = float[8], order = C_order), Array(1..6, {(1) = .25, (2) = -.1043, (3) = .1035, (4) = -0.362e-1, (5) = .0, (6) = .0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 1.544, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = .9466785280815533, (3, 2) = .25570116989825814, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = 3.3148251870684886, (4, 2) = 2.896124015972123, (4, 3) = .9986419139977808, (4, 4) = .0, (4, 5) = .0, (5, 1) = 1.2212245092262748, (5, 2) = 6.019134481287752, (5, 3) = 12.537083329320874, (5, 4) = -.687886036105895, (5, 5) = .0, (6, 1) = 1.2212245092262748, (6, 2) = 6.019134481287752, (6, 3) = 12.537083329320874, (6, 4) = -.687886036105895, (6, 5) = 1.0}, datatype = float[8], order = C_order), Array(1..6, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = -5.6688, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (3, 1) = -2.4300933568337584, (3, 2) = -.20635991570891224, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (4, 1) = -.10735290581452621, (4, 2) = -9.594562251021896, (4, 3) = -20.470286148096154, (4, 4) = .0, (4, 5) = .0, (5, 1) = 7.496443313968615, (5, 2) = -10.246804314641219, (5, 3) = -33.99990352819906, (5, 4) = 11.708908932061595, (5, 5) = .0, (6, 1) = 8.083246795922411, (6, 2) = -7.981132988062785, (6, 3) = -31.52159432874373, (6, 4) = 16.319305431231363, (6, 5) = -6.0588182388340535}, datatype = float[8], order = C_order), Array(1..3, 1..5, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (2, 1) = 10.126235083446911, (2, 2) = -7.487995877607633, (2, 3) = -34.800918615557414, (2, 4) = -7.9927717075687275, (2, 5) = 1.0251377232956207, (3, 1) = -.6762803392806898, (3, 2) = 6.087714651678606, (3, 3) = 16.43084320892463, (3, 4) = 24.767225114183653, (3, 5) = -6.5943891257167815}, datatype = float[8], order = C_order)]), ( 9 ) = ([Array(1..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[8]), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order)]), ( 8 ) = ([Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..2, {(1) = .0, (2) = .0}, datatype = float[8], order = C_order), Array(1..1, {(1) = .0}, datatype = float[8], order = C_order), 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)), ( 10 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(y)]`; if -3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3 < -27 then YP[1] := undefined; return 0 end if; if .866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2)) < -9/2 then YP[1] := undefined; return 0 end if; if .866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2)) < -9/2 then YP[1] := undefined; return 0 end if; if .866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2)) < -9/2 then YP[1] := undefined; return 0 end if; if -27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)) < 0 then YP[1] := undefined; return 0 end if; if -27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)) < 0 then YP[1] := undefined; return 0 end if; if (10.4829655768356*Y[2]*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))-31.4488967305067*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))*X-2.28942848510666*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3))*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))+72*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3))*evalf(1/(-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2)) < 0 then YP[1] := undefined; return 0 end if; YP[1] := -(1/12)*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))+.288675134594814*evalf(((10.4829655768356*Y[2]*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))-31.4488967305067*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))*X-2.28942848510666*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3))*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))+72*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3))*evalf(1/(-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2)))^(1/2)); 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 13 ) = (), ( 12 ) = (), ( 15 ) = ("rkf45"), ( 14 ) = ([0, 0]), ( 18 ) = ([]), ( 19 ) = (0), ( 16 ) = ([0, 0, 0, []]), ( 17 ) = ([proc (N, X, Y, YP) option `[Y[1] = u(y)]`; if -3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3 < -27 then YP[1] := undefined; return 0 end if; if .866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2)) < -9/2 then YP[1] := undefined; return 0 end if; if .866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2)) < -9/2 then YP[1] := undefined; return 0 end if; if .866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2)) < -9/2 then YP[1] := undefined; return 0 end if; if -27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)) < 0 then YP[1] := undefined; return 0 end if; if -27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)) < 0 then YP[1] := undefined; return 0 end if; if (10.4829655768356*Y[2]*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))-31.4488967305067*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))*X-2.28942848510666*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3))*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))+72*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3))*evalf(1/(-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2)) < 0 then YP[1] := undefined; return 0 end if; YP[1] := -(1/12)*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))+.288675134594814*evalf(((10.4829655768356*Y[2]*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))-31.4488967305067*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))*X-2.28942848510666*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3))*evalf((-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2))+72*evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3))*evalf(1/(-27.4731418212799*(4.57885697021332*Y[2]-13.7365709106400*X-evalf((.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(2/3)))*evalf(1/(.866025403784440*evalf((-3456*X^3+3456*X^2*Y[2]-1152*X*Y[2]^2+128*Y[2]^3+27)^(1/2))+9/2)^(1/3)))^(1/2)))^(1/2)); 0 end proc, -1, 0, 0, 0, 0, 0, 0]), ( 22 ) = (0), ( 23 ) = (0), ( 20 ) = ([]), ( 21 ) = (0), ( 24 ) = (0)  ] ))  ] ); _y0 := Array(0..2, {(1) = -1., (2) = 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] < 100 and 100 <= _dtbl[5-_i][4][9] then _i := 5-_i; _dtbl[4] := _i; _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) elif 100 <= _dtbl[_i][4][9] then _j := round(_dtbl[_i][4][17]); return round(_dtbl[_i][3][1][_j, 1]) else return 0 end if elif _xin = "eventstatus" then if _nv = 0 then error "this solution has no events" end if; _i := [selectremove(proc (a) options operator, arrow; _dtbl[1][3][1][a, 7] = 1 end proc, {seq(_j, _j = 1 .. round(_dtbl[1][3][1][_nv+1, 1]))})]; return ':-enabled' = _i[1], ':-disabled' = _i[2] elif _xin = "eventclear" then if _nv = 0 then error "this solution has no events" end if; _i := _dtbl[4]; if _i <> 2 and _i <> 3 then error "no events to clear" end if; if _dtbl[_i][4][10] = 1 and assigned(_dtbl[5-_i]) and _dtbl[_i][4][9] < 100 and 100 < _dtbl[5-_i][4][9] then _dtbl[4] := 5-_i; _i := 5-_i end if; if _dtbl[_i][4][9] < 100 then error "no events to clear" elif _nv < _dtbl[_i][4][9]-100 then error "event error condition cannot be cleared" else _j := _dtbl[_i][4][9]-100; if irem(round(_dtbl[_i][3][1][_j, 4]), 2) = 1 then error "retriggerable events cannot be cleared" end if; _j := round(_dtbl[_i][3][1][_j, 1]); for _k to _nv do if _dtbl[_i][3][1][_k, 1] = _j then if _dtbl[_i][3][1][_k, 2] = 3 then error "range events cannot be cleared" end if; _dtbl[_i][3][1][_k, 8] := _dtbl[_i][3][1][_nv+1, 8] end if end do; _dtbl[_i][4][17] := 0; _dtbl[_i][4][9] := 0; if _dtbl[1][4][10] = 1 then if _i = 2 then try procname(procname("left")) catch:  end try else try procname(procname("right")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and member(lhs(_xin), {"eventdisable", "eventenable"}) then if _nv = 0 then error "this solution has no events" end if; if type(rhs(_xin), {('list')('posint'), ('set')('posint')}) then _i := {op(rhs(_xin))} elif type(rhs(_xin), 'posint') then _i := {rhs(_xin)} else error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; if select(proc (a) options operator, arrow; _nv < a end proc, _i) <> {} then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _k := {}; for _j to _nv do if member(round(_dtbl[1][3][1][_j, 1]), _i) then _k := `union`(_k, {_j}) end if end do; _i := _k; if lhs(_xin) = "eventdisable" then _dtbl[4] := 0; _j := [evalb(assigned(_dtbl[2]) and member(_dtbl[2][4][17], _i)), evalb(assigned(_dtbl[3]) and member(_dtbl[3][4][17], _i))]; for _k in _i do _dtbl[1][3][1][_k, 7] := 0; if assigned(_dtbl[2]) then _dtbl[2][3][1][_k, 7] := 0 end if; if assigned(_dtbl[3]) then _dtbl[3][3][1][_k, 7] := 0 end if end do; if _j[1] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[2][3][4][_k, 1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to defined init `, _dtbl[2][3][4][_k, 1]); _dtbl[2][3][1][_k, 8] := _dtbl[2][3][4][_k, 1] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to rate hysteresis init `, _dtbl[2][5][24]); _dtbl[2][3][1][_k, 8] := _dtbl[2][5][24] elif _dtbl[2][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[2][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to initial init `, _x0); _dtbl[2][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #2, event code `, _k, ` to fireinitial init `, _x0-1); _dtbl[2][3][1][_k, 8] := _x0-1 end if end do; _dtbl[2][4][17] := 0; _dtbl[2][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("left")) end if end if; if _j[2] then for _k to _nv+1 do if _k <= _nv and not type(_dtbl[3][3][4][_k, 2], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to defined init `, _dtbl[3][3][4][_k, 2]); _dtbl[3][3][1][_k, 8] := _dtbl[3][3][4][_k, 2] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to rate hysteresis init `, _dtbl[3][5][24]); _dtbl[3][3][1][_k, 8] := _dtbl[3][5][24] elif _dtbl[3][3][1][_k, 2] = 0 and irem(iquo(round(_dtbl[3][3][1][_k, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to initial init `, _x0); _dtbl[3][3][1][_k, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #3, event code `, _k, ` to fireinitial init `, _x0+1); _dtbl[3][3][1][_k, 8] := _x0+1 end if end do; _dtbl[3][4][17] := 0; _dtbl[3][4][9] := 0; if _dtbl[1][4][10] = 1 then procname(procname("right")) end if end if else for _k in _i do _dtbl[1][3][1][_k, 7] := 1 end do; _dtbl[2] := evaln(_dtbl[2]); _dtbl[3] := evaln(_dtbl[3]); _dtbl[4] := 0; if _dtbl[1][4][10] = 1 then if _x0 <= procname("right") then try procname(procname("right")) catch:  end try end if; if procname("left") <= _x0 then try procname(procname("left")) catch:  end try end if end if end if; return  elif type(_xin, `=`) and lhs(_xin) = "eventfired" then if not type(rhs(_xin), 'list') then error "'eventfired' must be specified as a list" end if; if _nv = 0 then error "this solution has no events" end if; if _dtbl[4] <> 2 and _dtbl[4] <> 3 then error "'direction' must be set prior to calling/setting 'eventfired'" end if; _i := _dtbl[4]; _val := NULL; if not assigned(_EnvEventRetriggerWarned) then _EnvEventRetriggerWarned := false end if; for _k in rhs(_xin) do if type(_k, 'integer') then _src := _k elif type(_k, 'integer' = 'anything') and type(evalf(rhs(_k)), 'numeric') then _k := lhs(_k) = evalf[max(Digits, 18)](rhs(_k)); _src := lhs(_k) else error "'eventfired' entry is not valid: %1", _k end if; if _src < 1 or round(_dtbl[1][3][1][_nv+1, 1]) < _src then error "event identifiers must be integers in the range 1..%1", round(_dtbl[1][3][1][_nv+1, 1]) end if; _src := {seq(`if`(_dtbl[1][3][1][_j, 1]-_src = 0., _j, NULL), _j = 1 .. _nv)}; if nops(_src) <> 1 then error "'eventfired' can only be set/queried for root-finding events and time/interval events" end if; _src := _src[1]; if _dtbl[1][3][1][_src, 2] <> 0. and _dtbl[1][3][1][_src, 2]-2. <> 0. then error "'eventfired' can only be set/queried for root-finding events and time/interval events" elif irem(round(_dtbl[1][3][1][_src, 4]), 2) = 1 then if _EnvEventRetriggerWarned = false then WARNING(`'eventfired' has no effect on events that retrigger`) end if; _EnvEventRetriggerWarned := true end if; if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then _val := _val, undefined elif type(_dtbl[_i][3][4][_src, _i-1], 'undefined') or _i = 2 and _dtbl[2][3][1][_src, 8] < _dtbl[2][3][4][_src, 1] or _i = 3 and _dtbl[3][3][4][_src, 2] < _dtbl[3][3][1][_src, 8] then _val := _val, _dtbl[_i][3][1][_src, 8] else _val := _val, _dtbl[_i][3][4][_src, _i-1] end if; if type(_k, `=`) then if _dtbl[_i][3][1][_src, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_src, 4]), 32), 2) = 1 then error "cannot set event code for a rate hysteresis event" end if; userinfo(3, {'events', 'eventreset'}, `manual set event code `, _src, ` to value `, rhs(_k)); _dtbl[_i][3][1][_src, 8] := rhs(_k); _dtbl[_i][3][4][_src, _i-1] := rhs(_k) end if end do; return [_val] elif type(_xin, `=`) and lhs(_xin) = "direction" then if not member(rhs(_xin), {-1, 1, ':-left', ':-right'}) then error "'direction' must be specified as either '1' or 'right' (positive) or '-1' or 'left' (negative)" end if; _src := `if`(_dtbl[4] = 2, -1, `if`(_dtbl[4] = 3, 1, undefined)); _i := `if`(member(rhs(_xin), {1, ':-right'}), 3, 2); _dtbl[4] := _i; _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #4, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if; return _src elif _xin = "eventcount" then if _dtbl[1][3][1] = 0 or _dtbl[4] <> 2 and _dtbl[4] <> 3 then return 0 else return round(_dtbl[_dtbl[4]][3][1][_nv+1, 12]) end if else return "procname" end if end if; if _xout = _x0 then return [_x0, seq(evalf(_dtbl[1][6][_vmap[_i]]), _i = 1 .. _n-_ne)] end if; _i := `if`(_x0 <= _xout, 3, 2); if _xin = "last" and 0 < _dtbl[_i][4][9] and _dtbl[_i][4][9] < 100 then _dat := eval(_dtbl[_i], 2); _j := _dat[4][20]; return [_dat[11][_j, 0], seq(_dat[11][_j, _vmap[_i]], _i = 1 .. _n-_ne-_nd), seq(_dat[8][1][_vmap[_i]], _i = _n-_ne-_nd+1 .. _n-_ne)] end if; if not type(_dtbl[_i], 'array') then _dtbl[_i] := `dsolve/numeric/SC/IVPdcopy`(_dtbl[1], `if`(assigned(_dtbl[_i]), _dtbl[_i], NULL)); if 0 < _nv then for _j to _nv+1 do if _j <= _nv and not type(_dtbl[_i][3][4][_j, _i-1], 'undefined') then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to defined init `, _dtbl[_i][3][4][_j, _i-1]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][3][4][_j, _i-1] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 32), 2) = 1 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to rate hysteresis init `, _dtbl[_i][5][24]); _dtbl[_i][3][1][_j, 8] := _dtbl[_i][5][24] elif _dtbl[_i][3][1][_j, 2] = 0 and irem(iquo(round(_dtbl[_i][3][1][_j, 4]), 2), 2) = 0 then userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to initial init `, _x0); _dtbl[_i][3][1][_j, 8] := _x0 else userinfo(3, {'events', 'eventreset'}, `reinit #5, event code `, _j, ` to fireinitial init `, _x0-2*_i+5.0); _dtbl[_i][3][1][_j, 8] := _x0-2*_i+5.0 end if end do end if end if; if _xin <> "last" then if 0 < 0 then if `dsolve/numeric/checkglobals`(op(_dtbl[1][14]), _pars, _n, _y0) then `dsolve/numeric/SC/reinitialize`(_dtbl, _y0, _n, procname, _pars, _i) end if end if; if _dtbl[1][4][7] = 0 then error "parameters must be initialized before solution can be computed" end if end if; _dat := eval(_dtbl[_i], 2); _dtbl[4] := _i; try _src := `dsolve/numeric/SC/IVPrun`(_dat, _xout) catch: userinfo(2, `dsolve/debug`, print(`Exception in solnproc:`, [lastexception][2 .. -1])); error  end try; if _src = 0 and 100 < _dat[4][9] then _val := _dat[3][1][_nv+1, 8] else _val := _dat[11][_dat[4][20], 0] end if; if _src <> 0 or _dat[4][9] <= 0 then _dtbl[1][5][1] := _xout else _dtbl[1][5][1] := _val end if; if _i = 3 and _val < _xout then Rounding := -infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further right of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further right of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further right of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further right of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further right of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further right of %1", evalf[8](_val) end if elif _i = 2 and _xout < _val then Rounding := infinity; if _dat[4][9] = 1 then error "cannot evaluate the solution further left of %1, probably a singularity", evalf[8](_val) elif _dat[4][9] = 2 then error "cannot evaluate the solution further left of %1, maxfun limit exceeded (see ?dsolve,maxfun for details)", evalf[8](_val) elif _dat[4][9] = 3 then if _dat[4][25] = 3 then error "cannot evaluate the solution past the initial point, problem may be initially singular or improperly set up" else error "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up" end if elif _dat[4][9] = 4 then error "cannot evaluate the solution further left of %1, accuracy goal cannot be achieved with specified 'minstep'", evalf[8](_val) elif _dat[4][9] = 5 then error "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem", evalf[8](_val) elif _dat[4][9] = 6 then error "cannot evaluate the solution further left of %1, cannot downgrade delay storage for problems with delay derivative order > 1, try increasing delaypts", evalf[8](_val) elif _dat[4][9] = 10 then error "cannot evaluate the solution further right of %1, interrupt requested", evalf[8](_val) elif 100 < _dat[4][9] then if _dat[4][9]-100 = _nv+1 then error "constraint projection failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+2 then error "index-1 and derivative evaluation failure on event at t=%1", evalf[8](_val) elif _dat[4][9]-100 = _nv+3 then error "maximum number of event iterations reached (%1) at t=%2", round(_dat[3][1][_nv+1, 3]), evalf[8](_val) else if _Env_dsolve_nowarnstop <> true then `dsolve/numeric/warning`(StringTools:-FormatMessage("cannot evaluate the solution further left of %1, event #%2 triggered a halt", evalf[8](_val), round(_dat[3][1][_dat[4][9]-100, 1]))) end if; Rounding := 'nearest'; _xout := _val end if else error "cannot evaluate the solution further left of %1", evalf[8](_val) end if end if; if _EnvInFsolve = true then _dig := _dat[4][26]; _dat[4][26] := _EnvDSNumericSaveDigits; _Env_dsolve_SC_native := true; if _dat[4][25] = 1 then _i := 1; _dat[4][25] := 2 else _i := _dat[4][25] end if; _val := `dsolve/numeric/SC/IVPval`(_dat, _xout, _src); _dat[4][25] := _i; _dat[4][26] := _dig; [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] else Digits := _dat[4][26]; _val := `dsolve/numeric/SC/IVPval`(eval(_dat, 2), _xout, _src); [_xout, seq(_val[_vmap[_i]], _i = 1 .. _n-_ne)] end if end proc, (2) = Array(0..0, {}), (3) = [y, u(y)], (4) = [C = C]}); _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.5

 

HFloat(3.121002019164313)

 

false

(5)

 

Download Help_mmcdara.mw



Answer to your first question.
As the output exceeds 1000000 you can't display it if you use collect in a raw way.
So here is an indirect way to collect any components of the solution wrt to any random variables. 
I am not sure that the final expressions present any interest given their complexity, but that is my opinion and the decision is yours.
290423_Chi_version1_mmcdara.mw

Answer to your last question.
Here is a notional example

restart:

with(Statistics):

A__1 := RandomVariable(Normal(0, sigma__1));
A__2 := RandomVariable(Normal(0, sigma__2));

_R

 

_R0

(1)

RV := sigma__1 * rho__12 * A__1 + sigma__2 * sqrt(1-rho__12^2) * A__2 + nu__0

sigma__1*rho__12*_R+sigma__2*(-rho__12^2+1)^(1/2)*_R0+nu__0

(2)

# Observe that RV doesn't inherit of the type "RandomVariable"

type~([A__1, A__2, RV], RandomVariable);

[true, true, false]

(3)

# You don't whant this

expand(RV*(sigma__2 * rho__12 + nu__0));

sigma__1*rho__12^2*_R*sigma__2+sigma__1*rho__12*_R*nu__0+sigma__2^2*(-rho__12^2+1)^(1/2)*_R0*rho__12+sigma__2*(-rho__12^2+1)^(1/2)*_R0*nu__0+nu__0*sigma__2*rho__12+nu__0^2

(4)

# but this

Z := 'RV'*(sigma__2 * rho__12 + nu__0);
Z;

RV*(rho__12*sigma__2+nu__0)

 

(sigma__1*rho__12*_R+sigma__2*(-rho__12^2+1)^(1/2)*_R0+nu__0)*(rho__12*sigma__2+nu__0)

(5)

Z+1;

(sigma__1*rho__12*_R+sigma__2*(-rho__12^2+1)^(1/2)*_R0+nu__0)*(rho__12*sigma__2+nu__0)+1

(6)

f(Z);

f((sigma__1*rho__12*_R+sigma__2*(-rho__12^2+1)^(1/2)*_R0+nu__0)*(rho__12*sigma__2+nu__0))

(7)

 


 

Download Last_question.mw

A proposal to "extract" the coefficients of deAFTER n has been given a value.

UPDATED file.
Case one: n has a known numeric value (which corresponds to my initial answer and to the first part of the attached file).

Case two : n is kept formal to answer your reply "...but I need ODEs with n  by considering different power of beta like 0,1,2,3,4"

restart

de := diff(u__0(y), y, y) + beta*diff(u__1(y), y, y) + beta^2*diff(u__2(y), y, y) + n*beta*(diff(u__0(y), y) + beta*diff(u__1(y), y) + beta^2*diff(u__2(y), y))^(n - 1)*(diff(u__0(y), y, y) + beta*diff(u__1(y), y, y) + beta^2*diff(u__2(y), y, y)) - diff(p__0(x), x) - beta*diff(p__1(x), x) - beta^2*diff(p__2(x), x)

diff(diff(u__0(y), y), y)+beta*(diff(diff(u__1(y), y), y))+beta^2*(diff(diff(u__2(y), y), y))+n*beta*(diff(u__0(y), y)+beta*(diff(u__1(y), y))+beta^2*(diff(u__2(y), y)))^(n-1)*(diff(diff(u__0(y), y), y)+beta*(diff(diff(u__1(y), y), y))+beta^2*(diff(diff(u__2(y), y), y)))-(diff(p__0(x), x))-beta*(diff(p__1(x), x))-beta^2*(diff(p__2(x), x))

(1)

# This procedure returns a table whose indices are the powers of beta
# and the entries their coefficients when n is set to the value defined
# by the parameter of ExtractBeta.

ExtractBeta := proc(N)
  local c := coeffs(expand(eval(de, n=N)), beta, 'b');
  table([seq(b[i]=c[i], i=1..numelems([b]))])
end proc:

T := ExtractBeta(2)

table( [( 1 ) = diff(diff(u__0(y), y), y)-(diff(p__0(x), x)), ( beta^5 ) = 2*(diff(u__2(y), y))*(diff(diff(u__2(y), y), y)), ( beta^3 ) = 2*(diff(u__0(y), y))*(diff(diff(u__2(y), y), y))+2*(diff(u__1(y), y))*(diff(diff(u__1(y), y), y))+2*(diff(u__2(y), y))*(diff(diff(u__0(y), y), y)), ( beta ) = diff(diff(u__1(y), y), y)+2*(diff(u__0(y), y))*(diff(diff(u__0(y), y), y))-(diff(p__1(x), x)), ( beta^4 ) = 2*(diff(u__1(y), y))*(diff(diff(u__2(y), y), y))+2*(diff(u__2(y), y))*(diff(diff(u__1(y), y), y)), ( beta^2 ) = diff(diff(u__2(y), y), y)+2*(diff(u__0(y), y))*(diff(diff(u__1(y), y), y))+2*(diff(u__1(y), y))*(diff(diff(u__0(y), y), y))-(diff(p__2(x), x)) ] )

(2)


Without giving n a numeric value.

restart:

# Let A=beta and B=beta^2, and define f this way

f := (p+q*A+r*B)^n

(A*q+B*r+p)^n

(3)

# The multinomial coefficient of A^s*B^t (=beta^(s+2*t)) in the expansion of f
# has expression:


MultinomialCoeff := (n, s, t) -> n!/((n-s-t)!*s!*t!) * p^(n-s-t) * q^(s) * r^(t);

proc (n, s, t) options operator, arrow; factorial(n)*p^(n-s-t)*q^s*r^t/(factorial(n-s-t)*factorial(s)*factorial(t)) end proc

(4)

# The set of all couples couples (s, t) such that s+2*t has a given value u
# can be obtained using combinat:-composition.

st_set := proc(u)
  if   u >= 3 then map(x -> [x[1], x[2]/2], select((x -> x[2]::even), combinat:-composition(u, 2))):
  elif u =  2 then {[2, 0], [0, 1]}:
  elif u =  1 then {[1, 0]}:
  else      {[0, 0]}
  end if:
end proc:

# Examples

st_set(1);
st_set(2);
st_set(6);

{[1, 0]}

 

{[0, 1], [2, 0]}

 

{[2, 2], [4, 1]}

(5)

# Let u some positive integer.
# Compute the multinomial coefficient of beta^u in the expansion of f.

MultinomialCoeffBeta := proc(n, u)
  local MC, st_set:
  MC     := (n, s, t) -> n!/((n-s-t)!*s!*t!) * p^(n-s-t) * q^(s) * r^(t);
  st_set := proc(u)
    if   u >= 3 then map(x -> [x[1], x[2]/2], select((x -> x[2]::even), combinat:-composition(u, 2))):
    elif u =  2 then {[2, 0], [0, 1]}:
    elif u =  1 then {[1, 0]}:
    else      {[0, 0]}
    end if:
  end proc:
  add(MC(n, op(x)), x in st_set(u))
end proc:

# Examples

MultinomialCoeffBeta(n, 0);
MultinomialCoeffBeta(n, 1);
MultinomialCoeffBeta(n, 2);
MultinomialCoeffBeta(n, 6);

p^n

 

factorial(n)*p^(n-1)*q/factorial(n-1)

 

factorial(n)*p^(n-1)*r/factorial(n-1)+(1/2)*factorial(n)*p^(n-2)*q^2/factorial(n-2)

 

(1/4)*factorial(n)*p^(n-4)*q^2*r^2/factorial(n-4)+(1/24)*factorial(n)*p^(n-5)*q^4*r/factorial(n-5)

(6)

# Consider now the following expression:

g := (p+q*A+r*B)^n * (P+Q*A+R*B);

(A*q+B*r+p)^n*(A*Q+B*R+P)

(7)

# How to find the expression of beta^u in the expansion of g?
# Expanding g gives:

g := expand(g);

(A*q+B*r+p)^n*Q*A+(A*q+B*r+p)^n*R*B+(A*q+B*r+p)^n*P

(8)

# Then the coefficient of beta^u comes from three sources:
# source 1: this is MultinomialCoeffBeta(n, u) * P
# source 2: this is MultinomialCoeffBeta(n, u-1) * Q
# source 3: this is MultinomialCoeffBeta(n, u-2) * R

# Example

P*MultinomialCoeffBeta(n, 6) + Q*MultinomialCoeffBeta(n, 5) + R*MultinomialCoeffBeta(n, 4)

P*((1/4)*factorial(n)*p^(n-4)*q^2*r^2/factorial(n-4)+(1/24)*factorial(n)*p^(n-5)*q^4*r/factorial(n-5))+Q*((1/2)*factorial(n)*p^(n-3)*q*r^2/factorial(n-3)+(1/6)*factorial(n)*p^(n-4)*q^3*r/factorial(n-4))+(1/2)*R*factorial(n)*p^(n-3)*q^2*r/factorial(n-3)

(9)

simplify(%, size);

(1/4)*r*(factorial(n-5)*factorial(n-3)*q*(P*r+(2/3)*Q*q)*p^(n-4)+(1/6)*factorial(n-4)*(12*factorial(n-5)*(Q*r+R*q)*p^(n-3)+p^(n-5)*factorial(n-3)*P*q^3))*q*factorial(n)/(factorial(n-4)*factorial(n-5)*factorial(n-3))

(10)

# Your expression de is made of 3 terms:

Term_1 := diff(u__0(y), y, y) + beta*diff(u__1(y), y, y) + beta^2*diff(u__2(y), y, y);
Term_2 := n*beta*(diff(u__0(y), y) + beta*diff(u__1(y), y) + beta^2*diff(u__2(y), y))^(n - 1)*(diff(u__0(y), y, y) + beta*diff(u__1(y), y, y) + beta^2*diff(u__2(y), y, y));
Term_3 :=  - diff(p__0(x), x) - beta*diff(p__1(x), x) - beta^2*diff(p__2(x), x)

diff(diff(u__0(y), y), y)+beta*(diff(diff(u__1(y), y), y))+beta^2*(diff(diff(u__2(y), y), y))

 

n*beta*(diff(u__0(y), y)+beta*(diff(u__1(y), y))+beta^2*(diff(u__2(y), y)))^(n-1)*(diff(diff(u__0(y), y), y)+beta*(diff(diff(u__1(y), y), y))+beta^2*(diff(diff(u__2(y), y), y)))

 

-(diff(p__0(x), x))-beta*(diff(p__1(x), x))-beta^2*(diff(p__2(x), x))

(11)

# Applying the previous rules enables computing the coefficient of beta^u in Term_2:


Coeff_2 := proc(u)
  if u = 0 then
    0:
  elif u = 1 then
   n*P*MultinomialCoeffBeta(n-1, u-1):
  elif u = 2 then
   n*(P*MultinomialCoeffBeta(n-1, u-1) + Q*MultinomialCoeffBeta(n-1, u-2)):
  else
   n*(P*MultinomialCoeffBeta(n-1, u-1) + Q*MultinomialCoeffBeta(n-1, u-2) + R*MultinomialCoeffBeta(n-1, u-3)):
  end if:
end proc:

Coeff_2(0);
Coeff_2(1);
Coeff_2(2);
Coeff_2(6);

0

 

n*P*p^(n-1)

 

n*(P*factorial(n-1)*p^(n-2)*q/factorial(n-2)+Q*p^(n-1))

 

n*(P*((1/2)*factorial(n-1)*p^(n-4)*q*r^2/factorial(n-4)+(1/6)*factorial(n-1)*p^(n-5)*q^3*r/factorial(n-5))+(1/2)*Q*factorial(n-1)*p^(n-4)*q^2*r/factorial(n-4)+R*factorial(n-1)*p^(n-3)*q*r/factorial(n-3))

(12)

# Define the substitution rules

Equivalences := [p, q, r, P, Q, R] =~ [coeffs(op(1, op(-2, Term_2)), beta), coeffs(op(-1, Term_2), beta)]

[p = diff(u__0(y), y), q = diff(u__1(y), y), r = diff(u__2(y), y), P = diff(diff(u__0(y), y), y), Q = diff(diff(u__1(y), y), y), R = diff(diff(u__2(y), y), y)]

(13)

# And apply them to compute the "true" coefficient of betaû in Term_2
# Example 1

eval(Coeff_2(0), Equivalences);
print();
eval(Coeff_2(1), Equivalences);
print();
eval(Coeff_2(2), Equivalences);

0

 

 

n*(diff(diff(u__0(y), y), y))*(diff(u__0(y), y))^(n-1)

 

 

n*((diff(diff(u__0(y), y), y))*factorial(n-1)*(diff(u__0(y), y))^(n-2)*(diff(u__1(y), y))/factorial(n-2)+(diff(diff(u__1(y), y), y))*(diff(u__0(y), y))^(n-1))

(14)

# Example 2

eval(Coeff_2(6), Equivalences)

n*((diff(diff(u__0(y), y), y))*((1/2)*factorial(n-1)*(diff(u__0(y), y))^(n-4)*(diff(u__1(y), y))*(diff(u__2(y), y))^2/factorial(n-4)+(1/6)*factorial(n-1)*(diff(u__0(y), y))^(n-5)*(diff(u__1(y), y))^3*(diff(u__2(y), y))/factorial(n-5))+(1/2)*(diff(diff(u__1(y), y), y))*factorial(n-1)*(diff(u__0(y), y))^(n-4)*(diff(u__1(y), y))^2*(diff(u__2(y), y))/factorial(n-4)+(diff(diff(u__2(y), y), y))*factorial(n-1)*(diff(u__0(y), y))^(n-3)*(diff(u__1(y), y))*(diff(u__2(y), y))/factorial(n-3))

(15)

# For term_1, obviously:

Coeff_1 := proc(u)
  if u < 3 then coeffs(Term_1, beta)[u+1]
  else     0
  end if:
end proc:

# Examples

Coeff_1(0);
Coeff_1(1);
Coeff_1(2);
Coeff_1(3);

diff(diff(u__0(y), y), y)

 

diff(diff(u__1(y), y), y)

 

diff(diff(u__2(y), y), y)

 

0

(16)

# At last, for Term_3

Coeff_3 := proc(u)
  if u < 3 then coeffs(Term_3, beta)[u+1]
  else     0
  end if:
end proc:

# Examples

Coeff_3(0);
Coeff_3(1);
Coeff_3(2);
Coeff_3(3);

-(diff(p__0(x), x))

 

-(diff(p__1(x), x))

 

-(diff(p__2(x), x))

 

0

(17)

# It remains to aggregate these three partial results

Coeff_Beta := proc(u)
  Coeff_1(u) + eval(Coeff_2(u), Equivalences) + Coeff_3(u)
end proc:

# Examples

Coeff_Beta(0);
print():
Coeff_Beta(1);
print():
Coeff_Beta(2);
print():
Coeff_Beta(3);

diff(diff(u__0(y), y), y)-(diff(p__0(x), x))

 

 

diff(diff(u__1(y), y), y)+n*(diff(diff(u__0(y), y), y))*(diff(u__0(y), y))^(n-1)-(diff(p__1(x), x))

 

 

diff(diff(u__2(y), y), y)+n*((diff(diff(u__0(y), y), y))*factorial(n-1)*(diff(u__0(y), y))^(n-2)*(diff(u__1(y), y))/factorial(n-2)+(diff(diff(u__1(y), y), y))*(diff(u__0(y), y))^(n-1))-(diff(p__2(x), x))

 

 

n*((diff(diff(u__0(y), y), y))*(factorial(n-1)*(diff(u__0(y), y))^(n-2)*(diff(u__2(y), y))/factorial(n-2)+(1/2)*factorial(n-1)*(diff(u__0(y), y))^(n-3)*(diff(u__1(y), y))^2/factorial(n-3))+(diff(diff(u__1(y), y), y))*factorial(n-1)*(diff(u__0(y), y))^(n-2)*(diff(u__1(y), y))/factorial(n-2)+(diff(diff(u__2(y), y), y))*(diff(u__0(y), y))^(n-1))

(18)

 

Download Help_ODE_mmcdara_2.mw

you can do this:

restart


As soon as the expression is of type `*` you can do this

f := sqrt(a*(a+b+c))/(a*b+a*c+b*c)

(a*(a+b+c))^(1/2)/(a*b+a*c+b*c)

(1)

g := (a*b+a*c+b*c)*((1/3)*a+(1/3)*b+(1/3)*c)^(1/3)

(a*b+a*c+b*c)*((1/3)*a+(1/3)*b+(1/3)*c)^(1/3)

(2)

map(t -> if patmatch(t, a::anything^n::fraction,'p') then eval(1/n, p) end if, [op(f)])

[2]

(3)

map(t -> if patmatch(t, a::anything^n::fraction,'p') then eval(1/n, p) end if, [op(g)])

[3]

(4)


counter example

map(t -> if patmatch(t, a::anything^n::fraction,'p') then eval(1/n, p) end if, [op(f+g)])

[]

(5)


For more general expession types  `*` you can do this

map(t -> if patmatch(t, a::anything^n::fraction,'p') then eval(1/n, p) end if, indets(f));
map(t -> if patmatch(t, a::anything^n::fraction,'p') then eval(1/n, p) end if, indets(g));
map(t -> if patmatch(t, a::anything^n::fraction,'p') then eval(1/n, p) end if, indets(f+g));

{2}

 

{3}

 

{2, 3}

(6)


What do you expect in this case? 2 or 4 ?

h := f^(1/2);
map(t -> if patmatch(t, a::anything^n::fraction,'p') then eval(1/n, p) end if, indets(h));

((a*(a+b+c))^(1/2)/(a*b+a*c+b*c))^(1/2)

 

{2}

(7)

 

Download patmatch.mw


See the attached file
Pb_alias.mw

Every time you invoke, let's say U(theta), it's enough to write U instead.



If you have 50 regressors (intercept put aside) you have 50elementary effects50*49/2= 1225 order 1 interactions(or 51*50/2 = 1275) if you account for quadratic effets, and more generally a total of (50+d)!/(50!*d)!effects if you limit yourself to complete polynomials of total order d(intercept included).

When you use a stepwise regressionyou specify the minimum model (usually "1" to say that it could be constant) and the maximum one, which has 1326terms with 50regressors (quadratic effects includes), or 23426terms if you also want to account for order 2 interactions (interactions involving 3 regressors) and cubic effects.

If reallyyou want to do that, use a statistical software instead of Matlab, and if you don't want to spend money and look for a World reference, use R.
And go post your questions here https://community.rstudio.com/.

More generally, when you are dealing with a high-dimensional problem (and 50may already be a high dimension depending on what you want to achieve) you face the so-called curse of dimensionality, which is a common term to say tgat you are in deep s..t if you proceed roughly and without methodology.
"Methodology" always means trying to reduce the dimension of the problem, and one approach could be Sensitivity Analysis(SA).

Being capable to solve a high dimension problem, sorry to say that, is what mkes the difference between a statistician and someone who heard about a method (stepwise regression for instance, or PCR or PLS like in some of your previous questions) and do not know their capabilities, limitations, conditions of use, and is ignorant of the statistical methodology.

I can give you two advices: 

  1. start studying books or courses on data analysis, those that are more practical than theoretical and which focus on the methodology and not on particular techniques.
    You can see here https://www.gdr-mascotnum.fr/ to try and find some ideas.
     
  2. After you are familiar with the methodology, go to an forum (see bove) and ask your questions.
    There are also several excellent books onRthat explain how to approach concrete problems.
     

Maple is a general purpose tool. It reaches excellence in some domains and it is weak on some others.
In particular, despite some packages like CurveFitting, DeepLearning and specially Statistics, it cannot compare to R or SPSS to cite a few (which in turn both have almost zero cabilities in computer algebra).
You have an exotic problem to solve? Use the correct tool! 
 


@C_R is right.

But if you seek for a 5-uple which verifies almost exactly the equations you can do this:

J   := add(fa[i]^2, i=1..6):
opt := Optimization:-Minimize(sqrt(J), iterationlimit=100)
Warning, limiting number of major iterations has been reached
[                      -10                                       
[4.10501055530149644 10   , [U[0] = HFloat(7.01309745602936e-5), 

  V[0] = HFloat(-6.489610924321912e-5), 

  W[0] = HFloat(-3.4133357940097986e-4), 

  Z[0] = HFloat(4.557011539226921e-5), 

                                      ]
  r[0] = HFloat(3.536008624037784e-4)]]

# substituting the optimizer within the 6 equations gives almost 0
eval([seq(fa[i], i=1..6)], opt[2]);
[HFloat(1.2696690084905257e-11), HFloat(-2.3564374807767145e-12), 

  HFloat(3.2706322945133913e-12), HFloat(2.5254566668356693e-11), 

  HFloat(-1.8185399678621357e-10), HFloat(3.669127846427833e-10)]


REMARK 1: starting from another point could lead to another minimizer (look to Optimization:-Minimize for more details).

REMARK 2: fa[6]=0 ==> U[0] = V[0] = W[0] = Z[0] = r[0] = 0.
Unfortunately some fa[i] are of the form 0/0... unless these inderminate forms are both equal to some constant.

REMARK 3: assuming r[0] <> 0, then fa[i]=0 ==> numer(fa[i])=0 for each i=1..5,.
More of this each numer(fa[i]) is an homogenous polynomial.
Let P one of these  polynomial and V the sequence of its indeterminates.
Then P(C*V) = Cd*P(V) where d is thetotal degree of P.
This suggests that if  M is a minimizer of J (see the above code), then C*M will be another one:

evalf[3]( eval([seq(fa[i], i=1..6)], (lhs=rhs/100)~(opt[2])) );
[       -15          -16         -16         -15          -14  
[1.26 10   , -2.35 10   , 3.27 10   , 2.53 10   , -1.81 10   , 

         -14]
  3.65 10   ]
evalf[3]( eval([seq(fa[i], i=1..6)], (lhs=rhs/10^10)~(opt[2])) );
[       -31          -32         -32         -31          -30  
[1.26 10   , -2.35 10   , 3.27 10   , 2.53 10   , -1.81 10   , 

         -30]
  3.65 10   ]

So one can infer that U[0] = V[0] = W[0] = Z[0] = r[0] = 0 is indeed the solution provided that limit(U[0]/r[0], r[0]), limit(V[0]/r[0], r[0]),  limit(W[0]/r[0], r[0]), limit(Z[0]/r[0], r[0]) are both equal to some constant. These constants are:

eval([U[0]/r[0], V[0]/r[0], W[0]/r[0], Z[0]/r[0]], opt[2])
  [HFloat(0.19833372035221658), HFloat(-0.18352927309638167), 

    HFloat(-0.9653075421835637), HFloat(0.12887444640967105)]

 


Thera are many ways to fix your code ( @Carl Love already gave you one).
They depend essentially on what you want to do with the solutions you have obtained (the 3 couples (Rm, Xm)).
The attached file presents some of these ways.
Many_ways.mw

But one thing puzzles me: you wrote "I have the numbers of a bode plot (abs and phase) and I want to fit it in an equivalent circuit."
Your equivalent circuit in made of 2 impedances, one real (Rs) with known value  (50) , the other is complex with real part Rm and imaginary part Xm.
Either this second impedance has a value which depends on the frequency, or it has a constant value whatever the frequency.
In the first case it makes sense to computes Rm and Xm for each frequency; but this would no longer make sense in the second case where a real fit (for instance in the least-squares sense) would be more appropriate.


Here is the way to generate the R source file which codes what you wantedto achieve in your toy_try.mw file.
 

restart*with(GraphTheory):

with(ListTools):

G := CycleGraph(7):

E := Edges(G)

{{1, 2}, {1, 7}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {6, 7}}

(1)

EL     := [convert~(E, list)[]]:
__from := map2(op, 1, EL):
__to   := map2(op, 2, EL):

sprintf(cat(seq("""%d"",", k=1..numelems(__from))), op(__from)):
R_from := cat("From <- c(", %[1..-2], ")");
sprintf(cat(seq("""%d"",", k=1..numelems(__to))), op(__to)):
R_to := cat("To <- c(", %[1..-2], ")");

R_ft := "ft <- cbind(From, To)";
R_gr := "graph1 <- ftM2graphNEL(ft)";

MyRsource := cat(currentdir(), "/graph.R"):

writeline(MyRsource, R_from):
writeline(MyRsource, R_to):
writeline(MyRsource, R_ft):
writeline(MyRsource, R_gr):
fclose(MyRsource)
 

"From <- c("1","1","2","3","4","5","6")"

 

"To <- c("2","7","3","4","5","6","7")"

 

"ft <- cbind(From, To)"

 

"graph1 < -ftM2graphNEL(ft)"

(2)

 

toy_try_mmcdara.mw

This workwheet produces a text file named graph.R located in currentdir().
Assuming you use Rstudio:

  • Open Rstudio.
  • If not already done install package matrix2Graph.
  • Double click on graph.R.
  • Execute the code.
     

In the Rstudio main view the content of graph.R looks like this


PS I didn't run the code for matrix2Graph is not compatible with my R version and because I never use packages that are not in the official R repository https://cran.r-project.org/  (igraph for instance).

 

restart:
A := isolve(n >= 20);
about(_NN1)
                        {n = 20 + _NN1}
Originally _NN1, renamed _NN1~:
  is assumed to be: AndProp(integer,RealRange(0,infinity))

B := isolve(2*k+1 >=0);
about(_NN2)
                           {k = _NN2}
Originally _NN2, renamed _NN2~:
  is assumed to be: AndProp(integer,RealRange(0,infinity))

C := isolve(3*k-1 >=0);
about(_NN3)
                         {k = 1 + _NN3}
Originally _NN3, renamed _NN3~:
  is assumed to be: AndProp(integer,RealRange(0,infinity))

A intersect B intersect C
                               {}
# But :

`A inter B inter C` := isolve({k >= 20, 2*k+1 >= 0, 3*k-1 >= 0});
                        {k = 20 + _NN4}
about(_NN4)
Originally _NN4, renamed _NN4~:
  is assumed to be: AndProp(integer,RealRange(0,infinity))

# A less trivial example


restart:
A := isolve(n >= 20);
about(_NN1)
                        {n = 20 + _NN1}
Originally _NN1, renamed _NN1~:
  is assumed to be: AndProp(integer,RealRange(0,infinity))

B := isolve(2*k+1 <= 40);
about(_NN2)
                        {k = 19 - _NN2}
Originally _NN2, renamed _NN2~:
  is assumed to be: AndProp(integer,RealRange(0,infinity))

C := isolve((3*k-1)/2 >= 12);
about(_NN3)
                         {k = 9 + _NN3}
Originally _NN3, renamed _NN3~:
  is assumed to be: AndProp(integer,RealRange(0,infinity))

`A inter B inter C` := isolve({k >= 10, 2*k+1 <= 40, (3*k-1)/2 >= 12});
  {k = 10}, {k = 11}, {k = 12}, {k = 13}, {k = 14}, {k = 15}, {k = 16}, {k = 17}, {k = 18}, {k = 19}






Download Proposal.mw

First possible mistake: Are you sure that you shouldn't have written

eqns := [Eq13, Eq14, BodyEq1, BodyEq2, BodyEq3, BodyEq4, S__R__1, S__L__1, Joint1R_d, Joint1L_d, S__R__2, S__L__2, shear_SR2, shear_SL2, MSR2_Eq1, MSR2_Eq2, MSL2_Eq1, MSL2_Eq2, A_Eq1, A_Eq2, B_Eq1, B_Eq2]

instead of

eqns := [Eq13, Eq14, BodyEq1, BodyEq2, BodyEq3, BodyEq3, S__R__1, S__L__1, Joint1R_d, Joint1L_d, S__R__2, S__L__2, shear_SR2, shear_SL2, MSR2_Eq1, MSR2_Eq2, MSL2_Eq1, MSL2_Eq2, A_Eq1, A_Eq2, B_Eq1, B_Eq2]

?

Second possible mistake: lines 21 and 22 of AA are identical, which means that B_Eq1= B_Eq2... which is obvious from their definitions (you can  check, if you are patient enough, that Determinant(AA[1..21, 1..21]) <> 0)

So, shouldn't you have written 

B_Eq2 := subs(x = l__nL__2, phiL2prim2) = 0

instead of

B_Eq2 := subs(x = l__nL__2, phiL2prim3) = 0

?

So, correct your errors in the definition of (probably) B_Eq2 and run your code again (once again, this will take time to get the expression of this determinant).

Guessing that this question comes from some math chalenge, here is a way to get the solution by hand (even if I used Maple for the purpose of clarity).

restart:

f := x -> (x^2+1)/(x^2-1)

proc (x) options operator, arrow; (x^2+1)/(x^2-1) end proc

(1)

# As f is summetric the centre (Omega) of the circle C is on the vertical axis.
# Let (0, h) the coordinates of Omega.
# One has f(0)=-1.
# Let R the radius of C, then R = h+1.
#
# Let's take the branch of f defined by x > 1and search the point P of
# coordinates (X, Y=f(X)) such that (X-0)^2+(Y-h)^2=(h+1)^2:


CircleEquation = X^2+(f(X)-(R-1))^2 - R^2;

# As X > 1 on gets this relation


rel := numer(expand(rhs(%)))

CircleEquation = X^2+((X^2+1)/(X^2-1)-R+1)^2-R^2

 

-X^2*(-X^4+4*R*X^2-2*X^2-4*R-1)

(2)

# Clearly only the  term in parenthesis matters.
# Set X^2 = Z

rel1 := collect(algsubs(X^2=Z, op(-1, rel)), Z)

-Z^2+(4*R-2)*Z-4*R-1

(3)

# As we are looking for a tangence point, the discriminant of this
# equation must be equal to 0.
discrim(rel1, Z);
solve({%=0, R > 0}, R)

16*R^2-32*R

 

{R = 2}

(4)

# Thus R = 2 and the circle C has center (0, R-1=1)

R_circle := 2:
 

# Contact point for X > 1.
# As the squareroot ithin sol is equal to 0, one has

Z_contact := 2*R_circle - 1;

# And so:

X_contact := surd(Z_contact, 2);
Y_contact := (Z_contact+1) / (Z_contact-1);

3

 

3^(1/2)

 

2

(5)

# The contact point for X < 1 has coordinates

[-X_contact, Y_contact]

[-3^(1/2), 2]

(6)

 

Download By_hand.mw


THE FILE  calc_slip_two_cylinders_electo.mw  CORRESPONDS TO YOUR PREVIOUS QUESTION, TO WHICH I HAVE ALREADY GIVEN A SOLUTION.

calc_slip_two_cylinders_electo_mmcdara.mw


 

First 10 11 12 13 14 15 16 Last Page 12 of 52