8340 Reputation

19 Badges

11 years, 230 days

MaplePrimes Activity

These are questions asked by nm

I've reported this to Maplesoft 6 months ago.

I was wondering if someone with beta version of 2024 could check if these are fixed? (if one is allowed to do so). As these errors keep breaking my program. (not possible to trap).



`Standard Worksheet Interface, Maple 2023.2, Windows 10, November 24 2023 Build ID 1762575`


`The "Physics Updates" version in the MapleCloud is 1637 and is the same as the version installed in this computer, created 2023, November 29, 17:28 hours Pacific Time.`

ode:=diff(y(x),x) = (x*y(x)+x^3+x*y(x)^2+y(x)^3)/x^2;
sol:=exp(3*sum(1/(9*_R^2-1)*ln((-_R*x+y(x)-1/3*x)/x),_R = RootOf(27*_Z^3-9*_Z+29)))-c__1*exp(x) = 0;

diff(y(x), x) = (x*y(x)+x^3+x*y(x)^2+y(x)^3)/x^2

exp(3*(sum(ln((-_R*x+y(x)-(1/3)*x)/x)/(9*_R^2-1), _R = RootOf(27*_Z^3-9*_Z+29))))-c__1*exp(x) = 0

Error, (in simplify/RootOf) too many levels of recursion

ode:=diff(u(x),x)-1/2*(2*a*u(x)^3+u(x)+2*b)/x = 0;
sol:=2*sum(1/(6*_R^2*a+1)*ln(u(x)-_R),_R = RootOf(2*_Z^3*a+_Z+2*b))-1/2*ln(x)-_C1 = 0;

diff(u(x), x)-(1/2)*(2*a*u(x)^3+u(x)+2*b)/x = 0

2*(sum(ln(u(x)-_R)/(6*_R^2*a+1), _R = RootOf(2*_Z^3*a+_Z+2*b)))-(1/2)*ln(x)-_C1 = 0

Error, (in simplify/RootOf) too many levels of recursion


Download in_simplify_rootof_too_many_level_of_recursion_jan_6_2024.mw

Maple dsolve allows one to specify the algorithm to use to solve the ode. But sometimes it is very tricky to figure the syntax,

This ode 



               [[_homogeneous, `class G`], _rational, [_Abel, `2nd type`, `class A`]]

I wanted now to call dsolve telling dsolve to use the first method above. But how? All the following syntax failed for me

sol:=dsolve(ode,['_homogeneous, `class G`']);
sol:=dsolve(ode,'[_homogeneous, `class G`]');

All return method not found .

I am sure I am using wrong syntax but do not know what the correct one should be.



Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
trying Bernoulli
trying separable
trying inverse linear
trying homogeneous types:
trying homogeneous G
<- homogeneous successful

With long solution printed now OK. 

When using just '[homogeneous]' it works


It gives same solution as default case.

What is the correct syntax to tell dsolve to use specific method [_homogeneous, `class G`] ? i.e. I need to add class G

The reason I ask is becuase Maple have different kind of homogeneous method as described here

Maple 2023.2.1 on windows 10

Given equation 

We see this can be simplified to 

In Mathematica, I just need to tell it the denominator of the left side is not zero for it to do the simplification

The same thing in Maple did not work:

eq:= (y-2*x)^3/( (y-x)^2 * x ) = a/x;
the_denom:= denom(lhs(eq));
simplify(eq) assuming the_denom <>0

No change. 

I am doing this in code not by looking at the screen and simply wanted to eliminate common terms on both sides of equation. I can in code obtain the denominator of the LHS and RHS and add assumption. But since I do not know what if any common terms are on both sides, it is not easy to use elminate.

I see code at https://www.mapleprimes.com/questions/227043-How-To-Automatically-Cancel-Any-Common which actually worked on this and it did automatically elminate x from both sides.

But my question is: why Maple does not do it using simplify with the assumption given?  Tried simplify with size and no change.

I am looking for the simplist method to elminate common terms on both sides of equation. Is the link above the only way to do this in Maple? May be there is something simpler in recent Maple versions?

#code from https://www.mapleprimes.com/questions/227043-How-To-Automatically-Cancel-Any-Common


eq:= (y-2*x)^3/( (y-x)^2*x) = a/x;
TT := simplify(expand((eq)),size):
if lhs(TT)::`*` and rhs(TT)::`*` then
  TTT := map[2](map,freeze,TT);
  comm := `*`(op({op(lhs(TTT))} intersect {op(rhs(TTT))}));
  new := simplify(thaw(lhs(TTT)/comm=rhs(TTT)/comm));
