Re: a problem about NDSolve and NIntegrate
- To: mathgroup at smc.vnet.net
- Subject: [mg80001] Re: a problem about NDSolve and NIntegrate
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Fri, 10 Aug 2007 01:54:21 -0400 (EDT)
- Organization: Uni Leipzig
- References: <f9emog$lpq$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi, a) you mean f[c_?NumericQ] :=... and NumberQ because NumberQ is a test and you need ? in the pattern to apply the test. b) in you n[] function you use y[x] but only f[c] return something that include y[x] -- how shall n[] find aut that it need to compute f[c] to get y[] ?? Regards Jens lynn wrote: > Hello, > > I'm tring to solve a diffrential equation with > > its upper boundary as a variable. > > and then I want to integrate it, and define > > it as a funcion with two variable. > > However, I don't know why it doesn't work at the second step. > > > my equation is as following, > > f[c_?NumberQ]:=y[x]/.NDSolve[{eqn,y[0]==1,y'[0]==0},y,{x,0,c},MaxSteps- >> 10000][[1]] > > n[w_NumberQ,c_NumberQ]:=NIntegrate[c*y[x]*(r-w)],{r,w,1}] > > function f works well, however there's some problem in funcion n, > > and it's confused me for a long time..., > > thanks for your help!! > > Best Regards!! > Lynn > >