Post Reply 
Plus42 algebraic expressions update
03-06-2021, 05:48 PM (This post was last modified: 03-06-2021 06:02 PM by Vincent Weber.)
Post: #82
RE: Plus42 algebraic expressions update
(02-25-2021 05:39 PM)Thomas Okken Wrote:  
(02-25-2021 05:32 PM)Vincent Weber Wrote:  Also, it would be great to define functions rather than just equations, like DEF F(X,Y,Z)=X+Y+Z, and reuse them in either equations or RPN program.

The DEF syntax isn't needed. The function already defines its formal parameters simply by using them, i.e. the mechanism by which the calculator decides which variables to show in the CALC menu.

The way I see it, you should be able to write, for example,

QUAD:X^2-3*X+2

Or

LBL "QUAD" MVAR "X" RCL "X" X^2 LASTX 3 * - 2 + END

and use both exactly the same way, calling them using XEQ, or from SOLVE or INTEG.

(An expression containing an equals sign would be evaluated by evaluating the LHS and RHS separately and then subtracting them from each other. I believe this is how the numerical solver in the 17B and 27S works as well. Conversely, an expression without an equals sign is interpreted by adding =0 to it when solved symbolically.)
Also given this another thought. How will this work to reuse functions in other equations ? Will the implied ordering of variables based on "first appeared / first in the list", i.e if I define F:X+Y+Z, then using F(1:2:3) in another equation will mean calling F with X=1, Y=2, Z=3 ? Then we need to keep in mind that the order of appearance of variables in the 27S can be altered using G(), e.g. F:X+Y+Z+Y^2 will show X,Y,Z, but F: X+G(Y)+Z+Y^2, while functionally equivalent, will show X,Z,Y - not too sure how to articulate that the order of formal parameters for a function...

Cheers
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Plus42 algebraic expressions update - Vincent Weber - 03-06-2021 05:48 PM



User(s) browsing this thread: 1 Guest(s)