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: [mg127372] Re: NDSolve with NIntegrate where Integral is a function of x
  • From: psycho_dad <s.nesseris at gmail.com>
  • Date: Fri, 20 Jul 2012 03:53:13 -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: <ju8e8b$98m$1@smc.vnet.net>

Hi dude,
Your solution had a few problems I'm afraid. For example, in NDSolve you should always write y'[x]==... and not y'(x)=..  (note the == and the [] instead of = and () ). Also, the same applies for the initial condition y[x]=..

The following seems to work (with a few warnings).

f[x_]:=x^2
g[x_?NumberQ,t_?NumberQ]:=Sin[x*t]
sol=NDSolve[{y'[x]==f[x]*NIntegrate[g[x,t],{t,0,1}],y[0]==0.04},y[x],{x,0,10}][[1]];
Plot[y[x]/.sol,{x,0,10}]

Cheers



  • Prev by Date: Options to know shape of functions
  • Next by Date: Finding a sum
  • Previous by thread: Re: NDSolve with NIntegrate where Integral is a function of x
  • Next by thread: Re: NDSolve with NIntegrate where Integral is a function of x