[go: up one dir, main page]

Items tagged with division-by-zero

Feed App Center

Can solve give internal Maple error of division by zero to the caller?

Also when I run this using kernelopts('assertlevel'=1): or kernelopts('assertlevel'=2):, then not able to catch the internal error any more, which is division by zero using try/catch.

Only when kernelopts('assertlevel'=0).  can try/catch trap the error.

This means now I have to set kernelopts('assertlevel'=0) before calling solve to be able to trap the error and set it back to kernelopts('assertlevel'=2) after that, else the whole program halts.

But my main question is: can solve throw internal error of division by zero? I mean, is this expected sometimes to happen? I would have thought Maple should internally catch this and simply return no solution if can't solve it.

This equation is auto generated and the program calling solve on it to see if it can solve it.

Here is the worksheet

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1792 and is the same as the version installed in this computer, created 2024, August 22, 12:6 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

eq:=1 = 1/((exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X + exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*x0 + 2*Y + 2*y0)^2*Y*(exp(X*Y)^2*exp(X*y0)^2*exp(x0*Y)^2*exp(x0*y0)^2*X + exp(X*Y)^2*exp(X*y0)^2*exp(x0*Y)^2*exp(x0*y0)^2*x0 + 2*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X*Y^2 + 4*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X*Y*y0 + 2*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X*y0^2 + 2*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*Y^2*x0 + 4*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*Y*x0*y0 + 2*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*x0*y0^2 - X^2*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0) - 2*exp(X*Y)*exp(X*y0)*x0*exp(x0*Y)*exp(x0*y0)*X - exp(X*Y)*exp(X*y0)*x0^2*exp(x0*Y)*exp(x0*y0) - 2)):

kernelopts('assertlevel'=2):
try
   solve(identity(eq,X),[x0, y0]);
catch:
   print(lastexception);
end try;

Error, (in unknown) assertion failed

kernelopts('assertlevel'=1):

try
   solve(identity(eq,X),[x0, y0]);
catch:
   print(lastexception);;
end try;

Error, (in unknown) assertion failed

kernelopts('assertlevel'=0):

try
   solve(identity(eq,X),[x0, y0]);
catch:
   print(lastexception);
end try;

unknown, "numeric exception: division by zero"

 


 

Download division_by_zero_solve_identity_august_23_2024.mw

I do not have earlier Maple version to check now. But Maple 2024.1 gives division by zero on this second order ode with missing x. This looks like new problem in Maple. Would someone who have access to earlier version of Maple be able to check if this problem shows there also? I solved this and get y=x+3 as solution which Maple verifies.

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

restart;

ode:=diff(y(x),x$2)=(diff(y(x),x))^3-(diff(y(x),x))^2;
IC:=y(0)=3,D(y)(0)=1;

diff(diff(y(x), x), x) = (diff(y(x), x))^3-(diff(y(x), x))^2

y(0) = 3, (D(y))(0) = 1

dsolve([ode,IC])

Error, (in dsolve) numeric exception: division by zero

sol:=y(x)=3+x;
odetest(sol,[ode,IC])

y(x) = 3+x

[0, 0, 0]

DEtools:-odeadvisor(ode);

[[_2nd_order, _missing_x], [_2nd_order, _reducible, _mu_y_y1]]

infolevel[dsolve]:=5;

5

dsolve([ode,IC])

Methods for second order ODEs:

--- Trying classification methods ---

trying 2nd order Liouville

trying 2nd order WeierstrassP

trying 2nd order JacobiSN

differential order: 2; trying a linearization to 3rd order

--- trying a change of variables {x -> y(x), y(x) -> x}

differential order: 2; trying a linearization to 3rd order

trying 2nd order ODE linearizable_by_differentiation

trying 2nd order, 2 integrating factors of the form mu(x,y)

trying differential order: 2; missing variables

-> Computing canonical coordinates for the symmetry [0, 1]

-> Rewriting ODE in canonical coordinates by means of differential invariants

Try computing 1 more symmetries for ODE written in canonical coordinates

 -> Computing symmetries using: way = 3

 Found another symmetry:

[1, 0]

 Found another symmetry:

[-x+y, 0]

Computing a convenient ordering to use the 3 symmetries available

<- differential order: 2; canonical coordinates successful

<- differential order 2; missing variables successful

Error, (in dsolve) numeric exception: division by zero

dsolve(ode)

Methods for second order ODEs:

--- Trying classification methods ---

trying 2nd order Liouville

trying 2nd order WeierstrassP

trying 2nd order JacobiSN

differential order: 2; trying a linearization to 3rd order

--- trying a change of variables {x -> y(x), y(x) -> x}

differential order: 2; trying a linearization to 3rd order

trying 2nd order ODE linearizable_by_differentiation

trying 2nd order, 2 integrating factors of the form mu(x,y)

trying differential order: 2; missing variables

-> Computing canonical coordinates for the symmetry [0, 1]

-> Rewriting ODE in canonical coordinates by means of differential invariants

