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 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)
Just a brief note - if you leave a and r symbolic, you will probably want `max_symbolic`; if `a` and `r` always will have numeric values this isn't a problem (though I assume for your case it may be symbolic).
yes, I know about max_symbolic. I've also tried getting sage to solve this symbolically and numerically, but I don't know what I'm doing wrong.