nm

8552 Reputation

19 Badges

12 years, 347 days

MaplePrimes Activity


These are replies submitted by nm

@Carl Love 

 

Do you know how to reset it back to _C1? my program runs in a loop. So I need to rest back to _C1 each time.

I can't call restart ofcourse in the middle of the program to rest it for new problem. 

Now each time I call new_constant:= `tools/genglobal`(_C); it increments the counter. 

Maple 2023.2.1

@C_R 

Thanks,. I prefer to use the constant which is always has larger index than any already used. This makes things simpler.  But your second solution does not work. Here is an example

sol:=_C10+x-_C3*x+_C2*x^2;
myconstants:=indets(sol,And(symbol, suffixed(_C, nonnegint)));
n:=1; 
do n++ until is(_C||n=myconstants[-1]):
new_constant := _C ||(n)

This gives new_constant as _C3 but It should be  _C11  

Why do you say that element with the highest index is to the right. ?  For example

sol:=_C22+x-_C3*x+_C2*x^2;
indets(sol,And(symbol, suffixed(_C, nonnegint)));

Returns {_C2, _C22, _C3}

So it is not guaranteed that largest index is the last entry in the set. And since the result of indets is a set, and set has no explicit ordering in it, I can't really assume something about where the largest index can end at. Right?

I tried to find how Maple dsolve does it, but hard to follow the code of dsolve in the debugger. dsolve always adds new consant with index higher than any alreay used:

ode:=diff(y(x),x)=x+_C1;
dsolve(ode);

ode:=diff(y(x),x)=x+_C2;
dsolve(ode);

ode:=diff(y(x),x)=x+_C2+_C5;
dsolve(ode);

ode:=diff(y(x),x)=x+_C2+_C12;
dsolve(ode);

Gives

 

 

Notice how dsolve always use new constant of integration with index larger than any one present in the input. Not one in between. So Maple seems to do something similar to what I wanted to do.

@TechnicalSupport 

I know about this standard web page listing possible causes. None of them apply to me. 

Maple losses connection at random places (same with the random hangs) that I have been talking about for years.

If they happen at the same loop counter, then it will be easy to find the cause. But it is completely random. I think it is a memory problem. May be caused by the Java interface. 

Is there a technical reason why Maple have no logging facility?  If Maple has a system error log that one can enable, then all what your customers have to do is look at the Maple log file and find what caused the crash or server lossing connection.

Maple have been around for what, almost 45 years? I would expect a mature application like this to have at least a logging facility that one can look at to find the cause of these problems. 

May be Maplesoft should consider adding such a logging system to a future release, similar to windows event logger for example or similar to linux standard logging facility that many applications use where major events or error/warning messages are send to.

  • We’ve had a few reports of people encountering “Kernel connection has been lost” errors, and this update should fix that problem.

    I am afraid 2023.2.1 did not fix this. I still get



    3-4 times each day. 

    windows 10

    May be Maplesoft will really fix this in Maple 2024?

@Carl Love 

I understand now. I thought you were talking about the Physics package itself. I have no idea what what "Physics Updates/lib" is.

May be it is what is used to update the Physics package.

Strange that such a package will have any effect on the integrate command in this case. It seems to be added to libname by default when starting Maple.

@Carl Love 

As you see, I am not explicitly using Physics or loading it. It is in the system. right?

How does one try "without" the Physcis package? Do you mean there is a way to delete Physics package from Maple? How? And if one deletes the Physics package, how to install it again later? Since the command Physics:-Version(latest) will be gone if Physics package is not installed. right?

Will this not cause problems somewhere else if one removes the Physics package since it is core part of Maple and it could be used by other internal functions without the user knowing this?

But since you seem to imply you do not have Physics package on your Maple, and your Maple must be working OK, then I guess it is possible to remove Phyiscs package without affecting Maple internal working. But I now do not know how to do this.

But will google this now and see what I can find and if there are instructions on how to do this.

you could try google search with specific site as follows

"Normalized" "Expanded"  site:mapleprimes.com

I do not know if this will show what you are looking for or not.

@dharr 

The odeadvisor is also confusing for me. When asked for type of this ode, it says "linear". But it is also of type "homogeneous" but it does not say that. I would have expected odeadvisor to give all types the ode falls under, right?

ode:=x*diff(y(x), x) = x + 1/2*y(x);
DEtools:-odeadvisor(ode);

  [_linear]

But 

dsolve(ode,[homogeneous]);

Classification methods on request
Methods to be used are: [homogeneous]
----------------------------
* Tackling ODE using method: homogeneous
--- Trying classification methods ---
trying homogeneous types:
trying homogeneous D
<- homogeneous successful

And

dsolve(ode,[linear]);
Classification methods on request
Methods to be used are: [linear]
----------------------------
* Tackling ODE using method: linear
--- Trying classification methods ---
trying 1st order linear
<- 1st order linear successful

I could never know why sometimes it lists all types of the ode, and sometimes it does not.

@acer 

