# Truncated solution plot of ODE

**URL:** <https://community.wolfram.com/t/truncated-solution-plot-of-ode/19686>\
**Category:** Questions\
**Tags:** calculus, equation-solving, symbolic-computations\
**Created:** [February 27, 2022, 8:14am UTC](https://community.wolfram.com/t/truncated-solution-plot-of-ode/19686 "2022-02-27T08:14:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwojcik23](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@mwojcik23](https://community.wolfram.com/u/mwojcik23)\
**Post date:** [February 27, 2022, 8:14am UTC](https://community.wolfram.com/t/truncated-solution-plot-of-ode/19686/1 "2022-02-27T08:14:02Z")

</div>

Hello,

I tried to get a plot of function being solution of the following ODE:

```
sol = DSolve[{y'[x] == y[x]^2 - y[x]^3, y[0] == 0.001}, y[x], x]

```

solution I got is:

```
{{y[x] -> 
   InverseFunction[Log[1 - #1] - Log[#1] + 1/#1 &][1006.91 - x]}}

```

which i tried to visualize using:

```
Plot[y[x] /. sol, {x, 0, 2000}]

```

Unfortunately, plateau after x\>1000 is not shown.

 ![sol.png](https://global.discourse-cdn.com/wolfram/original/3X/4/4/44aee4240e1871fd706f674deb873d87429a5e59.png)

Question is: How can I get missed part of the solution graph?

Thank you,  
Marek

---

<div class="post-metadata">

**Author:** ![mhelmle](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@mhelmle](https://community.wolfram.com/u/mhelmle)\
**Post date:** [February 27, 2022, 9:08am UTC](https://community.wolfram.com/t/truncated-solution-plot-of-ode/19686/2 "2022-02-27T09:08:44Z")

</div>

Hello Marek,  
the plateau is not shown due to the plotrange that Mathematica decided. Use

```
Plot[y[x]/.sol, {x,0,2000},PlotRange-> All]

```

Regards,

Michael

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [February 27, 2022, 9:32am UTC](https://community.wolfram.com/t/truncated-solution-plot-of-ode/19686/3 "2022-02-27T09:32:22Z")

</div>

Other options:

```
sol = DSolve[{y'[x] == y[x]^2 - y[x]^3, y[0] == 10^-3}, y[x], x]

Plot[y[x] /. sol, {x, 0, 2000}, PlotRange -> Full]
Plot[y[x] /. sol, {x, 0, 2000}, PlotRange -> {{0, 2000}, {-1/2, 3/2}}]

```

We can convert to implict solution:

```
 S1 = ((sol[[1, 1, 2, 0, 1]] /@ {y})[[1]]) == sol[[1, 1, 2, 1]](*Easy way*)
 (*1/y + Log[1 - y] - Log[y] == 1000 - x - Log[1000/999] + Log[1000]*)

ContourPlot[Evaluate@S1, {x, 0, 2000}, {y, 0, 1}, MaxRecursion -> 2, 
 PlotPoints -> 100](*Plot implicit solution*)

```

---

<div class="post-metadata">

**Author:** ![mwojcik23](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@mwojcik23](https://community.wolfram.com/u/mwojcik23)\
**Post date:** [February 27, 2022, 10:15am UTC](https://community.wolfram.com/t/truncated-solution-plot-of-ode/19686/4 "2022-02-27T10:15:22Z")

</div>

Thank you for the answers.  
Indeed, plateau starts to appear slightly after using PlotRange. However, I cannot see it beyond say 1018, using proposed solutions.

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [February 27, 2022, 12:43pm UTC](https://community.wolfram.com/t/truncated-solution-plot-of-ode/19686/5 "2022-02-27T12:43:29Z")

</div>

Because if **x goes to Infinity** then **y goes to 1.**

Or another way:

```
M = Solve[S1 // FullSimplify, x](*Solve for x*)
Limit[x /. M[[1]], y -> 1]
(*Infinity*)

```

If y goes to **1** then x goes to **Infinity.**

---

<div class="post-metadata">

**Author:** ![mwojcik23](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@mwojcik23](https://community.wolfram.com/u/mwojcik23)\
**Post date:** [February 27, 2022, 1:30pm UTC](https://community.wolfram.com/t/truncated-solution-plot-of-ode/19686/6 "2022-02-27T13:30:58Z")

</div>

Correct, solution behavior is clear.

Problem concerns the plotting capabilities (and relevant options) in order to see different solution regimes.
