dharr

Dr. David Harrington

8235 Reputation

22 Badges

20 years, 341 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are answers submitted by dharr

Simplest way is

polarplot(sin(t)/cos(t)^2,t=-Pi/2..Pi/2, coordinateview=[0..2,-Pi..Pi]);

 

This may not be as efficient since it generates 256 matrices and then eliminates the zero matrices. But it does the conversion to the required notation at the same time.

M:=Matrix(4,4,(i,j)->E||i||j);

M := Matrix(4, 4, {(1, 1) = E11, (1, 2) = E12, (1, 3) = E13, (1, 4) = E14, (2, 1) = E21, (2, 2) = E22, (2, 3) = E23, (2, 4) = E24, (3, 1) = E31, (3, 2) = E32, (3, 3) = E33, (3, 4) = E34, (4, 1) = E41, (4, 2) = E42, (4, 3) = E43, (4, 4) = E44})

(1)

nums:=map(Bits:-Split,[$0..15],1,bits=4); #all binary numbers from 0 to 15 in bit reversed order

[[0, 0, 0, 0], [1, 0, 0, 0], [0, 1, 0, 0], [1, 1, 0, 0], [0, 0, 1, 0], [1, 0, 1, 0], [0, 1, 1, 0], [1, 1, 1, 0], [0, 0, 0, 1], [1, 0, 0, 1], [0, 1, 0, 1], [1, 1, 0, 1], [0, 0, 1, 1], [1, 0, 1, 1], [0, 1, 1, 1], [1, 1, 1, 1]]

(2)

M.~(Vector(nums[7]).Vector(nums[8])^%T);  # how it works
add(k,k=%);

Matrix([[0, 0, 0, 0], [E21, E22, E23, 0], [E31, E32, E33, 0], [0, 0, 0, 0]])

 

E21+E31+E22+E32+E23+E33

(3)

S:=table();
for i to nops(nums) do for j to nops(nums) do   #generate all 256 possibilities
S[i,j]:=add(k,k=M.~(Vector(nums[i]).Vector(nums[j])^%T));
end do end do;
S:=convert(S,set) minus {0}:   #remove the ones that are the zero matrix

table( [ ] )

(4)

nops(S);

225

(5)

S;


 Full output of S is removed but starts
{E11, E12, E13, E14, E21, E22, E23, E24, E31, E32, E33, E34, E41, E42, E43, E44, E11+E12...

Download bits.mw

Edited: I realize I should have just gone from 1 to 15 (not 0 to 15) and then I woudn't have to remove the zero matrices.

The returned module pds has routines to plot the solution, e.g., pds:-plot(...). For details and examples see the pdsolve/numeric help page ?pdsolve,numeric

Most of Maple (including the plot3d command) uses the "Math" convention as on the ?coords help page, i.e., the azimuthal angle second.

But the VectorCalculus package uses the "Physics" convention as on the ?VectorCalculus,Coordinates help page, i.e., azimuthal angle third. I believe the Physics package also uses this convention, though a quick glance at the help pages did not clarify this.

This is a definite problem for Maple, and I have seen some commentary about improving the situation, though I don't recall where. A first step would obviously be to put some warnings on each of these help pages!

I used 

read "stanform";

and got some immediate errors because Maple's ditto operator used to be " but is now %. I didn't attempt to replace the " with %, but it might be possible to make it work if you are familiar with Maple. In general old Maple code still runs, but there are a lot of lines of code there and I didn't look in detail through it.

According to the help page ?pdsolve,numeric, the default method is used unless you specify one of the others (those in your list). Under "Details" on that page is some more information:

"The default method uses a second order (in space and time) centered, implicit finite difference scheme to obtain the computed solution. The number of points in the stencil of the finite difference scheme is one greater than the order of each equation."

Some references are give at the bottom of the page, though they seem to be rather general.

PDETools:-dcoeffs(lhs(eq),q(T));

gives

324.6463527, 3.589858529*10^12, 4.012505275*10^11

eval substitutes N=infinity in each term, and concludes each term and the sum is zero. Limit is smarter:

limit(G(N),N=infinity); returns without an answer. I tried some assumptions here withouth success. On the other hand, you can do it numerically and approximately:

evalf(eval(G(N),N=10000)) gets it right to 3 decimal places. 

For 8x8

InvM:=Adjoint(M)/Determinant(M):

returns quickly, but then InvM[1,1] returns with "[Length of output exceeds limit of 1000000]"

So I think the answer is too complicated to do anything with, no matter how much memory.

On the other hand,

simplify(InvM.M);

gives the identity in about 150 s on my laptop.

You need to make an actual second point using Point1:=disk( ...  , color =black), then rotate it and display it with Point2. Rotate doesn't get rid of the color of the object, and the display color won't override a specified color in a plot object.

David.

In Maple 16:

restart;Digits;
10
evalf(Sum(I^n*BesselJ(n,2*sqrt(34))*exp(-I*n*arctan(5/3))*exp(I*n*Pi/4),n=1..30));
evalf(Sum(I^n*BesselJ(n,2*sqrt(34))*exp(-I*n*arctan(5/3))*exp(I*n*Pi/4),n=1..100));
evalf(Sum(I^n*BesselJ(n,2*sqrt(34))*exp(-I*n*arctan(5/3))*exp(I*n*Pi/4),n=1..1000));
0.05400552045 - 0.7873756700 I
0.05400552043 - 0.7873756700 I
0.05400552042 - 0.7873756700 I

 

L:=[{a},{b,c},{d,a,f},{b,d}] ;

 

look:=L[1][]:   #thing to look for
for i from 2 to nops(L) do
 if has(L[i],look) then print(L[i] minus {look}); break; end if;
end do;

 

gives {d,f}

 

which I think is what you wanted.

Hard to follow, but I get a message that some variables are in the equations but are not solved for, because you missed them in your set of variables. The easiest way to prevent this is to use

vars:=indets(Eqs1);

In Maple 16 (not Classic), if you want 1-D Maple input as the default (instead of ctrl-M every line), go to tools/options/display/and set Input Display to "Maple Notation".

 

One thing to check is that if autosave is too frequent, then for a long save or long calculation, one autosave starts before the previous one has finished. Try setting the autosave to a less frequent interval.

First 71 72 73 74 75 76 77 Last Page 73 of 81