Plotting piecewise parametric function

Click For Summary

Discussion Overview

The discussion revolves around plotting a piecewise parametric function defined for two intervals of the variable t. Participants explore various software options for creating the plot, including Excel, Mathematica, and other tools, while sharing specific formulas and methods for implementation.

Discussion Character

  • Technical explanation
  • Exploratory
  • Homework-related

Main Points Raised

  • One participant seeks advice on how to plot a piecewise parametric function using different software.
  • Another participant suggests that Excel can be used for this purpose, indicating it is straightforward.
  • A participant expresses skepticism about the capabilities of gnuplot, Maple, Octave, or Mathematica for this task, questioning the simplicity of the plotting process.
  • A detailed Excel formula is provided for calculating x and y values based on the piecewise definition of the function.
  • A participant shares a Mathematica code snippet for plotting the parametric equations, specifying the PlotRange for each segment.
  • Another participant questions the necessity of the specified PlotRange values in the Mathematica code.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best software for plotting the function, with differing opinions on the capabilities of various tools and the necessity of certain parameters in the plotting process.

Contextual Notes

Some participants express uncertainty about the effectiveness of certain software for this task, and there are unresolved questions regarding the appropriateness of the PlotRange values used in Mathematica.

fishingspree2
Messages
138
Reaction score
0
I want to plot on the same graph:

1 < t < 2
x(t) =1.146967180*(t-1)^3-2.178399723*(2-t)^3+38.3612214*t+106.1461765
y(t)=.3047483217*(t-1)^3-.5750322227*(2-t)^3+10.1163822*t+444.0230985

2 < t < 3
x(t)=-.4672626810*(t-2)^3+1.146967180*(3-t)^3+45.2430246*t+92.3825701
y(t)=-.1402738345*(t-2)^3+.3047483217*(3-t)^3+11.9448719*t+440.3661194

What software allows me to plot this, a parametric piecewise curve?

Thank you very much
 
Physics news on Phys.org
Depends on how fancy you want the plot to look. It would be pretty easy to do in Excel.
 
It isn't possible with gnuplot, maple, octave or mathematica? I can't believe such a simple thing is not possible :S

How to do it with excel?
 
fishingspree2 said:
How to do it with excel?

If your value of t is in cell A1, the following for x goes in B1:

Code:
=IF(A1>2,-0.467262681*(A1-2)^3+1.14696718*(3-A1)^3+45.2430246*A1+92.3825701,1.14696718*(A1-1)^3-2.178399723*(2-A1)^3+38.3612214*A1+106.1461765)

and the following in cell C1 for y:

Code:
=IF(A1>2,-0.1402738345*(A1-2)^3+0.3047483217*(3-A1)^3+11.9448719*A1+440.3661194,0.3047483217*(A1-1)^3-0.5750322227*(2-A1)^3+10.1163822*A1+444.0230985)

Took about 2 minutes. Plot isn't very inteststing - very linear. Log-log version has a slight curve to it. The other programs I (unfortunately) don't know at all.
 
In Mathematica:

Show[ParametricPlot[{1.146967180*(t - 1)^3 - 2.178399723*(2 - t)^3 +
38.3612214*t + 106.1461765,
0.3047483217*(t - 1)^3 - .5750322227*(2 - t)^3 + 10.1163822*t +
444.0230985}, {t, 1, 2}, PlotRange -> {{140, 200}, {440, 500}}],
ParametricPlot[{-0.4672626810*(t - 2)^3 + 1.146967180*(3 - t)^3 +
45.2430246*t +
92.3825701, -0.1402738345*(t - 2)^3 + .3047483217*(3 - t)^3 +
11.9448719*t + 440.3661194}, {t, 2, 3},
PlotRange -> {{140, 300}, {440, 500}}]]
 
Hello, where did you get the PlotRange values? Are they really needed?
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K