acer

32587 Reputation

29 Badges

20 years, 36 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

Your expectation is not valid.

Perhaps you meant to query   max(abs(Q))  ?

restart

A := Matrix(10, 10, {(1, 1) = 0.358665012985547e-3, (1, 2) = -0.164628637225196e-2, (1, 3) = 0.808705603350256e-3, (1, 4) = 0.131914692392149e-2, (1, 5) = -0.120745384995453e-2, (1, 6) = -0.127685186328850e-3, (1, 7) = -0.368262140727460e-3, (1, 8) = 0.722934152182773e-3, (1, 9) = 0.406838157326509e-3, (1, 10) = -0.270949354604275e-3, (2, 1) = -1.04811784877605, (2, 2) = -0.227246433636184e-2, (2, 3) = 1.12987295590946, (2, 4) = 0.320910227706809e-2, (2, 5) = -0.837137925723646e-1, (2, 6) = -0.590494756927829e-3, (2, 7) = 0.141893953127997e-2, (2, 8) = -0.431705701475750e-3, (2, 9) = 0.529611988652095e-3, (2, 10) = 0.876913927974057e-4, (3, 1) = -0.186537779517955e-2, (3, 2) = 0.731113455007046e-3, (3, 3) = -0.916700660778503e-2, (3, 4) = -0.429742144388156e-2, (3, 5) = 0.171402262358938e-1, (3, 6) = 0.147242552352914e-2, (3, 7) = -0.837021118160759e-2, (3, 8) = 0.348174114649671e-2, (3, 9) = 0.225687533471807e-2, (3, 10) = -0.139775301206369e-2, (4, 1) = -1.52107139964422, (4, 2) = 0.808077875491177e-2, (4, 3) = 1.64372029140351, (4, 4) = -0.847286100516818e-2, (4, 5) = -.127335986762229, (4, 6) = 0.118070315638635e-2, (4, 7) = 0.424032693235149e-2, (4, 8) = -0.111038208252920e-2, (4, 9) = 0.434602411991222e-3, (4, 10) = 0.318930385884084e-3, (5, 1) = 0.289424730370674e-2, (5, 2) = -0.172887794344293e-2, (5, 3) = 0.157061251396572e-1, (5, 4) = -0.363778806608431e-2, (5, 5) = -0.221497403961738e-1, (5, 6) = 0.205810013144210e-2, (5, 7) = 0.290388608347142e-2, (5, 8) = 0.554530769943721e-2, (5, 9) = 0.645600822073613e-3, (5, 10) = -0.223995662113480e-2, (6, 1) = 4.05367823691209, (6, 2) = -0.669541776787987e-2, (6, 3) = -4.37687402333541, (6, 4) = 0.100071882622313e-1, (6, 5) = .331612307231483, (6, 6) = -0.222866442868341e-2, (6, 7) = -0.854247230826875e-2, (6, 8) = -0.198825849939076e-2, (6, 9) = 0.144764377225621e-3, (6, 10) = 0.887581546748840e-3, (7, 1) = 0.437884803847533e-3, (7, 2) = -0.468560550990847e-2, (7, 3) = -0.274035269283456e-2, (7, 4) = 0.132221205985872e-2, (7, 5) = 0.587286710360397e-2, (7, 6) = 0.141670610986008e-2, (7, 7) = -0.324890905770655e-2, (7, 8) = 0.346314407352620e-2, (7, 9) = -0.313507643096885e-3, (7, 10) = -0.150449109852917e-2, (8, 1) = -1.74365543905306, (8, 2) = 0.329936253329467e-2, (8, 3) = 1.88180005384087, (8, 4) = -0.307966351872919e-2, (8, 5) = -.141724173079475, (8, 6) = 0.461487956516473e-3, (8, 7) = 0.455622531837965e-2, (8, 8) = -0.147959204065083e-2, (8, 9) = -0.964311997155483e-3, (8, 10) = 0.776900663643289e-3, (9, 1) = -0.182153308681337e-2, (9, 2) = 0.731579627122705e-2, (9, 3) = -0.459671306590223e-2, (9, 4) = 0.528628529817773e-2, (9, 5) = 0.340926625224384e-3, (9, 6) = -0.480044705401815e-2, (9, 7) = 0.906564729308528e-2, (9, 8) = -0.131891681339107e-1, (9, 9) = -0.298963526401197e-2, (9, 10) = 0.539189475787896e-2, (10, 1) = .259153153490112, (10, 2) = -0.239896326933024e-2, (10, 3) = -.278509331317189, (10, 4) = -0.165332320182602e-2, (10, 5) = 0.211686310866469e-1, (10, 6) = 0.115660284907533e-2, (10, 7) = -0.165524436062079e-2, (10, 8) = 0.496708050164578e-2, (10, 9) = -0.161592001287913e-3, (10, 10) = -0.203232293033617e-2})

Q := A/max(abs(A))

max(Q)

.926158307610656317

(1)

max(1/max(A).A)

1.00000000011419887

(2)

max(1/max(abs(A)).abs(A))

1.00000000021082958

(3)

L := [4, -10]:

max(abs~(L));

10

(4)

1/max(abs~(L)) * L;
max(%); # so what!

[2/5, -1]

 

2/5

(5)

1/max(abs~(L)) * abs~(L);
max(%);

[2/5, 1]

 

1

(6)

