Plotting piecewise parametric function

In summary, the conversation discussed a request to plot a parametric piecewise curve on the same graph using different equations for two different ranges of t values. The possibility of using various software programs, such as Excel, gnuplot, maple, octave, and Mathematica, was also mentioned. A specific method for creating the plot using Excel and Mathematica was provided. The conversation ended with a question about the need for specific PlotRange values.
  • #1
fishingspree2
139
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
  • #2
Depends on how fancy you want the plot to look. It would be pretty easy to do in Excel.
 
  • #3
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?
 
  • #4
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.
 
  • #5
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}}]]
 
  • #6
Hello, where did you get the PlotRange values? Are they really needed?
 

Related to Plotting piecewise parametric function

1. What is a piecewise parametric function?

A piecewise parametric function is a mathematical function that is defined by different equations or expressions for different intervals or portions of the domain. This allows for a more complex and flexible representation of a function, as each portion can have its own set of parameters and conditions.

2. How is a piecewise parametric function plotted?

To plot a piecewise parametric function, you first need to determine the equations or expressions that define each portion of the function for different intervals. Then, you can plot each portion separately and connect them at the points where the intervals meet. This will result in a piecewise curve that represents the function.

3. What are the advantages of using a piecewise parametric function?

One advantage of using a piecewise parametric function is that it allows for a more precise and accurate representation of a complex function. It also allows for more flexibility in terms of defining different parameters and conditions for different intervals. Additionally, it can be useful in situations where a single equation or expression cannot fully describe a function.

4. Are there any limitations to using a piecewise parametric function?

One limitation of using a piecewise parametric function is that it can be more difficult to work with and understand compared to a regular function with a single equation. It also requires more calculations and plotting to fully represent the function. Additionally, if the intervals are not defined properly, it can lead to discontinuities or inaccuracies in the function.

5. How can a piecewise parametric function be used in scientific research?

A piecewise parametric function can be used in scientific research to model and analyze complex systems, such as in physics, biology, and economics. It can also be used to study and understand the behavior of functions that cannot be fully described by a single equation. Additionally, it can be used to make predictions and test hypotheses in various fields of science.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
414
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
419
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
984
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top