Piecewise graphs
Moderator: DPlotAdmin
Piecewise graphs
Hi David, any chance there's some way to graph piecewise functions? Ie...y = a + b*(x-L)^4, but only graph where (x-L) >= 0?
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Start at x=L? 
I'm guessing that's not what you're after, though.
If you want to plot a function that results in an illegal operation for certain ranges of X (say sqrt of a negative number) you can use if(test,if true,if false) (more or less identical to the form used in Excel). Set the "if false" part to some constant well outside the range in Y you're interested in, then use Options>Amplitude limits to set the range outside which points will be ignored.

I'm guessing that's not what you're after, though.
If you want to plot a function that results in an illegal operation for certain ranges of X (say sqrt of a negative number) you can use if(test,if true,if false) (more or less identical to the form used in Excel). Set the "if false" part to some constant well outside the range in Y you're interested in, then use Options>Amplitude limits to set the range outside which points will be ignored.
Visualize Your Data
support@dplot.com
support@dplot.com
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
If F (your m) is a whole number, then this will work:
if(x-K<0,A+C*x^D,A+B*(x-K)^F+C*x^D)
(where K is your L)
If F is not a whole number you'll have to do some manual operations to get this to work. The problem in DPlot is that both the "if true" and "if false" parts are evaluated, whether the test is true or not. Off the top of my head I can't think of a good workaround in this case; you'll have to generate one curve for (x-K)<0 and another for (x-K)>=0, then lump the two together with Edit>Combine Curves.
if(x-K<0,A+C*x^D,A+B*(x-K)^F+C*x^D)
(where K is your L)
If F is not a whole number you'll have to do some manual operations to get this to work. The problem in DPlot is that both the "if true" and "if false" parts are evaluated, whether the test is true or not. Off the top of my head I can't think of a good workaround in this case; you'll have to generate one curve for (x-K)<0 and another for (x-K)>=0, then lump the two together with Edit>Combine Curves.
Visualize Your Data
support@dplot.com
support@dplot.com