Defining the model
Suppose that a population can be accurately modeled by the logistic equation
> MODEL1 := diff( p(t) , t ) = 0.4 * p(t) * ( 1 - p(t)/30 ) ;
in which is the size of the population years in the future (relative to 1998). Suppose, in 2003 ( i.e. , ), a disease is introduced into the population that kills 25% of the population per year. The model of the population after the infection begins is
> MODEL2 := diff( p(t) , t ) = 0.4 * p(t) * ( 1 - p(t)/30 ) - 0.25*p(t) ;
To obtain a single model for all time in the future, these two models can be pieced together as follows:
> MODEL := diff( p(t), t ) = piecewise( t<5, rhs(MODEL1), t>=5, rhs(MODEL2) );
>
Several initial conditions of possible interest are:
> IC1 := p(0) = 5 ;
> IC2 := p(0) = 10 ;
> IC3 := p(0) = 20 ;
> IC4 := p(0) = 30 ;
> IC5 := p(0) = 40 ;
>