Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

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



  • Prev by Date: Resetting after SetOptions
  • Next by Date: Inv.Interpol.Function
  • Previous by thread: Resetting after SetOptions
  • Next by thread: Re: function evaluations with NDSolve