Carl Love

Carl Love

28025 Reputation

25 Badges

12 years, 305 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

mySumOfMatrixDiagonal:= (M::Matrix('square'))-> add(M[k,k]^2, k= 1..upperbound(M)[1]):

For each kis a surface, not a curve, so use plot3d:

y:= k*x*sqrt(z*(1-z)):
plot3d(
    [seq([x,y,z], k= 5..100, 5)], x= 0..1, z= 0..1, 
    color= [seq(COLOR(HUE, .85*(k-5)/95), k= 5..100, 5)], 
    transparency= .15
);


 

Your answer[1] is a set, not an equation. Sets don't have right-hand sides. Here are four ways to proceed:

Map over the set:

rhs~(answer[1]);

Extract the first (and only) element from the set:

rhs(answer[1][1]);

Extract all elements from the set (this only works because there's only one element):

rhs(answer[1][]);

Forget about rhs; use eval instead:

eval(U__T2N, answer[1]);

The eval method is probably the one most commonly used by experienced Maple users.

The third form is equivalent to the first form under complex evaluation with appropriate adjustments of the contants of integration. And the second form can be obtained as a limit of the third form. For example,
 

restart:

Sol:= dsolve({
    diff(y(x),x,x)*x^2+3*x*diff(y(x),x)+lambda*y(x),
    y(1)=a, D(y)(1)=b
});

y(x) = -(1/2)*(1-lambda)^(1/2)*((1-lambda)^(1/2)*a+a+b)*x^(-1+(1-lambda)^(1/2))/(-1+lambda)+(1/2)*(1-lambda)^(1/2)*(-(1-lambda)^(1/2)*a+b+a)*x^(-1-(1-lambda)^(1/2))/(-1+lambda)

evalc(rhs(Sol)) assuming x>0, lambda>1;

a*cos((-1+lambda)^(1/2)*ln(x))/x+(a+b)*sin((-1+lambda)^(1/2)*ln(x))/((-1+lambda)^(1/2)*x)

limit(rhs(Sol), lambda=1);

(a*ln(x)+ln(x)*b+a)/x

 


 

Download EulerODE.mw

I don't know all the details of how Grid works, but intuitively Grid:-Set(arg1) seems unnecessary to me, and it seems like it would consume a lot of memory.

If one were required to use Grid:-Set(arg1), that would seem to me to be contrary to the whole idea of dividing the work among multiple processes.

Where you have blocks= [u,v], it should be 

blocks= [[u, v]]

Here is your complete code in the abbreviated "jet" notation:

restart:
DA:= DifferentialAlgebra:  DAT:= DA:-Tools:
R:= DA:-DifferentialRing('blocks'= [[u,v]], 'derivations'= [t]):
p:= u[t$3]*v[t] - u[t]*v[t$3]:
q:= v[t$3]^2*(v[t]*u[t$2] - v[t$2]*u[t]):
s:= DAT:-DifferentialPrem(p, q, R);
           s := 1, -u[t] v[t, t, t] + u[t, t, t] v[t]

 

In addition to sum not working for this, you've made a mistake by indexing the last row as 9. It's actually 10, but you do not need to index it at all. The sum that you want is simply

m1[2.., 1] . m1[2.., 2]

It is expressed above as the dot product of two vectors, i.e., a single operation that does the sum of the elementwise product of two vectors.

You simply need to switch Re with seq:

The following will work for any GridGraph:

restart:
GT:= GraphTheory:
G:= GT:-SpecialGraphs:-GridGraph(3,3):
GT:-DrawGraph(
    GT:-RelabelVertices(
        G, 
        sort(
            -sort(
                GT:-Vertices(G), 
                key= (v-> local p:= parse(v); [p[2], -p[1]]), 
                output= permutation
            ), 
            output= permutation
        )
    ), 
    stylesheet= "legacy"
);

The culprit is a remember table in procedure SumTools:-DefiniteSum:-ClosedForm. So a workaround is to use 

forget(SumTools);

before the second call to sum.

But since remember tables don't work correctly with mutable containers (such as Vectors), I'd recommend not using sum at all when the summand contains vector entries.

Tom's Answer shows some general techniques that a procedure can use to react sensibly to both numeric and nonnumeric input. However, for your simple example, all that's needed is piecewise; it already takes the numeric/nonnumeric distinction into account:

h:= x-> piecewise(x <= 0, sin(3*x), sin(x/3));

As far as I can tell, Maple's numeric PDE solver is restricted to boundary conditions that use only one of the system's dependent variables (the unknown functions).

For what it's worth, the numeric ODE BVP solver doesn't have that restriction. I'm just pointing out that contrast, not suggesting that that could help with your situation.

You asked:

  • Is there a 64 bit mode that will take better advanage of the system?

Yes, and it'll definitely take better advantage of your system. But you need to decide between 32-bit and 64-bit at the time that you download the installer.

  • For that matter, is there any configuring that can install it or configure it to take better advanatage of the multi-threaded hardward capabilities?

Maple has multi-processing and multi-threading capability right out of the box; there's no special configuring needed to use it. There are a few tweaks that are occasionally useful that can be made with the kernelopts command. See ?kernelopts. Using that capability is mostly up to the skill of the programmer. Most high-level Maple commands write to global variables, so they can't be used multi-threaded.

For your secondary question, about substituting the cube-root powers, do this:

evalindets(
    s1, 
    identical(5435+3*sqrt(515793))^({-1,1,2}/~3), 
    e-> t^numer(op(2,e))
);
 

Powers appearing in denominators are stored internally as powers with negative exponents, which is why the above looks for both -1/3 and 1/3 exponents.

You asked:

  • Is there a way to tell solve to return unique solution only by default?

Why should there be a named option for that when it's trivial to just use { }?

sol:= {solve(expr = 0,u)}:
First 95 96 97 98 99 100 101 Last Page 97 of 395