1/max(L) * L;
max(%);

[1, -5/2]

 

1

(7)

``

Download suuual_ac.mw 

 

One way that the error message "bad index into Array" can occur is where Maple tries to access the Array using a non-numeric index.

A typical example would be where Maple tries to access, say, Y[i] where the name i does not yet have an integer value. Eg,

restart;
Y := Array(1..10, i->i):

Y[i];
Error, bad index into Array

The seq command has special evaluation rules, which prevents Y[i] from being evaluated until i gets actual values. So this works.

restart;
Y := Array(1..10, i->i):

seq(Y[i], i=1..10);
               1, 2, 3, 4, 5, 6, 7, 8, 9, 10

But the sum command does not have special evaluation rules. The following produces the same error as does the first example above,

restart;
Y := Array(1..10, i->i):

sum(Y[i], i=1..10);
Error, bad index into Array

What just happened was that Maple tried to evaluate the first argument passed to the sum call before i got any value, which is Maple's usual evaluation rules for procedure calls. But, for what you are trying to accomplish, the Array reference Y[i] was evaluated prematurely.

Here are two alternative ways to do summation involving Array elements:

1) Use the add command instead of the sum command, since the add command also has special evaluation rules.

restart;
Y := Array(1..10, i->i):
add(Y[i], i=1..10);
                           55

2) Delay the indexed Array reference using unevaluation quotes (single right-quotes).

restart;
Y := Array(1..10, i->i):
sum('Y[i]', i=1..10);
                           55

Now, I am guessing that this kind of premature evaluation of an indexed Array reference is your problem, mostly based on your use of the words, "summation index" and the particular error message you cited. If I've guess wrongly then please provide the full example.

I'll note that at least one other Answer seems to be indicating that you've accessed Array entries using invalid numeric values for the index. I suspect that is not your problem, however, mostly because the error message for that situation is different than your Question's title.

restart;
Y := Array(1..10, i->i):

seq(Y[i+1]-Y[i], i=1..10);
Error, Array index out of range

seq(Y[i+1]-Y[i], i=0..9);
Error, Array index out of range

On MS-Windows and Linux you can use the keyboard short-cuts Ctl-r to temporarily switch from text mode to 2D Input mode, and Ctl-t to switch back.

On Mac OS X I believe that it's similar, Cmd-r and Cmd-t .

See the help-pages for more.

In general the solve command does not return all solutions for transcendental equations, while also not returning a warning about solutions being lost. This has some mention on the help-page for topic solve,details .

What that page fails to say is that, when the number of solutions can be determined by Maple as being bound by additional, supplied inequalities, the use of the explicit option as well as the allsolutions option can (sometimes, if it can be worked out by Maple) get an explicit full answer or additional solutions.

Sorry, I only have access to back to Maple 16.02 today, and not Maple 15 which seems to be indicated on your Question.

restart;

H := sqrt(1-2*r*cos(theta)):

eqs := { 0=2*r*(H*(2-H)-3*sin(theta)^2),
         0=-3*sin(2*theta) }:

solve( {r>=0, op(eqs)}, [r,theta] ):
map(print, %):

[r = 0, theta = 0]

 

[r = 1/2, theta = 0]

 

[r = 3/2, theta = Pi]

(1)

sols := solve( {r>=0, op(eqs), theta>=0, theta<=2*Pi},
               [r,theta], explicit, allsolutions ):
map(print, %):

[r = 0, theta = 0]

 

[r = 0, theta = (1/2)*Pi]

 

[r = 0, theta = Pi]

 

[r = 0, theta = (3/2)*Pi]

 

[r = 0, theta = 2*Pi]

 

[r = 1/2, theta = 0]

 

[r = 1/2, theta = 2*Pi]

 

[r = 3/2, theta = Pi]

(2)

 

Download solvert.mw

If you are just trying to get the right-hand sides of the equations in L,

map(rhs, L);
                             {b, f}

If you are trying to use L as a lookup key for a and e,

L := {a = b, e = f};
                      L := {a = b, e = f}

eval({a, e}, L);
                             {b, f}

eval([a, e], L);
                             [b, f]

eval(a, L);
                               b

eval(e, L);
                               f

Perhaps you are looking for a syncronized side-by-side Array of animations.

With the Table borders toggled off (via right-click Table->Properties), and with scaling=constrained, you could get it like so:

animarray.mw

The correct syntax would be Eigenvectors(A) instead of Eigenvectors[A] as you had it. But that seems to take too long.

restart;

local gamma;

E := [q2, q2^2/q1+(gamma-1)*(q5-(1/2)*q2^2/q1-(1/2)*q3^2/q1-(1/2)*q4^2/q1), q2*q3/q1, q4*q2/q1, q5*q2/q1+q2*(gamma-1)*(q5-(1/2)*q2^2/q1-(1/2)*q3^2/q1-(1/2)*q4^2/q1)/q1, q6*q2/q1]:

F := [q3, q2*q3/q1, q3^2/q1+(gamma-1)*(q5-(1/2)*q2^2/q1-(1/2)*q3^2/q1-(1/2)*q4^2/q1), q4*q3/q1, q5*q3/q1+q3*(gamma-1)*(q5-(1/2)*q2^2/q1-(1/2)*q3^2/q1-(1/2)*q4^2/q1)/q1, q6*q3/q1]:

