Page 1 of 1
Subtracting 2 curves
Posted: Sun Oct 23, 2011 8:33 am
by bfennema
One of the things I need to do is to subtract two curves. They are both plotted against time.
I tried F(X,Y1,Y2)
As an example I am trying to subtract
Y1:sin(x)
Y2= 2* sin(x) + 10
I use Generate F(X,(y1-y2)
and get the error message
"too many parameters at X=0."
I tried straight lines and with the same message and I tried excluding 0 from the start, with the same result.
So I think I am doing something wrong, but cannot see what.
Any ideas ?
P.s. I also found the SubtractCurves macro - how do I execute this in DPlot ?
Thanks for the help,
Boris.
Posted: Sun Oct 23, 2011 12:00 pm
by DPlotAdmin
The function you want is simply
Y1-Y2
(or Y2-Y1).
SubtractCurves does exactly the same thing. To use it in a macro just type
SubtractCurves(1,2) (or whatever curve indices are appropriate).
Posted: Mon Oct 24, 2011 3:58 am
by bfennema
Worked as you said - I thought F(x) needed to be included in the syntax - my mistake.
B.
Y=f(X,Y1,Y2,...) works for the first 9 curves only!
Posted: Fri Jun 01, 2012 6:40 pm
by dcl9000
Hi!
Is there a way to remove this 9 curves limit? I have 12 curves....
Posted: Fri Jun 01, 2012 9:14 pm
by DPlotAdmin
Sorry, no. That's a poor design decision on my part that I haven't worked around yet, but hope to sooner or later.
If you want the nuts and bolts of it, the function parser I use (which is otherwise excellent) takes letters A-Z as variables - 1 character only. DPlot reserves A-K as constants (skipping E because that would be confusing) and substitutes the next 9 letters L-T for Y1 - Y9. X, Y, and Z are reserved for obvious reasons. That leaves U, V, W for Y10, Y11, Y12, which I could do easily enough. But I'd rather remove the 1-character limitation so that you could have Y1-Y<whatever>.
Posted: Sat Jun 02, 2012 8:21 am
by jsc
Just to horn in, I'm bumping the 9 curve limit on one of the projects that I use DPlot for, so a few more curves would be nice! I'm shuffling curves to another plot, then adding them back to the mix. 2 or 3 more would be helpful. More than that, and I'm beyond MY limit to keep track of what I'm doing!
Posted: Fri Jun 08, 2012 12:43 pm
by dcl9000
Hope this limit can be removed soon.....
Thanks!