tomleslie

4601 Reputation

10 Badges

9 years, 120 days

MaplePrimes Activity


These are answers submitted by tomleslie

This is one of these case where (as Carl has said), it is probably easier to rewrite your ODE using brain-power rather than Maple. On the other hand, you can use the latter if you want to - see the attached

  restart;
  expr:= dx+4*x*dy/y = dy*a*y^(-6*b-1);
  dsolve(algsubs(dy/dx=diff(y(x),x),subs(y=y(x),expand(expr/dx)) ));

dx+4*x*dy/y = dy*a*y^(-6*b-1)

 

x+(1/2)*y(x)^(-6*b)*a/(3*b-2)-_C1/y(x)^4 = 0

(1)

 

Download solveODE.mw

 

see the attached

  restart;
  c := x -> piecewise(0 <= x and x <= 450000, 0.37*x, 450000 < x, 0.37*x + 0.06*(x - 450000)):
  g := x -> piecewise(0 <= x and x <= 558000, 0.37*x, 558000 < x, 0.37*x + 0.12*(x - 558000)):
  plots:-animate( plot,
                  [ [g(x), c(x)],
                    x = 0..skat,
                    color = [red, blue],
                    legend=['g(x)', 'c(x)']
                  ],
                  frames = 20,
                  skat = 0 .. 1000000
                );

 

 

 

Download animleg.mw

see the attached

restart;
interface(version);
Physics:-Version();
sys:=[diff(Y(x, t), t, t) = 0, Y(x, 0) = 0, (D[2](Y))(x, 1) = 0];
pdsolve(sys);

`Standard Worksheet Interface, Maple 2018.2, Windows 7, November 16 2018 Build ID 1362973`

 

"C:\Users\TomLeslie\maple\toolbox\2018\Physics Updates\lib\Physics Updates.maple", `2019, March 14, 23:22 hours, version in the MapleCloud: 375, version installed in this computer: 326.`

 

[diff(diff(Y(x, t), t), t) = 0, Y(x, 0) = 0, (D[2](Y))(x, 1) = 0]

 

Y(x, t) = 0

(1)

 

Download pdeProb.mw

as in

restart;
m1 := Matrix([[x[0,0]=1,x[0,1]=1,x[0,2]=0,x[0,3]=0,x[0,4]=0,x[0,5]=0],
              [x[1,0]=0,x[1,1]=0,x[1,2]=1,x[1,3]=1,x[1,4]=0,x[1,5]=0],
              [x[2,0]=0,x[2,1]=0,x[2,2]=0,x[2,3]=0,x[2,4]=1,x[2,5]=1]
             ]
            );
m2:=rhs~(m1);

 

but the attached *may* be what you want

expr:=u[1](T[1], T[2], T[3])=exp(T[1]*I);
diff(expr, indets(rhs(expr),name)[]);

u[1](T[1], T[2], T[3]) = exp(I*T[1])

 

diff(u[1](T[1], T[2], T[3]), T[1]) = I*exp(I*T[1])

(1)

 

Download doDiff.mw

The method shown in the attached is pretty 'ugly', but it seems to work

  restart;
  getOrd:= (f1, f2)-> max
                      ( PDETools:-difforder
                                  ( select
                                    ( i-> has(i, diff(f2,t)),
                                      convert
                                      ( indets(f1, function),
                                        list
                                      )
                                    )
                                  )
                      ):

  f:= 2*y*(diff(x(t), t))^2+3*(diff(x(t), t$3))-3*x*(diff(y(t), t));
  getOrd(f, y(t));
  getOrd(f, x(t));

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

 

1

 

3

(1)

 

Download getOrder.mw

some of which are probably more "elegant" than my attempt in the attached

  restart;
  plot3d( sin(x*y),
          x = -2 .. 2,
          y = -2 .. 2,
          axes = framed,
          colorscheme = [ "zgradient",
                          ["Blue", "Green", "Yellow", "Red"]
                        ]
        );

 

  doContour:= proc( nsteps::posint)
                    local j;
                    uses plots, ColorTools:
                    return display
                           ( [ seq
                               ( implicitplot
                                 ( sin(x*y)=-1+2*(j-1)/nsteps,
                                   x = -2 .. 2,
                                   y = -2 .. 2,
                                   axes = framed,
                                   color = WavelengthToColor
                                           ( 450+(j-1)*(625-450)/nsteps,
                                             method="linear"
                                           ),
                                   if   type(j, odd)
                                   then legend=(-1+2*(j-1)/nsteps)
                                   else NULL
                                   fi,
                                   scaling=constrained,
                                   size=[800,800]
                                 ),
                                 j = 1..nsteps+1
                               )
                             ]
                           );
              end proc:

 doContour(10);
 doContour(20);
 doContour(100);

 

 

 

 

 

 

Download conPlot.mw

 

 

 

of your animate() command is a bit "unusual". In fact I was mildly urprsed that it "worked" at all!

If I convert it to follow the standard technique explained in the "help", then the line properties appear to be retained. See the attached

with(plots):
A := animate( plot,
              [ X+t,
                X = -10 .. 10,
                color = red,
                linestyle = dash
              ],
              t = -10 .. 10
            ):
B := animate( plot,
              [ t^2+X,
                X = -10 .. 10,
                color = blue,
                linestyle = solid
              ],
              t = -10 .. 10
            ):
display([A, B]);

 

 

Download doAnim.mw

that it is impossible to list them all.

And so many that it is also impossible (for me at least) to figure out what you actually want.

See the attached for details of basix syntax (and other) problems. Be aware I got bored and stopped identifying errors about half way through your worksheet


 

``

