12-05-2015, 02:42 PM (This post was last modified: 12-05-2015 05:31 PM by dg1969.)
Post: #1
 dg1969 Member Posts: 108 Joined: Apr 2014
I just add this suggestion for improvement on tricider list:

The ability to plot families of curves inside the function APP.

For examples:

F1(X) : SIN({1,0.2,5}*X) => 3 curves in a single entry SIN(X) ; SIN(0.2*X) ; SIN(5*X)

F2(X) : X^{2*{1:2,0.5}} => 3 curves X^2; X^(2*1.5); X^(2*2)

F3(X) : {1,2}*X^2+{2,3}*X => 2 curves X^2+2*X; 2*X^2+3*X

F4(X) : [1,2]*X^2+[2,3]*X => 4 curves (1,2); (1,3); (2,2); (2,3)

mixed form ?

What could be the best syntax ?
12-05-2015, 06:49 PM
Post: #2
 Tim Wessman Senior Member Posts: 2,270 Joined: Dec 2013
Standard list processing would be used - so your F1 and F3. Introducing a new syntax wouldn't be such a great idea.

However, these are not the problem areas. The problem starts to happen when you have places where there are different numbers of curves/results in different places on the curve. For example, somewhere where you had this:

peicewise(x<2,{1,2,3}*X,SIN(-{1,2}))

Things like that can really throw the graphing engine for a loop and it is unclear exactly how best to handle it. Once we figure out how to do so the rest is pretty easy since automatic list processing already exists.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
12-05-2015, 08:23 PM (This post was last modified: 12-05-2015 08:28 PM by dg1969.)
Post: #3
 dg1969 Member Posts: 108 Joined: Apr 2014
(12-05-2015 06:49 PM)Tim Wessman Wrote:  For example, somewhere where you had this:
peicewise(x<2,{1,2,3}*X,SIN(-{1,2}))

In this case can we interpret this way ?

piecewise(x<2,1*X,SIN(-1))

piecewise(x<2,2*X,SIN(-2))

piecewise(x<2,3*X,NAN) "not a number" as usual when the function is not defined ?

So three curves in a single input...

Perhaps did I misunderstood your example... For sure I certainly did not imagine some problematic situations... But at first this possibility could be offered in a number of clearly documented basic case ?
12-06-2015, 05:13 PM
Post: #4
 Wes Loewer Senior Member Posts: 332 Joined: Jan 2014
(12-05-2015 06:49 PM)Tim Wessman Wrote:  The problem starts to happen when you have places where there are different numbers of curves/results in different places on the curve. For example, somewhere where you had this:

peicewise(x<2,{1,2,3}*X,SIN(-{1,2}))

Things like that can really throw the graphing engine for a loop and it is unclear exactly how best to handle it. Once we figure out how to do so the rest is pretty easy since automatic list processing already exists.

How about simply require that all lists be the same length? Basically, do what is done in Home by generating an error message whenever they are not the same length. (Please, not like what is done in CAS where missing elements are sometimes treated as zero, {1,2,3}+{3,4}={4,6,3}, and sometimes ignored, {1,2,3}*{3,4}={3,8}.)

This would be a really useful feature. I have a student using the Prime who recently asked about this as it is available on the TI calcs.
12-06-2015, 05:34 PM
Post: #5
 Wes Loewer Senior Member Posts: 332 Joined: Jan 2014
(12-05-2015 02:42 PM)dg1969 Wrote:  F2(X) : X^{2*{1:2,0.5}} => 3 curves X^2; X^(2*1.5); X^(2*2)

This could already be handled with the seq and mat2list commands
F2(X) : X^{2*mat2list(seq(K,K,1,2,0.5))}

It's too bad seq() doesn't just return a list instead of a vector.

Quote:F4(X) : [1,2]*X^2+[2,3]*X => 4 curves (1,2); (1,3); (2,2); (2,3)

This could get quickly out of hand.
F4(X) : [1,5]*X^2+[1,5]*X+[1,5]
would generate 125 curves. Typically, a user would want few enough curves to just use the other syntax.
F4(X) : {1,1,2,2}*X^2+{2,3,2,3}*X => 4 curves (1,2); (1,3); (2,2); (2,3)
12-06-2015, 08:06 PM
Post: #6
 jte Member Posts: 111 Joined: Feb 2014