nm

7150 Reputation

19 Badges

10 years, 135 days

MaplePrimes Activity


These are replies submitted by nm

@ecterrab 

Sorry, but I have no idea what a TTY Maple is.

I open new worksheet and issue the command Physics:-Version(latest); and this always used to work. It gives a message that I need to close Maple and restart after that.

Recently this no longer works. But I tried the icon method and that worked now. So I will use that instead from now on.

Is the command Physics:-Version(latest); issued from a worksheet no longer supported? Here is a smal movie.

@ecterrab 

Thanks for the fix, I was going to try it, but I am still not able to update the Physics package. Is the server still down?

I closed all of Maple and restarted it 3 times, and each time I get

Error, (in Physics:-Version) unable to determine the Physics Updates version, could you please report the problem to support@maplesoft.com

Should I wait and try again some other time? Here is the worksheet attached so you can see. I am on windows 10

interface(version);

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

Physics:-Version(latest);

Error, (in Physics:-Version) unable to determine the Physics Updates version, could you please report the problem to support@maplesoft.com

interface(version);

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

ode:=exp(y(x))+cos(x)*y(x)+(exp(y(x))*x+sin(x))*diff(y(x),x) = 0;
sol1:=y(x) = -LambertW(x/(sin(x)*exp(_C1/sin(x)))) - _C1/sin(x);
sol2:=y(x) = -LambertW(x/(sin(x)*exp(_C1/sin(x)))) + _C1/sin(x);

exp(y(x))+cos(x)*y(x)+(exp(y(x))*x+sin(x))*(diff(y(x), x)) = 0

y(x) = -LambertW(x/(sin(x)*exp(_C1/sin(x))))-_C1/sin(x)

y(x) = -LambertW(x/(sin(x)*exp(_C1/sin(x))))+_C1/sin(x)

odetest( sol1,ode)

0

odetest( sol2,ode)

Error, (in tools/map) too many levels of recursion

 

Download sign.mw

@Thomas Richard 

The error is simply due to sign change. Compare this below. This is clearly a bug. It is no problem if odetest can't verify it. This is not the issue.

The big problem is that Maple generates an exception that can not be even cought by the user. This brings down the whole application when this happens and there is no workaround. 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

ode:=exp(y(x))+cos(x)*y(x)+(exp(y(x))*x+sin(x))*diff(y(x),x) = 0;
sol1:=y(x) = -LambertW(x/(sin(x)*exp(_C1/sin(x)))) - _C1/sin(x);
sol2:=y(x) = -LambertW(x/(sin(x)*exp(_C1/sin(x)))) + _C1/sin(x);

exp(y(x))+cos(x)*y(x)+(exp(y(x))*x+sin(x))*(diff(y(x), x)) = 0

y(x) = -LambertW(x/(sin(x)*exp(_C1/sin(x))))-_C1/sin(x)

y(x) = -LambertW(x/(sin(x)*exp(_C1/sin(x))))+_C1/sin(x)

odetest( sol1,ode)

0

odetest( sol2,ode)

Error, (in tools/map) too many levels of recursion

 

Download sign.mw

@tomleslie 

Sure. I know I can use value() to evaluate the inert integral.

when it appears to be convenient not to evaluate

But that is really what I am asking. How does it decide when it is "not convenient"

if I want to duplicate Maple's result, I can not write

  If not  integral_result::convenient   then
     return inert_version_of_integral
 else
    return integral_result
 fi;

I wish I could.

So it must have some rules it decided what is and what is not  convenient and I am asking what are these rules/measures it uses as I would like to be able to do the same and also to learn something on how dsolve does these things.

@ecterrab 

Hello Edgardo

I seem not to have good job explaining the problem. I did not mean dsolve itself returns mixed c__i and _Ci. But that it seems only _C1 and _C2 are automatically translated to c__1 and c__2 and _C3 and _C4 remain the same. So when I build my own solution manually, I get mixed constants. Here is one more example

(having problem uploading worksheet, will try screen shot)

Download problem_with_C_2.mw

restart;
dsolve(diff(y(x),x)=1,arbitraryconstants=subscripted);
pdsolve(diff(psi(x,t),x$2)=0,arbitraryfunctions=subscripted);
_C1;_C2;_C3;_C4
mysoluiton:= y(x)=_C1*y1(x)+_C2*y1(x)+_C3*y1(x)+_C4*y1(x);

THis is the output

 

My question is simply, why only _C1 and _C2 are translated and not higher ones? My understading is that once the arbitraryconstants=subscripted is used once, it now automatically translate each _Ci to c__i for any i.

