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

MathGroup Archive 2012

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

Search the Archive

Re: NDSolve with NIntegrate where Integral is a function of x

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127358] Re: NDSolve with NIntegrate where Integral is a function of x
  • From: Oliver Ruebenkoenig <ruebenko at wolfram.com>
  • Date: Fri, 20 Jul 2012 03:48:32 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net


On Thu, 19 Jul 2012, Nikthecrab wrote:

> I am trying to solve a differential equation using NDSolve . It is of the form:
>
> NDSolve[{y'[x]=f(x)*Integrate[g(x,t),{t,0,infinity}],y[0]=0.04},y[x],{x,0,10}]
>
> here f is a function of x and g is a function of x and a dummy variable t for integration.
> The integral cannot be solved directly in terms of x.So I tried using NIntegrate.But NIntegrate requires x to be a number while NDSolve clearly has to vary x from 0 to 10. Can anyone suggest a suitable solution to this problem?
>
>

Hi,

Unfortunately, your code is not valid so here is an only an idea. Make the 
NIntegrate a function with a NumericQ pattern like so:

myFun[x_?NumericQ]:=NIntegrate[...]

Oliver





  • Prev by Date: Re: Sending an interrupt to the frontend?
  • Next by Date: How to Scale and vary plot for a Differential Equation
  • Previous by thread: NDSolve with NIntegrate where Integral is a function of x
  • Next by thread: Re: NDSolve with NIntegrate where Integral is a function of x