NDSolve

*To*: mathgroup at smc.vnet.net*Subject*: [mg3688] NDSolve*From*: FERRUCCIO Renzoni <renzoni at fexphds04.tu-graz.ac.at>*Date*: Fri, 5 Apr 1996 02:54:11 -0500*Sender*: owner-wri-mathgroup at wolfram.com

Dear Mma Users, in a program I use several times the following: o = -4.; ls = Table[ 0,{j,1,81}]; Do[ diff = NDSolve[ eq,var,{t,0.,tf},ms]; ls[[i]] = {o,NIntegrate[(p/. diff)[[1]],{t,ti,tf}, MinRecursion -> 5,MaxRecursion -> 12]}; qu[o,.5] = ( p /. t -> .5 /. diff )[[1]] ; qu[o,3.5] = ( p /. t -> 3.5 /. diff )[[1]]; qu[o,6.5] = ( p /. t -> 6.5 /. diff )[[1]]; qu[o,9.5] = ( p /. t -> 9.5 /. diff )[[1]]; qu[o,12.5] = ( p /. t -> 12.5 /. diff )[[1]]; qu[o,15.5] = ( p /. t -> 15.5 /. diff )[[1]]; ClearAll[diff]; o = o + 0.1, {i,1,81} ]; So I would like write it as a routine at the beginning of the program (I don't like packages because I have already lot of files!). How can I write in compact way such a routine that has as input "eq,var,tf,p" and as output ls and qu ? Thanks a lot. F. Renzoni renzoni at fexphds04.tu-graz.ac.at ==== [MESSAGE SEPARATOR] ====