restart; lambda := 0.5e6; A__h := 100; `&beta;__1` := 0.34e-1; `&psi;__o` := 0.25e-1; mu := 0.4e-3; theta := .7902; alpha := .11; k := 0.136e-3; z := 0.5e-1; delta := .7; eta := .134; xi := .12; beta := 0.1e-1; Q1 := 1; Q2 := 1; h := .1; n := 100; lambda[1][n] := 0; lambda[2][n] := 0; lambda[3][n] := 0; `&lambda;__4`[n] := 0; u[o][0] := 0

for i from 0 to n-1 do B[i+1] := h*(theta*E[i]+A__h+B[i])/(1+`&psi;__o`*h*P[i]/(P[i]+xi)+mu+u[o][i]+beta*C[i]); C[i+1] := h*B[i+1][beta*C[i]-psi[o]*P[i]/(P[i]+xi)]-(alpha+mu+k)*C[i+1]; P[i+1] := h*z*C[i+1]/(1+delta+eta); E[i+1] := h*(alpha*C[i+1]+B[i+1]*u[o][i]+E[i])/(1+theta+mu); lambda[1][n-k-1] := -h*[Q1+(beta*C[i]+psi[o]*P[i]/(P[i]+xi))*lambda[2][n-k]-lambda[1][n-k]-mu+u[o][i]]/(1+beta*C[i]+P[i]/(P[i]+xi)); lambda[2][n-k-1] := -h*[-beta*B[i+1]*lambda[1][n-k-1]+Q2-alpha-mu-kappa+z*lambda[3][n-k]+alpha*lambda[4][n-k]-lambda[2][n-k]]/(-beta*B[i+1]+1); lambda[3][n-k-1] := h*[(psi[o]*B[i+1]*P[i+1]/(P[i+1]+xi)^2+theta)*lambda[1][n-k-1]-lambda[2][n-k-1]*psi[o]*B[i+1]*P[i+1]/(P[i+1]+xi)^2-lambda[3][n-k]]/(1+delta+eta); lambda[4][n-k-1] := h*lambda[4][n-k]/(1-theta-mu); R1 := (lambda[1][n-k-1]-lambda[4][n-k-1])*S[i+1]/tau; u[o][i+1] := min(1, max(R1, 0)) end do

Error, recursive assignment

 

seq(i, i = 0 .. 30); seq(B[i], i = 0 .. 30)

restart; lambda := 0.5e6; with(plots); with(DEtools); ODE1 := diff(B(T), T) = A__h-beta[1]*B(T)*C(T)-psi[o]*B(T)*P(T)/(P(T)+xi)-mu*B(T)+theta*E(T); ODE2 := diff(C(T), T) = beta[1]*B(T)*C(T)-psi[o]*B(T)*P(T)/(P(T)+xi)-(alpha+mu+k)*C(T); ODE3 := diff(P(T), T) = z*P(T)-(delta+eta)*P(T); ODE4 := diff(E(T), T) = alpha*C(T)-(theta+mu)*E(T); SIRsys := [ODE1, ODE2, ODE3, ODE4]; Bplot := ODEplot(SIRsys, [B(T), C(T), P(T), E(T)], T = 0 .. 100, B = 0.167e9 .. 0.17e9, [[B(0) = 0.17e9, C(0) = 0, P(0) = 400, E(0) = 20]], scene = [T, B(T)], thickness = 2, linecolor = red, stepsize = .1); Cplot := ODEplot(SIRsys, [B(T), C(T), P(T), E(T)], T = 0 .. 100, C = 0 .. 400, [[B(0) = 0.17e9, C(0) = 0, P(0) = 400, E(0) = 20]], scene = [T, C(t)], thickness = 2, linecolor = red, stepsize = .1); Pplot := ODEplot(SIRsys, [B(T), C(T), P(T), E(T)], T = 0 .. 100, P = 0 .. 0.1e4, [[B(0) = 0.17e9, C(0) = 0, P(0) = 400, E(0) = 20]], scene = [T, P(T)], thickness = 2, linecolor = red, stepsize = .1); Eplot := ODEplot(SIRsys, [B(T), C(T), P(T), E(T)], T = 0 .. 100, E = 0 .. 0.1e4, [[B(0) = 0.17e9, C(0) = 0, P(0) = 400, E(0) = 20]], scene = [T, E(t)], thickness = 2, linecolor = red, stepsize = .1); A := `<|>`(`<,>`(seq(i, i = 0 .. 100)), `<,>`(seq(B[i], i = 0 .. 100))); p1 := pointplot(A, color = blue, symbol = diamond); display([p1, Bplot])

SIRsys := [diff(B(T), T) = 100-0.1e-1[1]*B(T)*C(T)-psi[o]*B(T)*P(T)/(P(T)+.12)-0.4e-3*B(T)+.7902*E(T), diff(C(T), T) = 0.1e-1[1]*B(T)*C(T)-psi[o]*B(T)*P(T)/(P(T)+.12)-.110536*C(T), diff(P(T), T) = -.784*P(T), diff(E(T), T) = .11*C(T)-.7906*E(T)]

 

_rtable[18446744074400619086]

 

Error, (in plots:-pointplot) points cannot be converted to floating-point values

 

Error, (in plots:-display) expecting plot structures but received: [p1]

 

G := `<|>`(`<,>`(seq(i, i = 0 .. 100)), `<,>`(seq(C[i], i = 0 .. 100))); p2 := pointplot(G, color = blue, symbol = soliddiamond); display([p2, Cplot])

