This doesn't want to work for me in Mathematica - I don't know why not. It usually gives me 0
, but sometimes also a different number. I know it should be a small, non-zero number.
Would someone be able to help me translate this to MatLab? I am new to that program, and it would save me time if someone with experience could help me get started.
myO[e1_, e2_] := (e1)/((e1) + (e2));
myU[e1_, e2_] := (1 - e2)/((1 - e1) + (1 - e2));
myV[p_, e1_, e2_] := p (e1)/(p (e1) + (1 - p) (1 - e2));
myW[p_, e1_, e2_] := p (1 - e1)/(p (1 - e1) + (1 - p) e2);
NIntegrate[ Boole[0 < e1 < e2 < 1/2 && 0 < e3 < 1/2 && e1 < p < 1 - e1 &&
e3 < myV[p, e1, e2] < 1 - e3 < myW[p, e1, e2] &&
myO[e1, e2] < e3 < myU[e1, e2]],
{p, 0, 1}, {e1, 0, 1/2}, {e2, 0, 1/2}, {e3, 0, 1/2}]
For those not familiar to Mathematica, Boole
simply gives 1
if the condition is met, and 0
otherwise. As such, I wish to integrate over all of parameterspace to find the volume of the subspace for which the conditions are met.