Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*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 2005

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

Search the Archive

Delayed Evaluation of NDSolve Arguments

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62945] Delayed Evaluation of NDSolve Arguments
  • From: "ben" <benjamin.friedrich at gmail.com>
  • Date: Fri, 9 Dec 2005 05:10:26 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Dear All,

is there a way to prevent NDSolve to evaluate its arguments
right on the spot?

Inside my differential equation

x'[t]=F[x[t],t,f[x[t],t]],

I want to use a function f[x,t] which
makes only sense, when called with
numeric arguments.
So everything would be fine, if NDSolve
would evaluate the differential equation
at each time step.
However, the differential equation is only
evaluated once at the beginning, and
then only numerical values are plugged
into the evaluated equation at each time step.

Below is a baby example of my problem

f[t_]:=If[NumericQ[t],1,0];

sol=NDSolve[{x'[t]==f[t],x[0]==0},x[t],{t,0,1}];

x[t]/.sol[[1]]
0. 
(* I want x[t]=t ! *)

Any help would be appreciated
Benjamin


  • Prev by Date: Re: general nth term of series
  • Next by Date: Re: exponential diophantine equations
  • Previous by thread: Re: Re: Using The Random Function to predict Things
  • Next by thread: Re: Delayed Evaluation of NDSolve Arguments