Generates X,Y pairs between a start and end point with a specified interval using a function of X and/or one or more Y values from existing curves. Y values from existing curves are included in the equation as "Yn", where n is the index of the curve. You are limited to the first nine existing curves (Y1, Y2, ... Y9). Curves used in the equation must have monotonically increasing X values.
Function (sin, cos, etc.) arguments must be in parentheses. See the list of available functions.
You can use placeholder codes for certain data parameters. For example “$YMAX(2)” will be replaced with the maximum Y value of the second curve. For more information on placeholder codes click here.
You can create conditional equations with the if function. The if function takes the form if(test,if_true,if_false), where test is the condition you want to check, if_true is the value the equation takes if test is true, and if_false is the value taken if test is false. For example, "if x > 5 then z=x^2, otherwise z=(10-x)^2" can be expressed with if(x<5,x^2,(10-x)^2).
By default, angular input values are in radians. You can set angles to degrees by clicking the degrees option button.
DPlot will automatically substitute the value of pi (3.141592653589793...) for "PI", "pi", or "Pi"
NOTE: Be specific. DPlot does not interpret "2X" as "2*X".
If you leave either the from X or to X boxes blank, DPlot assigns default values as follows:
If the equation includes Y terms, the from X value is set to the maximum starting X value for all curves included in the equation. The to X value is set to the minimum ending X value for those same curves.
Otherwise, if the document contains any curve, from X is set to the minimum starting X for all curves; to X is set to the maximum ending X value.
If the document contains no curves, from X is set to 0 and to X is set to 1.
For every generated X value, if the equation contains Y terms then DPlot interpolates the appropriate curve to find the value of Y to substitute in the equation. If X is outside the extents of the curve, then the corresponding Y value is set to 0.
Example:
This example shows a curve fit to input data and the square of the errors between the curve fit and the input. The third curve was generated with the equation "(Y2-Y1)^2".

This command makes use of the RunicSoft Function Parser from Andreas Hartl (FParser.dll in the DPlot folder).
Prevent divide by zero errors
If this box is unchecked, DPlot will trap divide by zero errors, report the value of x where the error occurred, and will not generate a curve. If this box is checked and the equation has one or more X terms, when DPlot traps a divide by zero it will shift x by a very small number and attempt the calculation again. This feature might be useful for generating curves of certain functions that would normally fail at specific values of x, e.g. sin(x)/x at x=0.
|
Related macro commands |
Page url: http://www.dplot.com/help/index.htm?helpid_funcy.htm