Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to solve for volume

I have a function that looks like this:

def f1(x,y):
    return max(0, a * (r - x*x-y*y))

a and r and constants, with r being the radius. Given the radius, how do I get sage to tell me what a needs to be so that the volume of the function is 1?

For example, solution for radius of 1.5 is 0.28294212105225836:

r = 1.5
a = 0.28294212105225836
dblquad(lambda x, y: f1(x,y), -r, r, lambda x: -r, lambda y: r)
(1.0000000008272796, 4.581186036178006e-09)

How to solve for volume

I have a function that looks like this:

def f1(x,y):
    return max(0, a * (r - x*x-y*y))

a and r and are constants, with r being the radius. Given the radius, how do I get sage to tell me what a needs to be so that the volume of the function is 1?

For example, solution for radius of 1.5 is 0.28294212105225836:

r = 1.5
a = 0.28294212105225836
dblquad(lambda x, y: f1(x,y), -r, r, lambda x: -r, lambda y: r)
(1.0000000008272796, 4.581186036178006e-09)