But just using sol:=dsolve(ode,[homogeneous]); does not specify the sub class of homogeneous to use. There are 4 or 5 subclass for this method. I put link to the help web page above.

For example

ode := diff(y(x),x)=F((a*x+b*y(x)+c)/(r*x+s*y(x)+t));
sol:=dsolve(ode,[homogeneous]);

Gives

trying homogeneous types:
trying homogeneous C
trying homogeneous types:
trying homogeneous D
<- homogeneous successful
<- homogeneous successful

So it used homogeneous C I am guessing because 

DEtools:-odeadvisor(ode)

gives

[[_homogeneous, `class C`], _dAlembert]

I wanted to tell dsolve to use a specific sub class of homogeneous. The reason is, I wanted to check that specific algorithm if it works on some ode's. 

May be then one can't specify the sub class of homogeneous method to use? Even though they are given names from odeadvisor? I thought any method given in odeadvisor can be specified?

 

@sursumCorda 

FYI. Found a bug

is_symbol_inside_func_only:=proc(expr::anything,f::name,y::symbol)::truefalse;
  type(applyrule('conditional'(f('x'::anything), _depends('x', y)) = `tools/gensym`(f), expr), freeof(y))
end proc;

expr:=-1/k^2*ln(x)+1/2/k^2*ln(k^2+x^2);
is_symbol_inside_func_only(expr,ln,x);

gives

Error, (in PatternMatching:-AlgStruct:-TableLookup) invalid input: depends expects its 2nd argument, x, to be of type {name, list(name), set(name)}, but received k^2+x^2

Maple 2023.2.1 on windows 10

It seems due to your function using 'x' inside?  The symbol passed can be anything,. y or z or x. If I change the call to 

expr:=-1/k^2*ln(y)+1/2/k^2*ln(k^2+y^2);
is_symbol_inside_func_only(expr,ln,y);

Then no error. 

I do not understand why you used 'x' and not declare local variable. I am sure there is good reason, but I did not use applyrule myself much before.

@dharr 

The problem with expansion is really due to weakness in Maple simplify. compare:

e1:=-(-y - 1 + 2*x)*(4*x^2 - 4*x*y + y^2 + 2*x - y + 1);
simplify(e1);
simplify(e1,size);

It did not simplify it back to 

In Mathematica:

So I took your cancel function and implemented in Mathematica, and this problem do not show up. I just need to call FullSimplify on the LHS. Here is your function in Mathematica

cancel[eq_Equal] := Module[{lhs, rhs, nums, dens},
     lhs = Factor[eq[[1]]];
     rhs = Factor[eq[[2]]];
     If lhs == 0 || rhs == 0,
          Return[lhs == rhs, Module]
      ];
  
     nums = Factor[Numerator[lhs]/Numerator[rhs]];
     dens = Factor[Denominator[lhs]/Denominator[rhs]];
     FullSimplify[Numerator[nums]/Numerator[dens]] == 
   Denominator[nums]/Denominator[dens]
  ]

And now

When I use your function in Maple, with Acer's change to add simplify(size), it still does not do the above

	
cancel := proc(eq::`=`);
  local lhseq, rhseq, nums, dens;
  lhseq := factor(lhs(eq));
  rhseq := factor(rhs(eq));
  if lhseq = 0 or rhseq = 0 then return lhseq = rhseq end if;
  nums := factor(numer(lhseq)/numer(rhseq));
  dens := factor(denom(lhseq)/denom(rhseq));
  simplify(numer(nums)/numer(dens),size) = denom(nums)/denom(dens);
end proc:

Now

expr:=((y-2*x)^3+1)/( (y-x)^2 * x )*x^2 = x*a;
cancel(expr);

gives

I always said that Maple needs a FullSimplify version of simplify. 

@Carl Love 

good question but I did not mention these cases because luckily for me, these do not show up for what I am using this for.

So one can assume that the function will be always be the top level.

For example, if it is ln then it will only show on its own as in ln(1+y) and not be inside another function.

So no cos(sin(ln(y)) and no sin(ln(y)) and so on. No need to worry about such cases since they will not show up.

The tests I showed are typical cases and your code only needs to pass these tests.

@Carl Love 

Yes, I know that. But I just prefer map(X->...., collection) notation than ~ because I find this is more explicit and I can more easily do things on X inside since it has a name to use, which is X in this case.

@Mikey_W 

I note that

evalhf(Pi)
3.14159265358979312

gives Pi correct as far as the 793 in the decimal readout. The 12 at the end is not correct

That is correct. I do not know why. May be slight fault somewhere. You could report it. On Mathematica, it gives 3.141592653589793

 

 

@Carl Love 

"Are you saying that in some earlier version of Maple, solve needed the parametric option"

I was replying to sursumCorda initial comment that he had to use parametric option to solve it. But he later on he editied his reply and removed this part. I assumed he was using different/older version of Maple. I only have Maple 2023 and 2022.

I was starring at this for 30 minuts and did not noticed that I have type eq1 on the left side on both of them 

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