G := Vector(4, {(1) = ` 101 x 2 `*Matrix, (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

 

Error, (in plots:-pointplot) points cannot be converted to floating-point values

 

Error, (in plots:-display) expecting plot structures but received: [p2]

 

NULL


 

Download corrections.mw

Outputting solution values to a file (or multiple files) is trivial.

However I'm not going to show how to do this because I have conerns over the validity of any generated numerical values.

Consider very carefully your boundary conditions

cond:= {u(0,t)=sin(.5*Pi), u(x,0)=0}

The first condition states that                u(0,0)=sin(0.5*Pi)=1.
The second condition states that          u(0,0)=0

So what do you want u(0,0) to be? Produce consistent  boundary conditions accordingly

For any given value of 's', you expresision is quartic in 'z' - so has four roots

A quick check examination appears to show that for any(?) value of 's', the expression has two real roots and a conjugate pair for 'z'.

The attached shows the imaginary parts of the conjugate pair

  restart;
  expr:=.9215999996*z^4+.9999999996*z^4*s^4-2.079999999*z^4*s^2-3.212799999*s*z^3+12.63999999*s^3*z^3-7.999999997*s^5*z^3-24.17694443*s^4*z^2-.3071555554*s^2*z^2+23.99999999*s^6*z^2-31.99999999*s^7*z+6.804911108*s^3*z+11.58777777*s^5*z+15.99999999*s^8+5.692222220*s^6-4.853219442*s^4=0:
  f:=p-> min(Im~([fsolve(eval(expr,s=p), z, complex)])):
  g:=p-> max(Im~([fsolve(eval(expr,s=p), z, complex)])):
  plot( [f, g], -10..10, axes=boxed);

 

 

Download plotIm.mw

 

has two problems (at least)

I have highlighted both of these in the attached

  restart;
  with(DEtools):
  eq1:= (D(x))(t) = -y(t);
  eq2:= (D(y))(t) = x(t)+2*x(t)^3-signum(z(t));
  eq3:= (D(z))(t) = w(t);
  eq4:= (D(w))(t) = -z(t)*(1+6*x(t)^2);
  sys:= eq1, eq2, eq3, eq4;
  ic1:= [ x(0)=0, y(0)=0, z(0)=cos(1), w(0)=sin(1)];
  ic2:= [ x(0)=0, y(0)=0, z(0)=cos(2.5), w(0)=sin(2.5)];
  ic:= ic1, ic2;
  DEplot( [sys],
          [x(t), y(t), z(t), w(t)],
           t = 0 .. 10,
           [ic],
           stepsize = 0.5e-1,
           scene = [x(t), y(t)],
           linecolor = [blue, red]
        );
  sol1:= dsolve
         ( { sys, x(0)=0, y(0)=0, z(0)=cos(1), w(0)=sin(1)},
           { x(t), y(t), z(t), w(t)},
           type=numeric
         );
  T:= 10.0;
  N:= 100;
  h:= T/N;
  xk:= 0;
  for k from 1 to N do
      solk:= sol1(k*h);
      xknew:= subs(solk,x(t));
      yknew:= subs(solk,y(t));
      if   xk*xknew<=0 and abs(yknew-6)<0.5
      then break
      fi;
  xk:= xknew;
  od:
  sol1(k*h):

  temps:= proc(alpha,eps)
                local sol, solk, T, N, h ,k, xk, xknew,
                      yknew, t0, t1, tm, x0, x1, xm;
                sol:= dsolve
                       ( { sys, x(0)=0, y(0)=0, z(0)=cos(alpha) ,w(0)=sin(alpha) },
                         { x(t), y(t), z(t), w(t)},
                         type=numeric
                       );
                T:= 10.0;
                N:= 100;
                h:= T/N;
                xk:= 0;
                for k from 1 to N do
                    solk:= sol(k*h);
                    xknew:= subs(solk, x(t));
                    yknew:= subs(solk, y(t));
                    if   xk*xknew<=0 and abs(yknew-6)<0.5
                    then break
                    fi;
                    xk:= xknew;
                od;
                t0:= (k-1)*h;
                t1:= k*h;
                x0:= subs(sol(t0), x(t));
                x1:= subs(sol(t1), x(t));
                while abs(x0-x1)>eps do
                      tm:= (t0+t1)/2;
                      xm:= subs(sol(tm), x(t));
                      if   xm*x0<0
                      then x1:= xm;
                           t1:= tm;
                      else x0:= xm;
                           t0:= tm;
                      fi;
                od;
                return t0;
           end:
  dicho:= proc(eps)
                local a, b, m, sola, solb, solm,
                      ta, tb, tm, ya, yb, ym;
                a:= 1;
                b:= 2.5;
                sola:= dsolve
                        ( {sys, x(0)=0, y(0)=0, z(0)=cos(a), w(0)=sin(a)},
                          {x(t),y(t),z(t),w(t)},
                          type=numeric
                        );
                solb:= dsolve
                        ( {sys, x(0)=0, y(0)=0, z(0)=cos(b), w(0)=sin(b)},
                          {x(t), y(t), z(t), w(t)},
                          type=numeric
                        );
                ta:= temps(a,eps);
                tb:= temps(b,eps);
                ya:= subs(sola(ta),y(t));
                yb:= subs(solb(tb),y(t));
                while abs(yb-ya)>eps do
                      m:= evalf((a+b)/2);
                      solm:= dsolve
                              ( { sys, x(0)=0, y(0)=0, z(0)=cos(m), w(0)=sin(m)},
                                {x(t), y(t), z(t), w(t)},
                                type=numeric
                              );
                      tm:= temps(m,eps);
                      # yb:= subs(sol(tm),y(t)); # should this be sola, solb or
                                                 # solm?? Used solm() just to
                                                 # eliminate the error This is
                                                 # quite likely to be incorrect
                      yb:= subs(solm(tm),y(t));
                      if   (ym-6)*(ya-6)<0 # first time through this loop ym is
                                           # not initialized In fact it is
                                           # *never* initialized - although all
                                           # sorts of stuff depends on it.
                                           # WTF is ym - I have no idea!!
                      then b:= m;
                           yb:= ym;
                      else a:= m;
                           ya:= ym;
                      fi;

                od;
                return a;
            end:
  dicho(0.01);
  temps(2.136718750,0.01);

(D(x))(t) = -y(t)

 

(D(y))(t) = x(t)+2*x(t)^3-signum(z(t))

 

(D(z))(t) = w(t)

 

(D(w))(t) = -z(t)*(1+6*x(t)^2)

 

(D(x))(t) = -y(t), (D(y))(t) = x(t)+2*x(t)^3-signum(z(t)), (D(z))(t) = w(t), (D(w))(t) = -z(t)*(1+6*x(t)^2)

 

[x(0) = 0, y(0) = 0, z(0) = cos(1), w(0) = sin(1)]

 

[x(0) = 0, y(0) = 0, z(0) = -.8011436155, w(0) = .5984721441]

 

[x(0) = 0, y(0) = 0, z(0) = cos(1), w(0) = sin(1)], [x(0) = 0, y(0) = 0, z(0) = -.8011436155, w(0) = .5984721441]

 

 

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

 

10.0

 

100

 

.1000000000

 

0

 

Error, (in dicho) cannot determine if this expression is true or false: -HFloat(0.17348797556887252)*ym < HFloat(-1.0409278534132351)

 

8.737500000

(1)

 

Download procprobs.mw

I understand correctly, then you want something like the attached

  restart;
#
# Define the functions
#
#      u(t,f) and
#      x(t,f)
#
  u:= unapply
      ( 1-(8*(10.3968*t^2-5.8368*t*f-.229376*f^2-5.1984))/(4.56*t^2-2.56*t*f+.8192*f^2+2.28)^2,
        [t,f]
      ):
  x:= unapply
      ( f+t-(8*(-2.28*t+.64*f))/(2.28+2*(-t+.64*f)^2+2.56*t^2),
        [t,f]
       ):
#
# Plot u(0,f) against x(0,f)
#
  plot( [x(0,f), u(0,f), f=-5..5]);
#
# Plot u(t,f) against x(t,f) and t
#
  plot3d([ x(t,f), t, u(t,f) ], f=-5..5, t=-5..5);

 

 

 


 

Download somePlots.mw

For details, see the attached.

Short version is that your procedure calls two functions 'f()' and 'check()' which are defined nowhere so procedure is guaranteed to fail, unless these 'unidentified' functions exist elsewhere(probably top-level)  in your code.

The "debug" icon in the toolbar is only really intended for to work with currenlty running operations - so if some code seems to be taking "forever" to execute then this will give you a kind of "interrupt" whihmay help you to figure out what it is currently doing and why. I actually find this facility pretty much useless for code which fails "quickly".

The best way to work out how to use the debugger (beware it isn't very user-friendly!) is to read the Maple Programming Guide available here, and experiment with the examples

https://www.maplesoft.com/support/help/Maple/view.aspx?path=ProgrammingGuide/Chapter16

(This document used to be available as a pdf (easier to download and study, in my opinion) but I can' figure out where the pdf link is

f1:=  proc(n)
          local x, y, i, rx, ry, dumbindex:= 1,
                xdumb, ydumb, d:= 0.00197241, flag:= 1,
                p, xl, yl, temp, xg, yg;
          xdumb[1]:= n:
          ydumb[1]:= n:  
          for i from 1 to  n do    
              while (d>0.0019724 or flag=1) do
                  #
                  # Why is a new random number generator
                  # being instantiated every time this
                  # loop executes?
                  # Surely better would be to initialise
                  # the first RNG outside both loops, call
                  # and run the calls to it in the outer
                  # - or maybe not?? Even if a couple of
                  # 'new' random numbers are needed every
                  # the 'inner' loop runs, it is probably
                  # a better idea to inilis the generators
                  # in the outer loop and only have the
                  # 'calls' here
                  #   
                    rx:= rand(1..n):
                    x[i]:= rx():
                    ry:= rand(x[i]..n):
                    y[i]:= ry():
                  #
                  # What does the following command do??
                  # There is a command called 'check()'
                  # in the Physics() package, but since
                  # the latter has not been loaded(?)
                  # the check() call here will never return
                  # anything other than an unevaluated
                  # function call??
                  #
                  # Doesn't look like right!
                  #
                    flag:= check(x[i],y[i],xdumb,ydumb,dumbindex):  
                    if   flag=1
                    then dumbindex:= dumbindex+1;
                         xdumb[dumbindex]:= x[i]:
                         ydumb[dumbindex]:= y[i]:
                    fi:
                  #
                  # What does the next command do??
                  #
                  # The function 'f()' is undefined so will
                  # never return anything other than its
                  # literal name, which is a single value.
                  # Therefore no way that a duplicate
                  # assignment will work, because lhs has
                  # two names, 'p' and 'd', and rhs only has
                  # one (unevaluated) value.
                  #
                  # Since both 'p' and 'd' are used in this
                  # code - this statement is probably not a
                  # good idea
                  #
                  # I did consider that this *might* be a
                  # recursive call - ie calling this procedure
                  # with new arguments, but since this
                  # procedure is called 'f1' and accepts one
                  # argument, and the invocation calls 'f'
                  # and supplies two arguments this interpretation
                  # is almost certainly incorrect
                  #
                  # The mismatch between the returned
                  # (unevaluated) single value and the dual
                  # assignment is what causes the error message
                  # whenever the prodedure 'f1()' is invoked
                  # 
                    p, d:= f(x[i],y[i]):
              end:  
              xl[i]:= x[i]:
              yl[i]:= y[i]:  
              if   i=1
              then temp:= p:
                   xg:= x[i]:
                   yg:= y[i];  
              else if   p<temp
                   then temp:= p:
                        xg:= x[i]:
                        yg:= y[i] ;
                   fi:  
              fi:
          end do:  
          return xg,yg:  

end proc;

proc (n) local x, y, i, rx, ry, dumbindex, xdumb, ydumb, d, flag, p, xl, yl, temp, xg, yg; dumbindex := 1; d := 0.197241e-2; flag := 1; xdumb[1] := n; ydumb[1] := n; for i to n do while 0.19724e-2 < d or flag = 1 do rx := rand(1 .. n); x[i] := rx(); ry := rand(x[i] .. n); y[i] := ry(); flag := check(x[i], y[i], xdumb, ydumb, dumbindex); if flag = 1 then dumbindex := dumbindex+1; xdumb[dumbindex] := x[i]; ydumb[dumbindex] := y[i] end if; p, d := f(x[i], y[i]) end do; xl[i] := x[i]; yl[i] := y[i]; if i = 1 then temp := p; xg := x[i]; yg := y[i] else if p < temp then temp := p; xg := x[i]; yg := y[i] end if end if end do; return xg, yg end proc

(1)

f1(10);

Error, (in f1) mismatched multiple assignment of 2 variables on the left side and 1 value on the right side

 

 

Download procProb.mw

whihc are pretty simple to fix. However a more serious problem is in the form of the boundary conditions which you are using. You are only allowed derivatives which are "normal" to the boundary. You have two,

D[2](C)(0, t) = 0, D[2](C)(250, t) = 0

which are not! These can never be used

An alternative is that you have misinterpreted how to apply the operator 'D'. The two boundary conditions above mean

  1. Obtain the first derivative with respct to the second variable (ie 't')
  2. Evaluate the results of (1) at (0,t) and (250,t)

On the other hand if you had intended to obtain the second derivative with respect to the first variable, this would be written

D[1,1](C)(0, t) = 0, D[1,1](C)(250, t) = 0

These derivatives are "normal" to the boundary and so pdsolve/numeric will provide a solution

I have used this changed interpretation in the final two execution groups of the attached, which now works without error. However a quick check on a few values indicates that the result isn't numerically very stable. When t>~0.15 values start to grow very  rapidly

restart

with(plots)

with(CurveFitting)

pts := [Vector[row](99, {(1) = 0, (2) = 3.016315859, (3) = 5.753536424, (4) = 8.489713643, (5) = 11.22797756, (6) = 13.96519812, (7) = 16.09414745, (8) = 18.83136802, (9) = 21.26445296, (10) = 24.00167353, (11) = 26.73889409, (12) = 29.47611466, (13) = 31.60506399, (14) = 34.34228455, (15) = 37.07950512, (16) = 39.51259007, (17) = 41.6415394, (18) = 44.37875996, (19) = 46.81184491, (20) = 49.54906547, (21) = 51.6780148, (22) = 54.11109975, (23) = 56.84832032, (24) = 58.97726964, (25) = 62.32276145, (26) = 64.45171078, (27) = 66.88479572, (28) = 69.01374505, (29) = 71.44578665, (30) = 74.1814422, (31) = 76.91814109, (32) = 79.0455254, (33) = 81.47704533, (34) = 84.21165752, (35) = 86.33695514, (36) = 88.76691004, (37) = 90.89116431, (38) = 93.3195542, (39) = 96.04894966, (40) = 98.17059556, (41) = 100.5958554, (42) = 103.3231642, (43) = 105.4432451, (44) = 107.8679832, (45) = 110.5947703, (46) = 113.3236441, (47) = 116.0514746, (48) = 118.1746855, (49) = 120.9066893, (50) = 125.4640285, (51) = 127.8960701, (52) = 130.634334, (53) = 132.763805, (54) = 135.1994984, (55) = 137.9382839, (56) = 140.06932, (57) = 142.5034483, (58) = 145.2411905, (59) = 147.976846, (60) = 150.7119799, (61) = 153.4450271, (62) = 156.1770309, (63) = 158.9069481, (64) = 161.9399575, (65) = 164.6693529, (66) = 167.0951345, (67) = 169.2178237, (68) = 171.9472192, (69) = 174.3756091, (70) = 176.4998633, (71) = 179.2334322, (72) = 181.9680444, (73) = 184.4011293, (74) = 186.531122, (75) = 189.2719943, (76) = 192.0149532, (77) = 194.4542983, (78) = 197.2014306, (79) = 201.7822452, (80) = 203.921628, (81) = 207.5889923, (82) = 210.3397763, (83) = 213.699875, (84) = 217.3651526, (85) = 220.1133283, (86) = 222.859939, (87) = 224.9961918, (88) = 227.7412375, (89) = 230.1795391, (90) = 232.3131835, (91) = 234.7504419, (92) = 237.4913141, (93) = 240.5368437, (94) = 242.9720153, (95) = 245.7108009, (96) = 247.8313153, (97) = 247.8413153, (98) = 247.8513153, (99) = 250}), Vector[row](99, {(1) = -0.41150436e-1, (2) = -0.41150436e-1, (3) = -0.4113729e-1, (4) = -0.38722776e-1, (5) = -0.41110998e-1, (6) = -0.41097851e-1, (7) = -0.41087627e-1, (8) = -0.4107448e-1, (9) = -0.41062795e-1, (10) = -0.41049649e-1, (11) = -0.41036503e-1, (12) = -0.41023356e-1, (13) = -0.41013132e-1, (14) = -0.40999985e-1, (15) = -0.40986839e-1, (16) = -0.40975154e-1, (17) = -0.40964929e-1, (18) = -0.40951783e-1, (19) = -0.40940097e-1, (20) = -0.40926951e-1, (21) = -0.40916726e-1, (22) = -0.40905041e-1, (23) = -0.40891895e-1, (24) = -0.4088167e-1, (25) = -0.40865602e-1, (26) = -0.40855378e-1, (27) = -0.40843692e-1, (28) = -0.40833467e-1, (29) = -0.38420415e-1, (30) = -0.34805218e-1, (31) = -0.33591388e-1, (32) = -0.29979112e-1, (33) = -0.26365376e-1, (34) = -0.20348812e-1, (35) = -0.11933802e-1, (36) = -0.4718015e-2, (37) = 0.6098363e-2, (38) = 0.169162e-1, (39) = 0.34939601e-1, (40) = 0.51759396e-1, (41) = 0.69781335e-1, (42) = 0.9260747e-1, (43) = .113029316, (44) = .132251939, (45) = .156278757, (46) = .175502841, (47) = .197128292, (48) = .210346036, (49) = .222366019, (50) = .233194081, (51) = .235607134, (52) = .233218913, (53) = .232028454, (54) = .226036722, (55) = .222447817, (56) = .217655307, (57) = .215265626, (58) = .214078088, (59) = .217693285, (60) = .222509166, (61) = .232127781, (62) = .244147763, (63) = .26097048, (64) = .280196024, (65) = .298219424, (66) = .31504068, (67) = .329459108, (68) = .347482508, (69) = .358300346, (70) = .369116723, (71) = .377534655, (72) = .383551219, (73) = .383562904, (74) = .381171762, (75) = .372780123, (76) = .35958575, (77) = .345189232, (78) = .32238939, (79) = .27918669, (80) = .255183243, (81) = .214377529, (82) = .183172901, (83) = .149569828, (84) = .113566848, (85) = 0.88365639e-1, (86) = 0.6676648e-1, (87) = 0.49967135e-1, (88) = 0.31970027e-1, (89) = 0.19974876e-1, (90) = 0.9178949e-2, (91) = -0.414835e-3, (92) = -0.8806474e-2, (93) = -0.18397336e-1, (94) = -0.23188385e-1, (95) = -0.26777289e-1, (96) = -0.30369115e-1, (97) = -0.30369115e-1, (98) = -0.30369115e-1, (99) = -0.30369115e-1})]

A := unapply(Spline(pts[1], pts[2], x, degree = 3), x)

PDE := diff(C(x, t), t) = diff(C(x, t), x, x)-(diff(C(x, t), x))+5*(diff(C(x, t), x, x, x, x))

IBC := C(x, 0) = A(x), (D[1](C))(0, t) = 0, (D[1](C))(250, t) = 0, (D[2](C))(0, t) = 0, (D[2](C))(250, t) = 0

pds := pdsolve(PDE, [IBC], numeric, time = t, range = 0 .. 250, timestep = 0.5e-2, spacestep = 1)

Error, (in pdsolve/numeric/process_IBCs) initial/boundary conditions can only contain derivatives which are normal to the boundary, got (D[2](C))(0, t)

 

IBC := C(x, 0) = A(x), (D[1](C))(0, t) = 0, (D[1](C))(250, t) = 0, (D[1, 1](C))(0, t) = 0, (D[1, 1](C))(250, t) = 0; pds := pdsolve(PDE, [IBC], numeric, time = t, range = 0 .. 250, timestep = 0.5e-2, spacestep = 1)
 

_m656127456

(1)

solt := pds:-value(x = 125, t = 0 .. 1)
solt(.1)
solt(.2)
solt(.3)
solt(.4)

solt(.5); pds:-plot3d(x = 0 .. 250, t = 0 .. .15)

proc (x_pde) local res, solnproc, outpoint, ndsol, stype, i; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; Digits := trunc(evalhf(Digits)); outpoint := evalf(x_pde); solnproc := proc (outpoint) local indepvals, depvals, vary, ndep, i; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; table( [( "soln_procedures" ) = array( 0 .. 0, [( 0 ) = (18446744074405474742)  ] ) ] ) indepvals := Vector(201, {(1) = .0, (2) = 0.50e-2, (3) = 0.1e-1, (4) = 0.15e-1, (5) = 0.2e-1, (6) = 0.25e-1, (7) = 0.3e-1, (8) = 0.35e-1, (9) = 0.4e-1, (10) = 0.45e-1, (11) = 0.5e-1, (12) = 0.55e-1, (13) = 0.6e-1, (14) = 0.65e-1, (15) = 0.7e-1, (16) = 0.75e-1, (17) = 0.8e-1, (18) = 0.85e-1, (19) = 0.9e-1, (20) = 0.95e-1, (21) = .1, (22) = .105, (23) = .11, (24) = .115, (25) = .12, (26) = .125, (27) = .13, (28) = .135, (29) = .14, (30) = .145, (31) = .15, (32) = .155, (33) = .16, (34) = .165, (35) = .17, (36) = .175, (37) = .18, (38) = .185, (39) = .19, (40) = .195, (41) = .2, (42) = .205, (43) = .21, (44) = .215, (45) = .22, (46) = .225, (47) = .23, (48) = .235, (49) = .24, (50) = .245, (51) = .25, (52) = .255, (53) = .26, (54) = .265, (55) = .27, (56) = .275, (57) = .28, (58) = .285, (59) = .29, (60) = .295, (61) = .3, (62) = .305, (63) = .31, (64) = .315, (65) = .32, (66) = .325, (67) = .33, (68) = .335, (69) = .34, (70) = .345, (71) = .35, (72) = .355, (73) = .36, (74) = .365, (75) = .37, (76) = .375, (77) = .38, (78) = .385, (79) = .39, (80) = .395, (81) = .4, (82) = .405, (83) = .41, (84) = .415, (85) = .42, (86) = .425, (87) = .43, (88) = .435, (89) = .44, (90) = .445, (91) = .45, (92) = .455, (93) = .46, (94) = .465, (95) = .47, (96) = .475, (97) = .48, (98) = .485, (99) = .49, (100) = .495, (101) = .5, (102) = .505, (103) = .51, (104) = .515, (105) = .52, (106) = .525, (107) = .53, (108) = .535, (109) = .54, (110) = .545, (111) = .55, (112) = .555, (113) = .56, (114) = .565, (115) = .57, (116) = .575, (117) = .58, (118) = .585, (119) = .59, (120) = .595, (121) = .6, (122) = .605, (123) = .61, (124) = .615, (125) = .62, (126) = .625, (127) = .63, (128) = .635, (129) = .64, (130) = .645, (131) = .65, (132) = .655, (133) = .66, (134) = .665, (135) = .67, (136) = .675, (137) = .68, (138) = .685, (139) = .69, (140) = .695, (141) = .7, (142) = .705, (143) = .71, (144) = .715, (145) = .72, (146) = .725, (147) = .73, (148) = .735, (149) = .74, (150) = .745, (151) = .75, (152) = .755, (153) = .76, (154) = .765, (155) = .77, (156) = .775, (157) = .78, (158) = .785, (159) = .79, (160) = .795, (161) = .8, (162) = .805, (163) = .81, (164) = .815, (165) = .82, (166) = .825, (167) = .83, (168) = .835, (169) = .84, (170) = .845, (171) = .85, (172) = .855, (173) = .86, (174) = .865, (175) = .87, (176) = .875, (177) = .88, (178) = .885, (179) = .89, (180) = .895, (181) = .9, (182) = .905, (183) = .91, (184) = .915, (185) = .92, (186) = .925, (187) = .93, (188) = .935, (189) = .94, (190) = .945, (191) = .95, (192) = .955, (193) = .96, (194) = .965, (195) = .97, (196) = .975, (197) = .98, (198) = .985, (199) = .99, (200) = .995, (201) = 1.0}, datatype = float[8]); if outpoint = "left" then return indepvals[1] elif outpoint = "right" then return indepvals[201] elif outpoint = "start" then return 0. elif not type(outpoint, 'numeric') then error "non-numeric input" end if; if outpoint < indepvals[1] or indepvals[201] < outpoint then error "requested %1 value must be in the range %2..%3", t, indepvals[1], indepvals[201] end if; depvals := Matrix(201, 1, {(1, 1) = .232413246628474, (2, 1) = .23239616646961464, (3, 1) = .23237892149561945, (4, 1) = .23236141490948167, (5, 1) = .2323434897931939, (6, 1) = .23232489790992714, (7, 1) = .23230525303085492, (8, 1) = .2322839612653557, (9, 1) = .23226011726920248, (10, 1) = .23223234989185657, (11, 1) = .23219859299622303, (12, 1) = .2321557456601578, (13, 1) = .2320991690132882, (14, 1) = .2320219420284306, (15, 1) = .23191376193707158, (16, 1) = .23175932109117015, (17, 1) = .23153591300916146, (18, 1) = .23120990423354942, (19, 1) = .23073153820732553, (20, 1) = .2300272873116472, (21, 1) = .22898860236580862, (22, 1) = .22745537085778184, (23, 1) = .2251916062173643, (24, 1) = .2218497337485686, (25, 1) = .2169181432744511, (26, 1) = .20964419344587107, (27, 1) = .19892121087706968, (28, 1) = .1831226910920823, (29, 1) = .159859090275643, (30, 1) = .12562114400159666, (31, 1) = 0.7525687322983228e-1, (32, 1) = 0.12048672257636854e-2, (33, 1) = -.1076295508104513, (34, 1) = -.26752136365844975, (35, 1) = -.5023393514500708, (36, 1) = -.8470822500842374, (37, 1) = -1.3530591829803609, (38, 1) = -2.095478090879571, (39, 1) = -3.1845603000066034, (40, 1) = -4.781818129398978, (41, 1) = -7.12389169840764, (42, 1) = -10.557452275826186, (43, 1) = -15.59030561957488, (44, 1) = -22.96620825198311, (45, 1) = -33.77439132275213, (46, 1) = -49.60988085600682, (47, 1) = -72.80815602744363, (48, 1) = -106.78859011313051, (49, 1) = -156.55706806286457, (50, 1) = -229.4415044451341, (51, 1) = -336.1681089648402, (52, 1) = -492.43615455279945, (53, 1) = -721.2219920248788, (54, 1) = -1056.1497935929094, (55, 1) = -1546.4225910400494, (56, 1) = -2264.0354020114896, (57, 1) = -3314.3259361260116, (58, 1) = -4851.406254205843, (59, 1) = -7100.732017405288, (60, 1) = -10392.10866662953, (61, 1) = -15207.958091640898, (62, 1) = -22253.897321405224, (63, 1) = -32561.93724658056, (64, 1) = -47641.36890750351, (65, 1) = -69699.3608112794, (66, 1) = -101963.4561341752, (67, 1) = -149153.01359209075, (68, 1) = -218168.34250177347, (69, 1) = -319097.9998957051, (70, 1) = -466691.0598252868, (71, 1) = -682508.8724608892, (72, 1) = -998069.74851753, (73, 1) = -1459444.5128234343, (74, 1) = -2133971.9718518686, (75, 1) = -3120071.707069492, (76, 1) = -4561582.034637951, (77, 1) = -6668708.879653955, (78, 1) = -9748632.228128573, (79, 1) = -14250220.236218752, (80, 1) = -20829350.67995919, (81, 1) = -30444332.626956508, (82, 1) = -44495292.23948388, (83, 1) = -65027769.467461646, (84, 1) = -95030092.66599123, (85, 1) = -138867707.18261558, (86, 1) = -202917504.4328947, (87, 1) = -296494209.74511987, (88, 1) = -433203244.1939546, (89, 1) = -632916314.2805808, (90, 1) = -924656261.0146995, (91, 1) = -1350809491.2018933, (92, 1) = -1973276701.9784503, (93, 1) = -2882453448.1263504, (94, 1) = -4210342042.5680957, (95, 1) = -6149694654.252813, (96, 1) = -8981960863.284027, (97, 1) = -13118087717.81392, (98, 1) = -19158080925.650814, (99, 1) = -27977951325.649986, (100, 1) = -40856633942.19292, (101, 1) = -59661250810.27815, (102, 1) = -87117529615.9517, (103, 1) = -127204508263.99371, (104, 1) = -185730631271.21918, (105, 1) = -271174575364.423, (106, 1) = -395912419512.31616, (107, 1) = -578008629658.7682, (108, 1) = -843829830278.0294, (109, 1) = -1231859257139.5845, (110, 1) = -1798263305722.7815, (111, 1) = -2625014768434.3804, (112, 1) = -3831746752987.8916, (113, 1) = -5593050233888.452, (114, 1) = -8163714524917.53, (115, 1) = -11915557194394.293, (116, 1) = -17391163684647.662, (117, 1) = -25382298731266.78, (118, 1) = -37044314030459.68, (119, 1) = -54063073575022.8, (120, 1) = -78898499607603.4, (121, 1) = -115139902167155.5, (122, 1) = -168024389458858.94, (123, 1) = -245193192407149.5, (124, 1) = -357795069992212.56, (125, 1) = -522096044739715.25, (126, 1) = -761827773722029.8, (127, 1) = -1111613426122815.5, (128, 1) = -1621965382171542.8, (129, 1) = -2366575805863003., (130, 1) = -3452951869937000.5, (131, 1) = -5037929812363038., (132, 1) = -7350305630466803., (133, 1) = -10723846513023158., (134, 1) = -15645444023256538., (135, 1) = -22825353360197104., (136, 1) = -33299647454728544., (137, 1) = -0.485796591927218e17, (138, 1) = -0.7086995911354716e17, (139, 1) = -103386295796726416., (140, 1) = -150819335655406272., (141, 1) = -220011054523291168., (142, 1) = -0.32094128362963859e18, (143, 1) = -0.46816661382867475e18, (144, 1) = -0.68291905520500314e18, (145, 1) = -0.99616692758229901e18, (146, 1) = -0.145307911952420608e19, (147, 1) = -0.211953607618466381e19, (148, 1) = -0.30916257929399265e19, (149, 1) = -0.45094931874709509e19, (150, 1) = -0.65775384546794076e19, (151, 1) = -0.9593874728212689e19, (152, 1) = -0.13993289338661493e20, (153, 1) = -0.20409898314084835e20, (154, 1) = -0.2976852071013085e20, (155, 1) = -0.4341793648670631e20, (156, 1) = -0.6332522481430088e20, (157, 1) = -0.9235917779374206e20, (158, 1) = -0.13470361467581542e21, (159, 1) = -0.19646013145967038e21, (160, 1) = -0.28652710459022495e21, (161, 1) = -0.4178815543499227e21, (162, 1) = -0.6094484927735468e21, (163, 1) = -0.8888269870863149e21, (164, 1) = -0.12962655454894534e22, (165, 1) = -0.18904593424536497e22, (166, 1) = -0.275700415018555e22, (167, 1) = -0.402072440554644e22, (168, 1) = -0.5863650698849213e22, (169, 1) = -0.8551235441314812e22, (170, 1) = -0.1247058167028118e23, (171, 1) = -0.18186189664696205e23, (172, 1) = -0.26521248292440736e23, (173, 1) = -0.3867617591359053e23, (174, 1) = -0.5640147870305979e23, (175, 1) = -0.822498144999205e23, (176, 1) = -0.11994355352909485e24, (177, 1) = -0.17491075513956936e24, (178, 1) = -0.25506672569657314e24, (179, 1) = -0.3719536772027066e24, (180, 1) = -0.5424025583569227e24, (181, 1) = -0.7909563003856047e24, (182, 1) = -0.11534033295613543e25, (183, 1) = -0.16819300244432607e25, (184, 1) = -0.245263384414934e25, (185, 1) = -0.35764786693182256e25, (186, 1) = -0.5215269392171449e25, (187, 1) = -0.7604945285926214e25, (188, 1) = -0.1108954516862426e26, (189, 1) = -0.16170733483518643e26, (190, 1) = -0.23580016241709754e26, (191, 1) = -0.3438404169059098e26, (192, 1) = -0.5013814264278816e26, (193, 1) = -0.7311022101615126e26, (194, 1) = -0.10660719966176913e27, (195, 1) = -0.1554510291617615e27, (196, 1) = -0.22667276264437233e27, (197, 1) = -0.33052459776593336e27, (198, 1) = -0.4819555489637077e27, (199, 1) = -0.7027631412283057e27, (200, 1) = -0.10247308124056785e28, (201, 1) = -0.14942025769915007e28}, datatype = float[8], order = C_order); vary := Array(1..2, {(1) = .0, (2) = -0.50e-2}, datatype = float[8]); ndep := 1; if vary[ndep+1]-outpoint <> 0. then `pdsolve/interp1dto0d`(201, indepvals, 1, depvals, true, outpoint, vary); vary[ndep+1] := outpoint end if; [seq(vary[i], i = 1 .. ndep)] end proc; if not type(outpoint, 'numeric') then if member(outpoint, ["start", "left", "right"]) then return solnproc(x_pde) elif outpoint = "solnprocedure" then return eval(solnproc) elif procname <> unknown then return ('procname')(x_pde) else ndsol := pointto(solnproc("soln_procedures")[0]); return ('ndsol')(x_pde) end if end if; stype := "2nd"; try res := solnproc(outpoint); if stype = "1st" then [x = outpoint, t = 125., seq([C(x, t)][i] = res[i], i = 1 .. 1)] else [x = 125., t = outpoint, seq([C(x, t)][i] = res[i], i = 1 .. 1)] end if catch: error  end try end proc

 

[x = 125., t = .1, C(x, t) = HFloat(0.22898860236580862)]

 

[x = 125., t = .2, C(x, t) = HFloat(-7.12389169840764)]

 

[x = 125., t = .3, C(x, t) = HFloat(-15207.958091640898)]

 

[x = 125., t = .4, C(x, t) = HFloat(-3.0444332626956508e7)]

 

[x = 125., t = .5, C(x, t) = HFloat(-5.966125081027815e10)]

 

 

 

 

 

Download pdeProb.mw

 

 

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