DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Subtracting 2 curves

 
Post new topic   Reply to topic    DPlot Forum Index -> Suggestions/Questions
View previous topic :: View next topic  
Author Message
bfennema



Joined: 23 Oct 2011
Posts: 7
Location: Bray, Ireland

PostPosted: Sun Oct 23, 2011 8:33 am    Post subject: Subtracting 2 curves Reply with quote

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.
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2016
Location: Vicksburg, Mississippi

PostPosted: Sun Oct 23, 2011 12:00 pm    Post subject: Reply with quote

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).
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bfennema



Joined: 23 Oct 2011
Posts: 7
Location: Bray, Ireland

PostPosted: Mon Oct 24, 2011 3:58 am    Post subject: Reply with quote

Worked as you said - I thought F(x) needed to be included in the syntax - my mistake.

B.
_________________
Best regards,

Boris Fennema
Back to top
View user's profile Send private message
dcl9000



Joined: 28 Mar 2011
Posts: 15

PostPosted: Fri Jun 01, 2012 6:40 pm    Post subject: Y=f(X,Y1,Y2,...) works for the first 9 curves only! Reply with quote

Hi!

Is there a way to remove this 9 curves limit? I have 12 curves....
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2016
Location: Vicksburg, Mississippi

PostPosted: Fri Jun 01, 2012 9:14 pm    Post subject: Reply with quote

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>.
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jsc



Joined: 02 Dec 2005
Posts: 189

PostPosted: Sat Jun 02, 2012 8:21 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
dcl9000



Joined: 28 Mar 2011
Posts: 15

PostPosted: Fri Jun 08, 2012 12:43 pm    Post subject: Reply with quote

Hope this limit can be removed soon.....
Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> Suggestions/Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group