Maple 7 Questions and Posts

These are Posts and Questions associated with the product, Maple 7

There was a discussion regarding Maple and two light sources a couple of days ago (unfortunately the content of that conversation has been removed by the original poster so if any of you thought you were getting early signs of alzheimers, rest assured the questions/posts were indeed there and you can all put your memories at ease for a little).

I did indeed go back into Maple to see how far it was that we lost the two light source capability.  I can tell you that as far back as Maple 10.06 dual (or more) light sources was not working.  So I worked my way up - of course the OP of the deleted questions mentioned Maple Vr4 (I think), so I started there.  Maple 6 and Maple 7 is ok.  I was unable to check Maple 8 and 9 as my computers with that software are currently missing (probably buried in my shed somewhere - as long as the wife hasn't got rid of them.. anyways)

So I'll share with you what once was.  From Maple 7, and an animated gif (which hopefully works) to illustrate two light sources (one brown light, and one mauve or purple light) and what it looked like from Maple 7.

with(plots):
setoptions3d(style=patchnogrid,projection=.9):
a:=plot3d(-x^2-y^2-x*y,x=-1..1,y=-1..1,color=[.5,.9,.9],grid=[15,15]):
b:=n->display(a,orientation=[n,60]):
display([seq(b(10*n),n=0..35)],light=[90,-80,1,.2,.1],light=[90,40,1,.5,.8],insequence=true);

The animation is not working so the uploaded gif file is here for you to check out. .. Couldn't upload the gif file so I've zipped it - that worked

twolightsource.zip

simplify_question.mws
Am trying to teach myself about lines and circles and inversion.  In the code below I'd like to put textt on the circles eg c1 to identify circle c1 etc.I'm more familiar with the textplot command & plottools, but want to use the draw command.  I've tried some options with the circle statement without success.
circle(c1,x^2+(y-2*R*cos(Pi/6))^2=R^2):  # 'ctext'=c1):

Is it possible to position text in a draw statement, similar to the textplot statement (that uses plot)?  

  I was amused by an idiosincracy of Maple 7.  The last line of my code uses the simplify command, yet I have had to resort to the simplification myself - (on the previous lines).   I was surprised and curious about this.  The Help section on simplify mentions several high power simplification procedures, yet fails to simplify a simple expression.  Any comments on this?

   I'm interested in learning more about circle inversion and wondered if anyone knew of some elementary books on this.  Geometry Inversion was never taught to me at school, nor university, despite it being a topic over 1000 years old.

   Thanks for your time.  Any comments, answers, gladly appreciated.      

  

restart:
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Test of geometry, radical axis.
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
with(geometry):
with(plots):
_EnvHorizontalName := x: _EnvVerticalName := y:

R:=5:
circle(c1,x^2+(y-2*R*cos(Pi/6))^2=R^2):  # 'ctext'=c1):
circle(c2,(x-R)^2+y^2=R^2):
circle(c3,(x+R)^2+y^2=R^2):
RadicalAxis(ra12,c1,c2):
RadicalAxis(ra13,c1,c3):

printf("Colors:  c1=red c2=blue  c3=gold\n");
printf("       ra12=magenta    ra23=grey\n");
t1:=textplot([0, 1.8*R, `Circle c1`]):
draw([c1,c2, c3, ra12,ra13], axes=normal, color=[red, blue,gold, magenta,grey]);

#draw([c1,c2, c3, ra12,ra13,t1], axes=normal, color=[red, blue,gold, magenta,grey, black], printtext=true);
if AreTangent(c1,c2) then
   printf("Circles c1 and c2 are tangential, (as they all are!)\n");
end if:
testp:=Equation(ra12):
#print(whattype(testp));
printf("Equation of radical axis for c1 & c2 is %A or\n", testp);
simplify(Equation(ra12)/10);
simplify(Equation(ra12));

Warning, the name changecoords has been redefined

Colors:  c1=red c2=blue  c3=gold

       ra12=magenta    ra23=grey

Circles c1 and c2 are tangential, (as they all are!)

Equation of radical axis for c1 & c2 is 50+10*x-10*3^(1/2)*y = 0 or

5+x-sqrt(3)*y = 0

50+10*x-10*sqrt(3)*y = 0

 

 


 

Download simplify_question.mws

 

wordwheel.mws
 

The program below works fine, but comes up with an error message: wrong number (or type) of parameters in function $.  I'm confused as the Maple 7 Help on 'convert, bytes' the $ symbol is omitted.  The program works fine: it is just a little disconcerting, as this is just the start of a general Wordwheel program.

   The error seems to be related to the textplot command - but why?

restart:
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Wordwheel program - intended to be general
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
with(plots):
with(plottools):
#Number of letters, including the ? sign
nolett:=7:
#Angle of arc for each letter
ang:=2*Pi/nolett:
R:=5:
# Draw the circle
c:=circle([0,0], R, color=black):
#Draw the lines
for
i from 0 to nolett-1 do
  lin[i] := line([0,0], [R*cos(i*ang),R*sin(i*ang)], color=black,   linestyle=1):
end do:  #i
#Upper & lower case alphabets
#s_L := convert( [$97..122], 'bytes' ):   #a - z
s_U := convert( [$65..95], 'bytes' ):   #A-Z
#s_L[25];   

tp1:=textplot([1,2,s_U[6]],align={ABOVE,RIGHT}):
plots[display](c,tp1, seq(lin[i], i=0..nolett-1), scaling=constrained, axes=none);

Warning, the name changecoords has been redefined

Warning, the name arrow has been redefined

Error, wrong number (or type) of parameters in function $

 

 


 

Download wordwheel.mws

 

numeric.mws

 

Dear Colleagues,
Please give advice - How correct in Maple can be solve the heat nonlinear equation system with perfect thermal contact conditions?

Using procedure dsolve (numeric) Maple cannot determine type of problem (initial or boundary).

****
initial/boundary conditions specified at too many points 1
Error, (in dsolve/numeric/type_check) cannot determine type of problem (initial or boundary), as conditions are given at 4 points
****
 

In attachment Maple file - numeric.

Maybe anyone can get a simple exaple of the maple code for numeric solution of this  task?

 

 


 

restart;

k1:=5; k2:=7;k3:=8; Q:=4;p:=0.001;l:=0.1; d:=0.6;

k1 := 5

k2 := 7

k3 := 8

Q := 4

p := 0.1e-2

l := .1

d := .6

(1)

Eq1:=(k1^2)*diff(T1(x),x$2)=0;

 

Eq1 := 25*(diff(T1(x), `$`(x, 2))) = 0

(2)

Eq2:=(k2^2)*diff(T2(x),x$2)=-Q*Dirac(x)+T2(x)^4;

Eq2 := 49*(diff(T2(x), `$`(x, 2))) = -4*Dirac(x)+T2(x)^4

(3)

Eq3:=(k3^2)*diff(T3(x),x$2)=0;

Eq3 := 64*(diff(T3(x), `$`(x, 2))) = 0

(4)

con1:=T1(0)=T2(0);con2:=T3(p)=T2(p); con3:=k1*(D(T1)(0))=Q-k2*(D(T2)(0)); con4:=k2*(D(T2)(p))=k3*(D(T3)(p)); con5:= T3(l)=300; con6:=T1(-d)=300;

con1 := T1(0) = T2(0)

con2 := T3(0.1e-2) = T2(0.1e-2)

con3 := 5*(D(T1))(0) = 4-7*(D(T2))(0)

con4 := 7*(D(T2))(0.1e-2) = 8*(D(T3))(0.1e-2)

con5 := T3(.1) = 300

con6 := T1(-.6) = 300

(5)

nsol:=dsolve({Eq1, Eq2, Eq3,con1,con2,con3,con4,con5,con6},{T1(x),T2(x),T3(x)}, numeric,bvp);

 

 

initial/boundary conditions specified at too many points 1

Error, (in dsolve/numeric/type_check) cannot determine type of problem (initial or boundary), as conditions are given at 4 points

 

 

 

 


 

Download numeric.mws

The plots at the end of the following code output the lines when the textplot is absent - but with the textplot the lines are omitted.  Am puzzled as to why this is happening.  Square_areas.mws  Square_areas.txt

Any help gratefully received.  David

 

restart:
 # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 # Areas of portions of a square 
 # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 with(plots):
 with(plottools):
 side:=6:A1:=16:A2:=20:A3:=32:
 # Pick a point in the square: say (x1, y1)
 poinC:=point([side/4,side/3]):
 cpoin:=op(1,%):
 x1:=cpoin[1];
 y1:=cpoin[2];
 lin[1]:=line([side/2,0],[x1,y1], color=black):
 lin[2]:=line([0,side/2],cpoin, color=black):
 lin[3]:=line([side/2,side],cpoin, color=black):
 lin[4]:=line([side,side/2],cpoin, color=black):
 #textA:=textplot([(cpoin[1]+side/2)/2,1,`A1`],align={ABOVE,RIGHT}):
 #textA:=textplot([(1.5+side/2)/2,1,`A1`]):
 tetA:=textplot([1,1.3,`A1`]):
 
 squ:= polygon([[0,0], [0,side], [side,side],[side,0]], color=white):
 # Plot without tetA - Lines are given
 plots[display]({seq(lin[i],i=1..4),squ,poinC}, scaling=constrained,axes=normal);
 # Plot with tetA - Lines are not given
 plots[display]({seq(lin[i],i=1..4),squ,tetA,poinC}, scaling=constrained,axes=normal);
 # Plot with tetA (placed  differently) - Lines are not given
 plots[display]({squ,poinC,tetA,lin[1],lin[2],lin[3],lin[4]}, scaling=constrained,axes=normal);

solve_V_alfa.mws

 

I'm trying to solve two simultaneous equations for velocity, V, and angle of inclination, alfa, given the range, ranj and maximum height, H.  The solve part works fine, but gives me several unwanted complex solutions.  I was trying to put the solutions in a list so that I could access them.  The text below is rather verbose, but I've left comments in as a possible educational aid for people understanding expression sequences, and sets. 

restart:
#interface(imaginaryunit, errorbreak=0, errorcursor=true, #labelling=false):
#with(SolveTools);

# Investigating sets and expression sequences
#S:={q, w,e}:
S:=7,2,5:
whattype(S);
L4:=convert(S,list): #Doesn't work for expression sequences
L4:=[S]; # this converts the expression sequence to a list, L4
L4[3]; # outputs 3rd element of L4 which is 5
# End of investigation

print(`Next part - solving two equations: Ranj and height H given`);
print(`To find angle of inclination, alfa, and velocity, V`);
g:=9.81:Ranj:=80:H:=15:
L:=solve({4*V^2*cos(alfa)^2-g*Ranj^2/(Ranj*tan(alfa)-2*H), Ranj*g-V*sin(2*alfa)},{V, alfa}): #::real}):
#L:=solve([4*V^2*cos(alfa)^2-g*Ranj^2/(Ranj*tan(alfa)-2*H), #Ranj*g-V*sin(2*alfa)],{V, alfa}): #::real}):
# ::real, alfa::real:
printf("L is of type %a", whattype(L));
#whattype(L);
#L2:=convert(L,list); #gives error message
L2:=[L]:
L2;
print(`Next: To distinguish between real and complex solutions`);
print(`Output in if statement is not working as expected.`);
#nops([L]);
for i from 1 to nops([L]) do
if type(L[i],complex(float)) then
#if type(L[i],nonreal) then
printf("Complex solution for i=%d\n",i);
else
printf("else part of if: i=%d\n",i);
print( L[i]);
end if;
end do; #for

Download solve_V_alfa.txt

 

Ball_Maple.mwsBall_Maple.txt

Attached is code in Maple 7 and a text file.There is a for loop in which I want the plots to be output, and the printf command - but I am not getting a plot at all.  Any advice most appreciated.  David

Letter_M.mwsLetter_M.txt

Attached are two similar files: one written in Maple 7 code, and a similar text file.

    My original intention was to have the two dimensional letter M do an animated "knees up" in just one color.  However the program works - but not as I intended.  The individual four sections danced around - and I thought it was rather novel - but decided to make each one a different color - red, blue, white and turquoise.  I was surprised to find the polygons were all the same turquise color - that of the fourth polygon.   Is there an easy fix, or must I write four separate procs for the four polygons?

Thanks in advance for any advice.  David 

Fivebyfive_crossword.mwsFivebyfive_crossword.txt

  I am trying to solve a 5x5 crossword  puzzle, where one must find 5 across clues, and 5 down clues - all in a 5x5 square grid.  I have done a dictionary search for all the possibilities of the ten clues.  (For brevity this is not in the attached program.)  These possible solutions have been put as lists.  The attached Maple 7 program attempts to solve the crossword by a series of nested for loops, checking if the intersection of across and down clue letters match.  In this the use of nops is made, as the number of possible words for each clue varies.  I appreciate why the program fails, but am at a loss for a "work around", and fear a complete restart may be needed. 

   I attach two files of the program.  The Fivebyfive_crossword.mws Maple 7 file includes a graphic grid of the crossword, with asterisks (*)  for unknown letters.  The corresponding .txt file probably will not have that.  Sadly, Maple doesn't allow the upload of .rtf files.  Further documentation is in the program.

   Any comments, help would be most appreciated.

I am in the process of rewriting a long program so that it invokes procs.  After each proc I write I want to test the proc, so am not interested in any further output.  So in the code I entered `quit` (12);  - which I obtained from the Maple 7 Help documentation.  ...and possibly for good measure:  done;   The system crashed and I had to start again.   I have looked on the MaplePrimes documentation.  There are a couple of posts which treat this as an amusement.  eg

subs(_=sscanf(D,%m)[],proc() _end)();   which I haven't been game to try yet.

  I am curious about the number 12.  In the Maple 7 documentation the output is meant to give some useful information regards bytes used, allocation, & time taken.  Maple 7 documentation says that the number between parentheses should be an nteger in the  range 0..255.  Does varying this number make any difference?

WARNING!  Running the following program could crash your system.  Save any work before trying it.

restart:  `quit` (12);

   I'm curious to know what that does on later versions.  I'm running Maple 7 on Windows 7, so I suspect some incompatibility.

Any comments, advice gratefully received.  David

Invalid arguments error message in the program below.  Advice please on why this is not working.
 

restart:
h:=12:base:=7.8:A:=1.12:w:=1.5:
lY:=w/sin(A):
depth:=(base/2-lY)*tan(A):
#Set notation brackets - ignores this
#solve({tan(x)=2*(h-depth-y)/w, z=w*cos(A)+w*sin(A)/tan(A+x), uY+z+depth=h},{x, y,z});
solve(tan(x)=2*(h-depth-y)/w, z=w*cos(A)+w*sin(A)/tan(A+x), uY+z+depth=h,{x, y,z});

Error, (in solve) invalid arguments

 

 


 

Download solve_equation.mws

Lett_Y_morphing.mws

I am trying to change (morph) the capital letter Yinto the shape of an American football goalpost -which has a sigle post , and the top part looks like the top part of the letter H.  The attached program is attempting to morph just three points - two of which, A, and D stay the same and the middle point Mo is meant to change from being on the line AD, to progressively change to be part of a right angle triangle.  Eventually I want to use more points - but am making heavy weather of this.  Any helpwould be appreciated. 

Letter_V_kaput.mwsLetter_V_working.mws

The two attached programs are such that the "kaput" version uses a procedure to draw the letter V, with the option of a flat top or pointed top.  The last parameter, s, takes on values "p" or "f" for pointed or flat respectively. - but I get error messages.  The Letter_V_working programdoes not use a proc, but works.  Where is the error?

  Thanks in advance for any help.

   .  .

cone_rail_track_Maple.mws

The attached program is of a point moving along a conical path of a cone, then doing a descent back to the start.   For values R=60, r=20, h=10 the animation seems to work reasonably well.  However when r=19 - only a small change - the development plot of the cone is only partially shown?   Also, I have some variables nameP1, nameP2 which I would like to alter the color of.  Howdo I do this?

  Any comments or help most appreciated. 

# About twenty years ago Joe Riel posted 

#printing_just_for_fun.mws   by Joe Riel 30-6-‘98

#As part of this he had:

 d_string:="D*e*v*o*u*r*e*r":

#eta:=symb(217):

print(cat(`Does `,d_string,` = `));

eta;
#Is it possible to put the eta symbol on the same line?

#   Yes,  …but without the comma??  And…
 printf("Does %s = %a\n",d_string, eta);

#  does not give the Greek letter eta, but just eta,  while

eta;

print(eta);
#...both give the Greek letter

#  Is it possible to use printf (or similar?) to obtain output 

#  of:  Does D*e*v*o*u*r*e*r = h  

#  Oops!  In Word the h was a Greek letter eta!

#  ...and lastly, can it be done in Maple 7?

1 2 3 4 Page 1 of 4