Carl Love

Carl Love

28070 Reputation

25 Badges

13 years, 30 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

Here's how to fix this error. I'll assume that you still have Maple 16 installed. If you don't, let me know, and I'll post here the necessary code.

There are three procedures necessary for your program that exist in Maple 16 that are missing in later Maple. Their names are zero_one, polyvariations, and midpoint. These procedures are defined when you execute the (deprecated) command readlib(realroot). We need to extract the code of these procedures from Maple 16 and put it in your code file. Here's how.

1. In a Maple 16 worksheet, issue the command

readlib(realroot):

2. Issue the command

showstat~([zero_one, polyvariations, midpoint]);

3. Using your favorite text editor (I used Microsoft Windows Notepad), cut-and-paste the code of the three procedures to the end of your code file proving.txt.

4. Using the text editor, remove the line numbers from the procedures, being very careful that you don't remove anything else. It's okay to remove or add spaces at the beginnings of lines.

5. Add a comment to your code about where these three procedures came from. Mention how they were extracted with readlib.

6. Save the file proving.txt.

7. Run your program in Maple 2015.

I have done this, and it works.

There may still be use instances of your program that lead to similar errors, or will eventually lead to similar errors in future editions of Maple. To help in finding those errors now rather than when those future editions come, I recommend that you comment out all uses of the command readlib and then do some rigorous testing of your program---something that uses all of its procedures.

Several changes were necessary to get this to work, all of which I point out in my modified worksheet below. Most significant is turning off hardware floats and specifying the inflection points of the distribution (see ?Statistics,Sample). It's a shame---an unnecessary limitation of Statistics:-Sample---that it does not automatically revert to software floating point if the hardware floating point doesn't work.

I redid your worksheet using 1D input because I can't tolerate the 2D input. I put my name in front of all my comments.

 

restart:

 

Carl: Maple will not be able to evaluate the derivative of the PDF using hardware floating point because the exponential values in the intermediate computations are too extreme (even though the final results are not too extreme). So, we force it to use software floating point. If this becomes a speed problem for you (because you need to sample millions of points, for example), let me know.

UseHardwareFloats:= false:

 

Normal distribution with a standard deviation relative to the mean.

NormalR:= (t,mu)-> exp(-(t-mu)^2/2/(mu/20)^2);

proc (t, mu) options operator, arrow; exp(-200*(t-mu)^2/mu^2) end proc

Create a truncation, both at the tails and in the center. To sample a PDF, the PDF should be twice differentiable (except at the tail-truncation). Use logistic functions.

Lot:= (t,mu,alpha,beta)-> 1/(1+exp(-mu/beta*((1-beta)*mu-t))) + 1/(1+exp(-mu/beta*(t-(1+beta)*mu)));

proc (t, mu, alpha, beta) options operator, arrow; 1/(1+exp(-mu*((1-beta)*mu-t)/beta))+1/(1+exp(-mu*(t-(1+beta)*mu)/beta)) end proc

plot(Lot(t, 10, 0.1, 0.01), t= 8.5..11.5);

Carl: Observe what happens on the small scale.

plot(Lot(t, 10, 0.1, 0.01), t= 9.89..9.91);

Carl: Observe that the inflection point is at 9.9. Likewise, there's an inflection point at 10.1.

 

Carl: Create the untruncated PDF.


LotR:= (t, mu, alpha, beta)-> NormalR(t, mu)*Lot(t, mu, alpha, beta);
plot(LotR(t, 10, 0.1, 0.01), t= 8.5..11.5);

proc (t, mu, alpha, beta) options operator, arrow; NormalR(t, mu)*Lot(t, mu, alpha, beta) end proc

Carl: Find inflection point on first up slope.

fsolve(diff(LotR(t,10,1/10,1/100), t$2), t= 8.5..9.9);

9.50000000000000

Carl: Likewise, there's an inflection point at 10.5.

 

The final distribution function.

 

Carl: Truncate and renormalize to get our final PDF. We want to do this in such a way that the integration isn't redone every time the PDF is used. Thus, it needs go be done as below, as a procedure that returns the result of an unapply.

LotRPDF:= (t::name, mu::numeric, alpha::positive, beta::positive)->  
     unapply(
          LotR(t, mu, alpha, beta) /
          evalf(Int(LotR(t,mu,alpha,beta), t= (1-alpha)*mu..(1+alpha)*mu)),
          t
     )
;

proc (t::name, mu::numeric, alpha::positive, beta::positive) options operator, arrow; unapply(LotR(t, mu, alpha, beta)/evalf(Int(LotR(t, mu, alpha, beta), t = (1-alpha)*mu .. (1+alpha)*mu)), t) end proc

Carl: Note that LotRPDF returns a procedure with parameter t rather than an expression in t

plot(LotRPDF(t, 10, 0.1, 0.01), 8.5..11.5);

Carl: Note that the PDF is only the part from 9..11. It's truncated. Verify:

evalf(Int(LotRPDF(t, 10, 0.1, 0.01), 9..11));

1.00000000000000

Carl: Make a procedure that returns a distribution. Note the Support argument: Providing is often not strictly necessary, but it vastly simplifies the computation required to use the distribution.

GetDist:= (mu,alpha,beta)->
     Statistics:-Distribution(
          PDF= LotRPDF(t, mu, alpha, beta),
          Support= (1-alpha)*mu..(1+alpha)*mu
     )
:

T:= GetDist(10, 0.1, 0.01):
Statistics:-DensityPlot(T);

RandomR:= Statistics:-RandomVariable(T);

_R0

Density plot is not a problem, however, computation of the Sample seems not to end.

 

Carl: We need to tell Sample the inflection points and the range. Then it will end. Note that the end result of this will be a procedure which can be used for all sampling rather just a sampled value.

SampleR:= Statistics:-Sample(
     T,
     method= [
          envelope,
          range= 9.00..11.00,
          #Inflection points
          basepoints= [9.5, 9.9, 10, 10.1, 10.5]
     ]
);

proc (n::Sample:-sizeType) local v, r, t; option `Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2004`; if UseHardwareFloats = 'deduced' then UseHardwareFloats := `if`(Digits <= trunc(evalhf(Digits)), true, false) end if; if UseHardwareFloats then Digits := `if`(Digits < trunc(evalhf(Digits)), trunc(evalhf(Digits)), Digits) end if; if type(n, ':-rtable') then v := n else if type(n, ':-nonnegint') then r := 1 .. n; t := ':-Vector'[':-row'] elif type(n, ':-range') then r := n; t := ':-Array' elif type(n, '[:-nonnegint, :-nonnegint]') then r := 1 .. n[1], 1 .. n[2]; t := ':-Matrix' else r := op(n); t := ':-Array' end if; v := rtable(r, ':-datatype' = ':-float', ':-subtype' = t, op([])) end if; mapleRandomSample(v, 'NULL', [[1, [proc (t) options operator, arrow; 1.00239102890660*exp(-2*(t-10)^2)*(1/(1+exp(-9900.00000000000+1000.00000000000*t))+1/(1+exp(-1000.00000000000*t+10100.0000000000))) end proc, proc (t) options operator, arrow; 1.00239102890660*(-4*t+40)*exp(-2*(t-10)^2)*(1/(1+exp(-9900.00000000000+1000.00000000000*t))+1/(1+exp(-1000.00000000000*t+10100.0000000000)))+1.00239102890660*exp(-2*(t-10)^2)*(-1000.00000000000*exp(-9900.00000000000+1000.00000000000*t)/(1+exp(-9900.00000000000+1000.00000000000*t))^2+1000.00000000000*exp(-1000.00000000000*t+10100.0000000000)/(1+exp(-1000.00000000000*t+10100.0000000000))^2) end proc, [9.00, 9.5, 9.9, 10., 10.1, 10.5, 11.00], 100, false]]], UseHardwareFloats); return v end proc

Carl: Generate 1 point.

SampleR(1);

Vector[row](1, {(1) = 10.4381592823491})

Carl: It would be nice if the range and basepoints were parametrized in terms of mu, alpha, and beta. But, I've done enough for now.

 

Download RandomVariableSample(2).mw

How about

M:= k-> Matrix(10, 10, [1$k, 0$10-k], scan= diagonal):
M(5);
'M(k)' $ 'k'= 1..10;