But may be this  is not how it works and I misunderstood it.

@Preben Alsholm 

Yes, infinity is not a real number. But you do agree that -infinity satisfies the equation in the question. Therefore it is a solution.

In addition, in differential equations, having an +- infinity as constant of integration is a valid value and allowed. So my question is, does Maple have methods to find these non finite value solutions or must one find them manually using limit and trial and error? which is what I do now.

@Athar Kharal 

fyi, updated answer. I changed both to select member. I do not know if "has" is slower or faster than "member" or "in" commands. You could do your own timing and decide which is faster. I changed the first one to also use "member" instead of "has".

@Carl Love 

I just realized I was causing all these trouble with signum myself. Sometimes when simplifying an expression using the assumption real, these signum now show up in the result. The result is not much simpler anyway, but I get some signums showing up.

I should not using simplify with real much anymore. I have to be careful when to use it. Here is an example

r:=(x^2-6)^(1/2)/(x^2-4)^(1/4)*(x+(x^2-4)^(1/2))^(1/(x^2-4)^(3/2)*((x^2-4)^3)^(1/2)*3^(1/2))*exp(-1/2*((x^2-4)^3)^(1/2)*(arctanh(1/2*(2^(1/2)*3^(1/2)*x-4)*2^(1/2)/(x^2-4)^(1/2))+arctanh(1/2*(4+2^(1/2)*3^(1/2)*x)*2^(1/2)/(x^2-4)^(1/2)))/(x^2-4)^(3/2));

Now

simplify(r) assuming real

having signums there causes odetest to fail in many cases. So the fix is not to using simplify with real assumption before.

So now I do not have to do anything to get rid of signum since it no longer shows up in the first place.

I also noticed using simplify with the size option does not cause this problem even when using real (even though in this example, the size does not change, but at least no signums show up)

simplify(r,size) assuming real

 

I do not know why simplify thinks that having signum() show up is considered "simpler" than before. (may be due to removing the sqrt at the cost of replacing it by signum). I prefer to see the sqrt than signum.  I did not notice this before.

@Carl Love 

Maple's result matches Mathematica, so I think it is correct for the left direction:

someone who knows where to look in the code could probably find out for sure, but my guess it does both. May be it stores Pi for million digits or 1000 digits. But if more digits are needed, there are algorithms that quicky find Pi for any number of digits needed, such as Spigot_algorithm

Same for Euler constant.

@Joe Riel 

we must be using different Maple or I do not understand what you meant. If I use eq:=_self:-A^2;  then the warning comes back., If I use eq:= A^2;  then the warning goes away, yes. But you are saying warning should not show up in both cases?

I tried also commenting out the USE_SELF inside the foo proc, but it made no difference.

kernelopts('assertlevel'=2):

$ifdef MINTONLY
$define USE_SELF _self;
$else
$define USE_SELF
$endif


A_class:=module()
option object;
local A :: integer :=0;
export
    ModuleCopy :: static := proc( _self, proto :: A_class,m::integer:= proto:-A)
        USE_SELF
        _self:-A := m; #initialize object private variable
end proc;

export foo :: static := proc(_self,$)
local eq;
    USE_SELF;
    eq := _self:-A^2;
    return eq;
end proc;

end module:


a := Object(A_class, 23):
foo(a);

Now

>"C:\Program Files\Maple 2022\bin.X86_64_WINDOWS\mint.exe" -i 2 A.mpl

Module A_class() on lines 10 to 26
  These local variables were assigned a value, but otherwise unused:
      A::integer

What exactly did you mean then by it is independent of whether you use _self:-A or A in the code.

Thanks

@Joe Riel 

Thanks. But I do not think I will use this workaround. The reason is, I actually prefer to write  inside a proc

          eq :=  _self:-A

vs. just

          eq :=  A

Why? Because when looking at the code, I can see that A in the first case is a variable of the object.

While in the second case, I have no idea if A is a local variable to the proc itself, or variable for the object itself which this proc is function memeber of, or even if A is global variable.

So   _self:-A is like self documenting the code. It tells the reader where A lives and this is useful for me, otherwise all variables will now look the same in terms of reference to them. I would not know looking at the code, where A came from without having each time to go look around all the code.Rigth now, if there is no _self:- then I know the variable is local to the proc right away without having to check.

I think mint should be fixed instead.

But thanks again for  the suggestion.

 

@Joe Riel 

The A:- are not required in foo.  Without them, mint is clean. 

I am afraid this did not solve the problem.  Yes mint is clean now. but code now gives a errors when I run it using