Try computing 1 more symmetries for ODE written in canonical coordinates

 -> Computing symmetries using: way = 3

 Found another symmetry:

[1, 0]

 Found another symmetry:

[-x+y, 0]

Computing a convenient ordering to use the 3 symmetries available

-> Calling odsolve with the ODE diff(_b(_a) _a) = _b(_a)^3-_b(_a)^2 _b(_a) HINT = [[1 0] [-_a+y -_b*(_b-1)]]

   *** Sublevel 2 ***

   symmetry methods on request

 1st order, trying reduction of order with given symmetries:

[1, 0], [-_a+y, -_b*(_b-1)]

   1st order, trying the canonical coordinates of the invariance group

   <- 1st order, canonical coordinates successful

<- differential order: 2; canonical coordinates successful

<- differential order 2; missing variables successful

y(x) = ln(LambertW(-c__1*exp(x-1)))+c__2

 

 

Download divide_by_zero_maple_2024_1_august_5_2024.mw

There is an integration method called orering in Maple. But see no mention on it at help page 

It shows up when using option 

method=_RETURNVERBOSE

And that is how I knew about it.

It gives division by zero when asked to integrate zero !

Any one knows what is this method? Will send bug email to Maplesoft suport just in case also.
 

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

int(0,x)

0

int(0,x,method=orering)

Error, (in IntegrationTools:-Indefinite) numeric exception: division by zero

int(1,x,method=orering)

x

 


 

Download division_by_zero_int_orering_method.mw

 

 

Good day to all of you. 

I am working with a differential equation, got a first approximation setting all the constants equal to 1. But at the time to use the real values there appears the error numeric exception: division by zero.

I'll thanks any advice.

best regards

division_by_zero.mw

question7.mw

NULL

***e2.106

 

Plot this couple of parametric equations, identify the geometric figure known as the folium of Descartes , and relate properties of the figure to numerical coefficients in the equations.

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

NULL

restart: with(plots):

 

 

 

See how the plot of the folium of Descartes can be built with the following code:

d1 :=

Error, invalid terms in product: -10 .. 10

Error, invalid terms in product: -10 .. 10

Error, (in plots:-pointplot) points cannot be converted to floating-point values

NULL

NULL

Download question7.mw

For this question I need that who help me focus in second block of code in the document. Basically, what I am trying is to get a plot of folium of Dercastes using parametric equation to plot ordered pairs. In order to success, is needed to exclude t=-1. In the block is showed what I tried. I concluded that my approach in solving that part of exercise is wrong. What could be a well approach?

In Maple 2021.1

restart;
int(cos(3*x)/(-(-1+8*cos(x)^2)^(1/2)+(3*cos(x)^2-sin(x)^2)^(1/2)),x)

gives

Error, (in SumTools:-DefiniteSum:-ClosedForm) numeric exception: division by zero

But in Maple 2020.2 it works OK giving an answer. (A very long one)

btw, the answer should be

3/4*arcsin(2/3*sin(x)*3^(1/2))-3/4*arctan(sin(x)/(-1+4*cos(x)^2)^(1/2))-3/4*arctan(sin(x)/(-1+8*cos(x)^2)^(1/2
))+5/8*arcsin(2/7*sin(x)*14^(1/2))*2^(1/2)-1/2*sin(x)*(-1+4*cos(x)^2)^(1/2)-1/2*sin(x)*(-1+8*cos(x)^2)^(1/2)

 

Is this a known issue? I know Maple int has went some changes and improvements in Maple 2021 from the release notes. May be this was caused by some of these changes?

https://www.maplesoft.com/products/maple/new_features/

  • Integration has been enhanced with improved algorithms for indefinite integration, and the ability to easily specify which integration method should be used and to compare the results from different methods."

Maple 2021.1 on windows 10

update July 2, 2021

These are additional failed integration in 2021.1 that throw exceptions now. no errors in 2020.2

#427
int(cos(3*x)/(-(-1+8*cos(x)^2)^(1/2)+(3*cos(x)^2-sin(x)^2)^(1/2)),x)

#533 #no error in Maple 2020, it does not evaluate there. But no error
int((-3+exp(7*x))^(2/3)/exp(2*x),x)

#26/11 #no error in Maple 2020, it does not evaluate there. But no error
int((b*x+(b^2*x^2+a)^(1/2))^(1/2)/(b^2*x^2+a)^(1/2),x)


 

I do not remember if there was a post on this before or not
Maple 2021.1

int(arcsin(x)/(1+(-x^2+1)^(1/2)),x)

gives

Error, (in Utils:-TransformAndApply) numeric exception: division by zero

The correct answer should be

((-1 + Sqrt[1 - x^2]) ArcSin[x])/x + ArcSin[x]^2/2 -  Log[1 + Sqrt[1 - x^2]]

I had to go back to Maple 2018, to get no exception:

May be this could be looked at for next Maple version?