G := [q4, q4*q2/q1, q4*q3/q1, q4^2/q1+(gamma-1)*(q5-(1/2)*q2^2/q1-(1/2)*q3^2/q1-(1/2)*q4^2/q1), q5*q4/q1+q4*(gamma-1)*(q5-(1/2)*q2^2/q1-(1/2)*q3^2/q1-(1/2)*q4^2/q1)/q1, q6*q4/q1]:

Ebar := expand(E*xi_x+F*xi_y+G*xi_z):
U := [q1, q2, q3, q4, q5, q6]:

A := subs(q1 = rho, q2 = rho*u, q3 = rho*v, q4 = rho*w, q5 = rho*e, q6 = rho*nu, VectorCalculus:-Jacobian(Ebar, U)):

A := subs(e = P/((gamma-1)*rho)+(1/2)*u^2+(1/2)*v^2+(1/2)*w^2, A):

A := subs(P = rho*c^2/gamma, A):

A := simplify(A):

op(1,A);

6, 6

(1)

with(LinearAlgebra):

evalsA:=LinearAlgebra:-Eigenvalues(A);

Vector(6, {(1) = u*xi_x+v*xi_y+w*xi_z+sqrt(c^2*xi_x^2+c^2*xi_y^2+c^2*xi_z^2), (2) = u*xi_x+v*xi_y+w*xi_z-sqrt(c^2*xi_x^2+c^2*xi_y^2+c^2*xi_z^2), (3) = u*xi_x+v*xi_y+w*xi_z, (4) = u*xi_x+v*xi_y+w*xi_z, (5) = u*xi_x+v*xi_y+w*xi_z, (6) = u*xi_x+v*xi_y+w*xi_z})

(2)

DetK:=Determinant(CharacteristicMatrix(A,K)):

seq(simplify(eval(DetK,K=evalsA[ii])), ii=1..6);

0, 0, 0, 0, 0, 0

(3)

#N6gen:=LinearSolve(eval(CharacteristicMatrix(A,K),K=evalsA[6]), Vector(6));

#simplify(eval(CharacteristicMatrix(A,K),K=evalsA[6]) . N6gen);
#simplify( A.N6gen - evalsA[6]*N6gen );

for ii from 1 to 3 do
  evecsA[ii]:=simplify(NullSpace(eval(CharacteristicMatrix(A,K),K=evalsA[ii])));
end do:

for ii from 1 to 3 do
  seq( simplify( A . evecsA[ii][jj] - evalsA[ii] * evecsA[ii][jj] ), jj=1..nops(evecsA[ii]));
end do;

Vector(6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0})

 

Vector(6, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0})

 

Vector[column](%id = 18446884146858440574), Vector[column](%id = 18446884146858442254), Vector[column](%id = 18446884146531192950), Vector[column](%id = 18446884146531194390)

(4)

 


Download eigs.mw

Since the answer you expected has just F on the left-hand side then it is understandable that people give you answers about isolating or solving for F.

But another way to interpret your question involves cancellation of common factors in the left- and right-hand sides. For your given example that just happens to provide the same result as isolating for F.

But it's not a silly question. The simplify command will not "cancel" such common factors.

I don't promise that the following will work for all kinds of equations. But here's your example as well as another slightly more complicated one.

restart;

fact := (expr::equation) -> frontend(gcd,[numer(lhs(expr)),numer(rhs(expr))])/
                            frontend(gcd,[denom(lhs(expr)),denom(rhs(expr))]):

eq1 := F*R=(1/2*M*R^2)*(a/R);

                                       M R a
                          eq1 := F R = -----
                                         2

eq1/fact(eq1);

                                    M a
                                F = ---
                                     2

eq2 := (F+G)*R/sqrt(W-1)=(1/2*M*R^2)*(a/(R*sqrt(W-1)));

                          (F + G) R       M R a
                   eq2 := ---------- = ------------
                                 1/2            1/2
                          (W - 1)      2 (W - 1)

eq2/fact(eq2);

                                      M a
                              F + G = ---
                                       2

After some simplification the modified expression can become real-valued (eg. for positive omega). fsolve can be used for this example.

ps. Are you using Maple 2016.0, and if so have you considered upgrading to 2016.2?

Download fs.mw

Using Maple 2015.2,

restart;
ee := simplify(expand(exp(-(2*m-4)*exp(t)+t*(m+1))*(t-2*exp(t)))):
f2 := subs(foo=ee,m->evalf(Int(unapply(foo,t),0..infinity))):
plot(f2, 3..20);

or,

restart;
ee := simplify(expand(exp(-(2*m-4)*exp(t)+t*(m+1))*(t-2*exp(t)))):
f2 := subs(foo=ee,m->evalf(Int(foo,t=0..infinity,method=_d01amc))):
plot(f2, 3..20);

Why are you trying for output=Array(...)? And why with so few points? (With more points you could get a much smoother piecewise spline as an interpolation.)

restart;

sol := dsolve([-diff(F(x), x$2)+F(x) = x*sin(5*x),
              F(0)=0.2, F(1)=1],
              numeric, 'output' = listprocedure);

