0
$\begingroup$

I am new to Mathematica and I have two questions that I really appreciate if you can help me to solve them.

1) I want to plot all the points (x, y) which satisfy the following equation:

 y==11+(1+2x)((11x)/(5+10x))^((3y)/(3y-(5+x)))

Where x>0 and y>0.

2) Consider the following inequality where again x>0 and y >0:

y>11+(1+2x)((11x)/(5+10x))^((3y)/(3y-(5+x)))

I want to figure out range of y that satisfies the inequality given a specific x.

Any help is appreciated.

$\endgroup$
  • $\begingroup$ Forgive me, I'm a little confused. If you "want to plot all the points (x, y)" that satisfy some condition, then x and y are not free variables for which you can "change the value of both x and y dynamically." Do you mean you want to animate a point that traces along the curve? Or something else? $\endgroup$ – Michael E2 Jul 29 at 15:55
  • $\begingroup$ Thanks for the reply @MichaelE2. You are absolutely right.All I want is to plot the points that satisfy the equation. $\endgroup$ – Shirin elahi Jul 29 at 15:59
  • $\begingroup$ Have you seen ContourPlot? $\endgroup$ – Michael E2 Jul 29 at 16:10
  • $\begingroup$ I used it but is showed nothing. Just an empty plot. $\endgroup$ – Shirin elahi Jul 29 at 16:11
  • $\begingroup$ Include the code in the Q. Then we can probably see what went wrong. $\endgroup$ – Michael E2 Jul 29 at 16:12
0
$\begingroup$

Does this help?

ListPlot[{x,y}/.FindInstance[y==11+(1+2x)((11x)/(5+10x))^((3y)/(3y-(5+x)))&&x>0&&y>0,{x,y},20]]

will find and plot 20 pairs of points.

Change that 20 to 200 and it will take longer to give you 200 pairs.

Change that 200 to 2000 and it will take far longer to give you 2000 pairs.

Finding "all" the points seems to be an infinite task.

You can restrict the range doing this

ListPlot[{x,y}/.FindInstance[y==11+(1+2x)((11x)/(5+10x))^((3y)/(3y-(5+x)))&&1000>x>0&&y>0,{x,y},3]]

It appears if you ask for more points than it can find that it may take a long time to decide that it can't find that many points.

$\endgroup$
  • $\begingroup$ Thanks Bill. It works perfectly. I think I am gonna need to solve the inequality to find a range for y. May I ask if you have any idea for the second question? $\endgroup$ – Shirin elahi Jul 29 at 16:19
  • $\begingroup$ Your second question appears to puzzle Mathematica, but it appears that if you choose any of those {x,y} values returned from FindInstance then every y value greater than that will satisfy your second question. Thus N[FindInstance[y==11+(1+2x)((11x)/(5+10x))^((3y)/(3y-(5+x)))&&x>0&&y>0,{x,y}]] showed me {{x->4.10529,y->20.}} and x==4.10529,y==20.01 or y==20.02 or y=30 or y=1000000 all seem to satisfy your y>11+(1+2x)((11x)/(5+10x))^((3y)/(3y-(5+x))) condition. Does this work for you? $\endgroup$ – Bill Jul 29 at 16:45
  • $\begingroup$ Have you tried RegionPlot[ y > 11 + (1 + 2 x) ((11 x)/(5 + 10 x))^((3 y)/(3 y - (5 + x))), {x, 0, 1000}, {y, 0, 1000}] which works well in version 12.0? $\endgroup$ – user64494 Jul 29 at 17:40
  • $\begingroup$ Thanks Bill and "user64494". RegionPlot worked perfectly $\endgroup$ – Shirin elahi Jul 29 at 21:16
0
$\begingroup$

You can use Solve to find values of y for a given value of x:

yy[x_?NumericQ] := y /. NSolve[y==11+(1+2x)((11x)/(5+10x))^((3y)/(3y-(5+x))), y, Reals]

It's a bit slow, but it works:

yy[1] //AbsoluteTiming
yy[100] //AbsoluteTiming

{0.002267, {13.0802}}

{0.001798, {33.6105, 234.514}}

You can use Reduce to find the range of y values for a given x value:

rng[x_?NumericQ] := N @ Reduce[y > 11+(1+2x)((11x)/(5+10x))^((3y)/(3y-(5+x))), y, Reals]

For example:

rng[1]
rng[100]

y > 13.0802

33.6105 < y < 35. || y > 234.514

If you want to plot the variation of the y that satisfies your equation, you could try using Plot. I will use a domain where the function yy isn't too slow:

Plot[yy[x], {x, 30, 40}]

enter image description here

If you try this with a range with a lower x-bound, it will be too slow. In that case, I recommend a technique that I often suggest. Use NDSolveValue. For your case it would proceed as follows. Create the ODE and find an initial value:

eqn = y == 11+(1+2x)((11x)/(5+10x))^((3y)/(3y-(5+x)));
ode = D[eqn /. y->y[x], x];
y1 = yy[1]

{13.0802}

Then, use NDSolveValue (there is a singularity at the origin which I avoid by starting at $MachineEpsilon):

sol = NDSolveValue[{ode, y[1] == y1}, y, {x, $MachineEpsilon, 30}];

Visualization:

Plot[sol[t], {t, 0, 30}]

enter image description here

$\endgroup$
  • $\begingroup$ Thank you so much Carl. That's the answer I was looking for. $\endgroup$ – Shirin elahi Jul 29 at 21:15

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.