Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

The code below generates the error when I attempt to export to CDF Preview:

Coordinate {xde[4.69588928222656], yde[4.69588928222656]} should be a pair of numbers, or a Scaled or Offset form.

Here is my code:

system = {x'[t] == 2 x[t] - 0.08 x[t] y[t], x[0] == 400,
   y'[t] == -y[t] + 0.01 x[t] y[t], y[0] == 25};

sol = NDSolve[system, {x[t], y[t]}, {t, 6}];

{xde[t_], yde[t_]} = {x[t], y[t]} /. Flatten[sol];

Animate[Show[
  ParametricPlot[{xde[t], yde[t]}, {t, 0, 5.4}, 
   AxesLabel -> {"Prey", "Predator"}, AspectRatio -> 1, 
   PlotRange -> {{0, 400}, {0, 80}}], 
  Graphics[{Red, PointSize[Large], Point[{xde[t], yde[t]}]}]], {t, 0, 
  5.4, AppearanceElements -> "PlayPauseButton"}, AnimationRate -> 0.5]

How can this be fixed? Thx.

share|improve this question
    
Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! –  ssch Oct 25 '13 at 13:57

1 Answer 1

You are just missing the SaveDefinitions -> True option in the Animate command.

share|improve this answer
    
You passed me in reputation: NOT ALLOWED! :) –  rcollyer Oct 25 '13 at 14:13
    
@rcollyer -- sorry, didn't mean to! –  bill s Oct 25 '13 at 14:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.