Maple 7 Questions and Posts

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

when i try to save my program maple is close, crashing. how can i fix this?

Hello, i want to do convert numbers to binary code 8 bytes and I want to sum the digits of each number 

For example first number is 0 i want to write 0 0 0 0 0 0 0 0 , sum=0, for 1= 0 0 0 0 0 0 0 1,  sum =1 for 7= 0 0 0 0 0 1 1 1 sum=3 etc.....
my code is this;

for i from 0 to 10 do;
> S(i):=convert(i,binary);
> end do;

and output is 

                              S(0) := 0
                              S(1) := 1
                              S(2) := 10
                            S(3) := 11
                             S(5) := 101
                             S(6) := 110
                            S(7) := 111
                           S(8) := 1000
                             S(9) := 1001
                            S(10) := 1010
                and  Histogram(S(i));  doesnt work.                


 > save mytable, "foo.m";
in whitch folder may I find the file "foo.m" ?

I try with the function "search" of Windows 10, but it can't find it.

Thanks for a answer.


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.


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

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.      


# # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Test of geometry, radical axis.
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
_EnvHorizontalName := x: _EnvVerticalName := y:

circle(c1,x^2+(y-2*R*cos(Pi/6))^2=R^2):  # 'ctext'=c1):

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:
printf("Equation of radical axis for c1 & c2 is %A or\n", testp);

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



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?

# # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Wordwheel program - intended to be general
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
#Number of letters, including the ? sign
#Angle of arc for each letter
# Draw the circle
c:=circle([0,0], R, color=black):
#Draw the lines
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

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




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?





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




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



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



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


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


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


 # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 # Areas of portions of a square 
 # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 # Pick a point in the square: say (x1, y1)
 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):
 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);



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. 

#interface(imaginaryunit, errorbreak=0, errorcursor=true, #labelling=false):

# Investigating sets and expression sequences
#S:={q, w,e}:
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`);
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));
#L2:=convert(L,list); #gives error message
print(`Next: To distinguish between real and complex solutions`);
print(`Output in if statement is not working as expected.`);
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);
printf("else part of if: i=%d\n",i);
print( L[i]);
end if;
end do; #for

Download solve_V_alfa.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


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 


  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.

#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


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. 

1 2 3 4 Page 1 of 4