[SOLVED] LNAME  exctracting variables from stringed expression?

01162017, 11:41 AM
(This post was last modified: 01162017 11:42 AM by DrD.)
Post: #2




RE: LNAME  exctracting variables from stringed expression?
I can share this, and hopefully, it's helpful for you and others ...
(You can copy each command line up to the semi, and paste into the command entry for testing): 1. Example: b:="X+Y<4"; // We know X,Y are reserved vars, so: LNAME(CAS("CAS(b)")); // ==> {}; 2. Convert to lower case variables, one way to avoid reserved vars: b:=LOWER(b); // X+Y<4 ==> x+y<4 LNAME(CAS("CAS(b)")); // ==> {x,y} LNAME(CAS("right(CAS(b)")); // ==> {x,y} I won't mention the CAS left/right thing. 3. Extending the example to your case: b:="(XY)"; ==> similar to your expression, using X and Y b:=LOWER(b); ==> non reserved variables LNAME(CAS("CAS(b)")); // ==> {x,y} LNAME(CAS("left(CAS(b)")); // ==> {x} I won't mention the CAS left/right thing. b:= "(CA)"; ==> Precisely your provided expression b:=LOWER(b); ==> To get nonreserved variables LNAME(CAS("CAS(b)")); // ==> {} // Check to see if there was any preexisting content in variables c or a: // I previously used a and c, so let's change to different variables: "(GF)" b:= "(GF)"; ==> Modeling your provided expression b:=LOWER(b); ==> To get nonreserved variables LNAME(CAS("CAS(b)")); // ==> {g,f} Summary: 1. LNAME is shown in the [Toolbox] and command entry, as a Home command, and shown in the [Help] as a CAS command. 2. LNAME requires nonreserved variables, (symbolics only). 3. Possibly one way to get nonreserved variables is to shift them to lower case equivalents. They must not preexist, only symbolic. 4. An LNAME acceptable string argument can get "evaluated" in the CAS system using the CAS command. 5. Be careful when using the CAS to obtain left or right expressions from a statement. The opinions expressed, may not be your own. Dale 

« Next Oldest  Next Newest »

Messages In This Thread 
[SOLVED] LNAME  exctracting variables from stringed expression?  chromos  01162017, 09:34 AM
RE: LNAME  exctracting variables from stringed expression?  DrD  01162017 11:41 AM
RE: [SOLVED] LNAME  exctracting variables from stringed expression?  Han  01162017, 02:46 PM
RE: LNAME  exctracting variables from stringed expression?  Didier Lachieze  01162017, 12:23 PM
RE: LNAME  exctracting variables from stringed expression?  chromos  01162017, 12:38 PM
RE: [SOLVED] LNAME  exctracting variables from stringed expression?  DrD  01162017, 03:05 PM
RE: [SOLVED] LNAME  exctracting variables from stringed expression?  DrD  01162017, 03:33 PM

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