Question: Concatenation / Print command help needed

Hi all,

This is probably a rookie mistake, but my Maple code is not outputting as I'd expect. E is a list of eigenvectors, s is a list of sets containing coordinates and n is the number of vectors in the list - my code should loop through the elements, and determine the type of stationary point. However, the print function seems to be causing unneccessary trouble.

for i from 1 to n by 1 do
    if E[i][1]>0 and E[i][2]>0 then sptype:="Minimum" end if:
    if E[i][1]<0 and E[i][2]<0 then sptype:="Maximum" end if:
    if E[i][1]<0 and E[i][2]>0 then sptype:="Saddle" end if:
    if E[i][1]>0 and E[i][2]<0 then sptype:="Saddle" end if:
    if E[i][1]=0 or E[i][2]=0 then sptype:="Unknown" end if:   
    print("Stationary point "||s[i]||" is a "||sptype);
end do;

"Stationary point " || [{x = 2, y = 1}, {x = 2, y = -1}, {x = -2, y = 1}, {x = -2, y = -1}][1] || " is a " || "Saddle"

As you can see, rather than outputting the {x=2, y=1} it gives the whole list with the index on the end. Also, all the concatenation symbols and quotation marks are shown, which isn't very neat.

I tried
   pt:=op(s[i]):   
   print("Stationary point "||pt||" is a "||sptype);
to get around the first issue, but the second issue is still bugging me, and I'm not sure why the above workaround is needed.

Many thanks

Ralph

 

Please Wait...