Message Boards Message Boards

Problems using Manipulate to plot a parametric equation

Posted 10 years ago
Attachments:
POSTED BY: Mitchell Sandlin
3 Replies
POSTED BY: Lou D'Andria

Thanks for the reply and your solution works perfectly. However, there still seems to be an inconsistency in the way Mathematica handles variables using the Manipulate command. The section of code I sent you was just a portion of the total code – see attached for complete file.

In the complete file, I used two other variables “speed” and “dist” in addition to “f”, “g” and “c”. In the attached example, I cannot understand why the variable “speed” is not required to be inside the Manipulate command like the rest of the variables.

Additionally, I created the file using an example. In the example, it appears that all the variables are in the same code block but just before the Manipulate command, and that code seems to work. Possibly the example is an older version, but it creates confusion.

In any event, I am still interested in learning why the variable “speed” is treated differently than all the other variables used in the Manipulate command.

Thanks,

Mitch Sandlin

Attachments:
POSTED BY: Mitchell Sandlin
Posted 10 years ago
Manipulate[

 f[t_] := E^(-a*t)*Cos[b*t];
 g[t_] := E^(-a*t)*Sin[b*t];
 c[t_] := {f[t], g[t]};

 Grid[{{Show[
     ParametricPlot[c[t], {t, 0, B}, PlotStyle -> {Thick, Blue}, 
      PerformanceGoal -> "Quality"], 
     ListPlot[{c[B]}, PlotStyle -> {Black, PointSize[0.02]}], 
     AxesLabel -> {"x", "y"}, PlotRange -> 1.2, ImageSize -> Medium, 
     AxesOrigin -> {0, 0}]}}],

 {B, 0.00001, 4 \[Pi]}, {{a, 1}, 0.1, 10}, {{b, 1}, 0.1, 10}]
POSTED BY: Simon Tyran
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract