Rouben Rostamian

MaplePrimes Activity


These are answers submitted by Rouben Rostamian

restart;

with(plots):

r := (c,t) -> < (1+c*sin(t))*cos(t), (1+c*sin(t))*sin(t) >;

proc (c, t) options operator, arrow; `<,>`((1+c*sin(t))*cos(t), (1+c*sin(t))*sin(t)) end proc

frame := proc(c)
  global track_points;
  local cardioid, point_of_tangency, tangent_line, tval, T, P, track;
  cardioid := plot([r(c,t)[1], r(c,t)[2], t=0..2*Pi], color=red);
  T := diff(r(c,t),t);     # tangent vector
  T[2]/T[1] = -1;          # set slope to -1
  tval := fsolve(%, t, t=0..Pi/2);
  T := eval(T / sqrt(T^+ . T), t=tval);  # unit tangent vector
  P := r(c, tval);         # point of tangency
  point_of_tangency := pointplot(P, symbol=circle, symbolsize=20);
  P + s*T;                 # the equation of the tangent line
  eval(%, s=-1), eval(%, s=+1);
  tangent_line := pointplot([%], connect, color="Green");
  track_points := track_points, P;
  track := pointplot([track_points], connect, color=blue);
  display([cardioid, point_of_tangency, tangent_line, track]);
end proc:

track_points := NULL:
nframes := 30:
display([seq(frame(q*2.5/(nframes-1)), q=0..nframes-1)],
  insequence, scaling=constrained);

Download mw.mw

 

Note added later:

If you prefer, you may replace the display and seq in the last few lines with plots:-animate, as in

track_points := NULL:
nframes := 30:
animate(frame, [c], c=0..2.5, frames=nframes, scaling=constrained);


 

doit := proc(n)
  combinat:-choose({$2..n}, 3);
  select(x->hastype(x,odd), %);
  nops(%);
end proc:

Then doit(6) returns 9.

If you would rather see the selected subsets, comment out the nops(%) line.

 

@MapleUser2017 

As I wrote earlier, the inflection points of discrete data is not a well-defined concept.
The data that you have presented (which I see that you picked up from the Matlab
discussion on the web) is particularly ill-suited for assigning any meaningful sense

of inflection.  Here is what you can expect.

restart;

xdat := < 7.0, 7.2, 7.4 ,7.6, 8.4, 8.8, 9.2, 9.6, 10.0,10.4,10.8,11.2 >:
ydat := < 0.692, 0.719, 0.723, 0.732, 0.719, 0.712, 1.407, 1.714,
1.99,2.118, 2.305, 2.711>:

xmin, xmax := xdat[1], xdat[-1];

7.0, 11.2

(1)

This is what the data looks like:

P0 := plot(xdat, ydat, style=point, symbol=solidcircle, symbolsize=15, color=red);

 

I don't see a meaningful way of assigning "inflection points" to that data.

Nevertheless, let's try fitting it with a 6th degree polynomial.

func_fit := Statistics:-Fit(add(a[i]*x^i, i=0..6), xdat, ydat, x):

plots:-display(P0, plot(func_fit, x=xmin..xmax, color=blue));

 

For whatever it's worth, the "inflection points" are at

fsolve(diff(func_fit, x$2), x=xmin..xmax);

7.648979160, 9.275103257, 10.50936371

(2)

Alternatively, you may try a spline fit:

spline_fit := CurveFitting:-Spline(xdat, ydat, x):

plots:-display(P0, plot(spline_fit, x=xmin..xmax, color="Green"));

 

The curve exhibits several inflection points.  But can we say those are the

inflection points of the data?  I would say not.  But if you insist, you may

obtain them by finding the roots of the curve's second derivative which

looks like this:

plot(diff(spline_fit, x$2), x=xmin..xmax);

 


 

Download mw.mw

 

restart;

A := < 6, 1; 4, 3 >;

Matrix(2, 2, {(1, 1) = 6, (1, 2) = 1, (2, 1) = 4, (2, 2) = 3})

B := < 6*t, -10*t + 4 >;

Vector(2, {(1) = 6*t, (2) = -10*t+4})

Phi := < phi[1](t), phi[2](t) >;

Vector(2, {(1) = phi[1](t), (2) = phi[2](t)})

diff(Phi,t) =~ A . Phi + B;
sys := convert(%, set);

Vector(2, {(1) = diff(phi[1](t), t) = 6*phi[1](t)+phi[2](t)+6*t, (2) = diff(phi[2](t), t) = 4*phi[1](t)+3*phi[2](t)-10*t+4})

{diff(phi[1](t), t) = 6*phi[1](t)+phi[2](t)+6*t, diff(phi[2](t), t) = 4*phi[1](t)+3*phi[2](t)-10*t+4}

dsolve(sys);

{phi[1](t) = exp(7*t)*_C2+exp(2*t)*_C1-2*t-4/7, phi[2](t) = exp(7*t)*_C2-4*exp(2*t)*_C1+10/7+6*t}


 

Download mw.mw

I don't understand your code for making a cylinder.  I would make a cylinder with the command in the plottools package, like this:

with(plots):
with(plottools):
display(cylinder(strips=60));

The "strips" option specifies the number of strips that make up the cylinder's cirved surface.  Change as needed. Other parameters may be specified as well.  See the help page.

You may translate and rotate the resulting cylinder through the translate and rotate commands provided in the plottools package.

The interchange of z and tau does not affect the innermost integral, therefore we need to concern ourselves with the two outer integrals.  In the picture below I have presented the calculations and the final result without words.  See if you can make sense of it.

This doesn't make much sense but it does the job:

simplify(v);

Added later: A couple of funky ways of acheiving the same result:

v + <0,0>;
v * sin(Pi/2); 


 

Your integrand blows up at x = −d/c.  The expression for the evaluated integral varies, depending on whether that singularity lies inside or outside the interval (a,b).  You can let Maple account for all possibilities by doing

int(1/(c*x + d), x = a .. b, AllSolutions); 

Or you may prefer to set the conditions yourself.  For instance, if −d/c is outside and to the left of the interval (a,b) and a < b, then we do

int(1/(c*x + d), x = a .. b) assuming a > -d/c, b > a;

But if −d/c  is inside the interval (a,b) (and a < b) then we do

int(1/(c*x + d)^2, x = a .. b) assuming real, a < -d/c, b > -d/c;

Your second integral can be handled in the same way.

There are several mathematical and programming errors in what you have shown.  Rather than pointing them one by one, I will show you a corrected worksheet.  Study it and ask if you need explanations.  The equation models the cooling of a disk of radius a (in 2D) as it loses heat through the boundary to its surrouindings.

restart;

pde := diff(T(r,t), t) - 1/r*diff(r*diff(T(r,t),r), r) = Q;

diff(T(r, t), t)-(diff(T(r, t), r)+r*(diff(diff(T(r, t), r), r)))/r = Q

ibc := { D[1](T)(0,t) = 0,
         D[1](T)(a,t) = -k*(T(a,t)-T__amb),
         T(r,0) = 1 };

{T(r, 0) = 1, (D[1](T))(0, t) = 0, (D[1](T))(a, t) = -k*(T(a, t)-T__amb)}

params := Q = 0, a = 1, k = 1, T__amb = 0;

Q = 0, a = 1, k = 1, T__amb = 0

eval(pde, {params});
eval(ibc, {params});
pdsol := pdsolve(%%, %, numeric, time=t, range=0..1);

diff(T(r, t), t)-(diff(T(r, t), r)+r*(diff(diff(T(r, t), r), r)))/r = 0

{T(r, 0) = 1, (D[1](T))(0, t) = 0, (D[1](T))(1, t) = -T(1, t)}

_m139996160549280

The graph of the function T(r, t):

pdsol:-plot3d(t=0..2, style=patchcontour, shading="z");

Animation of the disk's tenperature versus time:

pdsol:-value(output=listprocedure);
myT := rhs(%[3]);

[r = proc () option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; evalf(args[1]) end proc, t = proc () option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; evalf(args[2]) end proc, T(r, t) = proc () local tv, xv, solnproc, stype, ndsol, vals; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; Digits := trunc(evalhf(Digits)); solnproc := proc (tv, xv) local INFO, errest, nd, dvars, dary, daryt, daryx, vals, msg, i, j; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; table( [( "soln_procedures" ) = array( 1 .. 1, [( 1 ) = (18446884069870505230)  ] ) ] ) INFO := table( [( "solmat_v" ) = Vector(189, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (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) = .0, (20) = .0, (21) = .0, (22) = .0, (23) = .0, (24) = .0, (25) = .0, (26) = .0, (27) = .0, (28) = .0, (29) = .0, (30) = .0, (31) = .0, (32) = .0, (33) = .0, (34) = .0, (35) = .0, (36) = .0, (37) = .0, (38) = .0, (39) = .0, (40) = .0, (41) = .0, (42) = .0, (43) = .0, (44) = .0, (45) = .0, (46) = .0, (47) = .0, (48) = .0, (49) = .0, (50) = .0, (51) = .0, (52) = .0, (53) = .0, (54) = .0, (55) = .0, (56) = .0, (57) = .0, (58) = .0, (59) = .0, (60) = .0, (61) = .0, (62) = .0, (63) = .0, (64) = .0, (65) = .0, (66) = .0, (67) = .0, (68) = .0, (69) = .0, (70) = .0, (71) = .0, (72) = .0, (73) = .0, (74) = .0, (75) = .0, (76) = .0, (77) = .0, (78) = .0, (79) = .0, (80) = .0, (81) = .0, (82) = .0, (83) = .0, (84) = .0, (85) = .0, (86) = .0, (87) = .0, (88) = .0, (89) = .0, (90) = .0, (91) = .0, (92) = .0, (93) = .0, (94) = .0, (95) = .0, (96) = .0, (97) = .0, (98) = .0, (99) = .0, (100) = .0, (101) = .0, (102) = .0, (103) = .0, (104) = .0, (105) = .0, (106) = .0, (107) = .0, (108) = .0, (109) = .0, (110) = .0, (111) = .0, (112) = .0, (113) = .0, (114) = .0, (115) = .0, (116) = .0, (117) = .0, (118) = .0, (119) = .0, (120) = .0, (121) = .0, (122) = .0, (123) = .0, (124) = .0, (125) = .0, (126) = .0, (127) = .0, (128) = .0, (129) = .0, (130) = .0, (131) = .0, (132) = .0, (133) = .0, (134) = .0, (135) = .0, (136) = .0, (137) = .0, (138) = .0, (139) = .0, (140) = .0, (141) = .0, (142) = .0, (143) = .0, (144) = .0, (145) = .0, (146) = .0, (147) = .0, (148) = .0, (149) = .0, (150) = .0, (151) = .0, (152) = .0, (153) = .0, (154) = .0, (155) = .0, (156) = .0, (157) = .0, (158) = .0, (159) = .0, (160) = .0, (161) = .0, (162) = .0, (163) = .0, (164) = .0, (165) = .0, (166) = .0, (167) = .0, (168) = .0, (169) = .0, (170) = .0, (171) = .0, (172) = .0, (173) = .0, (174) = .0, (175) = .0, (176) = .0, (177) = .0, (178) = .0, (179) = .0, (180) = .0, (181) = .0, (182) = .0, (183) = .0, (184) = .0, (185) = .0, (186) = .0, (187) = .0, (188) = .0, (189) = .0}, datatype = float[8], order = C_order, attributes = [source_rtable = (Matrix(21, 9, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (1, 7) = .0, (1, 8) = .0, (1, 9) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (2, 7) = .0, (2, 8) = .0, (2, 9) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (3, 7) = .0, (3, 8) = .0, (3, 9) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (4, 7) = .0, (4, 8) = .0, (4, 9) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (5, 7) = .0, (5, 8) = .0, (5, 9) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0, (6, 7) = .0, (6, 8) = .0, (6, 9) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (7, 5) = .0, (7, 6) = .0, (7, 7) = .0, (7, 8) = .0, (7, 9) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0, (8, 5) = .0, (8, 6) = .0, (8, 7) = .0, (8, 8) = .0, (8, 9) = .0, (9, 1) = .0, (9, 2) = .0, (9, 3) = .0, (9, 4) = .0, (9, 5) = .0, (9, 6) = .0, (9, 7) = .0, (9, 8) = .0, (9, 9) = .0, (10, 1) = .0, (10, 2) = .0, (10, 3) = .0, (10, 4) = .0, (10, 5) = .0, (10, 6) = .0, (10, 7) = .0, (10, 8) = .0, (10, 9) = .0, (11, 1) = .0, (11, 2) = .0, (11, 3) = .0, (11, 4) = .0, (11, 5) = .0, (11, 6) = .0, (11, 7) = .0, (11, 8) = .0, (11, 9) = .0, (12, 1) = .0, (12, 2) = .0, (12, 3) = .0, (12, 4) = .0, (12, 5) = .0, (12, 6) = .0, (12, 7) = .0, (12, 8) = .0, (12, 9) = .0, (13, 1) = .0, (13, 2) = .0, (13, 3) = .0, (13, 4) = .0, (13, 5) = .0, (13, 6) = .0, (13, 7) = .0, (13, 8) = .0, (13, 9) = .0, (14, 1) = .0, (14, 2) = .0, (14, 3) = .0, (14, 4) = .0, (14, 5) = .0, (14, 6) = .0, (14, 7) = .0, (14, 8) = .0, (14, 9) = .0, (15, 1) = .0, (15, 2) = .0, (15, 3) = .0, (15, 4) = .0, (15, 5) = .0, (15, 6) = .0, (15, 7) = .0, (15, 8) = .0, (15, 9) = .0, (16, 1) = .0, (16, 2) = .0, (16, 3) = .0, (16, 4) = .0, (16, 5) = .0, (16, 6) = .0, (16, 7) = .0, (16, 8) = .0, (16, 9) = .0, (17, 1) = .0, (17, 2) = .0, (17, 3) = .0, (17, 4) = .0, (17, 5) = .0, (17, 6) = .0, (17, 7) = .0, (17, 8) = .0, (17, 9) = .0, (18, 1) = .0, (18, 2) = .0, (18, 3) = .0, (18, 4) = .0, (18, 5) = .0, (18, 6) = .0, (18, 7) = .0, (18, 8) = .0, (18, 9) = .0, (19, 1) = .0, (19, 2) = .0, (19, 3) = .0, (19, 4) = .0, (19, 5) = .0, (19, 6) = .0, (19, 7) = .0, (19, 8) = .0, (19, 9) = .0, (20, 1) = .0, (20, 2) = .0, (20, 3) = .0, (20, 4) = .0, (20, 5) = .0, (20, 6) = .0, (20, 7) = .0, (20, 8) = .0, (20, 9) = .0, (21, 1) = .0, (21, 2) = .0, (21, 3) = .0, (21, 4) = .0, (21, 5) = .0, (21, 6) = .0, (21, 7) = .0, (21, 8) = .0, (21, 9) = .0}, datatype = float[8], order = C_order))]), ( "eqndep" ) = [1], ( "allocspace" ) = 21, ( "solvec3" ) = Vector(21, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (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) = .0, (20) = .0, (21) = .0}, datatype = float[8]), ( "depdords" ) = [[[2, 1]]], ( "method" ) = theta, ( "erroraccum" ) = true, ( "depshift" ) = [1], ( "startup_only" ) = false, ( "depords" ) = [[2, 1]], ( "rightwidth" ) = 0, ( "explicit" ) = false, ( "theta" ) = 1/2, ( "pts", r ) = [0, 1], ( "leftwidth" ) = 1, ( "intspace" ) = Matrix(21, 1, {(1, 1) = .0, (2, 1) = .0, (3, 1) = .0, (4, 1) = .0, (5, 1) = .0, (6, 1) = .0, (7, 1) = .0, (8, 1) = .0, (9, 1) = .0, (10, 1) = .0, (11, 1) = .0, (12, 1) = .0, (13, 1) = .0, (14, 1) = .0, (15, 1) = .0, (16, 1) = .0, (17, 1) = .0, (18, 1) = .0, (19, 1) = .0, (20, 1) = .0, (21, 1) = .0}, datatype = float[8], order = C_order), ( "timestep" ) = 0.500000000000000e-1, ( "solvec2" ) = Vector(21, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (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) = .0, (20) = .0, (21) = .0}, datatype = float[8]), ( "errorest" ) = false, ( "depeqn" ) = [1], ( "PDEs" ) = [diff(T(r, t), t)-(diff(T(r, t), r)+r*(diff(diff(T(r, t), r), r)))/r], ( "multidep" ) = [false, false], ( "banded" ) = true, ( "eqnords" ) = [[2, 1]], ( "vectorproc" ) = proc (v, vp, vpp, t, x, k, h, n, vec) local _s1, _s2, _s3, _s4, _s5, _s6, xi; _s3 := 2*k; _s4 := h*k; _s5 := 4*h^2; _s6 := 4*k*h^2; vec[1] := 0; vec[n] := 0; for xi from 2 to n-1 do _s1 := -vp[xi-1]+vp[xi+1]; _s2 := vp[xi-1]-2*vp[xi]+vp[xi+1]; vec[xi] := (_s2*_s3*x[xi]+_s5*vp[xi]*x[xi]+_s1*_s4)/(_s6*x[xi]) end do end proc, ( "matrixproc" ) = proc (v, vp, vpp, t, x, k, h, n, mat) local _s1, _s2, xi; _s1 := 4*h^2; _s2 := (h^2+k)/(k*h^2); mat[4] := -(3/2)/h; mat[5] := 2/h; mat[6] := -(1/2)/h; mat[9*n-5] := (3/2)/h+1; mat[9*n-7] := (1/2)/h; mat[9*n-6] := -2/h; for xi from 2 to n-1 do mat[9*xi-5] := _s2; mat[9*xi-6] := (h-2*x[xi])/(_s1*x[xi]); mat[9*xi-4] := -(h+2*x[xi])/(_s1*x[xi]) end do end proc, ( "spaceadaptive" ) = false, ( "spacepts" ) = 21, ( "solmat_i2" ) = 0, ( "maxords" ) = [2, 1], ( "periodic" ) = false, ( "totalwidth" ) = 9, ( "timei" ) = 3, ( "indepvars" ) = [r, t], ( "timeadaptive" ) = false, ( "extrabcs" ) = [0], ( "inputargs" ) = [diff(T(r, t), t)-(diff(T(r, t), r)+r*(diff(diff(T(r, t), r), r)))/r = 0, {T(r, 0) = 1, (D[1](T))(0, t) = 0, (D[1](T))(1, t) = -T(1, t)}, time = t, range = 0 .. 1], ( "solmat_is" ) = 0, ( "IBC" ) = b, ( "fdepvars" ) = [T(r, t)], ( "stages" ) = 1, ( "solmatrix" ) = Matrix(21, 9, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (1, 7) = .0, (1, 8) = .0, (1, 9) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (2, 7) = .0, (2, 8) = .0, (2, 9) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (3, 7) = .0, (3, 8) = .0, (3, 9) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (4, 7) = .0, (4, 8) = .0, (4, 9) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (5, 7) = .0, (5, 8) = .0, (5, 9) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0, (6, 7) = .0, (6, 8) = .0, (6, 9) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (7, 5) = .0, (7, 6) = .0, (7, 7) = .0, (7, 8) = .0, (7, 9) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0, (8, 5) = .0, (8, 6) = .0, (8, 7) = .0, (8, 8) = .0, (8, 9) = .0, (9, 1) = .0, (9, 2) = .0, (9, 3) = .0, (9, 4) = .0, (9, 5) = .0, (9, 6) = .0, (9, 7) = .0, (9, 8) = .0, (9, 9) = .0, (10, 1) = .0, (10, 2) = .0, (10, 3) = .0, (10, 4) = .0, (10, 5) = .0, (10, 6) = .0, (10, 7) = .0, (10, 8) = .0, (10, 9) = .0, (11, 1) = .0, (11, 2) = .0, (11, 3) = .0, (11, 4) = .0, (11, 5) = .0, (11, 6) = .0, (11, 7) = .0, (11, 8) = .0, (11, 9) = .0, (12, 1) = .0, (12, 2) = .0, (12, 3) = .0, (12, 4) = .0, (12, 5) = .0, (12, 6) = .0, (12, 7) = .0, (12, 8) = .0, (12, 9) = .0, (13, 1) = .0, (13, 2) = .0, (13, 3) = .0, (13, 4) = .0, (13, 5) = .0, (13, 6) = .0, (13, 7) = .0, (13, 8) = .0, (13, 9) = .0, (14, 1) = .0, (14, 2) = .0, (14, 3) = .0, (14, 4) = .0, (14, 5) = .0, (14, 6) = .0, (14, 7) = .0, (14, 8) = .0, (14, 9) = .0, (15, 1) = .0, (15, 2) = .0, (15, 3) = .0, (15, 4) = .0, (15, 5) = .0, (15, 6) = .0, (15, 7) = .0, (15, 8) = .0, (15, 9) = .0, (16, 1) = .0, (16, 2) = .0, (16, 3) = .0, (16, 4) = .0, (16, 5) = .0, (16, 6) = .0, (16, 7) = .0, (16, 8) = .0, (16, 9) = .0, (17, 1) = .0, (17, 2) = .0, (17, 3) = .0, (17, 4) = .0, (17, 5) = .0, (17, 6) = .0, (17, 7) = .0, (17, 8) = .0, (17, 9) = .0, (18, 1) = .0, (18, 2) = .0, (18, 3) = .0, (18, 4) = .0, (18, 5) = .0, (18, 6) = .0, (18, 7) = .0, (18, 8) = .0, (18, 9) = .0, (19, 1) = .0, (19, 2) = .0, (19, 3) = .0, (19, 4) = .0, (19, 5) = .0, (19, 6) = .0, (19, 7) = .0, (19, 8) = .0, (19, 9) = .0, (20, 1) = .0, (20, 2) = .0, (20, 3) = .0, (20, 4) = .0, (20, 5) = .0, (20, 6) = .0, (20, 7) = .0, (20, 8) = .0, (20, 9) = .0, (21, 1) = .0, (21, 2) = .0, (21, 3) = .0, (21, 4) = .0, (21, 5) = .0, (21, 6) = .0, (21, 7) = .0, (21, 8) = .0, (21, 9) = .0}, datatype = float[8], order = C_order), ( "minspcpoints" ) = 4, ( "dependson" ) = [{1}], ( "initialized" ) = false, ( "depvars" ) = [T], ( "adjusted" ) = false, ( "solution" ) = Array(1..3, 1..21, 1..1, {(1, 1, 1) = .0, (1, 2, 1) = .0, (1, 3, 1) = .0, (1, 4, 1) = .0, (1, 5, 1) = .0, (1, 6, 1) = .0, (1, 7, 1) = .0, (1, 8, 1) = .0, (1, 9, 1) = .0, (1, 10, 1) = .0, (1, 11, 1) = .0, (1, 12, 1) = .0, (1, 13, 1) = .0, (1, 14, 1) = .0, (1, 15, 1) = .0, (1, 16, 1) = .0, (1, 17, 1) = .0, (1, 18, 1) = .0, (1, 19, 1) = .0, (1, 20, 1) = .0, (1, 21, 1) = .0, (2, 1, 1) = .0, (2, 2, 1) = .0, (2, 3, 1) = .0, (2, 4, 1) = .0, (2, 5, 1) = .0, (2, 6, 1) = .0, (2, 7, 1) = .0, (2, 8, 1) = .0, (2, 9, 1) = .0, (2, 10, 1) = .0, (2, 11, 1) = .0, (2, 12, 1) = .0, (2, 13, 1) = .0, (2, 14, 1) = .0, (2, 15, 1) = .0, (2, 16, 1) = .0, (2, 17, 1) = .0, (2, 18, 1) = .0, (2, 19, 1) = .0, (2, 20, 1) = .0, (2, 21, 1) = .0, (3, 1, 1) = .0, (3, 2, 1) = .0, (3, 3, 1) = .0, (3, 4, 1) = .0, (3, 5, 1) = .0, (3, 6, 1) = .0, (3, 7, 1) = .0, (3, 8, 1) = .0, (3, 9, 1) = .0, (3, 10, 1) = .0, (3, 11, 1) = .0, (3, 12, 1) = .0, (3, 13, 1) = .0, (3, 14, 1) = .0, (3, 15, 1) = .0, (3, 16, 1) = .0, (3, 17, 1) = .0, (3, 18, 1) = .0, (3, 19, 1) = .0, (3, 20, 1) = .0, (3, 21, 1) = .0}, datatype = float[8], order = C_order), ( "t0" ) = 0, ( "spacestep" ) = 0.500000000000000e-1, ( "vectorhf" ) = true, ( "solvec1" ) = Vector(21, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (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) = .0, (20) = .0, (21) = .0}, datatype = float[8]), ( "solmat_i1" ) = 0, ( "autonomous" ) = true, ( "timeidx" ) = 2, ( "ICS" ) = [1], ( "matrixhf" ) = true, ( "solspace" ) = Vector(21, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (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) = .0, (20) = .0, (21) = 1.0}, datatype = float[8]), ( "solvec5" ) = 0, ( "spacevar" ) = r, ( "mixed" ) = false, ( "linear" ) = true, ( "timevar" ) = t, ( "norigdepvars" ) = 1, ( "solmat_ne" ) = 0, ( "solvec4" ) = 0, ( "soltimes" ) = Vector(3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8]), ( "BCS", 1 ) = {[[1, 1, 0], b[1, 1, 0]], [[1, 0, 1], [1, 1, 1], b[1, 1, 1]+b[1, 0, 1]]}, ( "spaceidx" ) = 1, ( "bandwidth" ) = [2, 4] ] ); if xv = "left" then return INFO["solspace"][1] elif xv = "right" then return INFO["solspace"][INFO["spacepts"]] elif tv = "start" then return INFO["t0"] elif not (type(tv, 'numeric') and type(xv, 'numeric')) then error "non-numeric input" end if; if xv < INFO["solspace"][1] or INFO["solspace"][INFO["spacepts"]] < xv then error "requested %1 value must be in the range %2..%3", INFO["spacevar"], INFO["solspace"][1], INFO["solspace"][INFO["spacepts"]] end if; dary := Vector(3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8]); daryt := 0; daryx := 0; dvars := []; errest := false; nd := nops(INFO["depvars"]); if dary[nd+1] <> tv then try `pdsolve/numeric/evolve_solution`(INFO, tv) catch: msg := StringTools:-FormatMessage(lastexception[2 .. -1]); if tv < INFO["t0"] then error cat("unable to compute solution for %1<%2:
", msg), INFO["timevar"], INFO["failtime"] else error cat("unable to compute solution for %1>%2:
", msg), INFO["timevar"], INFO["failtime"] end if end try end if; if dary[nd+1] <> tv or dary[nd+2] <> xv then `pdsolve/interp2dto0d`(3, INFO["soltimes"], INFO["spacepts"], INFO["solspace"], nops(INFO["depvars"]), INFO["solution"], true, tv, xv, dary); if errest then `pdsolve/interp2dto0d`(3, INFO["soltimes"], INFO["spacepts"], INFO["err_t"], nops(INFO["depvars"]), INFO["solution"], true, tv, xv, daryt); `pdsolve/interp2dto0d`(3, INFO["soltimes"], INFO["spacepts"], INFO["err_x"], nops(INFO["depvars"]), INFO["solution"], true, tv, xv, daryx) end if end if; dary[nd+1] := tv; dary[nd+2] := xv; if dvars = [] then [seq(dary[i], i = 1 .. INFO["norigdepvars"])] else vals := NULL; for i to nops(dvars) do j := eval(dvars[i]); try if errest then vals := vals, evalhf(j(tv, xv, dary, daryt, daryx)) else vals := vals, evalhf(j(tv, xv, dary)) end if catch: userinfo(5, `pdsolve/numeric`, `evalhf failure`); try if errest then vals := vals, j(tv, xv, dary, daryt, daryx) else vals := vals, j(tv, xv, dary) end if catch: vals := vals, undefined end try end try end do; [vals] end if end proc; stype := "2nd"; if nargs = 1 then if args[1] = "left" then return solnproc(0, "left") elif args[1] = "right" then return solnproc(0, "right") elif args[1] = "start" then return solnproc("start", 0) else error "too few arguments to solution procedure" end if elif nargs = 2 then if stype = "1st" then tv := evalf(args[1]); xv := evalf(args[2]) else tv := evalf(args[2]); xv := evalf(args[1]) end if; if not (type(tv, 'numeric') and type(xv, 'numeric')) then if procname <> unknown then return ('procname')(args[1 .. nargs]) else ndsol := pointto(solnproc("soln_procedures")[1]); return ('ndsol')(args[1 .. nargs]) end if end if else error "incorrect arguments to solution procedure" end if; vals := solnproc(tv, xv); vals[1] end proc]

proc () local tv, xv, solnproc, stype, ndsol, vals; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; Digits := trunc(evalhf(Digits)); solnproc := proc (tv, xv) local INFO, errest, nd, dvars, dary, daryt, daryx, vals, msg, i, j; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; table( [( "soln_procedures" ) = array( 1 .. 1, [( 1 ) = (18446884069870505230)  ] ) ] ) INFO := table( [( "solmat_v" ) = Vector(189, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (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) = .0, (20) = .0, (21) = .0, (22) = .0, (23) = .0, (24) = .0, (25) = .0, (26) = .0, (27) = .0, (28) = .0, (29) = .0, (30) = .0, (31) = .0, (32) = .0, (33) = .0, (34) = .0, (35) = .0, (36) = .0, (37) = .0, (38) = .0, (39) = .0, (40) = .0, (41) = .0, (42) = .0, (43) = .0, (44) = .0, (45) = .0, (46) = .0, (47) = .0, (48) = .0, (49) = .0, (50) = .0, (51) = .0, (52) = .0, (53) = .0, (54) = .0, (55) = .0, (56) = .0, (57) = .0, (58) = .0, (59) = .0, (60) = .0, (61) = .0, (62) = .0, (63) = .0, (64) = .0, (65) = .0, (66) = .0, (67) = .0, (68) = .0, (69) = .0, (70) = .0, (71) = .0, (72) = .0, (73) = .0, (74) = .0, (75) = .0, (76) = .0, (77) = .0, (78) = .0, (79) = .0, (80) = .0, (81) = .0, (82) = .0, (83) = .0, (84) = .0, (85) = .0, (86) = .0, (87) = .0, (88) = .0, (89) = .0, (90) = .0, (91) = .0, (92) = .0, (93) = .0, (94) = .0, (95) = .0, (96) = .0, (97) = .0, (98) = .0, (99) = .0, (100) = .0, (101) = .0, (102) = .0, (103) = .0, (104) = .0, (105) = .0, (106) = .0, (107) = .0, (108) = .0, (109) = .0, (110) = .0, (111) = .0, (112) = .0, (113) = .0, (114) = .0, (115) = .0, (116) = .0, (117) = .0, (118) = .0, (119) = .0, (120) = .0, (121) = .0, (122) = .0, (123) = .0, (124) = .0, (125) = .0, (126) = .0, (127) = .0, (128) = .0, (129) = .0, (130) = .0, (131) = .0, (132) = .0, (133) = .0, (134) = .0, (135) = .0, (136) = .0, (137) = .0, (138) = .0, (139) = .0, (140) = .0, (141) = .0, (142) = .0, (143) = .0, (144) = .0, (145) = .0, (146) = .0, (147) = .0, (148) = .0, (149) = .0, (150) = .0, (151) = .0, (152) = .0, (153) = .0, (154) = .0, (155) = .0, (156) = .0, (157) = .0, (158) = .0, (159) = .0, (160) = .0, (161) = .0, (162) = .0, (163) = .0, (164) = .0, (165) = .0, (166) = .0, (167) = .0, (168) = .0, (169) = .0, (170) = .0, (171) = .0, (172) = .0, (173) = .0, (174) = .0, (175) = .0, (176) = .0, (177) = .0, (178) = .0, (179) = .0, (180) = .0, (181) = .0, (182) = .0, (183) = .0, (184) = .0, (185) = .0, (186) = .0, (187) = .0, (188) = .0, (189) = .0}, datatype = float[8], order = C_order, attributes = [source_rtable = (Matrix(21, 9, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (1, 7) = .0, (1, 8) = .0, (1, 9) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (2, 7) = .0, (2, 8) = .0, (2, 9) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (3, 7) = .0, (3, 8) = .0, (3, 9) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (4, 7) = .0, (4, 8) = .0, (4, 9) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (5, 7) = .0, (5, 8) = .0, (5, 9) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0, (6, 7) = .0, (6, 8) = .0, (6, 9) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (7, 5) = .0, (7, 6) = .0, (7, 7) = .0, (7, 8) = .0, (7, 9) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0, (8, 5) = .0, (8, 6) = .0, (8, 7) = .0, (8, 8) = .0, (8, 9) = .0, (9, 1) = .0, (9, 2) = .0, (9, 3) = .0, (9, 4) = .0, (9, 5) = .0, (9, 6) = .0, (9, 7) = .0, (9, 8) = .0, (9, 9) = .0, (10, 1) = .0, (10, 2) = .0, (10, 3) = .0, (10, 4) = .0, (10, 5) = .0, (10, 6) = .0, (10, 7) = .0, (10, 8) = .0, (10, 9) = .0, (11, 1) = .0, (11, 2) = .0, (11, 3) = .0, (11, 4) = .0, (11, 5) = .0, (11, 6) = .0, (11, 7) = .0, (11, 8) = .0, (11, 9) = .0, (12, 1) = .0, (12, 2) = .0, (12, 3) = .0, (12, 4) = .0, (12, 5) = .0, (12, 6) = .0, (12, 7) = .0, (12, 8) = .0, (12, 9) = .0, (13, 1) = .0, (13, 2) = .0, (13, 3) = .0, (13, 4) = .0, (13, 5) = .0, (13, 6) = .0, (13, 7) = .0, (13, 8) = .0, (13, 9) = .0, (14, 1) = .0, (14, 2) = .0, (14, 3) = .0, (14, 4) = .0, (14, 5) = .0, (14, 6) = .0, (14, 7) = .0, (14, 8) = .0, (14, 9) = .0, (15, 1) = .0, (15, 2) = .0, (15, 3) = .0, (15, 4) = .0, (15, 5) = .0, (15, 6) = .0, (15, 7) = .0, (15, 8) = .0, (15, 9) = .0, (16, 1) = .0, (16, 2) = .0, (16, 3) = .0, (16, 4) = .0, (16, 5) = .0, (16, 6) = .0, (16, 7) = .0, (16, 8) = .0, (16, 9) = .0, (17, 1) = .0, (17, 2) = .0, (17, 3) = .0, (17, 4) = .0, (17, 5) = .0, (17, 6) = .0, (17, 7) = .0, (17, 8) = .0, (17, 9) = .0, (18, 1) = .0, (18, 2) = .0, (18, 3) = .0, (18, 4) = .0, (18, 5) = .0, (18, 6) = .0, (18, 7) = .0, (18, 8) = .0, (18, 9) = .0, (19, 1) = .0, (19, 2) = .0, (19, 3) = .0, (19, 4) = .0, (19, 5) = .0, (19, 6) = .0, (19, 7) = .0, (19, 8) = .0, (19, 9) = .0, (20, 1) = .0, (20, 2) = .0, (20, 3) = .0, (20, 4) = .0, (20, 5) = .0, (20, 6) = .0, (20, 7) = .0, (20, 8) = .0, (20, 9) = .0, (21, 1) = .0, (21, 2) = .0, (21, 3) = .0, (21, 4) = .0, (21, 5) = .0, (21, 6) = .0, (21, 7) = .0, (21, 8) = .0, (21, 9) = .0}, datatype = float[8], order = C_order))]), ( "eqndep" ) = [1], ( "allocspace" ) = 21, ( "solvec3" ) = Vector(21, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (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) = .0, (20) = .0, (21) = .0}, datatype = float[8]), ( "depdords" ) = [[[2, 1]]], ( "method" ) = theta, ( "erroraccum" ) = true, ( "depshift" ) = [1], ( "startup_only" ) = false, ( "depords" ) = [[2, 1]], ( "rightwidth" ) = 0, ( "explicit" ) = false, ( "theta" ) = 1/2, ( "pts", r ) = [0, 1], ( "leftwidth" ) = 1, ( "intspace" ) = Matrix(21, 1, {(1, 1) = .0, (2, 1) = .0, (3, 1) = .0, (4, 1) = .0, (5, 1) = .0, (6, 1) = .0, (7, 1) = .0, (8, 1) = .0, (9, 1) = .0, (10, 1) = .0, (11, 1) = .0, (12, 1) = .0, (13, 1) = .0, (14, 1) = .0, (15, 1) = .0, (16, 1) = .0, (17, 1) = .0, (18, 1) = .0, (19, 1) = .0, (20, 1) = .0, (21, 1) = .0}, datatype = float[8], order = C_order), ( "timestep" ) = 0.500000000000000e-1, ( "solvec2" ) = Vector(21, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (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) = .0, (20) = .0, (21) = .0}, datatype = float[8]), ( "errorest" ) = false, ( "depeqn" ) = [1], ( "PDEs" ) = [diff(T(r, t), t)-(diff(T(r, t), r)+r*(diff(diff(T(r, t), r), r)))/r], ( "multidep" ) = [false, false], ( "banded" ) = true, ( "eqnords" ) = [[2, 1]], ( "vectorproc" ) = proc (v, vp, vpp, t, x, k, h, n, vec) local _s1, _s2, _s3, _s4, _s5, _s6, xi; _s3 := 2*k; _s4 := h*k; _s5 := 4*h^2; _s6 := 4*k*h^2; vec[1] := 0; vec[n] := 0; for xi from 2 to n-1 do _s1 := -vp[xi-1]+vp[xi+1]; _s2 := vp[xi-1]-2*vp[xi]+vp[xi+1]; vec[xi] := (_s2*_s3*x[xi]+_s5*vp[xi]*x[xi]+_s1*_s4)/(_s6*x[xi]) end do end proc, ( "matrixproc" ) = proc (v, vp, vpp, t, x, k, h, n, mat) local _s1, _s2, xi; _s1 := 4*h^2; _s2 := (h^2+k)/(k*h^2); mat[4] := -(3/2)/h; mat[5] := 2/h; mat[6] := -(1/2)/h; mat[9*n-5] := (3/2)/h+1; mat[9*n-7] := (1/2)/h; mat[9*n-6] := -2/h; for xi from 2 to n-1 do mat[9*xi-5] := _s2; mat[9*xi-6] := (h-2*x[xi])/(_s1*x[xi]); mat[9*xi-4] := -(h+2*x[xi])/(_s1*x[xi]) end do end proc, ( "spaceadaptive" ) = false, ( "spacepts" ) = 21, ( "solmat_i2" ) = 0, ( "maxords" ) = [2, 1], ( "periodic" ) = false, ( "totalwidth" ) = 9, ( "timei" ) = 3, ( "indepvars" ) = [r, t], ( "timeadaptive" ) = false, ( "extrabcs" ) = [0], ( "inputargs" ) = [diff(T(r, t), t)-(diff(T(r, t), r)+r*(diff(diff(T(r, t), r), r)))/r = 0, {T(r, 0) = 1, (D[1](T))(0, t) = 0, (D[1](T))(1, t) = -T(1, t)}, time = t, range = 0 .. 1], ( "solmat_is" ) = 0, ( "IBC" ) = b, ( "fdepvars" ) = [T(r, t)], ( "stages" ) = 1, ( "solmatrix" ) = Matrix(21, 9, {(1, 1) = .0, (1, 2) = .0, (1, 3) = .0, (1, 4) = .0, (1, 5) = .0, (1, 6) = .0, (1, 7) = .0, (1, 8) = .0, (1, 9) = .0, (2, 1) = .0, (2, 2) = .0, (2, 3) = .0, (2, 4) = .0, (2, 5) = .0, (2, 6) = .0, (2, 7) = .0, (2, 8) = .0, (2, 9) = .0, (3, 1) = .0, (3, 2) = .0, (3, 3) = .0, (3, 4) = .0, (3, 5) = .0, (3, 6) = .0, (3, 7) = .0, (3, 8) = .0, (3, 9) = .0, (4, 1) = .0, (4, 2) = .0, (4, 3) = .0, (4, 4) = .0, (4, 5) = .0, (4, 6) = .0, (4, 7) = .0, (4, 8) = .0, (4, 9) = .0, (5, 1) = .0, (5, 2) = .0, (5, 3) = .0, (5, 4) = .0, (5, 5) = .0, (5, 6) = .0, (5, 7) = .0, (5, 8) = .0, (5, 9) = .0, (6, 1) = .0, (6, 2) = .0, (6, 3) = .0, (6, 4) = .0, (6, 5) = .0, (6, 6) = .0, (6, 7) = .0, (6, 8) = .0, (6, 9) = .0, (7, 1) = .0, (7, 2) = .0, (7, 3) = .0, (7, 4) = .0, (7, 5) = .0, (7, 6) = .0, (7, 7) = .0, (7, 8) = .0, (7, 9) = .0, (8, 1) = .0, (8, 2) = .0, (8, 3) = .0, (8, 4) = .0, (8, 5) = .0, (8, 6) = .0, (8, 7) = .0, (8, 8) = .0, (8, 9) = .0, (9, 1) = .0, (9, 2) = .0, (9, 3) = .0, (9, 4) = .0, (9, 5) = .0, (9, 6) = .0, (9, 7) = .0, (9, 8) = .0, (9, 9) = .0, (10, 1) = .0, (10, 2) = .0, (10, 3) = .0, (10, 4) = .0, (10, 5) = .0, (10, 6) = .0, (10, 7) = .0, (10, 8) = .0, (10, 9) = .0, (11, 1) = .0, (11, 2) = .0, (11, 3) = .0, (11, 4) = .0, (11, 5) = .0, (11, 6) = .0, (11, 7) = .0, (11, 8) = .0, (11, 9) = .0, (12, 1) = .0, (12, 2) = .0, (12, 3) = .0, (12, 4) = .0, (12, 5) = .0, (12, 6) = .0, (12, 7) = .0, (12, 8) = .0, (12, 9) = .0, (13, 1) = .0, (13, 2) = .0, (13, 3) = .0, (13, 4) = .0, (13, 5) = .0, (13, 6) = .0, (13, 7) = .0, (13, 8) = .0, (13, 9) = .0, (14, 1) = .0, (14, 2) = .0, (14, 3) = .0, (14, 4) = .0, (14, 5) = .0, (14, 6) = .0, (14, 7) = .0, (14, 8) = .0, (14, 9) = .0, (15, 1) = .0, (15, 2) = .0, (15, 3) = .0, (15, 4) = .0, (15, 5) = .0, (15, 6) = .0, (15, 7) = .0, (15, 8) = .0, (15, 9) = .0, (16, 1) = .0, (16, 2) = .0, (16, 3) = .0, (16, 4) = .0, (16, 5) = .0, (16, 6) = .0, (16, 7) = .0, (16, 8) = .0, (16, 9) = .0, (17, 1) = .0, (17, 2) = .0, (17, 3) = .0, (17, 4) = .0, (17, 5) = .0, (17, 6) = .0, (17, 7) = .0, (17, 8) = .0, (17, 9) = .0, (18, 1) = .0, (18, 2) = .0, (18, 3) = .0, (18, 4) = .0, (18, 5) = .0, (18, 6) = .0, (18, 7) = .0, (18, 8) = .0, (18, 9) = .0, (19, 1) = .0, (19, 2) = .0, (19, 3) = .0, (19, 4) = .0, (19, 5) = .0, (19, 6) = .0, (19, 7) = .0, (19, 8) = .0, (19, 9) = .0, (20, 1) = .0, (20, 2) = .0, (20, 3) = .0, (20, 4) = .0, (20, 5) = .0, (20, 6) = .0, (20, 7) = .0, (20, 8) = .0, (20, 9) = .0, (21, 1) = .0, (21, 2) = .0, (21, 3) = .0, (21, 4) = .0, (21, 5) = .0, (21, 6) = .0, (21, 7) = .0, (21, 8) = .0, (21, 9) = .0}, datatype = float[8], order = C_order), ( "minspcpoints" ) = 4, ( "dependson" ) = [{1}], ( "initialized" ) = false, ( "depvars" ) = [T], ( "adjusted" ) = false, ( "solution" ) = Array(1..3, 1..21, 1..1, {(1, 1, 1) = .0, (1, 2, 1) = .0, (1, 3, 1) = .0, (1, 4, 1) = .0, (1, 5, 1) = .0, (1, 6, 1) = .0, (1, 7, 1) = .0, (1, 8, 1) = .0, (1, 9, 1) = .0, (1, 10, 1) = .0, (1, 11, 1) = .0, (1, 12, 1) = .0, (1, 13, 1) = .0, (1, 14, 1) = .0, (1, 15, 1) = .0, (1, 16, 1) = .0, (1, 17, 1) = .0, (1, 18, 1) = .0, (1, 19, 1) = .0, (1, 20, 1) = .0, (1, 21, 1) = .0, (2, 1, 1) = .0, (2, 2, 1) = .0, (2, 3, 1) = .0, (2, 4, 1) = .0, (2, 5, 1) = .0, (2, 6, 1) = .0, (2, 7, 1) = .0, (2, 8, 1) = .0, (2, 9, 1) = .0, (2, 10, 1) = .0, (2, 11, 1) = .0, (2, 12, 1) = .0, (2, 13, 1) = .0, (2, 14, 1) = .0, (2, 15, 1) = .0, (2, 16, 1) = .0, (2, 17, 1) = .0, (2, 18, 1) = .0, (2, 19, 1) = .0, (2, 20, 1) = .0, (2, 21, 1) = .0, (3, 1, 1) = .0, (3, 2, 1) = .0, (3, 3, 1) = .0, (3, 4, 1) = .0, (3, 5, 1) = .0, (3, 6, 1) = .0, (3, 7, 1) = .0, (3, 8, 1) = .0, (3, 9, 1) = .0, (3, 10, 1) = .0, (3, 11, 1) = .0, (3, 12, 1) = .0, (3, 13, 1) = .0, (3, 14, 1) = .0, (3, 15, 1) = .0, (3, 16, 1) = .0, (3, 17, 1) = .0, (3, 18, 1) = .0, (3, 19, 1) = .0, (3, 20, 1) = .0, (3, 21, 1) = .0}, datatype = float[8], order = C_order), ( "t0" ) = 0, ( "spacestep" ) = 0.500000000000000e-1, ( "vectorhf" ) = true, ( "solvec1" ) = Vector(21, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (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) = .0, (20) = .0, (21) = .0}, datatype = float[8]), ( "solmat_i1" ) = 0, ( "autonomous" ) = true, ( "timeidx" ) = 2, ( "ICS" ) = [1], ( "matrixhf" ) = true, ( "solspace" ) = Vector(21, {(1) = .0, (2) = .0, (3) = .0, (4) = .0, (5) = .0, (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) = .0, (20) = .0, (21) = 1.0}, datatype = float[8]), ( "solvec5" ) = 0, ( "spacevar" ) = r, ( "mixed" ) = false, ( "linear" ) = true, ( "timevar" ) = t, ( "norigdepvars" ) = 1, ( "solmat_ne" ) = 0, ( "solvec4" ) = 0, ( "soltimes" ) = Vector(3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8]), ( "BCS", 1 ) = {[[1, 1, 0], b[1, 1, 0]], [[1, 0, 1], [1, 1, 1], b[1, 1, 1]+b[1, 0, 1]]}, ( "spaceidx" ) = 1, ( "bandwidth" ) = [2, 4] ] ); if xv = "left" then return INFO["solspace"][1] elif xv = "right" then return INFO["solspace"][INFO["spacepts"]] elif tv = "start" then return INFO["t0"] elif not (type(tv, 'numeric') and type(xv, 'numeric')) then error "non-numeric input" end if; if xv < INFO["solspace"][1] or INFO["solspace"][INFO["spacepts"]] < xv then error "requested %1 value must be in the range %2..%3", INFO["spacevar"], INFO["solspace"][1], INFO["solspace"][INFO["spacepts"]] end if; dary := Vector(3, {(1) = .0, (2) = .0, (3) = .0}, datatype = float[8]); daryt := 0; daryx := 0; dvars := []; errest := false; nd := nops(INFO["depvars"]); if dary[nd+1] <> tv then try `pdsolve/numeric/evolve_solution`(INFO, tv) catch: msg := StringTools:-FormatMessage(lastexception[2 .. -1]); if tv < INFO["t0"] then error cat("unable to compute solution for %1<%2:
", msg), INFO["timevar"], INFO["failtime"] else error cat("unable to compute solution for %1>%2:
", msg), INFO["timevar"], INFO["failtime"] end if end try end if; if dary[nd+1] <> tv or dary[nd+2] <> xv then `pdsolve/interp2dto0d`(3, INFO["soltimes"], INFO["spacepts"], INFO["solspace"], nops(INFO["depvars"]), INFO["solution"], true, tv, xv, dary); if errest then `pdsolve/interp2dto0d`(3, INFO["soltimes"], INFO["spacepts"], INFO["err_t"], nops(INFO["depvars"]), INFO["solution"], true, tv, xv, daryt); `pdsolve/interp2dto0d`(3, INFO["soltimes"], INFO["spacepts"], INFO["err_x"], nops(INFO["depvars"]), INFO["solution"], true, tv, xv, daryx) end if end if; dary[nd+1] := tv; dary[nd+2] := xv; if dvars = [] then [seq(dary[i], i = 1 .. INFO["norigdepvars"])] else vals := NULL; for i to nops(dvars) do j := eval(dvars[i]); try if errest then vals := vals, evalhf(j(tv, xv, dary, daryt, daryx)) else vals := vals, evalhf(j(tv, xv, dary)) end if catch: userinfo(5, `pdsolve/numeric`, `evalhf failure`); try if errest then vals := vals, j(tv, xv, dary, daryt, daryx) else vals := vals, j(tv, xv, dary) end if catch: vals := vals, undefined end try end try end do; [vals] end if end proc; stype := "2nd"; if nargs = 1 then if args[1] = "left" then return solnproc(0, "left") elif args[1] = "right" then return solnproc(0, "right") elif args[1] = "start" then return solnproc("start", 0) else error "too few arguments to solution procedure" end if elif nargs = 2 then if stype = "1st" then tv := evalf(args[1]); xv := evalf(args[2]) else tv := evalf(args[2]); xv := evalf(args[1]) end if; if not (type(tv, 'numeric') and type(xv, 'numeric')) then if procname <> unknown then return ('procname')(args[1 .. nargs]) else ndsol := pointto(solnproc("soln_procedures")[1]); return ('ndsol')(args[1 .. nargs]) end if end if else error "incorrect arguments to solution procedure" end if; vals := solnproc(tv, xv); vals[1] end proc

plots:-animate(plot3d, [[r*cos(s), r*sin(s), myT(r,t)], r=0..1, s=-Pi..Pi],
    t=0..2, style=surface, axes=framed, shading="z", frames=50);


 

Download heat-equation-on-a-disk.mw

 

restart;

A := <a, b; c, d>;

Matrix(2, 2, {(1, 1) = a, (1, 2) = b, (2, 1) = c, (2, 2) = d})

Y := < y(t), diff(y(t),t) >;

Vector(2, {(1) = y(t), (2) = diff(y(t), t)})

F := < f[1], f[2] >;

Vector(2, {(1) = f[1], (2) = f[2]})

sys := A . Y =~ F;

Vector(2, {(1) = a*y(t)+b*(diff(y(t), t)) = f[1], (2) = c*y(t)+d*(diff(y(t), t)) = f[2]})

Recover the coefficient matrix:

LinearAlgebra:-GenerateMatrix(convert(sys,list), convert(Y,list))[1];

Matrix(2, 2, {(1, 1) = a, (1, 2) = b, (2, 1) = c, (2, 2) = d})

Alternatively, if the system is given as

sys := A . Y = F;

(Vector(2, {(1) = a*y(t)+b*(diff(y(t), t)), (2) = c*y(t)+d*(diff(y(t), t))})) = (Vector(2, {(1) = f[1], (2) = f[2]}))

Then we do

LinearAlgebra:-GenerateMatrix(convert(lhs(sys),list), convert(Y,list))[1];

Matrix(2, 2, {(1, 1) = a, (1, 2) = b, (2, 1) = c, (2, 2) = d})


 

Download mw.mw

 

I don't think a fixed set of option would be suitable for every plot.  I tweak the options until I get the best representation for the object at hand.  But if you have a favorite set of options which you would like to apply to every plot, then you may put those in your initialization file like this:
plots[setoptions3d](style=patch, axes=boxed, scaling=constrained, tickmarks=[0,0,0], projection=0.3);

As to antialiasing, as far as I can see, Maple's 3D plots have properly antialiased edges.  Perhaps there is something that you can see that I don't.

The "size changes with depth" is achieved through plot3d's projection option.  See the sample below.

As to lighting, I agree with you that the default settings can be improved.  Ideally there should be a GUI method for moving the light source, and optionally provide more than one light source.  Are you listening, Maple Tech?

It would help if you would post a specific plot and point out those aspects in it that you are unhappy with.  Then people may be able to provide useful pointers.  For now, I am posting a plot of a knot since you mentioned it.
 

restart;

x := sin(t) + 2*sin(2*t):
y := cos(t) - 2*cos(2*t):
z := sin(3*t):
plots:-tubeplot([x,y,z], t=0..2*Pi, radius=0.5,
  grid=[120,20], style=surface, color="Green",
  scaling=constrained, projection=0.4, axes=none);


 

Download knot.mw

 

restart;

F := p[i,j] = 1 - q[i,j] - alpha*q[i,k] - beta*(q[h,j]+alpha*q[h,k]);

p[i, j] = 1-q[i, j]-alpha*q[i, k]-beta*(alpha*q[h, k]+q[h, j])

We look at all selections of `in`(i, {1, 2}), `in`(j, {1, 2, 3}), and pick h <> i and k <> j.
That gives us 12 cases.  We evaluate F for those 12 cases and obtain a
linear system of 12 equations in the 6 unknowns q[1, 1], q[1, 2], q[1, 3], q[2, 1], q[2, 2], q[2, 3].

sys := NULL:
for i from 1 to 2 do
  for j from 1 to 3 do
    printf("i = %d, j = %d, ", i, j);
    printf("h in %a, ", {1,2} minus {i});
    printf("k in %a\n", {1,2,3} minus {j});
    sys := sys, seq(seq(F, h in {1,2} minus {i}), k in {1,2,3} minus {j});
  end do;
end do:
sys := {sys}:

i = 1, j = 1, h in {2}, k in {2, 3}
i = 1, j = 2, h in {2}, k in {1, 3}
i = 1, j = 3, h in {2}, k in {1, 2}
i = 2, j = 1, h in {1}, k in {2, 3}
i = 2, j = 2, h in {1}, k in {1, 3}
i = 2, j = 3, h in {1}, k in {1, 2}

nops(sys);

12

indets(sys, name);
vars := select(has, %, q);

{alpha, beta, p[1, 1], p[1, 2], p[1, 3], p[2, 1], p[2, 2], p[2, 3], q[1, 1], q[1, 2], q[1, 3], q[2, 1], q[2, 2], q[2, 3]}

{q[1, 1], q[1, 2], q[1, 3], q[2, 1], q[2, 2], q[2, 3]}

solve(sys, vars);  # returns empty

We see that the system has no solution (it is inconsistent).  You need to reformulate
your question.

 

 

 

Download mw.mw

 

 

Solving statically determinate trusses in Maple

This worksheet shows how to solve a statically determinate truss in Maple.
It is done through an example but the method is general and applies to both
2D and 3D trusses.  With a little extra work it should be possible to encapsulate
the process into a general module.  I will leave that as an exercise for the interested
reader.


The example truss is taken from

http://adaptivemap.ma.psu.edu/websites/5_structures/method_of_joints/methodofjoints.html
                               

 

Rouben Rostamian
2019-11-06

restart;

with(plots):

with(plottools):

Define the coordinates of the joints, taken from the picture above:

Joints := [
  <0,0>,                     # A
  <10,0>,                    # B
  <10, -10*tan(20/180*Pi)>,  # C
  <20, 0>,                   # D
  <20, -10*tan(20/180*Pi)>,  # E
  <30, 0>,                   # F
NULL];

[Vector(2, {(1) = 0, (2) = 0}), Vector(2, {(1) = 10, (2) = 0}), Vector(2, {(1) = 10, (2) = -10*tan((1/9)*Pi)}), Vector(2, {(1) = 20, (2) = 0}), Vector(2, {(1) = 20, (2) = -10*tan((1/9)*Pi)}), Vector(2, {(1) = 30, (2) = 0})]

nJoints := nops(Joints);

6

A member that connects joints i and j is represented as the pair [i, j]

Members := [[1,2], [2,4], [4,6], [1,3], [3,5], [5,6], [2,3], [4,5], [2,5]];

[[1, 2], [2, 4], [4, 6], [1, 3], [3, 5], [5, 6], [2, 3], [4, 5], [2, 5]]

nMembers := nops(Members);

9

We precompute the lengths of the members because these will be needed in several places later on.

MemberLength := (x->LinearAlgebra:-Norm(Joints[x[2]]-Joints[x[1]],2))~(Members);

[10, 10, 10, 10*(1+tan((1/9)*Pi)^2)^(1/2), 10, 10*(1+tan((1/9)*Pi)^2)^(1/2), 10*tan((1/9)*Pi), 10*tan((1/9)*Pi), 10*(1+tan((1/9)*Pi)^2)^(1/2)]

Force[i] is the force vector acting on the joint #i.  We do not distinguish between the given/applied
forces (in this case those acting on the joints #2 and #4) and the (unknown) reaction forces at the
supports.  Referring to the picture, we see that joint #1 is an anchor therefore its reaction has
both horizontal and vertical components ("`H__1`,`V__1`)" but joint #6 is a rolling support therefore its
reaction has only a vertical component "(0,`V__6`)."

Force := Array(1..nJoints, {1=<H[1],V[1]>, 2=<0,-60>, 4=<0,-80>, 6=<0,V[6]>});

Vector[row](6, {(1) = Vector(2, {(1) = H[1], (2) = V[1]}), (2) = Vector(2, {(1) = 0, (2) = -60}), (3) = 0, (4) = Vector(2, {(1) = 0, (2) = -80}), (5) = 0, (6) = Vector(2, {(1) = 0, (2) = V[6]})})

Here are the components of the reaction forces:

Reactions := {H[1], V[1], V[6]};

{H[1], V[1], V[6]}

We write T[i] for the (yet unknown)  axial force within the member #i.  A positive T[i]
corresponds to tension while a negative T[i]  corresponds to compression.  Here is
the problem's complete set of unknowns:

unknowns := {T[k] $k=1..nMembers} union Reactions;

{H[1], T[1], T[2], T[3], T[4], T[5], T[6], T[7], T[8], T[9], V[1], V[6]}

We plot the truss to reassure ourselves that we have made no data entry errors

display([
  seq(pointplot([Joints[Members[k][1]], Joints[Members[k][2]]], connect), k=1..nMembers),
  seq(pointplot(Joints[k], symbol=solidcircle, symbolsize=20, color=red), k=1..nJoints),
NULL], scaling=constrained, axes=framed, thickness=5, color="Green", size=[700,200]);

At this point we are done with setting up the problem.  Now we proceed with the solution.

The matrix B defined below expresses the connectivity of the truss.  Specifically,
if B[i, j] is zero then the joints NULL and NULLare not connected.  Otherwise they are
connected through the member k = B[i, j].

B := Matrix(nJoints, shape=symmetric):
for k from 1 to nMembers do
  i := Members[k][1];
  j := Members[k][2];
  B[i,j] := k;
end do:
unassign('i', 'j', 'k');

This is what B  looks like:

print(B);

Matrix(6, 6, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 4, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (2, 1) = 1, (2, 2) = 0, (2, 3) = 7, (2, 4) = 2, (2, 5) = 9, (2, 6) = 0, (3, 1) = 4, (3, 2) = 7, (3, 3) = 0, (3, 4) = 0, (3, 5) = 5, (3, 6) = 0, (4, 1) = 0, (4, 2) = 2, (4, 3) = 0, (4, 4) = 0, (4, 5) = 8, (4, 6) = 3, (5, 1) = 0, (5, 2) = 9, (5, 3) = 5, (5, 4) = 8, (5, 5) = 0, (5, 6) = 6, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 3, (6, 5) = 6, (6, 6) = 0})

At equilibrium the resultant of forces applied to every joint
is zero.  This gives us a system of (2*nJoints) equations.

sys := NULL:
for i from 1 to nJoints do
  eq := 0;
  for j from 1 to nJoints do
    if (k := B[i,j]) = 0 then next end if;
    eq += (Joints[j] - Joints[i])/MemberLength[k]*T[k];
  end do;
  eq + Force[i];
  sys := sys, convert(%, set);
end do:
unassign('i', 'j', 'k');
sys := `union`(sys);

{-T[2]+T[3], -T[3]-T[6]/(1+tan((1/9)*Pi)^2)^(1/2), -T[8]-80, -T[4]/(1+tan((1/9)*Pi)^2)^(1/2)+T[5], -T[4]*tan((1/9)*Pi)/(1+tan((1/9)*Pi)^2)^(1/2)+V[1], T[4]*tan((1/9)*Pi)/(1+tan((1/9)*Pi)^2)^(1/2)+T[7], -T[6]*tan((1/9)*Pi)/(1+tan((1/9)*Pi)^2)^(1/2)+V[6], -T[1]+T[2]+T[9]/(1+tan((1/9)*Pi)^2)^(1/2), T[1]+T[4]/(1+tan((1/9)*Pi)^2)^(1/2)+H[1], -T[7]-T[9]*tan((1/9)*Pi)/(1+tan((1/9)*Pi)^2)^(1/2)-60, -T[9]/(1+tan((1/9)*Pi)^2)^(1/2)-T[5]+T[6]/(1+tan((1/9)*Pi)^2)^(1/2), T[9]*tan((1/9)*Pi)/(1+tan((1/9)*Pi)^2)^(1/2)+T[8]+T[6]*tan((1/9)*Pi)/(1+tan((1/9)*Pi)^2)^(1/2)}

Here is the solution of truss

sol := solve(sys, unknowns);

{H[1] = 0, T[1] = -(200/3)/tan((1/9)*Pi), T[2] = -(220/3)/tan((1/9)*Pi), T[3] = -(220/3)/tan((1/9)*Pi), T[4] = (200/3)*(1+tan((1/9)*Pi)^2)^(1/2)/tan((1/9)*Pi), T[5] = (200/3)/tan((1/9)*Pi), T[6] = (220/3)*(1+tan((1/9)*Pi)^2)^(1/2)/tan((1/9)*Pi), T[7] = -200/3, T[8] = -80, T[9] = (20/3)*(1+tan((1/9)*Pi)^2)^(1/2)/tan((1/9)*Pi), V[1] = 200/3, V[6] = 220/3}

and here is the floating point representation of the solution:

evalf(sol);

{H[1] = 0., T[1] = -183.1651613, T[2] = -201.4816774, T[3] = -201.4816774, T[4] = 194.9202934, T[5] = 183.1651613, T[6] = 214.4123227, T[7] = -66.66666667, T[8] = -80., T[9] = 19.49202934, V[1] = 66.66666667, V[6] = 73.33333333}

 

 

 

Download truss.mw

 

restart;

Your system consists of four differential equations:

de1 := 2.412138000*diff(varphi(t), t)^2 = -0.28*Yb;

2.412138000*(diff(varphi(t), t))^2 = -.28*Yb

de2 := 15.00000000*diff(varphi(t), t)^2 = Ya + Yb;

15.00000000*(diff(varphi(t), t))^2 = Ya+Yb

de3 := -2.412138000*diff(varphi(t), t, t) = -0.28*Xb;

-2.412138000*(diff(diff(varphi(t), t), t)) = -.28*Xb

de4 := 15.00000000*diff(varphi(t), t, t) = Xa + Xb;

15.00000000*(diff(diff(varphi(t), t), t)) = Xa+Xb

Differentiating de1 with respect to t we get

dde1 := diff(de1,t);

4.824276000*(diff(varphi(t), t))*(diff(diff(varphi(t), t), t)) = 0

This says that either the first derivative or the second derivative of `&varphi;` is zero.

Let's look at the case where the first derivative of `&varphi;` is zero.

Then `&varphi;` is a constant.  But you want `&varphi;`(0) = 0, therefore `&varphi;` is identically zero.
Then

from de1 we get Yb = 0
from de3 we get Xb = 0;
from de2 we get Ya = 0
from de4 we get Xa = 0.

Now, let's look at the case where the second derivative `&varphi;` is zero"."
Then `&varphi;`(t) = a*t because you want `&varphi;`(0) = 0.  The coefficient a
is arbitrary.  Then

from de3 we get Xb = 0
from de4 we get Xa = 0;
from de1 we get Yb = -8.614778571*a^2;
from de2 we get Ya = 23.61477857*a^2.

 

``

 

Download mw.mw

 

 

Your eq41 is:

eq41_orig:=R__max(theta,0)=piecewise(theta<=rhs(eq02),(B/2+L__1)/cos(theta),theta<=rhs(eq03),(H/2)/sin(theta),rhs(eq03)<theta,(B/2-L__1)/cos(Pi-theta));

eq41 := R__max(theta, 0) = piecewise(theta <= arctan(H/(2*((1/2)*B+L__1))), ((1/2)*B+L__1)/cos(theta), theta <= Pi-arctan(H/(2*((1/2)*B-L__1))), H/(2*sin(theta)), Pi-arctan(H/(2*((1/2)*B-L__1))) < theta, -((1/2)*B-L__1)/cos(theta))

We see that the right-hand side is a function of theta, everything else being
constants. To simplify the computation, replace that messy expression with
a generic phi(theta), as in

eq41:=R__max(theta,0)=phi(theta);

R__max(theta, 0) = phi(theta)

Then execute your worksheet to arrive at this simple representation of the solution:

sol3:=simplify(dsolve([eq37a,bc], v__r(r, theta,beta)));

v__r(r, theta, beta) = -8*Pi^2*H*B*(B+2*L__1)^2*(((B+2*L__1)*Pi+4*beta*C)*phi(theta)-r*Pi*(B+2*L__1))*r*C*(((B+2*L__1)*Pi+4*beta*C)*phi(theta)+r*Pi*(B+2*L__1))/(phi(theta)^2*(r*cos(theta)-R__f)*(Int(phi(theta)^2, theta = 0 .. Pi))*((B+2*L__1)*Pi+4*beta*C)^5)

To complete the calculation, you need to evaluate the integral in the denominator.
Since phi(theta) is defined piecewise, there are too many cases if the parameters "B, H,"
and L__1 are unspecified.  What do you know about how those parameters are related?
Perhaps with some a priori information on the relative values of the paramters a
general answer can be obtained.

In the absence of that information, specifying the parameters is the way to go.
For instance, with your choice of numerical values the integral evaluates to 100:

eval(rhs(eq41_orig), {B=10, H=10, L__1=4}):
int(%^2, theta=0..Pi);

100


 

Download mw.mw

 

First 19 20 21 22 23 24 25 Last Page 21 of 53