Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6781

Re: How to solve or approximate a first order differential equation ?

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How to solve or approximate a first order differential equation ?
Date 2011-11-27 09:17 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jasv6s$762$1@smc.vnet.net> (permalink)

Show all headers | View raw


Clear[y];

data = {{1, 0.033}, {2, 0.054}, {5, 0.088}};

With[{C = 1/9},
  Column[{
    model = DSolve[
       {y'[t] == -A (y[t])^2 + B (C - y[t]), y[0] == 0},
       y[t], t][[1]],
    param = FindFit[data, y[t] /. model, {A, B}, t],
    Plot[y[t] /. model /. param, {t, 0, Max[data[[All, 1]]]},
     ImageSize -> 400, AxesLabel -> {"t", "y[t]"},
     Epilog -> {Red, AbsolutePointSize[5], Point[data]}]}]] // Quiet


Bob Hanlon


On Sat, Nov 26, 2011 at 5:09 AM, Dino <dinodeblasio@gmail.com> wrote:
> Hello everyone,
>
> I have this first order differential equation:
>
> y'[t] = -A (y[t])^2 + B (C - y[t])
>
> where A and B are unknown constants and C is known constant.
> One condition is y[0]==0
>
> A and B should be determined by fitting a list of {y[i],t[i]} values.
>
> For this reason i would like to approximate my differential equation
> with a function which I could use to fit the data and find A and B.
>
> I don't know how to do this.
> Any help is highly appreciated.
>
> Thanks,

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: How to solve or approximate a first order differential equation ? Bob Hanlon <hanlonr357@gmail.com> - 2011-11-27 09:17 +0000
  Re: How to solve or approximate a first order differential equation ? Dino <dinodeblasio@gmail.com> - 2011-11-28 10:57 +0000
  Re: How to solve or approximate a first order differential equation ? Dino <dinodeblasio@gmail.com> - 2011-11-28 10:54 +0000
    Re: How to solve or approximate a first order differential equation ? Ray Koopman <koopman@sfu.ca> - 2011-11-29 12:04 +0000

csiph-web