Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #4165
| From | Oliver Ruebenkoenig <ruebenko@wolfram.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Integrating Interpolating function |
| Date | 2011-08-03 23:26 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j1clem$g71$1@smc.vnet.net> (permalink) |
| References | <201108031107.HAA10850@smc.vnet.net> |
On Wed, 3 Aug 2011, math_new wrote:
> Hi,
>
> I solve a system of differential equations using NDSolve up to time
> t_end. which gives me something like
>
> sol = {f->InterpolatingFunction}
>
> Now I want to do an integral like that
>
> Integrate[t*f[t],{t,0,tend}]
>
> but it won't be computed. What am I doing wrong?
>
> Cheers
>
>
Hi
s = NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 30}]
NIntegrate[t*s[t], {t, 0, 30}]
does what you are looking for.
Hth,
Oliver
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Integrating Interpolating function Oliver Ruebenkoenig <ruebenko@wolfram.com> - 2011-08-03 23:26 +0000
csiph-web