Re: animation question
- To: mathgroup at smc.vnet.net
- Subject: [mg71187] Re: animation question
- From: "dimitris" <dimmechan at yahoo.com>
- Date: Fri, 10 Nov 2006 06:37:42 -0500 (EST)
- References: <eiurmk$ggr$1@smc.vnet.net>
Thanks to David Park I found a solution to my problem Clear["Global`*"] fr[n_] := Plot[(Sqrt[7*x^4 + 6*x + 5] - Sqrt[7*x^4 + 3*x + 3])*Sqrt[63*x^2 - 5*x + 20], {x, 0, n}, PlotRange -> {{0, 10}, {2, 6.5}}, Frame -> {True, True, False, False}, Epilog -> {Red, Line[{{0, 4.5}, {10, 4.5}}]}] Table[fr[n], {n, 1, 10, 0.1}]; SelectionMove[EvaluationNotebook[], All, GeneratedCell]; FrontEndTokenExecute["CellGroup"] FrontEndTokenExecute["OpenCloseGroup"] Here is another solution I thought fr2[n_] := Plot[(Sqrt[7*x^4 + 6*x + 5] - Sqrt[7*x^4 + 3*x + 3])*Sqrt[63*x^2 - 5*x + 20], {x, 0, n}, PlotRange -> {{0, 10}, {2, 6.5}}, Frame -> {True, True, False, False}, AxesOrigin -> {0, 4}, AxesStyle -> Red] Table[fr2[n], {n, 1, 10, 0.1}]; SelectionMove[EvaluationNotebook[], All, GeneratedCell]; FrontEndTokenExecute["CellGroup"] FrontEndTokenExecute["OpenCloseGroup"] Yet another solution which offers better animation hadling (thanks again David!) << "Graphics`Animation`" fr[n_] := Plot[(Sqrt[7*x^4 + 6*x + 5] - Sqrt[7*x^4 + 3*x + 3])*Sqrt[63*x^2 - 5*x + 20], {x, 0, n}, PlotRange -> {{0, 10}, {2, 6.5}}, Frame -> {True, True, False, False}, Epilog -> {Red, Line[{{0, 4.5}, {10, 4.5}}]}] Animate[fr[n], {n, 1, 10, 0.1}]; SelectionMove[EvaluationNotebook[], All, GeneratedCell] FrontEndTokenExecute["OpenCloseGroup"]; Pause[0.5]; FrontEndExecute[{FrontEnd`SelectionAnimate[200, AnimationDisplayTime®0*0.1, AnimationDirection -> Forward]}] Regards Dimitris dimitris wrote: > Consider the simple animation > > fr[n_] := Show[Plot[(Sqrt[7*x^4 + 6*x + 5] - Sqrt[7*x^4 + 3*x + > 3])*Sqrt[63*x^2 - 5*x + 20], {x, 0, n}, > PlotRange -> {{0, 10}, {2, 6.5}}, Frame -> {True, True, False, > False}], Graphics[{Red, Line[{{0, 4.5}, {10, 4.5}}]}]] > > Table[fr[n], {n, 1, 10, 0.1}]; > SelectionMove[EvaluationNotebook[], All, GeneratedCell]; > FrontEndTokenExecute["CellGroup"] > FrontEndTokenExecute["OpenCloseGroup"] > > How is possible to hold the red line (which has the meaning of the > limit as x->infinity; try > Limit[(Sqrt[7*x^4 + 6*x + 5] - Sqrt[7*x^4 + 3*x + 3])*Sqrt[63*x^2 - 5*x > + 20], x -> Infinity]) > fixed (i.e. not "animated")? > > I think where I have inserted the graphic primitive I can't avoid this. > But I can't think something other. > > Regards > Dimitris