interface(warnlevel=4);
kernelopts('assertlevel'=2):

Which I have on all the time.  I run all my code with the above setting.

So  removing A:- made mint clean, but code does not run any more. So it is either mint is wrong, or kernelopts('assertlevel'=2): is wrong.

So I had to put these all back and live with mint warnings.

Here is worksheet so you can see for your self. It looks like mint needs a major update by Maplesoft.
 

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

#######################################
#Mint complain about B but code runs !
restart;

interface(warnlevel=4);
kernelopts('assertlevel'=2):
A:=module()
   local B:=module()
         option object;
         export n::integer:=1;
   end module;

   export foo:=proc()
      local a::A:-B;  #mint complains that A is global not declared!
      a:=Object(A:-B);
      a:-n:=2;
   end proc;
end module;

3

_m2560568340448

maplemint(A)

Nested Anonymous Module module() on lines 1 to 2
  These exported variables were never used:  n::integer
Module A()
  These local variables were assigned a value, but otherwise unused:  B

A:-foo();

2

##################################
# removed A:- mint now does not complain, but code no longer runs
restart;

interface(warnlevel=4);
kernelopts('assertlevel'=2):
A:=module()
   local B:=module()
         option object;
         export n::integer:=1;
   end module;

   export foo:=proc()
      local a::B;  #mint does not now complain
      a:=Object(B);
      a:-n:=2;
   end proc;
end module;

3

_m2560568340448

maplemint(A)

Nested Anonymous Module module() on lines 1 to 2
  These exported variables were never used:  n::integer

A:-foo()

Error, (in foo) type `B` does not exist

 


 

Download mint_msg_oct_18_2022.mw

 

 

 

 

@Joe Riel 

Thanks. Do you know how to get rid of

These local variables were assigned a value, but otherwise unused

This happens like this: I have module which is object. Have local/private variables in it. In this example below, the variable is A::integer. In the constructor, this variable in initialized to a value.

Later on, in one of the object methods, this variable is accessed/read as _self:-A, and used in an equation that gets returned back to caller.

But maple mint keeps says the variable A::integer was not used.  What do I need to change to make such warnings go away? Almost every local variable I have in the object has such a warning message on it.

I think mint does not know that _self:-A refer to A:: above in the module itself?.  Because clearly A is used. It is used to make eq

The code all runs fine, been running fine for long time, but would like to get rid of these mint messages.  I do not want to get into preprocessor conditionals as I do not use them and want to keep things simple for now. I just like to understand first why Maple thinks the object variable A is not being used, that is all. Is there a way to modiy the code to get rid of this message without using mint specific preprocessor conditionals?


 

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

restart;

A_class:=module()
   option object;
   local A::integer:=0;
   export ModuleCopy::static:= proc( _self, proto::A_class,m::integer)
       _self:-A :=m; #initialize object private variable
   end proc;

   export foo::static:=proc(_self,$)
       local eq;            
       eq:= (_self:-A)^2; #access object private variable      
       return eq;
   end proc;
end module;

_m2560473590880

maplemint(A_class)

Anonymous Module module()
  These local variables were never used:  A::integer

#Works OK
o:=Object(A_class,10);
o:-foo()

_m2560568238624

100

 


 

Download mint_msg_oct_17_2022.mw

 

@Carl Love 

Surely I've read it a few hundred times.

Have you thought of writing a book on Maple that  concetrates on the type system? There is no such book at all on Maple. None of the books I have on Maple go into any depth on how to use these commands and I have many. It will be a best seller.

Examples showing when to use specfunc(f) vs. specfunc(type,f) vs. anyfunc(type*) vs. specop(operator) vs. specop(type,operator) vs. anyop(type*) vs. patlist[reverse](type,type*) and so on and on.

The current help page have no real examples, (the few at the end of the page are so trivial and do not touch 99% of what is on the page above). no explantion, nothing any where. The little bullet points below, are not helpful and hard to follow and so dense.

People learn by examples not by reading something that reads as this

Thus, type(f, typefunc(t, T)) is equivalent to the logical conjunction type(f, function) and type([op(0,f)], [T]) and type([op(f)], list(t)).

That page full of commands with nothing to help the user learn when and how to use these things. Compare the help pages to Mathematica, where each page it is full of examples after examples covering every possible option and sub option.

May be consider talking to Maplesoft about wriitng such a book? May be they could sponser this effort? 

I bet there are only 5 people living who understand how to use these commands in Maple. I would be the first to buy this book.

1 2 3 4 5 6 7 Last Page 1 of 62