Plotting piecewise parametric function

AI Thread Summary
The discussion centers on plotting parametric piecewise curves defined by specific equations for two intervals of t (1 < t < 2 and 2 < t < 3). Users seek software recommendations for creating these plots, with Excel being highlighted as a straightforward option. Instructions for implementing the equations in Excel are provided, detailing how to use conditional formulas for x(t) and y(t). While some users express surprise at the limitations of other software like gnuplot, Maple, Octave, and Mathematica, a Mathematica solution is also shared. The resulting plot is described as linear, with a log-log version showing slight curvature. Questions arise about the necessity of specific PlotRange values in Mathematica, indicating a desire for clarity on plot customization.
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
Views
2K
Replies
1
Views
2K
Replies
1
Views
1K
Replies
2
Views
3K
Replies
2
Views
2K
Replies
9
Views
5K
Back
Top