| 1 | initial version |
well, as simple as it could be:
a,b,c = var('a,b,c')
c = 1
f = c*a*b
monte_carlo_integral(lambda new_a,new_b: f.subs({a: new_a, b: new_b}), [0,0], [3,3], 1000)
just replacing the old a,b with the new variables for the integral. (idk if its efficient or not)
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.