Here is a division-by-zero bug in a solution produced by pdsolve.  Admittedly, this sort of problem can be difficult to avoid in a CAS, but here it is, in case there is a chance to get it fixed somehow.

restart;

kernelopts(version);

`Maple 2020.1, X86 64 LINUX, Jul 30 2020, Build ID 1482634`

pde := diff(u(x,y,t),t,t) = diff(u(x,y,t),x,x) + diff(u(x,y,t),y,y);

diff(diff(u(x, y, t), t), t) = diff(diff(u(x, y, t), x), x)+diff(diff(u(x, y, t), y), y)

bc := u(x,0,t)=0, u(x,1,t)=0, u(0,y,t)=0, u(1,y,t)=0;

u(x, 0, t) = 0, u(x, 1, t) = 0, u(0, y, t) = 0, u(1, y, t) = 0

ic := u(x,y,0) = x*y*sin(Pi*x)*sin(Pi*y),  D[3](u)(x,y,0)=0;

u(x, y, 0) = x*y*sin(Pi*x)*sin(Pi*y), (D[3](u))(x, y, 0) = 0

pdsol := pdsolve({pde, bc, ic});

"pdsol:=u(x,y,t)=(&sum;) (&sum;)-(2 sin(n Pi x) sin(n1 Pi y) cos(Pi sqrt(n^2+n1^2) t) ({[[Pi^2,n=1],[-(8 n ((-1)^n+1))/((n-1)^2 (n+1)^2),1<n]]) n1 ((-1)^n1+1))/(Pi^4 (-1+n1)^2 (n1+1)^2)"

eval(pdsol, infinity=4);
value(%);

"u(x,y,t)=(&sum;) (&sum;)-(2 sin(n Pi x) sin(n1 Pi y) cos(Pi sqrt(n^2+n1^2) t) ({[[Pi^2,n=1],[-(8 n ((-1)^n+1))/((n-1)^2 (n+1)^2),1<n]]) n1 ((-1)^n1+1))/(Pi^4 (-1+n1)^2 (n1+1)^2)"

Error, (in SumTools:-DefiniteSum:-ClosedForm) summand is singular in the interval of summation

 

 

 

Download pdsolve-bug.mw

 

Basically it spits out the subset of values for which a division by zero error will occur for the function you specify on  range you specify for each of it's arguments, but I get an ambigous error when ever exponentiation features in the function I specify, which of course dramatically reduces the application of the calculator. Division,addition,substraction and multiplication are currently the only available arithmetic operators availble for the function window that I know the error will not occur.

If some one can help it is much appriciated

 

DIVISION_BY_ZERO_CALCULATOR.mw

Dear all,

I am trying to solve the following equation:

y(z) = F(z) + int(sqrt(z - sigma)*y(sigma), sigma = 0..z);

intsolve(%, y(z));

But i get the following error: 

Error, (in intsolve) numeric exception: division by zero

My guess would be that there appears a limit in the calculation which exists but is not evaluated properly by Maple. Is it possible to pass this kind of exception (comparable to http://www.maplesoft.com/support/help/errors/view.aspx?path=Error,%20numeric%20exception%3A%20division%20by%20zero)

Thanks and best regards

Ferdinand

I am having difficulty helping someone series expand an eigenvector solution.  I can expand the eigenvalues easily but get a numeric exception divide by zero when I attempt to expand a component of an eigenvector.  Mathematica seems to have no problem solving this problem.  Any help would be appreciated.

 

 

 

 

 

assume(varepsilon > 0)

H := Matrix(3, 3, {(1, 1) = 0, (1, 2) = -epsilon, (1, 3) = epsilon, (2, 1) = -epsilon, (2, 2) = 2-2*epsilon, (2, 3) = 0, (3, 1) = epsilon, (3, 2) = 0, (3, 3) = 2+2*epsilon})

Matrix(%id = 18446744078100429630)

(1)

with(LinearAlgebra):

evals, evecs := Eigenvectors(H):

e1 := convert(simplify(series(evals[1], varepsilon = 0, 4)), polynom)

2+2*varepsilon+(1/2)*varepsilon^2-(7/16)*varepsilon^3

(2)

e2 := convert(simplify(series(evals[2], varepsilon = 0, 4)), polynom)

-varepsilon^2

(3)

e3 := convert(simplify(series(evals[3], varepsilon = 0, 4)), polynom)

2-2*varepsilon+(1/2)*varepsilon^2+(7/16)*varepsilon^3

(4)

simplify(series(evecs[1][1], epsilon = 0, 4))

Error, (in simplify/sqrt/local) numeric exception: division by zero

 

``

 

Download CourseraOpticsEigenvalues.mwCourseraOpticsEigenvalues.mw

Hi,

I would like to define the following exceptions:

0/0 should be equal with 0, but any other x/0 should be infinity, if x>0 or -infinity, if x<0.

In the following example, I show what I achieved, however, I also would like to have equation (8) to be infinity.

BR,

Zoltan Faigl

 



Page 1 of 1