# [R] how to plot a differential equation?

Moshe Olshansky m_olshansky at yahoo.com
Thu Aug 2 06:52:50 CEST 2007

```Hi Montserrat,

What exactly would you like to plot?

Your differential equation can be easily integrated so
that you can get an implicit expression for F(x), i.e.
expression like G(c,x,F(x)) = 0 where G is a known
function and c is an arbitrary constant. For every
value of c and each value of x such that x < (-1/k2 +
(k1+k2)*ln(k1+k2)/k2^2) [if my calculations are
correct!] there exist 2 possible values of F(x): one
with F(x) <1 and one with F(x) > 1. So for each c you
have two branches of the function F defined for x <
x(c). You will need a numerical procedure to find
these two values of F(x).

Regards,

Moshe.

--- Montse Rue <montse.rue at gmail.com> wrote:

> Hi,
>
> I would like to plot the following equation:
>
> dF(x)/dx=(k1+k2F(x))(1-F(x))
>
> where k1 and k2 are parameters that I have estimated
>
> How can I plot the curve in R?
>
> Thanks!
>
> Montserrat Rue
> Universitat de Lleida (Spain)
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.
>

```