Message Boards Message Boards

0
|
2526 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Plot a solution of NDSolve[ ]?

Posted 3 years ago

I am trying to plot the solution to the following ode:

x'[t] = x[t]*(1 - x[t])*(1/2 ((1 - (1 - x[t])^5)/x[t] - 3/5)), 
x[0] = 0.5

I have attached my code that plots the solution but it doesn't start at x[0] = 0.5, How can I rectify this?

Attachments:
POSTED BY: James Bainbridge
3 Replies
Posted 3 years ago

Not sure what you mean. In the plot when x = 0, y = 0.5. Also in [Evaluate[x[t] /. o], o is not defined.

POSTED BY: Rohit Namjoshi

Apologies I was misreading the plot.

POSTED BY: James Bainbridge

Try:

sol = NDSolve[{x'[t] == x[t]*(1 - x[t])*(1/2 ((1 - (1 - x[t])^5)/x[t] - 3/5)), x[0] == 1/2}, x, {t, 0, 10}];
Plot[x[t] /. sol, {t, 0, 10}, PlotRange -> {Automatic, {0, 1}}, Epilog -> {Red, PointSize[0.02], Point[{0, 1/2}]}]
POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract