CAS command question
|
01-04-2017, 08:37 PM
Post: #21
|
|||
|
|||
RE: CAS command question
(01-04-2017 04:01 PM)Han Wrote: Regarding your comment on the second case... I'm not sure I follow. The example I gave shows how to use strings and still not have it evaluate anything -- just add ' to the start and end of the string. Second point by way of Example. Here is a linear programming problem: p=3x+2y ==> Objective Function s.t. 2x+3y<=12 2x+y<=8 ==> Constraints Then as part of a program, the user is asked to key in each of those expressions. The program's input structure receives the above as a list of string objects: L9:={"p=3x+2y","2x+3y<=12","2x+y<=8 "}; I was referring to: CAS("left(CAS(L9(I)))"); where I is a loop variable, as being a straight forward way to parse left sides of each expression in the list, IF left() could be depended upon to yield the left side, which it can't, when the inequality sign is "<". I think you were referring to: The second case uses evaluation. left(CAS(" 'x+y<4' ")) will return x+y. The distinction being the additional requirement for the single quotes. (Apologies for the confusion). Both of Arno K's comments are fitting, but I was referring to his first, "left is left, and right is right" comment. That says it all. The user solving the example problem would not need to be concerned about the intrinsic system level details, and can input the expressions as found, no need to worry about evaluation, format, or other internal concerns. Even more so, if tasked with creating a program solver for this example. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)