MathGroup Archive 2004

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

Search the Archive

Re: Garbage collection problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg51896] Re: Garbage collection problem
  • From: sean_incali at yahoo.com (sean kim)
  • Date: Thu, 4 Nov 2004 01:50:52 -0500 (EST)
  • References: <cm7d0u$lho$1@smc.vnet.net> <cma0s1$8vg$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

actually it should have been 

In[1]:=
(*Setup*)eq={9.8*(0.99*Cos[qS[t]]+0.01*Cos[qH[t]+qS[t]])-0.01*Sin[qH[t]]*
            qH'[t]*qS'[t]-0.01*Sin[qH[t]]*
            qH'[t]*(qH'[t]+qS'[t])+(0.001+0.01*Cos[qH[t]])*
            qH''[t]+(0.982+0.02*Cos[qH[t]])*qS''[t]\[Equal]0,
      0.1*Cos[qH[t]+qS[t]]+0.01*Sin[qH[t]]*qS'[t]^2+0.001*
            qH''[t]+(0.001+0.01*Cos[qH[t]])*qS''[t]\[Equal]0,
      qS[0]\[Equal]1.71,qS'[0]\[Equal]-1.01,qH[0]\[Equal]2.84,
      qH'[0]\[Equal]1.1};
vars={qS[t],qH[t],qS'[t],qH'[t]};
test=qH[t]\[GreaterEqual]Pi&&
        2*Cos[qH[t]/2]*Cos[qH[t]/2+qS[t]]*Sin[Pi/180]+
            Cos[Pi/180]*(Cos[qS[t]]*Sin[qH[t]]+(1+Cos[qH[t]])*
                    Sin[qS[t]])<-0.01&&
        Cos[qH[t]+qS[t]]*Derivative[1][qH][t]+(Cos[qS[t]]+Cos[qH[t]+qS[t]])*
              Derivative[1][qS][t]<-0.01||Abs[qH[t]]<Pi/6||Sin[qS[t]]<1/4;
$HistoryLength=0;
(*end*)




In[29]:=
arun[do_]:= Module[{}, Do[ soln=NDSolve[eq,vars,{t,0,2}][[1]];, {do}] ]


In[30]:=
arun[20]
MemoryInUse[] 

Out[31]=
2827840

In[26]:=
brun[do_]:= 
  Module[{}, 
    Do[ soln=NDSolve[eq,vars,{t,0,2},StoppingTest->test][[1]]; , {do}]] 


In[27]:=
brun[20] 
MemoryInUse[] 


Out[28]=
2800832


  • Prev by Date: Re: How to include images and graphics in Mathematica
  • Next by Date: Re: Re: Null entry in a Graphics list?
  • Previous by thread: Re: Garbage collection problem
  • Next by thread: Re: Garbage collection problem