nm

11353 Reputation

20 Badges

13 years, 10 days

MaplePrimes Activity


These are questions asked by nm

I do not understand why select(has,-a^2,x); returns 1 but select(has,a^2,x); returned undefined.

Should not both return undefined, since there is no anywhere in the expression?

I looked at help and do not see a clue so far.

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1849 and is the same as the version installed in this computer, created 2025, March 12, 12:37 hours Pacific Time.`

restart;

C:=a^2;
select(has,C,x);

a^2

undefined

C:=-a^2;
select(has,C,x);

-a^2

1

 

 

Download select_question_march_23_2025.mw

Here is another variation, where I changed a^2 to a

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1849 and is the same as the version installed in this computer, created 2025, March 12, 12:37 hours Pacific Time.`

restart;

C:=a;
r:=select(has,C,x);

a

C:=-a;
r:=select(has,C,x);

-a

1

 

 

Download select_question_v2_march_23_2025.mw

The good thing is that has(C,x) returns false in both case. So the problem is not with the has call. It is select which decided to return 1 when there is negative sign. But why?

restart;

C:=a;
r:=has(C,x);

a

false

C:=-a;
r:=has(C,x);

-a

false

 

 

Download select_question_v3_march_23_2025.mw

This is problem from INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014 ,  Chapter 2. First Order Equations. Exercises 2.4, page 57, problem 39

Maple 2024.2 can't solve it. But solution is arctan(t)-t*y(t)^2 = 0 which Maple verifies correct

restart;

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1848 and is the same as the version installed in this computer, created 2025, March 11, 16:9 hours Pacific Time.`

restart;

ode:=(1/(1+t^2)-y(t)^2)-(2*t*y(t))*diff(y(t),t)=0;
IC:=y(0)=0;

1/(t^2+1)-y(t)^2-2*t*y(t)*(diff(y(t), t)) = 0

y(0) = 0

sol:=dsolve([ode,IC])

mysol:=arctan(t)-t*y(t)^2 = 0;

arctan(t)-y(t)^2*t = 0

odetest(mysol,[ode,IC])

[0, 0]

 

 

Download can_not_dsolve_march_12_2025.mw

Any one has suggestion how to help dsolve find this solution?

Windows 10. From normal command line window:

"C:\Program Files\Maple 2024\bin.X86_64_WINDOWS\mint.exe" foo.mpl

Gives this

The file foo.mpl is

export module ODE() 
    option object; 
    export ode::`=`;
end module;

Notice the funny looking characters in the output.

Why does it happen?

Is this a bug in mint?

Given this foo.mpl

foo:=proc()
    local x:=2,y:=3;       
        
    if MmaTranslator[Mma][LeafCount](x)<MmaTranslator[Mma][LeafCount](y)  then        
        0;
    else
       1;
    fi;  

end proc;   

It says

Procedure foo() on lines 2 to 11
  These names were used as global names but were not declared:  LeafCount, Mma

But if I rewrite the above using :- instead:

foo:=proc()
    local x:=2,y:=3;       
        
    if MmaTranslator:-Mma:-LeafCount(x)<MmaTranslator:-Mma:-LeafCount(y)  then        
        0;
    else
       1;
    fi;  

end proc;  

Now mint is happy and no message are given.

Is not  MmaTranslator:-Mma:-LeafCount(x)  the same as MmaTranslator[Mma][LeafCount](x) ?

Maple itself is happy with both. So why is mint complaining?

I am finding many problems with mint. Will post more problems found when I have more time.

Is mint still actively  maintained by Maplesoft? 

Whenever I have local proc inside a proc, and use local variables from the outer proc inside it, Mint tells me that the variables are not used.

This can't be right. Why does it say that? Here is MWE. I have this foo.mpl file

foo := proc()

local C1;
local y,x;

    proc()
        C1:= `tools/genglobal`(_C); 
        sol:=y(x)=  C1; 
    end proc();

end proc;

We see clearly that C1 is used, also x and y are used. There can be more code using these inside the inner proc. But this is what mint says

"C:\Program Files\Maple 2024\bin.X86_64_WINDOWS\mint.exe" foo.mpl

    |\^/|      Maple 2024 Diagnostic Program
._|\|   |/|_.  Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2024
 \  MINT   /   All rights reserved. Maple is a trademark of
 <____ ____>   Waterloo Maple Inc.
      |
Procedure foo() on lines 1 to 11
  These local variables were never used:  C1, x, y

Any idea why it says these are not used?

Also, I noticed it did not warn me that variable sol is global inside the proc. i.e. I was expecting something like this 

          These names were used as global names but were not declared: sol

Which is typical message mint gives when using a name inside a proc which was not declared,

Maple 2024.2 on Windows

First 7 8 9 10 11 12 13 Last Page 9 of 199