Post Reply 
Write an equation that contains several variables, and go immediately to solve them
03-07-2021, 09:45 PM (This post was last modified: 03-11-2021 11:53 AM by essen.)
Post: #11
RE: Write an equation that contains several variables, and go immediately to solve them
(02-28-2021 01:00 AM)CharlieF Wrote:  
(02-27-2021 09:45 AM)ramon_ea1gth Wrote:  I often use the HP 50g solver with MINIT, MITM and MSOLVR, working in a folder...


So do I. Very often. And... that is: working in a 'particular folder'.
And I do it very often. Exaggerating a bit: 'I couldn't live without them'!

By the way: do you know what is the folder (= memory area) in which I do that work? In a sub-sub-folder called "Home .1 .11". I suppose you can already guess why to do all that work in such a particular folder (a sub sub folder of Home). I'll give you the answer (which I'm sure you can guess): I have in the CST menu of that Home sub sub folder, I have a key in it assigned to a program (very simple program, with just two instructions) that… automatically deletes all the variables created in that sub sub-folder of HOME; and so I can make it clear the 'blackboard', to go on to solve the next problem in chemistry or physics. 'I couldn't live without CST menu, MINIT, MITM, MSOLVR, etc.!



(02-27-2021 09:45 AM)ramon_ea1gth Wrote:  My proposal for the HP-Prime would be this:
- Start the Solve app.
- From the Home screen, create the variables you need as app variables with this command: 0▶AVars({"PrXs_011","PreXs_053","PreTAM_034","LOCFm_01"})
- Press the Symb key and enter your equation. Your created variables are also available by pressing [Vars][Solve][Program]
This approach is also useful if you create new apps based on the Solve app, as you can store your variables as local app variables, avoiding clutter in the Home environment with global variables.


Great!!!!, excellent!!!!, fantastic!!!!!! Thank you very much, Ramón!!!

And an absolute novice idea: do you think we could combine, in a single program (in order to get the calculator to do it all while we are sitting on the sofaWink,
- that AVars command
- with... this one that I just discovered: lname (syntax: lname (Expres)) I am not sure if the command is written lname or LNAME
Its description is this:
- list of variables in the expression
- example: lname (exp (x) * 2sin (y)) returns [x, y]


I've checked for an equation..., and it works too.
Example: LNAME (AB_01= exp (x) * 2/B_37) returns this list [AB_01, x, B_37]


Thank you in advance.


--------------------------------------------------------------------------------
Lname()

The "l" in lname stands for list.

Try this:

Set your Prime in CAS mode.

Save your variables like this:
{MyA1,MyD1,MyC1,MyB1}:={5.3,-41,13.9, 1}
It' s never mind if one of these values are an unknown value.
You can even set it "" if wanted.
You now can se these variables in CAS-memory having these given values.

Rearrange your equation as you showed us, but in a style like this.
'0=MyA1*MyD1+MyC1*(MyB1+MyD1)'

Save it like so:
EQMIN:='0=MyA1*MyD1+MyC1*(MyB1+MyD1)'
It is essentiel your remember to quote it with ' '
Because anytime you fetch your equation it wil evaluate if not quoted.
You can now find this equation in CAS-memory.

Now do this:
lname(quote(EQMIN))
Again you must use quote, otherwise lname() will not function.
This will show you a list of your equations variables.

{MyA1,MyD1,MyC1,MyB1}

You are allowed to do it conversely. That is, you could had started storing
the equation. Then used the lname. Then used the found variable list
to store your variables value as shown.

Now you want to solved for 3 known and a third one unknown.
Say, MyB1

You have 3 that all works:
solve(EQMIN,MyB1,1)
or this one
fsolve(EQMIN,MyB1,1)
or this one
solvec(EQMIN,MyB1,1), for complex roots.

The "1" in these are just guesses. It can be necessary to try more guess
if you just get an empty bracket like []. Try also negative. And you sure will
get an empty bracket half of your trials, because these Prime solvers er really
bad designed. There has never been alike trouble with HP HP - 50. Of course,
if you saved an unknown variable with "", then solve that first.

I now shown you the bread and butter to build with. Though, I would not use
these solvers myself. I will recommend you to read very carefully the Primes
input(). - That one are excellent. With this, it is possible making up a program
exactly like the HP 48 solver. Using the input() are easier than starting with
CSTMENU.

The Primes app solver are a real bogey. It is essential given variable meaningful
names, as you did. - Not one letter names. If storing names of multi-letters
first, the app solver accept them, but I could not yet get it working, no result
came.

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


Messages In This Thread
RE - CharlieF - 02-27-2021, 05:58 AM
RE: Write an equation that contains several variables, and go immediately to solve them - essen - 03-07-2021 09:45 PM



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