A problem with derivative InterpolatingFunction from NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg94680] A problem with derivative InterpolatingFunction from NDSolve
- From: bar at ANTYSPAM.ap.krakow.pl
- Date: Sat, 20 Dec 2008 06:20:29 -0500 (EST)
When i use an iteration with a derivative InterpolatingFunction Mathematica uses more than enough memory ( memory icreases in every steps) This is the sample: -------------- For[jj = 0, jj < 2, alf = N[1 - jj/20]; Print["alf= ", alf]; dj = 1/200; For[j = 0, j < 3, ni = N[1.2 + j dj]; start = 0; tmax = 4000; eq1 = u1''[t] + 5 alf u1[t] + ni u2[t] == 0; eq2 = u2''[t] + 3 u2[t] == 0; sol = NDSolve[{eq1, eq2, u1[0] == 1, u1'[0] == 0, u2[0] == 1, u2'[0] == 0}, {u1, u2}, {t, 0, tmax}, MaxSteps -> Infinity]; U1[t_] := Evaluate[u1[t] /. sol][[1]]; U2[t_] := Evaluate[u2[t] /. sol][[1]]; F[t_] := U1[t] + U2[t]; (*POINCARE ** ** ** ** **********) lista = {}; start = 1500.; T = 2 Pi/ni; nt = 400; AppendTo[lista, {U1[100], U1'[100]}]; Print[jj, j, " ", MemoryInUse[]]; j++]; jj++] --------------------- When I try U1[t] in place of U1'[t] everything's ok (MemoryInUse gives the same in all steps) Clear[u1,u2,U1,U2] doesn't help. Any suggestions ? Regards, Olaf