function evaluations with NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg36655] function evaluations with NDSolve
- From: "Higinio Ramos" <higra at usal.es>
- Date: Wed, 18 Sep 2002 02:09:30 -0400 (EDT)
- Reply-to: "Higinio Ramos" <higra at usal.es>
- Sender: owner-wri-mathgroup at wolfram.com
I pretend to know how many times the function f has to be evaluated when using NDSolve to solve a differential equation. I've tried : cont=0; f[x_]:=(cont++;x^2); NDSolve[ {y''[x]+y[x]==f[x],y[0]==1,y'[0]==0},y,{x,0,6}] I obtain the solution of the ODE but cont returns 1 instead the number of funtion evaluations. How can I obtain it? Thanks. Higinio Ramos