awass

296 Reputation

10 Badges

19 years, 278 days

MaplePrimes Activity


These are questions asked by awass

The Help pages says:

Import a Worksheet from XML
  Open an existing XML document as a worksheet to modify the content or to change its appearance.
1. From the File menu, select Open. The Open dialog appears.
Select the Maple Worksheet as XML file type.

Those instructions do NOT apply to Maple 2018 on a Mac (although I have verified they DO apply on a Windows machine.) No dialog appears.

My .mw file is 90% format information and thenbits and pieces of Maple code. Is there some way to just extract the maple stuff? The file is pretty long and cutting out the xml stuff is very time consuming.

Thanks,

 

I have a procedure that changes the value of an input variable quite unexpectdly. Can anyone explain why? I have a very simplified example of this below.

restart;
with(LinearAlgebra):
switch := proc (V::Vector)
description "This procedure is supposed to take a Vector V and switch entries 1 and 2";
local W,a,b;
W:= V;
a:= W[1];
b:= W[2];
W[1 ] := b;  
W[2] :=a;
W
end proc;

V1:=Vector([1,3,5]);
V2:=switch(V1);
I have omitted the output for brevity's sake but all works well as expected.
However,
V1;

returns V2 not V1. Why is the procedure changing V1?
 

The problem occurs with matrices but not with lists.

 

Thanks.

 

Here is a simple procedure that works fine if entered using 1D Maple input
> Q:=proc(x)
sin(x)
end proc;
but if you use 2D math input
> q:=proc(x)
sin(x);

  end proc;

Error, unterminated procedure
    Typesetting:-mambiguous(qAssignTypesetting:-mambiguous(

      procApplyFunction(x) sinApplyFunction(x),

      Typesetting:-merror("unterminated procedure")))
Error, unable to parse
    Typesetting:-mambiguous(  Typesetting:-mambiguous(end,

      Typesetting:-merror("unable to parse")) procsemi)

Ouch! But to confuse things further the following procedures may be entered using 2D math and work fine:
>H := proc (x) x^2*sin(x) end proc;
>K := proc (x) sin(x^2) end proc;
Doesn't make any sense to me. Perhaps 2D math is not ready for prime time?

 

From the help pages for the Gram Schmidt command:

The number of Vectors returned is the dimension of the vector space spanned by V.  In particular, if the Vectors in V are not linearly independent, fewer Vectors than the number in V are returned.


That is not what happens when floating point numbers are involved, for example:

>restart;
>with(LinearAlgebra);
>a := Vector([1, 2, 3]); b := Vector([1, -2, 3]); c := Vector([3, 2, 1]); d := Vector([5, 1, -3]); e := Vector([0, 1.01, -3]);
>GramSchmidt([a, b, c, d, e]);

This returns 3 vectors as it should BUT
>GramSchmidt([b, c, d, e, a]) returns 5 vectors (one of which is essentially 0).  That is definitely a bug.
 

Here is a simple little procedure that does not work

et :=proc(x) 

description   "this is a variant of evalf that gets rid of almost 0 nos.(rounding error) and shortens the display to 2 `digits"`;  

if  abs(x) < 10^((-14))  then 0 else  evalf(x,2) end if     end proc;


Error, unable to delimit strings/identifiers


and here is the same procedure that works because I added the # before the description.

et :=proc(x)

# description   "this is a variant of evalf that gets rid of almost 0 nos.(rounding error) and shortens the display to 2 `digits"`;  

if  abs(x) < 10^((-14))  then 0 else  evalf(x,2) end if     end proc;

 

In the help pages they do not say that the description must be hidden by the # sign (nor do they mention that quotes should be used although they are used in the examples.

 

What am I missing?

 

 

 

1 2 3 4 5 6 7 Page 3 of 9