Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Differential Equation: Not getting result

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127340] Re: Differential Equation: Not getting result
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Wed, 18 Jul 2012 01:38:52 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20120717053145.BA8F96877@smc.vnet.net>

Clear[x];
r = 1;
K = 1;
eqn = x'[t] - r x[t] (1 - x[t]/K) == 0;
sol = NDSolve[
    {eqn, x[0] == 1/2}, x[t],
    {t, 0, 50}][[1]];

ParametricPlot[
 Evaluate[{x[t] /. sol, D[x[t] /. sol, t]}],
 {t, 0, 50},
 Frame -> True,
 AxesLabel -> {"x", Overscript[x, "."]},
 AspectRatio -> 1]

ParametricPlot[
 Evaluate[{t, x[t] /. sol}],
 {t, 0, 50},
 Frame -> True,
 AxesLabel -> {"t", "x"},
 AspectRatio -> 1]

Or with DSolve

sol2 = DSolve[
    {eqn, x[0] == 1/2}, x[t], t][[1]] // Quiet

{x[t] -> E^t/(1 + E^t)}

D[sol2, t] // Simplify

{Derivative[1][x][t] -> E^t/(1 + E^t)^2}


Bob Hanlon


On Tue, Jul 17, 2012 at 1:31 AM, Rahul Chakraborty
<rahul.6sept at gmail.com> wrote:
> Dear all,
>
>  For the following code i'm not getting result. kindly tell me where i'm making mistake.
>
> Clear[x];
> r=1;
> K=1;
> eqn= (x^')[t]-r  x[t]  (1-x[t]/K)==0//Simplify;
> sol=NDSolve[{eqn,x[0]==1/2,x'[0]==0},x[t],{t,0,50}][[1]]
> ParametricPlot[Evaluate[{x[t]/.sol,D[x[t]/.sol,t]}],{t,0,50},Frame->True,AxesLabel->{"x",Overscript[x,"."]},AspectRatio->1]
> ParametricPlot[Evaluate[{t,x[t]/.sol}],{t,0,50},Frame->True,AxesLabel->{"t","x"},AspectRatio->1]
>
>
> Regards,
> rc
>



  • Prev by Date: Re: can somebody help ?
  • Next by Date: Recover lost PGP passphrase with Mathematica! (Done)
  • Previous by thread: Re: Differential Equation: Not getting result
  • Next by thread: Re: Differential Equation: Not getting result