1
$\begingroup$

I have below two variable function:

(-1/(d-1))+(2d +(d-1) Abs[d-p(d+1)] +(d-1) Abs[d-p(d-1)])/((2d-2)Abs[d +p(d-1)])

And I want to find the equation of the intersection of my 2 variable function with the plane pd, In fact I want to find the p and d as a function of each other on plane pd. (I have to mentioned that p is a continuous variable between 0 and 1 and d is a discrete variable larger or equal to 2.

$\endgroup$

2 Answers 2

1
$\begingroup$

Define a function

f[d_, p_] := ((d - 1)*Abs[d - p*(d - 1)] + (d - 1)*Abs[d - p*(d + 1)] + 2*d)/((2*d - 2)*Abs[d + (d - 1)*p]) - 1/(d - 1)

Solve

sol = Reduce[{f[d, p] == 0, d > 2, 0 <= p <= 1}, Reals]

(* (2/3 < p < 1 && 2 < d <= -(p/(-1 + p))) || (p == 1 && d > 2) *)
$\endgroup$
1
  • $\begingroup$ Dear Stitch, Thank you so much for your kind help. $\endgroup$
    – Najmeh
    Commented Nov 24, 2016 at 6:37
1
$\begingroup$
f[p_, d_] := (-1/(d - 1)) + (2 d + (d - 1) Abs[d - p (d + 1)] + (d - 1) Abs[d - p (d - 1)])/((2 d - 2) Abs[d + p (d - 1)])

Plot[Evaluate@Table[f[p, i], {i, 2, 10}], {p, 0.6, 1}]

enter image description here

Table[p /. FindInstance[f[p, i] == 0 && 0 < p < 1, p][[1, 1]], {i, 2, 10}]

{2/3, 3/4, 4/5, 5/6, 6/7, 7/8, 8/9, 9/10, 10/11}

hence the proposition is that for a given integer d, the first p that makes f[p, d] == 0 is

pp[d_] := d/(d + 1)

Check:

f[pp[d], d] // FullSimplify[#, d ∈ Integers] &

enter image description here

$\endgroup$
7
  • $\begingroup$ Dear Corey979, Thank you so much for your kind help, I just can understand the last step (checking). What does this command do? "f[pp[d], d] // FullSimplify[#, d ∈ Integers] &" $\endgroup$
    – Najmeh
    Commented Nov 24, 2016 at 6:36
  • $\begingroup$ @Najmeh You evaluate f[pp[d], d]. Then you FullSimplify it with the assumption d ∈ Integers (for comparison evaluate just f[pp[d], d]). The # and & is a pure function due to the postfix // notation. It's equivalent to `FullSimplify[f[pp[d], d], d ∈ Integers]'. $\endgroup$
    – corey979
    Commented Nov 24, 2016 at 8:09
  • $\begingroup$ Dear Corey, Thank you so much. Thank you. $\endgroup$
    – Najmeh
    Commented Nov 24, 2016 at 10:16
  • $\begingroup$ @Najmeh Glad it helped. If you find an answer useful, you might want to upvoting it by clicking the gray triangle next to it, and accepting by clicking the gray checkmark. $\endgroup$
    – corey979
    Commented Nov 24, 2016 at 10:18
  • $\begingroup$ Dear Carol, I have tried to upvoting your answer the first time I read it and also now, But I get this answer in both times I tried: " Votes cast by those with less than 15 reputation are recorded, but do not change the publicly displayed post score.| $\endgroup$
    – Najmeh
    Commented Nov 27, 2016 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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