nm

12258 Reputation

20 Badges

13 years, 302 days

MaplePrimes Activity


These are questions asked by nm

Is there a workaround to being able to call object method inside the debugger? I use Objects everywhere and hard to debug things when not able to try calls inside the debugger.

Here is an example.

This worksheet below has the code to reproduce this. Ofcourse the code works when I run it in the debugger using "continue" button, or using the "next" or "step". But I need sometimes to check something before doing this.

interface(version);

`Standard Worksheet Interface, Maple 2026.1, Windows 10, April 28 2026 Build ID 2011354`

restart;

kernelopts('assertlevel'=2):

module person_type()
    option object;
    local _name::string:="";    
    export ModuleCopy::static := proc( _self::person_type, proto::person_type, name::string)
      _name:=name;
      NULL;
    end proc;

    export get_name::static:=proc(_self)
       _self:-_name;
    end proc;
end module;

module person_type () local _name::string; option object; end module

foo:=proc(o::person_type)::string;
  local name;
  DEBUG();
  name:=o:-get_name();
  name;
end proc;

proc (o::person_type)::string; local name; DEBUG(); name := o:-get_name(); name end proc

o:=Object(person_type,"me");

module person_type () local _name::string; option object; end module

o:-get_name();

"me"

#run this. Debugger will now open
foo(o);

 

 

Download why_calling_object_fail_in_debugger.mw

Maple 2026 and Maple 2025.2

Is this a bug in limit? or as designed?

Doing 

limit(sol,[_C3 = 0, _C4 = 0])

Gives internal error. But

limit(sol,_C3 = 0);
limit(%,_C4 = 0);

works and no error.

Worksheet below. I've had problems before with multilimit. I think I need to change my code to do limit one by one from now on.

interface(version);

`Standard Worksheet Interface, Maple 2026.0, Windows 10, March 05 2026 Build ID 2001916`

restart;

sol:=(piecewise(t <= 0,0,t <= Pi,(arctan(tan(t))*cos(t)*_C3*_C4+arctan(tan(t))*sin(t)*_C4^2-cos(t)*_C3*_C4*t+sin(t)*_C3^2*t)/(_C3*cos(t)+_C4*sin(t)),Pi < t,Pi*_C3*(tan(t)*_C3-_C4)/(tan(t)*_C4+_C3))+2*_C3^2+2*_C4^2)*(_C3*cos(t)+_C4*sin(t))/(2*_C3^2+2*_C4^2)

sol := (piecewise(t <= 0, 0, t <= Pi, (arctan(tan(t))*cos(t)*_C3*_C4+arctan(tan(t))*sin(t)*_C4^2-cos(t)*_C3*_C4*t+sin(t)*_C3^2*t)/(cos(t)*_C3+_C4*sin(t)), Pi < t, Pi*_C3*(tan(t)*_C3-_C4)/(tan(t)*_C4+_C3))+2*_C3^2+2*_C4^2)*(cos(t)*_C3+_C4*sin(t))/(2*_C3^2+2*_C4^2)

limit(sol,[_C3 = 0, _C4 = 0])

Error, (in limit/multi/ldegree1) invalid input: limit/multi/ReIm expects its 1st argument, f, to be of type polynom, but received _DIR1*cos(t)+_DIR2*sin(t)

limit(sol,_C3 = 0)

piecewise(t <= 0, _C4*sin(t), t <= Pi, (1/2)*arctan(tan(t))*sin(t)+_C4*sin(t), _C4*sin(t))

limit(%,_C4 = 0)

piecewise(t <= 0, 0, t <= Pi, (1/2)*arctan(tan(t))*sin(t), 0)

 

 

Download limit_problem_april_2_2026.mw

Currently I generate unique local symbol inside a proc to use for intergation dummy variable. And need to make sure this symbol is not already used somewhere else in other proc. (so all symbols display different)

So I use this code

`tools/genglobal`[1](tau, 1, :-reset);
z:=`tools/genglobal`(tau);
z:=`tools/genglobal`(tau);

Which works ok, except that the symbols generated do not display nice in Latex.  Instead of  

which when rendered in latex look like this 

Which is bad as you see.  It looked like tau is being multiplied by a number.

I'd like to get the generated symbols to be  tau__1 and tau__2 instead of tau1 and tau2 and so on. Which will now display much nicer.

Is there a way in Maple to still use `tools/genglobal`(...); but generate subscripted unique symbols, where only the subscript number changes like the above.

Not able to find what syntax to use. Also not able to find any help pages on tools/genglobal.

If there is no way, I can make a global  N counter and use that to increment it and append it to a local variable, something like

 

foo:=proc()
   local z:=convert( cat("tau__",N), '`local`');
   z;
end proc;

THen call it as

But would prefer to use `tools/genglobal` if possible.

Any other suggestions?

Maple 2026

Maple 2026 and 2025

What option to use to make PDEtools:-Solve show all solutions, even double/duplicate ones? I am not able to find it using AI or help.

restart;

eq:=x^2+2*x+1=0;
solve(eq,{x})

x^2+2*x+1 = 0

{x = -1}, {x = -1}

PDEtools:-Solve(eq,x,'allsolutions')

x = -1

_EnvAllSolutions := true:
PDEtools:-Solve(eq,x);

x = -1

 

 

Download PDEtools_solve_march_28_2026.mw

Not able to make odetest give zero on this Maple solution to this first order ode.

So not sure if solution is correct or not, as can't also get same solution by hand.

Any one can find a method or way to verify this solution is correct?

odetest says it satisfies the IC but not the ode itself.

Below is worksheet. Tried with Maple 2026 and 2025.2 both give same solution.

Site will not let me upload worksheet. Here is code

ode:=diff(diff(y(x),x),x)+sin(y(x)) = 0;
IC:=y(infinity) = Pi;
sol:=[dsolve([ode,IC])];

the_residue:=odetest(sol[1],[ode,IC]);
the_residue:=odetest(sol[2],[ode,IC]);

Tried many things, including different assumptions, but can't get zero.

 

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