Ask Your Question

integral() failing with "segmentation fault"

asked 2014-01-27 10:37:16 +0200

marv gravatar image

updated 2023-01-09 23:59:33 +0200

tmonteil gravatar image

Hi sage community

My question again arises from exercises in technical chemistry done in sage. I wanted to calculate an definite integral (number of transfer units).


#my function
#print i

#I, the indefinite integral of i
#print I

#three methods too calculate the integral
print n(I(x=0.0275)-I(x=0))
print numerical_integral(i,0,0.0275)
print integral(i,x,0,0.275)

The first two methods work fine. The last method gives me the infinite of the following messages.

;;; Detected access to protected memory, also kwown as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt

This is a bug, isn't it? However, i have no idea how integrate() works.

Greetings, marv

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-01-27 10:57:37 +0200

tmonteil gravatar image

updated 2014-01-27 11:08:05 +0200

I can reproduce your behaviour, i confirm this is a bug :(

It is reported as trac ticket 15747.

edit flag offensive delete link more


thanks for making a track ticket

marv gravatar imagemarv ( 2014-01-27 14:36:46 +0200 )edit

answered 2014-01-27 21:46:28 +0200

kcrisman gravatar image

I can confirm that this problem also occurs with the integral to 11/40.

That said,

sage: i
1/((1.31926121372032*x + 0.00329815303430079)/(1.31926121372032*x + 1.00329815303430) - x/(x + 1))

and usually Maxima does not particularly like integrating floating point things exactly, because it sort of doesn't make sense.

sage: numerical_integral(i,0,0.275)
(12.325862793647284, 4.191806193893343e-11)
edit flag offensive delete link more


you're right, the problem doesn't occur when defining all decimals as fractions

marv gravatar imagemarv ( 2014-01-29 04:31:34 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2014-01-27 10:37:16 +0200

Seen: 660 times

Last updated: Jan 27 '14