[x = proc (x) local _res, _dat, _solnproc; option `Copyright (c) 1993 by the University of Waterloo. All rights reserved.`; _dat := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = .0, (2) = .13356755121790845, (3) = .30430039984542584, (4) = .4711335427102931, (5) = .6262694366777036, (6) = .7636417442240576, (7) = .8856536401001731, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .2, (1, 2) = .6355472386901964, (2, 1) = .28679901058587776, (2, 2) = .6642172351157226, (3, 1) = .4026629349647905, (3, 2) = .6898565048786539, (4, 1) = .5191388059317775, (4, 2) = .7087686351481234, (5, 1) = .6327422107075403, (5, 2) = .7672375606410581, (6, 1) = .745854892367845, (6, 2) = .8933518491303937, (7, 1) = .8652730228741763, (7, 2) = 1.0741950607628237, (8, 1) = 1.0, (8, 2) = 1.2869514632712835}, datatype = float[8], order = C_order); YP := Matrix(8, 2, {(1, 1) = .6355472386901964, (1, 2) = .2, (2, 1) = .6642172351157226, (2, 2) = .2040819987788216, (3, 1) = .6898565048786539, (3, 2) = 0.987321747068094e-1, (4, 1) = .7087686351481234, (4, 2) = .18582163798963208, (5, 1) = .7672375606410581, (5, 2) = .6263258981104891, (6, 1) = .8933518491303937, (6, 2) = 1.2240154135287016, (7, 1) = 1.0741950607628237, (7, 2) = 1.7154194632259072, (8, 1) = 1.2869514632712835, (8, 2) = 1.9589242746631386}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = .0, (2) = .13356755121790845, (3) = .30430039984542584, (4) = .4711335427102931, (5) = .6262694366777036, (6) = .7636417442240576, (7) = .8856536401001731, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .0, (1, 2) = 0.13030464384801514e-6, (2, 1) = 0.1302535103026619e-7, (2, 2) = 0.14221614646911444e-6, (3, 1) = -0.4128469958203856e-7, (3, 2) = 0.15918945269923148e-6, (4, 1) = -0.7225809617070991e-7, (4, 2) = 0.11203207102741712e-6, (5, 1) = -0.5203959916725329e-7, (5, 2) = 0.648213485009814e-7, (6, 1) = -0.26104233388354814e-7, (6, 2) = 0.4841390359814309e-7, (7, 1) = -0.10238961917655763e-7, (7, 2) = 0.4628901322935305e-7, (8, 1) = .0, (8, 2) = 0.48876597274231683e-7}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.5918945269923148e-7) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 8, [F(x), diff(F(x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[F(x), diff(F(x), x)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.5918945269923148e-7) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 18446883866908093534, (2) = 18446883866908094062, (3) = 18446883866908094238}), (3) = [x, F(x), diff(F(x), x)], (4) = 0}); _solnproc := _dat[1]; if member(x, ["last", 'last']) then _res := _solnproc("last"); if type(_res, 'list') then return _res[1] end if elif type(x, `=`) and member(lhs(x), ["initial", 'initial']) then if type(rhs(x), 'list') then _res := _solnproc("initial" = [0, op(rhs(x))]) else _res := _solnproc("initial" = [1, rhs(x)]) end if; if type(_res, 'list') then return _res[1] end if elif x = "sysvars" then return _dat[3] end if; x end proc, F(x) = proc (x) local res, data, solnproc, `F(x)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](x) else outpoint := evalf(x) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = .0, (2) = .13356755121790845, (3) = .30430039984542584, (4) = .4711335427102931, (5) = .6262694366777036, (6) = .7636417442240576, (7) = .8856536401001731, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .2, (1, 2) = .6355472386901964, (2, 1) = .28679901058587776, (2, 2) = .6642172351157226, (3, 1) = .4026629349647905, (3, 2) = .6898565048786539, (4, 1) = .5191388059317775, (4, 2) = .7087686351481234, (5, 1) = .6327422107075403, (5, 2) = .7672375606410581, (6, 1) = .745854892367845, (6, 2) = .8933518491303937, (7, 1) = .8652730228741763, (7, 2) = 1.0741950607628237, (8, 1) = 1.0, (8, 2) = 1.2869514632712835}, datatype = float[8], order = C_order); YP := Matrix(8, 2, {(1, 1) = .6355472386901964, (1, 2) = .2, (2, 1) = .6642172351157226, (2, 2) = .2040819987788216, (3, 1) = .6898565048786539, (3, 2) = 0.987321747068094e-1, (4, 1) = .7087686351481234, (4, 2) = .18582163798963208, (5, 1) = .7672375606410581, (5, 2) = .6263258981104891, (6, 1) = .8933518491303937, (6, 2) = 1.2240154135287016, (7, 1) = 1.0741950607628237, (7, 2) = 1.7154194632259072, (8, 1) = 1.2869514632712835, (8, 2) = 1.9589242746631386}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = .0, (2) = .13356755121790845, (3) = .30430039984542584, (4) = .4711335427102931, (5) = .6262694366777036, (6) = .7636417442240576, (7) = .8856536401001731, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .0, (1, 2) = 0.13030464384801514e-6, (2, 1) = 0.1302535103026619e-7, (2, 2) = 0.14221614646911444e-6, (3, 1) = -0.4128469958203856e-7, (3, 2) = 0.15918945269923148e-6, (4, 1) = -0.7225809617070991e-7, (4, 2) = 0.11203207102741712e-6, (5, 1) = -0.5203959916725329e-7, (5, 2) = 0.648213485009814e-7, (6, 1) = -0.26104233388354814e-7, (6, 2) = 0.4841390359814309e-7, (7, 1) = -0.10238961917655763e-7, (7, 2) = 0.4628901322935305e-7, (8, 1) = .0, (8, 2) = 0.48876597274231683e-7}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.5918945269923148e-7) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 8, [F(x), diff(F(x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[F(x), diff(F(x), x)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.5918945269923148e-7) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 18446883866908093534, (2) = 18446883866908094062, (3) = 18446883866908094238}), (3) = [x, F(x), diff(F(x), x)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(x) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(x) else `F(x)` := pointto(data[2][2]); return ('`F(x)`')(x) end if end if; try res := solnproc(outpoint); res[2] catch: error  end try end proc, diff(F(x), x) = proc (x) local res, data, solnproc, `diff(F(x),x)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](x) else outpoint := evalf(x) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = .0, (2) = .13356755121790845, (3) = .30430039984542584, (4) = .4711335427102931, (5) = .6262694366777036, (6) = .7636417442240576, (7) = .8856536401001731, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .2, (1, 2) = .6355472386901964, (2, 1) = .28679901058587776, (2, 2) = .6642172351157226, (3, 1) = .4026629349647905, (3, 2) = .6898565048786539, (4, 1) = .5191388059317775, (4, 2) = .7087686351481234, (5, 1) = .6327422107075403, (5, 2) = .7672375606410581, (6, 1) = .745854892367845, (6, 2) = .8933518491303937, (7, 1) = .8652730228741763, (7, 2) = 1.0741950607628237, (8, 1) = 1.0, (8, 2) = 1.2869514632712835}, datatype = float[8], order = C_order); YP := Matrix(8, 2, {(1, 1) = .6355472386901964, (1, 2) = .2, (2, 1) = .6642172351157226, (2, 2) = .2040819987788216, (3, 1) = .6898565048786539, (3, 2) = 0.987321747068094e-1, (4, 1) = .7087686351481234, (4, 2) = .18582163798963208, (5, 1) = .7672375606410581, (5, 2) = .6263258981104891, (6, 1) = .8933518491303937, (6, 2) = 1.2240154135287016, (7, 1) = 1.0741950607628237, (7, 2) = 1.7154194632259072, (8, 1) = 1.2869514632712835, (8, 2) = 1.9589242746631386}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = .0, (2) = .13356755121790845, (3) = .30430039984542584, (4) = .4711335427102931, (5) = .6262694366777036, (6) = .7636417442240576, (7) = .8856536401001731, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .0, (1, 2) = 0.13030464384801514e-6, (2, 1) = 0.1302535103026619e-7, (2, 2) = 0.14221614646911444e-6, (3, 1) = -0.4128469958203856e-7, (3, 2) = 0.15918945269923148e-6, (4, 1) = -0.7225809617070991e-7, (4, 2) = 0.11203207102741712e-6, (5, 1) = -0.5203959916725329e-7, (5, 2) = 0.648213485009814e-7, (6, 1) = -0.26104233388354814e-7, (6, 2) = 0.4841390359814309e-7, (7, 1) = -0.10238961917655763e-7, (7, 2) = 0.4628901322935305e-7, (8, 1) = .0, (8, 2) = 0.48876597274231683e-7}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.5918945269923148e-7) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 8, [F(x), diff(F(x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[F(x), diff(F(x), x)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.5918945269923148e-7) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 18446883866908093534, (2) = 18446883866908094062, (3) = 18446883866908094238}), (3) = [x, F(x), diff(F(x), x)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(x) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(x) else `diff(F(x),x)` := pointto(data[2][3]); return ('`diff(F(x),x)`')(x) end if end if; try res := solnproc(outpoint); res[3] catch: error  end try end proc]

(1)

f := eval(F(x),sol);

proc (x) local res, data, solnproc, `F(x)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](x) else outpoint := evalf(x) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = .0, (2) = .13356755121790845, (3) = .30430039984542584, (4) = .4711335427102931, (5) = .6262694366777036, (6) = .7636417442240576, (7) = .8856536401001731, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .2, (1, 2) = .6355472386901964, (2, 1) = .28679901058587776, (2, 2) = .6642172351157226, (3, 1) = .4026629349647905, (3, 2) = .6898565048786539, (4, 1) = .5191388059317775, (4, 2) = .7087686351481234, (5, 1) = .6327422107075403, (5, 2) = .7672375606410581, (6, 1) = .745854892367845, (6, 2) = .8933518491303937, (7, 1) = .8652730228741763, (7, 2) = 1.0741950607628237, (8, 1) = 1.0, (8, 2) = 1.2869514632712835}, datatype = float[8], order = C_order); YP := Matrix(8, 2, {(1, 1) = .6355472386901964, (1, 2) = .2, (2, 1) = .6642172351157226, (2, 2) = .2040819987788216, (3, 1) = .6898565048786539, (3, 2) = 0.987321747068094e-1, (4, 1) = .7087686351481234, (4, 2) = .18582163798963208, (5, 1) = .7672375606410581, (5, 2) = .6263258981104891, (6, 1) = .8933518491303937, (6, 2) = 1.2240154135287016, (7, 1) = 1.0741950607628237, (7, 2) = 1.7154194632259072, (8, 1) = 1.2869514632712835, (8, 2) = 1.9589242746631386}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = .0, (2) = .13356755121790845, (3) = .30430039984542584, (4) = .4711335427102931, (5) = .6262694366777036, (6) = .7636417442240576, (7) = .8856536401001731, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .0, (1, 2) = 0.13030464384801514e-6, (2, 1) = 0.1302535103026619e-7, (2, 2) = 0.14221614646911444e-6, (3, 1) = -0.4128469958203856e-7, (3, 2) = 0.15918945269923148e-6, (4, 1) = -0.7225809617070991e-7, (4, 2) = 0.11203207102741712e-6, (5, 1) = -0.5203959916725329e-7, (5, 2) = 0.648213485009814e-7, (6, 1) = -0.26104233388354814e-7, (6, 2) = 0.4841390359814309e-7, (7, 1) = -0.10238961917655763e-7, (7, 2) = 0.4628901322935305e-7, (8, 1) = .0, (8, 2) = 0.48876597274231683e-7}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.5918945269923148e-7) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 8, [F(x), diff(F(x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[F(x), diff(F(x), x)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.5918945269923148e-7) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 18446883866908093534, (2) = 18446883866908094062, (3) = 18446883866908094238}), (3) = [x, F(x), diff(F(x), x)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(x) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(x) else `F(x)` := pointto(data[2][2]); return ('`F(x)`')(x) end if end if; try res := solnproc(outpoint); res[2] catch: error  end try end proc

(2)

fdx := eval(diff(F(x),x),sol);

proc (x) local res, data, solnproc, `diff(F(x),x)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](x) else outpoint := evalf(x) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = .0, (2) = .13356755121790845, (3) = .30430039984542584, (4) = .4711335427102931, (5) = .6262694366777036, (6) = .7636417442240576, (7) = .8856536401001731, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .2, (1, 2) = .6355472386901964, (2, 1) = .28679901058587776, (2, 2) = .6642172351157226, (3, 1) = .4026629349647905, (3, 2) = .6898565048786539, (4, 1) = .5191388059317775, (4, 2) = .7087686351481234, (5, 1) = .6327422107075403, (5, 2) = .7672375606410581, (6, 1) = .745854892367845, (6, 2) = .8933518491303937, (7, 1) = .8652730228741763, (7, 2) = 1.0741950607628237, (8, 1) = 1.0, (8, 2) = 1.2869514632712835}, datatype = float[8], order = C_order); YP := Matrix(8, 2, {(1, 1) = .6355472386901964, (1, 2) = .2, (2, 1) = .6642172351157226, (2, 2) = .2040819987788216, (3, 1) = .6898565048786539, (3, 2) = 0.987321747068094e-1, (4, 1) = .7087686351481234, (4, 2) = .18582163798963208, (5, 1) = .7672375606410581, (5, 2) = .6263258981104891, (6, 1) = .8933518491303937, (6, 2) = 1.2240154135287016, (7, 1) = 1.0741950607628237, (7, 2) = 1.7154194632259072, (8, 1) = 1.2869514632712835, (8, 2) = 1.9589242746631386}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = .0, (2) = .13356755121790845, (3) = .30430039984542584, (4) = .4711335427102931, (5) = .6262694366777036, (6) = .7636417442240576, (7) = .8856536401001731, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .0, (1, 2) = 0.13030464384801514e-6, (2, 1) = 0.1302535103026619e-7, (2, 2) = 0.14221614646911444e-6, (3, 1) = -0.4128469958203856e-7, (3, 2) = 0.15918945269923148e-6, (4, 1) = -0.7225809617070991e-7, (4, 2) = 0.11203207102741712e-6, (5, 1) = -0.5203959916725329e-7, (5, 2) = 0.648213485009814e-7, (6, 1) = -0.26104233388354814e-7, (6, 2) = 0.4841390359814309e-7, (7, 1) = -0.10238961917655763e-7, (7, 2) = 0.4628901322935305e-7, (8, 1) = .0, (8, 2) = 0.48876597274231683e-7}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.5918945269923148e-7) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 8, [F(x), diff(F(x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[F(x), diff(F(x), x)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.5918945269923148e-7) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 18446883866908093534, (2) = 18446883866908094062, (3) = 18446883866908094238}), (3) = [x, F(x), diff(F(x), x)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(x) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(x) else `diff(F(x),x)` := pointto(data[2][3]); return ('`diff(F(x),x)`')(x) end if end if; try res := solnproc(outpoint); res[3] catch: error  end try end proc

(3)

fd2x := D(eval(diff(F(x),x),sol));

D(proc (x) local res, data, solnproc, `diff(F(x),x)`, outpoint; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](x) else outpoint := evalf(x) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = .0, (2) = .13356755121790845, (3) = .30430039984542584, (4) = .4711335427102931, (5) = .6262694366777036, (6) = .7636417442240576, (7) = .8856536401001731, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .2, (1, 2) = .6355472386901964, (2, 1) = .28679901058587776, (2, 2) = .6642172351157226, (3, 1) = .4026629349647905, (3, 2) = .6898565048786539, (4, 1) = .5191388059317775, (4, 2) = .7087686351481234, (5, 1) = .6327422107075403, (5, 2) = .7672375606410581, (6, 1) = .745854892367845, (6, 2) = .8933518491303937, (7, 1) = .8652730228741763, (7, 2) = 1.0741950607628237, (8, 1) = 1.0, (8, 2) = 1.2869514632712835}, datatype = float[8], order = C_order); YP := Matrix(8, 2, {(1, 1) = .6355472386901964, (1, 2) = .2, (2, 1) = .6642172351157226, (2, 2) = .2040819987788216, (3, 1) = .6898565048786539, (3, 2) = 0.987321747068094e-1, (4, 1) = .7087686351481234, (4, 2) = .18582163798963208, (5, 1) = .7672375606410581, (5, 2) = .6263258981104891, (6, 1) = .8933518491303937, (6, 2) = 1.2240154135287016, (7, 1) = 1.0741950607628237, (7, 2) = 1.7154194632259072, (8, 1) = 1.2869514632712835, (8, 2) = 1.9589242746631386}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(8, {(1) = .0, (2) = .13356755121790845, (3) = .30430039984542584, (4) = .4711335427102931, (5) = .6262694366777036, (6) = .7636417442240576, (7) = .8856536401001731, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .0, (1, 2) = 0.13030464384801514e-6, (2, 1) = 0.1302535103026619e-7, (2, 2) = 0.14221614646911444e-6, (3, 1) = -0.4128469958203856e-7, (3, 2) = 0.15918945269923148e-6, (4, 1) = -0.7225809617070991e-7, (4, 2) = 0.11203207102741712e-6, (5, 1) = -0.5203959916725329e-7, (5, 2) = 0.648213485009814e-7, (6, 1) = -0.26104233388354814e-7, (6, 2) = 0.4841390359814309e-7, (7, 1) = -0.10238961917655763e-7, (7, 2) = 0.4628901322935305e-7, (8, 1) = .0, (8, 2) = 0.48876597274231683e-7}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[8] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.5918945269923148e-7) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 8, [F(x), diff(F(x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(8, 2, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[F(x), diff(F(x), x)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[8] elif outpoint = "order" then return 6 elif outpoint = "error" then return HFloat(1.5918945269923148e-7) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 8, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[8] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[8] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(8, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(1..3, {(1) = 18446883866908093534, (2) = 18446883866908094062, (3) = 18446883866908094238}), (3) = [x, F(x), diff(F(x), x)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(x) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(x) else `diff(F(x),x)` := pointto(data[2][3]); return ('`diff(F(x),x)`')(x) end if end if; try res := solnproc(outpoint); res[3] catch: error  end try end proc)

(4)

plot( f, 0 .. 1, view=0 .. 1, size=[600,200] );

 

plot( fdx, 0 .. 1, view=0 .. 1.5, size=[600,200] );

 

plot( fd2x, 0 .. 1, view=0 .. 3, size=[600,200] );

 

 

Download fd2x_bvp.mw

This question has come up several times before, and you can find several old posts about it by entering the word colorbar in the Mapleprimes search.

One can manually edit the properties of the GUI Table inserted by plots:-display (to remove borders), and re-size it by dragging the borders. But such edits are lost upon re-execution.

Another possibility is to use the DocumentTools:-Tabulate command. Here is a variant on Adri's pointplot3d example.

tabulate_colorbar.mw

Unfortunately the worksheet renderer of this site is unable to inline the worksheet so that it's properly visible here.

For example here is an old post where I used Tabulate to align a 3d surface and a 2d densityplot for the colorbar. It's also possible to orient the colorbar horizontally, and locate it below/above the 3d plot. Using a 2d densityplot has the advantage that it can be constructed using the size option. However using a 2d densityplot can get tricky since one end of the hue rolls back to red. This may not match that of the 3d plot created with shading=zhue, with hue ending around magenta. So in that post I used,
    color=[f,1,1,colortype=HSV]
instead of
   shading=zhue
for the 3d surface plot.

Using the main menubar you can toggle off the item View -> Status Bar . That removes the status bar, in which the button appears (along with everything else in that bar). This aspect of the GUI's "View" is saved as a preference when the GUI is fully closed.

But I'm unaware of any way only to disable that "editable" button.

Your code assigns a value to Ha, but it appears as if you wanted the ode sys to vary with Ha=L[k].

[edit] Even if I've misunderstood the role you intend for Ha, or whether you still intend on looping, you might still utilize the visual labelling of the curves and a legend as below. [end of edit]

I'm not sure what you mean by "contour" here. Do you mean that you want to distinguish between the curves, say by color and a legend?

restart;

with(plots):

R1 := .1; R0 := .1; m := .1; a := .1;
#Ha := .1;
Nt := .1; Nb := .1; Pr := 6.2; Le := .6; Bi := 1; Ec := .1; k := 1; r := .1; A := 1; fcns := {C(y), T(y), U(y), W(y)}; sys := diff(U(y), `$`(y, 2))+(R1*(diff(U(y), y))-2*R0*W(y))*exp(a*T(y))-a*(diff(U(y), y))*(diff(T(y), y))-Ha*(U(y)+m*W(y))*exp(a*T(y))/(m^2+1)-U(y)/k+A*exp(a*T(y)) = 0, diff(W(y), `$`(y, 2))+(R1*(diff(W(y), y))+2*R0*U(y))*exp(a*T(y))-a*(diff(W(y), y))*(diff(T(y), y))-Ha*(W(y)-m*U(y))*exp(a*T(y))/(m^2+1)-W(y)/k = 0, diff(T(y), `$`(y, 2))+R1*Pr*(diff(T(y), y))+Pr*Ec*exp(-a*T(y))*((diff(U(y), y))*(diff(U(y), y))+(diff(W(y), y))*(diff(W(y), y)))+Nt*(diff(T(y), y))*(diff(T(y), y))+Pr*Ec*(U(y)*U(y)+W(y)*W(y))*exp(-a*T(y))/k = 0, diff(C(y), `$`(y, 2))+Pr*Le*R1*(diff(C(y), y))+Nt*(diff(C(y), `$`(y, 2)))/Nb-r*C(y) = 0; bc := U(0) = 0, W(0) = 0, C(0) = 0, (D(T))(0) = Bi*(T(0)-1), U(1) = 0, W(1) = 0, C(1) = 1, T(1) = 0;

.1

 

.1

 

.1

 

.1

 

.1

 

.1

 

6.2

 

.6

 

1

 

.1

 

1

 

.1

 

1

 

{C(y), T(y), U(y), W(y)}

 

diff(diff(U(y), y), y)+(.1*(diff(U(y), y))-.2*W(y))*exp(.1*T(y))-.1*(diff(U(y), y))*(diff(T(y), y))-.9900990099*Ha*(U(y)+.1*W(y))*exp(.1*T(y))-U(y)+exp(.1*T(y)) = 0, diff(diff(W(y), y), y)+(.1*(diff(W(y), y))+.2*U(y))*exp(.1*T(y))-.1*(diff(W(y), y))*(diff(T(y), y))-.9900990099*Ha*(W(y)-.1*U(y))*exp(.1*T(y))-W(y) = 0, diff(diff(T(y), y), y)+.62*(diff(T(y), y))+.62*exp(-.1*T(y))*((diff(U(y), y))^2+(diff(W(y), y))^2)+.1*(diff(T(y), y))^2+.62*(U(y)^2+W(y)^2)*exp(-.1*T(y)) = 0, 2.000000000*(diff(diff(C(y), y), y))+.372*(diff(C(y), y))-.1*C(y) = 0

 

U(0) = 0, W(0) = 0, C(0) = 0, (D(T))(0) = T(0)-1, U(1) = 0, W(1) = 0, C(1) = 1, T(1) = 0

(1)

L := [seq(0.5 .. 2.0, 0.25)]; AP := NULL;

[.5, .75, 1.00, 1.25, 1.50, 1.75, 2.00]

 

(2)

NN := nops(L);
for k to NN do
 R := dsolve(eval({bc, sys}, Ha = L[k]), fcns, type = numeric, method = bvp[midrich], AP);
 AP := approxsoln = R;
 p1u[k] := odeplot(R, [y, U(y)], 0 .. 1, numpoints = 100, labels = ["y", "U"], linestyle = dash,
                   color = ColorTools:-Color("HSV",[(k-1)/(NN),1.0,1.0]), legend=[typeset(''Ha''=L[k])]);
end do:

7

(3)

display([seq(p1u[i], i=1..NN)], legendstyle=[location=right], size=[600,400]);

 

 

Download odelegend.mw

The differences in the Matrix between k=0.001 and k=0.0001 is on the order of 10^(-6), while the values themselves range from 0 to about 1.8. So you don't see the difference between frames.

I'm presuming that the computation of the data is doing what you intend.

How about plotting the difference instead?

ps. I don't see why you'd want to set Digits to 5.

restart; Digits := 15; with(plots); with(LinearAlgebra)

NULL

a := 0; b := 1; N := 9; h := (b-a)/(N+1); phi := .5; K := 10^(-6); mu := 1.67; alpha := K/(phi*mu); lambda := alpha*k/h^2

0.119760479041916e-3*k

(1)

NULL

for i from 0 while i <= N do u[i, 0] := h*i+1 end do

NULL

for j from 0 while j <= N+1 do u[0, j] := .1; u[N+1, j] := .5 end do

NULL

printlevel := 2; for i while i <= N do for j from 0 while j <= N do eq[i, j] := lambda*u[i-1, j]+(2-2*lambda)*u[i, j]+lambda*u[i+1, j] = -lambda*u[i-1, j+1]+(2+2*lambda)*u[i, j+1]-lambda*u[i+1, j+1] end do end do; for i while i <= N do for j from 0 while j <= N do eq[i, j] := lambda*u[i-1, j]+(2-2*lambda)*u[i, j]+lambda*u[i+1, j] = -lambda*u[i-1, j+1]+(2+2*lambda)*u[i, j+1]-lambda*u[i+1, j+1] end do end do

``

``

sys := ([seq])(seq(eq[i, j], j = 0 .. N), i = 1 .. N):

nops(sys);

vars:=indets(sys) minus {k}:

nn := Matrix(N+1, N+1,(i, j)-> u[i-1, j-1]):

##

p:=proc(kk) local u_res,A;

  u_res:=solve(eval(sys,k=kk),vars);

  A:=eval(nn,u_res);

  #plots:-matrixplot(A)

end proc:

90

(2)

## Testing p for k=0.001:

plots:-matrixplot(p(0.0001)-p(0.001));

 

## Animating the plot for k=0.0001..0.001:

plots:-animate(K->plots:-matrixplot(p(0.0001)-p(K)),[k],k=0.0001..0.001);

 

 

 

NULL


Download Crank_scheme_4a.mw

First 176 177 178 179 180 181 182 Last Page 178 of 338