0
$\begingroup$

Evaluating

$Version
(*12.0.0 for Linux x86 (64-bit) (April 7, 2019)*)

Clear["Global`*"];
ineq1 = r[2]+y r[3]>r[1]+y r[2]&&(-1+y) r[2]+r[4]<y r[3];
reg1=ImplicitRegion[ineq1,{{r[1],0,1},{r[2],0,1},{r[3],0,1},{r[4],0,1}}];
int[y_]=Assuming[1>y>0,Integrate[y r[2],{r[1],r[2],r[3],r[4]}\[Element]reg1]]

beeps with no output.

"Why the beep?" explains "The kernal Local has quit(exited) during the course of an evaluation)

Do Windows/Mac users experience the same? Is the error elsewhere?

$\endgroup$
  • 2
    $\begingroup$ Reproduced on 12.0.0 for Mac OS X x86 (64-bit) (April 7, 2019). The kernel should not crash. Please report to Wolfram Support. Using SetDelayed and specifying a value for y seems to work. int[y_] := ..., int[0.5]. $\endgroup$ – Rohit Namjoshi Nov 20 '19 at 20:52
  • $\begingroup$ Thanks. Just reported. $\endgroup$ – Logan Smith Nov 20 '19 at 22:00
  • $\begingroup$ @RohitNamjoshi - on my Mac with v12, int[0.5] erroneously evaluates to a complicated Piecewise function of y. $\endgroup$ – Bob Hanlon Nov 20 '19 at 23:06
  • $\begingroup$ @BobHanlon, I was not able to replicate the complicated Piecewise function in this case, although in other similar problems I've gotten complicated piecewise functions. What code did you specifically run? $\endgroup$ – Logan Smith Nov 21 '19 at 0:39
2
$\begingroup$

This is an extended comment to demonstrate the results on my system

$Version

(* "12.0.0 for Mac OS X x86 (64-bit) (April 7, 2019)" *)

Clear["Global`*"];

ineq1 = r[2] + y r[3] > r[1] + y r[2] && (-1 + y) r[2] + r[4] < y r[3];

reg1 = ImplicitRegion[
   ineq1, {{r[1], 0, 1}, {r[2], 0, 1}, {r[3], 0, 1}, {r[4], 0, 1}}];

int[y_] := 
 Assuming[1 > y > 0, 
  Integrate[y r[2], {r[1], r[2], r[3], r[4]} ∈ reg1]]

int[0.5]

enter image description here

% // Simplify[#, 0 < y < 1] &

enter image description here

Since int[0.5] has a numeric value for y, the symbol y should not appear in the evaluated output.

Presumably, it is a scoping issue which is avoided by explicitly passing y as a parameter to ineq1 and reg1

Clear["Global`*"];

ineq1[y_] := r[2] + y r[3] > r[1] + y r[2] && (-1 + y) r[2] + r[4] < y r[3];

reg1[y_] := 
  ImplicitRegion[
   ineq1[y], {{r[1], 0, 1}, {r[2], 0, 1}, {r[3], 0, 1}, {r[4], 0, 1}}];

int[y_] := 
 Assuming[1 > y > 0, 
  Integrate[y r[2], {r[1], r[2], r[3], r[4]} ∈ reg1[y]]]

int[0.5]

(* 0.09375 *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.