The evalf[n](exprdoesn't mean "give me the value of expr accurate to digits". Many users have that wrong impression. It means (approximately) that at least digits are used in all the subcomputations. That "give me the value..." thing is practically impossible to implement. For the reasons, see the first chapter of almost any textbook on numeric computation.

The code that you're running here is obviously intended to break or to highlight the deficiencies of floating-point computation systems.

As to your second question: Many Maple commands "remember" the values from earlier computations. So, if it knows that it already computed the desired result to a higher precision, it just re-uses that. The commands restart and forget make it forget what it has remembered (I recommend the restart).

Three points:

1. Don't set Digits as low as 5 unless that's necessary to get an answer. If you only want digits, just ignore the other digits. (There's also a command interface(displayprecision). The results of using that are visually hideous.) Stick with the default Digits10, or use my favorite "sweet spot", Digits = 15.

2. The command pade is in the package numapprox. To access it you need to refer to it as numapprox:-pade or numapprox[pade] or first issue the command with(numapprox). I strongly prefer the first of these three options.

3. solve will spend a long time trying to find exact solutions to this pair of high-degree polynomials---a likely impossible task. Use fsolve instead of solve to get decimal solutions. This only takes a few seconds. This will only give one solution. If you need more than one, let me know: For polynomial systems, it's usually easy to get all the solutions within any real bounding box.

So, change the last part of your your code to

fsolve({
     limit(numapprox:-pade(diff(f,x), x, [4,4]), x= infinity) = 1,
     limit(numapprox:-pade(t, x, [4,4]), x= infinity) = 0.
     }, {A,B}
);

     {A = -0.680502612209264e-1, B = -3.43533296567616}

Here's an even shorter and faster variant for returning the coefficient of particular term.

P:=a*x^2*y*z+b*x*y*z+c*x^2*y*z+d*x*y^2*z+e*x*y*z:
L:=[coeffs(P, [x,y,z], 't')]:

H:= table([t]=~L):
H[x^2*y*z];

       a + c

How about (assuming that alpha has a numeric value)

fracdiff(t^beta, t, alpha);

or, if alpha is symbolic, something like

fracdiff(t^beta, t, alpha) assuming alpha > 0, alpha < 1;

As Kitonum points out, this is done by the command GraphTheory:-SequenceGraph. However, this will return a graph with the vertices generically labeled from 1 to n. I got the impression from your Question that you wanted to use your own vertex labels. So here is a procedure to do that. The procedure takes two arguments. The first is the list of degrees. The second argument is optional and is the corresponding list of vertices. If omitted, generic 1-to-n labels will be used. The procedure returns FAIL if the degree sequence can't possibly be made into a graph.

RealizeDegreeSequence:= proc(
     Degrees::list(nonnegint),
     Vertices::list({symbol,string,integer}):= [$1..nops(Degrees)]
)
local
     Edges:= table(), e:= 0,
     D:= Vector(Degrees),
     V:= Vector(Vertices),
     P, k
;
     if max(D) >= op(1,D) then  return FAIL  end if;
     do
          (D,P):= sort(D, 'output'= ['sorted', 'permutation']);
          V:= V[P];
          if D[-1] = 0 then  break  end if;
          for k from 2 to D[-1]+1 do
               if D[-k] = 0 then  return FAIL  end if;
               D[-k]:= D[-k] - 1;
               e:= e+1;
               Edges[e]:= {V[-1],V[-k]}
          end do;
          D[-1]:= 0
     end do;
     GraphTheory:-Graph(Vertices, convert(Edges, set))
end proc:

I'd rather do the example with Sum rather than sum because the evaluation of the sums gives results that obsfucate the example, but I wrote the code so that it works for either. Using subsindets, it's a short one-liner.

 

S:= 2*(Sum(A*cos(omega*t)^2+cos(omega*t)*B*sin(omega*t)-cos(omega*t)*ymeas(t), t));

2*(Sum(A*cos(omega*t)^2+cos(omega*t)*B*sin(omega*t)-cos(omega*t)*ymeas(t), t))

subsindets[flat](S, specfunc({sum,Sum}), S-> map(op(0,S), op(S)));

2*(Sum(A*cos(omega*t)^2, t))+2*(Sum(cos(omega*t)*B*sin(omega*t), t))+2*(Sum(-cos(omega*t)*ymeas(t), t))

 

 

Download subsindets.mw

I found two substantial differences between your Mathematica code and your Maple code (from your PDF versions). In the Mathematica code, the initial condition for h is

G:= 0.005*exp(-(x-0.7)^2/(1/500)) + hin;

In the Maple code it's

F:= 0.01*exp(-(x-0.4)^2/(1/300)) + hin;

The other difference is that in the Mathematica code, the upper bound of is w = 1, whereas in the Maple it's l = 2.

If I use your Mathematica conditions in the Maple code, the animation runs much faster.

 

I redid your worksheet in a much cleaner style (even though it was already quite well organized), which is much less prone to user errors. All floating-point constants are in a list of parameters that is not applied to the system until needed. Thus you can see the PDEs in their fully symbolic form. I changed zita to zeta[0] and gama to gamma (and made gamma local) so that these would print nicer. 

Then I used numeric differentiation (fdiff) applied to the pdsolve solution to compute the residuals of the two PDEs over a grid of 18 interior points. The residuals seem reasonably small to me, except near (x,t) = (1,5). Also, read the help page ?pdsolve,numeric,errorcontrol.

 

restart:

 

Digits:=15:
interface(rtablesize= 30):

local gamma:

 

PDEtools:-declare(h(x,t),u(x,t)):

params:= [
     g= 9.81,
     beta= 0.65,
     L= 0.001,
     zeta[0]= evalf(35.1*Pi/180),
     zeta[1]= evalf(32.9*Pi/180),
     zeta[2]= evalf(42*Pi/180),
     mu1= tan(zeta[1]),
     mu2= tan(zeta[2]),
     gamma= (mu2-mu1)/(tan(zeta[0])-mu1) - 1,
     B= beta*sqrt(g*cos(zeta[0]))/(L*gamma),
     nu= 2*gamma*L*sqrt(g)*sin(zeta[0])/(9*beta*sqrt(cos(zeta[0]))),
     hstop= L*gamma,
     hin= 1.2*hstop,

     uin= B*hin^(3/2),
     l= 2 #upperbound of x
]:

'params' = <params[]>;
 

mu:= mu1+(mu2-mu1)/(1+beta*h(x,t)^(3/2)*sqrt(g*cos(zeta[0]))/(L*u(x,t)));

 

 

h(x, t)*`will now be displayed as`*h

u(x, t)*`will now be displayed as`*u

params = (Matrix(15, 1, {(1, 1) = g = 9.81, (2, 1) = beta = .65, (3, 1) = L = 0.1e-2, (4, 1) = Zeta[0] = .612610567450009, (5, 1) = Zeta[1] = .574213323906135, (6, 1) = Zeta[2] = .733038285837617, (7, 1) = mu1 = tan(Zeta[1]), (8, 1) = mu2 = tan(Zeta[2]), (9, 1) = gamma = (mu2-mu1)/(tan(Zeta[0])-mu1)-1, (10, 1) = B = beta*sqrt(g*cos(Zeta[0]))/(gamma*L), (11, 1) = nu = (2/9)*gamma*L*sqrt(g)*sin(Zeta[0])/(beta*sqrt(cos(Zeta[0]))), (12, 1) = hstop = gamma*L, (13, 1) = hin = 1.2*hstop, (14, 1) = uin = B*hin^(3/2), (15, 1) = l = 2}))

mu1+(mu2-mu1)/(1+beta*h(x, t)^(3/2)*(g*cos(zeta[0]))^(1/2)/(L*u(x, t)))

F:= 0.01*exp(-(x-0.4)^2/(1/300))+hin;

plot(eval[recurse](F, params), x= 0..2);

 

0.1e-1*exp(-300*(x-.4)^2)+hin

pde1:= Diff(h(x,t),t)+Diff(h(x,t)*u(x,t),x)=0;

Diff(h(x, t), t)+Diff(h(x, t)*u(x, t), x) = 0

pde2:=
     Diff(h(x,t)*u(x,t), t) + Diff(h(x,t)*u(x,t)^2, x) =
     h(x,t)*g*sin(zeta[0]) -
     mu*h(x,t)*g*cos(zeta[0]) -
     Diff((1/2)*(h(x,t))^2*g*cos(zeta[0]),x) +
     Diff(nu*h(x,t)^(3/2)*Diff(u(x,t),x),x)
;

 

Diff(h(x, t)*u(x, t), t)+Diff(h(x, t)*u(x, t)^2, x) = h(x, t)*g*sin(zeta[0])-(mu1+(mu2-mu1)/(1+beta*h(x, t)^(3/2)*(g*cos(zeta[0]))^(1/2)/(L*u(x, t))))*h(x, t)*g*cos(zeta[0])-(Diff((1/2)*h(x, t)^2*g*cos(zeta[0]), x))+Diff(nu*h(x, t)^(3/2)*(Diff(u(x, t), x)), x)

sys:= [pde1,pde2]:

ibc:= [
     h(x,0)=F, h(0,t)=h(l,t), u(x,0)=uin,
     D[1](u)(0,t) = D[1](u)(l,t), u(0,t)=u(l,t)
]:

'ibc' = <ibc[]>;

 

ibc = (Matrix(5, 1, {(1, 1) = h(x, 0) = 0.1e-1*exp(-300*(x-.4)^2)+hin, (2, 1) = h(0, t) = h(l, t), (3, 1) = u(x, 0) = uin, (4, 1) = (D[1](u))(0, t) = (D[1](u))(l, t), (5, 1) = u(0, t) = u(l, t)}))

sol:= pdsolve(
     eval[recurse](value([sys,ibc]), params)[], [h,u], numeric,
     time= t, spacestep= 0.001, timestep= 0.06,
     range= eval(0..l, params),
     compile= true,
     optimize= true
);

 

module () local INFO; export plot, plot3d, animate, value, settings; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; end module

sol:-animate(
     h(x,t), t= 0..6.2, thickness= 2, frames= 100,
     color= blue, view= [default,0..0.1]
);

 

(U,H):= eval([u(x,t),h(x,t)], sol:-value(output= listprocedure))[];

`[Length of output exceeds limit of 1000000]`

Residuals:= unapply(
     subs(
          diff(u(x,t),x$2)= fdiff(U, [1,1], [x,t]),
          diff(u(x,t),x)= fdiff(U, [1], [x,t]),
          diff(u(x,t),t)= fdiff(U, [2], [x,t]),
          diff(h(x,t),x)= fdiff(H, [1], [x,t]),
          diff(h(x,t),t)= fdiff(H, [2], [x,t]),
          u(x,t)= U(x,t), h(x,t)= H(x,t),
          (lhs-rhs)~(eval[recurse](value(sys), params))
     ), [x,t],
     proc_options= remember
);     

proc (x, t) option remember; [fdiff(H, [2], [x, t])+fdiff(H, [1], [x, t])*U(x, t)+H(x, t)*fdiff(U, [1], [x, t]), fdiff(H, [2], [x, t])*U(x, t)+H(x, t)*fdiff(U, [2], [x, t])+fdiff(H, [1], [x, t])*U(x, t)^2+2*H(x, t)*U(x, t)*fdiff(U, [1], [x, t])-5.64080152254456*H(x, t)+8.02604872793949*(.646929012633441+.253475031664396/(1+1841.46832379882*H(x, t)^(3/2)/U(x, t)))*H(x, t)+8.02604872793949*H(x, t)*fdiff(H, [1], [x, t])-0.361033442303963e-2*H(x, t)^(1/2)*fdiff(U, [1], [x, t])*fdiff(H, [1], [x, t])-0.240688961535974e-2*H(x, t)^(3/2)*fdiff(U, [1, 1], [x, t])] end proc

for X from .5 by .5 to 1.5 do
     for T from 1 by 1 to 6 do
           Residuals(X,T)
     end do
end do;

op(4, eval(Residuals));

table( [( 1.5, 1 ) = [HFloat(-8.7e-11), HFloat(-1.2522802239622877e-11)], ( .5, 5 ) = [HFloat(2.85953750500176e-5), HFloat(-0.001490879050560265)], ( 1.0, 1 ) = [HFloat(1.932828276029985e-6), HFloat(4.135527008128567e-5)], ( .5, 1 ) = [HFloat(2.287801319130747e-6), HFloat(-2.0692549446668662e-5)], ( 1.5, 5 ) = [HFloat(2.053365866274521e-6), HFloat(1.0652653516122965e-4)], ( .5, 3 ) = [HFloat(-1.1647776369834434e-7), HFloat(1.318382691491558e-7)], ( .5, 4 ) = [HFloat(6.435492967658586e-4), HFloat(-0.012572282194018345)], ( 1.0, 2 ) = [HFloat(-6.725756623120064e-4), HFloat(5.915982663221885e-4)], ( 1.0, 4 ) = [HFloat(7.606652077449086e-7), HFloat(-3.3512252416319854e-5)], ( 1.0, 3 ) = [HFloat(5.244656243204955e-5), HFloat(8.974099297601484e-5)], ( 1.5, 3 ) = [HFloat(0.016529087254550233), HFloat(0.02796219302039396)], ( .5, 6 ) = [HFloat(-8.402923824848941e-6), HFloat(1.1685994412418874e-4)], ( 1.5, 2 ) = [HFloat(1.2992914585305754e-5), HFloat(2.5073699512041575e-5)], ( .5, 2 ) = [HFloat(-5.696111396287452e-7), HFloat(1.7360380724026877e-6)], ( 1.0, 5 ) = [HFloat(0.19337670235490467), HFloat(0.06306079458023821)], ( 1.0, 6 ) = [HFloat(-4.413769663749155e-5), HFloat(-0.0015418020395394545)], ( 1.5, 4 ) = [HFloat(2.88274342677532e-5), HFloat(-1.0790727271419618e-4)], ( 1.5, 6 ) = [HFloat(4.155903691802692e-4), HFloat(-0.0021539603521344894)] ] )

 

 

Download PDE_residuals.mw

The Maple command for (infinite) series is sum:

sum(f, n= 2..infinity);

Maple returns infinity, meaning that the series diverges. To restrict to odd terms, do

sum(eval(f, n= 2*k+1), k= 1..infinity);

If you actually mean the convergence or divergence of the sequence rather than the series, use the limit command:

limit(f, n= infinity);

which returns 0.

Considering the triviality of this problem, I suggest that you look up the Limit Comparison Test in your textbook or on the Web. If you knew this test, you would be able to look at this problem and instantly know that the series diverges.

This Answer is to answer the OP's followup question requesting a procedure that determines whether an arbitrary polynomial can be produced as a linear combination of a set of polynomials, and, if so, returning the coefficients.

I decided that it would be better to just write a separate procedure for this rather than rolling it into my procedure LinearCombo from an earlier thread. So I wrote a little procedure PolyLinearCombo that calls my version of Kitonum's CoeffsOfLinComb. I changed the declaration-of-variables argument to be optional; by default, all nonconstant names will be considered variables. If you want to use parameters, then include the variables argument as a set.

For various reasons, it's better that a procedure always return the same number of return values. So, this procedure returns true and a list of coefficients if the second argument can be produced as a linear combination of the elements of the first argument, and it returns false, [] if there's no such combination.

I decided to disallow 0 as the second argument. If you want nontrivial coefficients to produce 0, then just call CoeffsOfLinComb.

CoeffsOfLinComb:= proc(
     L::list(polynom),
     V::set(name):= indets(L, And(name, Not(constant)))
)
local
     c, k, C:= {c[k] $ k= 1..nops(L)},
     S:= solve({coeffs(expand(`+`((C*~L)[])), V)}, C),
     F:= indets(rhs~(S), name) intersect C=~ 1
;
     eval([C[]], eval(S,F) union F)
end proc:


PolyLinearCombo:= proc(
     F::list(polynom),
     f::And(polynom, Not(identical(0))),
     V::set(name):= indets([F,f], And(name, Not(constant)))
)
local C:= CoeffsOfLinComb([f, F[]], V);
     if C[1]=0 then (false, []) else (true, -C[2..] /~ C[1]) end if
end proc:

Examples of use:

Dependent example:

F:= ['randpoly([x,y])' $ 22]:
f:= randpoly([x,y]):
C:= PolyLinearCombo(F, f, {x,y});

Independent example:

F:= ['randpoly([x,y])' $ 22]:
f:= randpoly([z,y]):
C:= PolyLinearCombo(F, f, {x,y,z});

The above example becomes dependent if z is treated as a parameter:

F:= ['randpoly([x,y])' $ 22]:
f:= randpoly([z,y]):
C:= PolyLinearCombo(F, f, {x,y});

I'd condsider this a bug: The value of Digits and other environment variables (which have been modified from their defaults) should be transcribed to all nodes. Another workaround is to put

Digits:= 30;

into your initialization file.

I agree with Roman that you should run the evalf also in parallel; timewise, it is a significant part of the computation. But I do not agree that you should necessarily use numeric integration. So, change the Mapped procedure from int to evalf@Int or evalf@int depending on whether you want to use numeric or symbolic integration.

Your problem is that pdf1(i), etc., will evaluate to a numeric value even if i is symbolic (i.e., even if i has no numeric value). There are two ways to correct this. The preferred way is to make the following the first executable line of pdf1:

if not x::numeric then return 'procname'(args) end if;

The crude way is to put unevaluation quotes around the call to pdf1:

Sum('pdf1'(i), i= 3..3),

etc.

There is no bug.

First 257 258 259 260 261 262 263 Last Page 259 of 395