nm

7210 Reputation

19 Badges

10 years, 200 days

MaplePrimes Activity


These are questions asked by nm

if isolate fail, then it returns back the input equation. But if solve failed to solve for the variable in question, it returns either NULL or empty list, or empty set (depending on the input). So it is easy to check if it failed or not.

How does one check that isolate failed? Should I check the left side of what isolate returns is the variable I am solving for? For an example,

sol:=isolate(-2*y-cos(y)+x+sin(x)-_C1 = 0,y)

returns back -2*y-cos(y)+x+sin(x)-_C1 = 0

Is the following the correct way to check if isolate solved the equation or not:

sol:=isolate(-2*y-cos(y)+x+sin(x)-_C1 = 0,y);
if lhs(sol)=y then
   print("it solved it. Soltion is ",sol);
else
   print("Failed to solve it. Try solve command now ");
fi;

Just wanted to make sure as help for isolate does not mention anything about what happens if isolate can't solve the equation.

Maple 2022.1

Is this a bug?

I was cleaning my code using mint. It told me that

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

which is the direction used in a limit. When this happens, I just replace the name with 'right' to make it happy. This works for everything so far. But now limit fails with

      Error, (in assuming) when calling 'limit'. Received: 'invalid directional argument'

the strange thing this happens only when adding assuming after the limit.

It seems to me to be some parsing issue?  Attached is worksheet showing the problem.

Maple 2022.2 on windows 10. So for now I will remove the '' and let mint just complain.

interface(version)

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

c:=0:
m:=1:
n:=0:
f:=1/4*x^2:
limit(diff((x-c)^m*f,x$(m-n)),x = c,right)/(m-n)!;
limit(diff((x-c)^m*f,x$(m-n)),x = c,'right')/(m-n)!;

0

0

limit(diff((x-c)^m*f,x$(m-n)),x = c,right)/(m-n)! assuming real;

0

limit(diff((x-c)^m*f,x$(m-n)),x = c,'right')/(m-n)! assuming real;

Error, (in assuming) when calling 'limit'. Received: 'invalid directional argument'

 

Download issue_with_limit_oct_31_2022.mw

in some cases, when integral returns result with special function in it, I want to keep the integral as inert instead.

Currently I do an explicit check for some special functions that could show up (and add more if needed). like this

anti := timelimit(60,-int(B/A, x));
if  has(anti,hypergeom) 
               or has(anti,MeijerG) or has(anti,WhittakerM) 
               or has(anti,WhittakerW)or has(anti,EllipticE) or has(anti,EllipticF) then                            
   anti := -Int(B/A, x);
 fi;

It will be nice if I could write

anti := timelimit(60,-int(B/A, x));
if hastype(anti,'special_math_function') then                  
   anti := -Int(B/A, x);
fi;

Function advisor knows about all elementary functions in maple

FunctionAdvisor( elementary );
The 26 functions in the "elementary" class are:

 [arccos, arccosh, arccot, arccoth, arccsc, arccsch, arcsec, 

   arcsech, arcsin, arcsinh, arctan, arctanh, cos, cosh, cot, 

   coth, csc, csch, exp, ln, sec, sech, sin, sinh, tan, tanh]


Is there a way to make a type in Maple for "special math functions"?  You might ask, what is a special math function. Well, it is all build in math functions in Maple which are not elementary? So I do not have to list them all in name one by one as there are so many of them.

Any suggestions?

Maple 2022.2.

I have not used _Envsignum0 before. Been looking at it, and I am little confused.

My testcase is the following

restart;

_Envsignum0:=1;
fy:=1/2*(a^2/y^2+2*a*b/y-4*a*c/y+b^2-4*b*c+4*c^2+2*a)^(1/2);
limit(diff(y*fy,y),y = 0,right) assuming real;

It still has signum there., I assumed all are real.

Is there a setting that will automatically convert all signum to 1?  as _Envsignum0:=1; does not seem to do it. Or do I have to explicitly add positive each time? as in

restart;
_Envsignum0:=1;
fy:=1/2*(a^2/y^2+2*a*b/y-4*a*c/y+b^2-4*b*c+4*c^2+2*a)^(1/2);
limit(diff(y*fy,y),y = 0,right) assuming real,positive;

The problem with adding assuming real,positive is that it applies to all variables in the expression. I only wanted those that has signum on them, to be replaced by 1.

Maple 2022.2 windows 10

I have an Array A which I wanted to convert to Matrix. Doing B:=convert(A,Matrix); displays different on the screen than if A is first converted to list, then the list is next converted to Matrix.

Also the dimension in the first case if not the same as the dimension of the matrix done using the list conversion first. I expected both to give same dimension which is 10 by 3 in this example.

Should not both be the same? Does this to convert an Array to Matrix, one first needs to convert it to list, then convert the list to Matrix?

ps. thinking more about this, I think this seems to work as designed. I just expected convert to Matrix to generate the standard 2 dimensional matrix  10 by 3 automatically from the Array, but I see now that it probably does need that extra conversion to a list first.

 


 

interface(version);

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

restart;

A:=Array(1..0);
for i from 1 to 10 do
   A ,= [i, i+1, i+2]
od:
B:=convert(A,Matrix);
whattype(B);
LinearAlgebra:-Dimension(B);

A := Vector[row](0, {})

Matrix(%id = 36893490060059048044)

Matrix

1, 10

restart;
A:=Array(1..0);
for i from 1 to 10 do
   A ,= [10-i, i+1, i+2]
od:
B:=convert(A,list);
B:=convert(B,Matrix);
whattype(B);
LinearAlgebra:-Dimension(B);

A := Vector[row](0, {})

B := [[9, 2, 3], [8, 3, 4], [7, 4, 5], [6, 5, 6], [5, 6, 7], [4, 7, 8], [3, 8, 9], [2, 9, 10], [1, 10, 11], [0, 11, 12]]

Matrix(%id = 36893490060058557844)

Matrix

10, 3

 

 


 

Download oct_25_2022.mw

2 3 4 5 6 7 8 Last Page 4 of 142