end if:

May be this should be part of Maple build in functions and used by simplify? 


I just hit on a way to do this automatically with no assumption of anything. The idea is to simply rewrite the equation, like this


eq:= (y-2*x)^3/( (y-x)^2 * x ) = a/x;
numer(lhs(eq))*denom(rhs(eq)) /  (denom(lhs(eq)) *numer(rhs(eq)))=1;

You see, the common term on both sides is automatically gone!   I need to test this more. 

To moderator: if you think this question is duplicate, feel free to delete it.

Given an expression expr, and symbol, say I wanted to check that only shows as argument to a specific Maple function. In this case, say ln() just an example but this can be any other function.

But if shows up in the expression but not as argument to ln() then I want to detect this also. So the function is passed the expression and the symbol name, and it returns true or false. 

True means the symbol only shows inside ln and false means it found in the expression but not inside ln()

I can find all indets where the symbol shows inside the function. But the problem is how to find if the symbol shows outside of the function?

I think I need to use depends() somehow. But could not figure out how do far. Below is the code I have and few test examples and the result expected.

local the_type:=`Or`(     
          'specfunc( `&*`(anything,identical(y)), f )',  
          'specfunc( identical(y), f )'  ,
          'specfunc( `&+`(anything,identical(y)), f )'
local T;
T:=indets(expr, the_type );

#need to check that y does not show any where inside expression unless 
#as argument to f

RETURN(true); #or RETURN(false);
end proc:

Here some test cases

is_symbol_inside_func_only(expr,ln,y); #should return false

is_symbol_inside_func_only(expr,ln,y); #should return true

is_symbol_inside_func_only(expr,ln,y); #should return false

is_symbol_inside_func_only(expr,cos,y); #should return true

is_symbol_inside_func_only(expr,ln,y); #should return false

is_symbol_inside_func_only(expr,ln,y); #should return true

some context: I wanted to apply exponential to an expression to convert all ln(y)+ln(1+y)+...  to exp(...) to make it easy to process.

But wanted to do this ONLY if all terms that has are functions on ln otherwise, I will not raise it to exp in this case. The expression will always have the symbol in it. So need to worry about this case. 


After asking the question, I thought about using selectremove and it seems to do what I want. But need to test it more.

local the_type:=`Or`(     
          'specfunc( `&*`(anything,identical(y)), f )',  
          'specfunc( identical(y), f )'  ,
          'specfunc( `&+`(anything,identical(y)), f )'
local hasF,nothasF;
if has(nothasF,y) then
end proc:

Here is the result

is_symbol_inside_func_only(expr,ln,y); #should return false

is_symbol_inside_func_only(expr,ln,y); #should return true

is_symbol_inside_func_only(expr,ln,y); #should return false

is_symbol_inside_func_only(expr,cos,y); #should return true

is_symbol_inside_func_only(expr,ln,y); #should return false

is_symbol_inside_func_only(expr,ln,y); #should return true



I just found my function has a bug. I added one more test case. so you can ignore my function and use any of the other ones given in the answers below.


Maple 2023.2.1

is it possible to find why Maple fails to solve these two equations in two unknowns? Has this always been the case? I do not have older versions of Maple to check. The trace shows that it found solution but then itg says no solution was found. This is very strange.



`Standard Worksheet Interface, Maple 2023.2, Windows 10, November 24 2023 Build ID 1762575`


`The "Physics Updates" version in the MapleCloud is 1622. The version installed in this computer is 1618 created 2023, November 29, 17:28 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2023\Physics Updates\lib\`



sol:=1/4*exp(-t) * (c2*(-1+exp(4*t)) + c1*(3+exp(4*t))):



-3 = (1/4)*c1*exp(12)+(1/4)*c2*exp(12)+(3/4)*exp(-4)*c1-(1/4)*exp(-4)*c2


-17 = -(1/4)*exp(-4)*(c2*(-1+exp(16))+c1*(3+exp(16)))+(1/4)*exp(-4)*(4*c2*exp(16)+4*c1*exp(16))

-17 = (1/4)*exp(-4)*c2+(3/4)*c2*exp(12)-(3/4)*exp(-4)*c1+(3/4)*c1*exp(12)



Main: Entering solver with 2 equations in 2 variables

Main: attempting to solve as a linear system

Linear: solving 2 linear equations

Algebraic: # equations is: 2

Main: Linear solver successful. Exiting solver returning 1 solution

solve: Warning: no solutions found


Download unable_to_solve_2_equations_dec_26_2023.mw

For reference this is the solution given by Mathematica


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