dharr

Dr. David Harrington

8482 Reputation

22 Badges

21 years, 33 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

How about putting the whole thing in a procedure? Then your "quitting the search" can be

return i[1], ...i[10];

Put the cursor in the execution group, then use edit/select execution group (or ctrl-alt-shift-E) to select the group. Then you can copy it. This copies the input and output.

In Maple 2015, you can fudge it like:

with(plots):with(plottools):

p1:=display(parallelepiped([0, 0, 1], [0, 2, 2], [2, 2, 2], transparency=0.5),shading=xyz):

p2:=display(parallelepiped([0, 0, 1], [0, 1, 1], [1, 1, 1], transparency=0.5),shading=zhue):

display([p1,p2]);

 

(I think in earlier versions, color functions and shading schemes weren't available for all plot structures, like the POLYGON structure that parallelopiped produces. So I think the warning from plottools is perhaps a leftover from earlier versions, and I'm not sure this workaround can solve the problem in Maple 15)

Set each of your plots into a variable, then combine them with plots:-display. You may want to add extra options to the display that override the ones in the individual plots:

p1:=plots:-pointplot([seq([x,0],x=[-sqrt(16),-2,-3/4,0,exp(1),Pi])],view=[-4..4,0..0.01],symbolsize=20,symbol=solidcircle,colour=blue,scaling=constrained);

p2:=plots:-textplot([-4,.7,typeset("-sqr 16")],font=[TIMES,BOLD,12]);

plots:-display(p1,p2,view=[-4..4,0..1],scaling=constrained);

Use Digits:=40; before plotting. I'm guessing you need more digits to combine the very large 10^1390 with the very small exp(-1.597924898*2000)

I'd select the text, copy it and then paste in into a text file such as code.txt. Then read it into maple using the read command, something like read(cat(currentdir(),"/code.txt")); (assumes your maple worksheet and code.txt are in the same directory). You may have to edit the text file slightly, e.g., what look like backquotes don't seem to be, so replace them with actual backquotes (according to the syntax error).

Also conformal in the plots package will do the grids in to new curves as you wanted. See also conformal3d.

After creating two plots, e.g. by

p1:=plot(x,x=0..1,color=blue);p2:=plot([[0.5,0.5]],style=point,symbol=solidcircle,symbolsize=30,color=red);

 

then plots:-display(p1,p2) plots p2 on top of p1, and plots:-display(p2,p1) plots p1 on top of p2.

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

First 72 73 74 75 76 77 78 Last Page 74 of 83