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


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

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

From psycho_dad <s.nesseris@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: NDSolve with NIntegrate where Integral is a function of x
Date 2012-07-20 07:56 +0000
Message-ID <jub2vr$eit$1@smc.vnet.net> (permalink)
References <ju8e8b$98m$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


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

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


Thread

NDSolve with NIntegrate where Integral is a function of x Nikthecrab <nikhil.dexter@gmail.com> - 2012-07-19 07:50 +0000
  Re: NDSolve with NIntegrate where Integral is a function of x psycho_dad <s.nesseris@gmail.com> - 2012-07-20 07:56 +0000

csiph-web