Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10993

Re: What is best trick to eliminate flicker in simulation animation?

From "Nasser M. Abbasi" <nma@12000.org>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: What is best trick to eliminate flicker in simulation animation?
Date 2012-07-20 07:54 +0000
Message-ID <jub2r4$ehu$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


On 7/19/2012 2:59 AM, Nasser M. Abbasi wrote:

Opps, I seem to have pasted an older cell somehow. Please
ignore last code, here it is again (was missing 2 lines, do
not know how this happened).

thanks,
--Nasser

-----------------------
ClearAll["`*"];
g=9.8; m=30; f=1; L0=4;
k=m*(2*Pi*f)^2;

eq1=x1'[t]==x2[t];
eq2=x2'[t]==x1[t]*x4[t]^2-g*Cos[x3[t]]-(k/m)*(x1[t]-L0);
eq3=x3'[t]==x4[t];
eq4=x4'[t]==-(g/x1[t])Sin[x3[t]]-2*x2[t]*x4[t]/x1[t];
ic={x1[0]==L0,x2[0]==0.,x3[0]==Pi/4.,x4[0]==0.};
sol=First@NDSolve[Flatten@{eq1,eq2,eq3,eq4,ic},{x1,x2,x3,x4},{t,0,10}];

x=x1/.sol;
theta=x3/.sol;

Animate[
Graphics[{Red,Line[{{0,0},{x[t]*Sin[theta[t]],-x[t]*Cos[theta[t]]}}]},

PlotRange->{{-L0,L0},{-1.4L0,L0/2}},
ImageSize->300,
Frame->True,
Axes->False],
{t,0,10,.1},AnimationRunning->False]
--------------------------

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: What is best trick to eliminate flicker in simulation animation? "Nasser M. Abbasi" <nma@12000.org> - 2012-07-20 07:54 +0000

csiph-web