HP Forums

Full Version: hp-prime solver and variable name
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

About the hp-prime solver in APPS,

If i write this formulla : X = 2*3.14*F*C

i can deal with the capacitive impedance (XC)

but

the correct formulla is not X = but XC.

the problem is :

i can't write in the hp prime solver XC = because the prime understand X*C =.

is there a solution ?

Hi,

You could try lowercase c in Home view. Works on my calculator

Cheers,

Terje

It doesn't work, but i have understood this :

If in the solver i try to write xc =, even in lowercase, i have an error message

but

if, before to go to the solver, i create/declare an variable(real) named xc, it works.

in the same way, i can create a real name Vout and write on the solver this formulla :

Vout = 1.25*(1+R/220)

this is for an LM317 regulator

SO !!!!! strangelly first i have to create a variable with the wished name to be allowed to use it in the solver in a second time

is this the HP-PRIME reality ??

It's a bit frustrating.

To get around it, start up the SOLVE app and then press Program, and then Edit. Delete the APP program template there, and then add the line
EXPORT XC, X_C, x_C, X_c, X_L;
including those variables you wish to use.

Go back to the APPS screen and SAVE the SOLVE app under a new name - Reactance, perhaps.

Start your new app. You will find that the variables can now all be used - XC won't be X*C any more.

I don't know whether there's another way to do this, but it's worked for me with a set of projectile equations (u_x, u_y, v_x, v_y, and so on).

It all actually works rather well, but it is a nuisance setting it up. On the other hand, I end up with an App that I can keep and use without cluttering up the main SOLVE app. Then again, where am I going to keep all of these different solver apps? There aren't any folders available ....

Hope this helps.

Nigel (UK)

Note: these EXPORTED variables can be accessed from the Home screen as app variables (Reactance.XC, etc)

Edited: 9 Dec 2013, 7:56 a.m.

Yes, sorry you have to define the variable first (in my trial uppercase X, lowercase c).

What tricked me was, if you have already entered the function you can delete the variable later (which I did). If you then open the Num view it will ask you if you want to define the new variable. However if you try to edit in Symb view you get an error message. I can find no way of entering the function without declaring the variable first.

Something apparently learned :-)

thank's for your help, but, once more, the hp-prime is for me a deception, too complicate to use it.
i imagine the young student in the classroom

But HP don't realize this. Like i said: The Prime is (in this manner) unsuitable for students/education.

Edited: 9 Dec 2013, 9:18 a.m.

In HP's defence if you check the user manual it says
<<<

In addition to the built-in variables, you can use one or more variables you created yourself (either in Home view or in the CAS). For example, if you've created a variable called ME, you could include it in an equation such as this: Y 2 = G2 + ME.

>>>

I.e. you need to pre define additional variables to the built-in ones.
New users of the calculator might pay more attention to the manual than us who has tried all before :-) so they may not be as confused?

Cheers,

Terje

Thanks Nigel. I'll add that to my knowledge base of undocumented/poorly documented features of the Prime. I've been playing with my old 50g alongside the new Prime, and continue to be amazed at how hp has managed to make things that used to be relatively simple and intuitive into an obscure and illogical mess. The plain fact is that the 50g can do everything that I need and that the Prime adds nothing more than a nicer front and back end interface with modern processing speed. About the only feature that the Prime brings that is a real improvement is the Spreadsheet App, and even then it is plagued with bugs and missing critical features.

But why not be able to create new variables on the fly within the Solver or Function Apps as they are needed. Instead, you have this convoluted methodology that makes all this far more complex that it needs to be. If you inadvertently attempt to define a reserved name as a variable, you just get a error message like "cannot use reserved name as user defined variable name."

Michael, many high-level structured programming languages require the programmer to explicitly define every variable prior to use. This is really a good thing, because it prevents you from coding something like NUM_RECS = NUM_RECS + 1 and later in your code, PRINT NM_RECS and you wonder why NM_RECS is always zero when you know you processed 1000 records. Most languages I used when programming mainframes were like that.

I agree, though. On a hobbyist calculator, it's more of a hindrance than a help.

On the HP-50g my working folder quickly gets cluttered up with the variables from my most recent use of the Solver. (Financial calculations are particularly bad in this respect.) I know that these variables can be purged, but somehow I never get around to it.

On the Prime, if I want to use anything other than A-Z as a variable I have to create it as an app variable in the Solver, either in the main app or in a renamed copy of the Solver. This avoids the "variable clutter" problem of the HP-50g but at the cost of some inconvenience.

Perhaps, by default, the Solver could create undefined variables as Solver app variables? The clutter problem would be restricted to the Solver, while ease of use would be greatly improved.

Nigel (UK)

Hi Don,

I've done tons of FORTRAN programming in the distant past on mainframes and understand all that, but this is not the issue here. We have these Apps which should be smart enough to automate all this stuff. I didn't have these kinds of problems with my 50g.

There is nothing to add.

On the 50g you can create subdirectories for each problem to avoid this clutter. The main VAR home directory simply contains the names of the subdirectories, and the first key in each subdirectory is named BACK, which contains the program <<HOME>>, that returns you to the Home main directory.

Edited: 9 Dec 2013, 10:47 a.m.

'BACK' <<HOME>>: a nice trick. Thanks for that!

Capacitive Reactance is the reciprocal of (2*pi*f*C)

Quote:
On the 50g you can create subdirectories for each problem to avoid this clutter. The main VAR home directory simply contains the names of the subdirectories, and the first key in each subdirectory is named BACK, which contains the program <<HOME>>, that returns you to the Home main directory.

Or, create a custom menu at the top directory. Just save:

{ UPDIR HOME } 'CST' STO

Now you don't have to recreate 'BACK' in each subdirectory. Just go to the custom menu and use the shortcuts there.

thomas !!!!!!!

it's EXACTLY what i've written

i CHOOSE to use 3.14 instead of PI to be more clear in my details problems because of PI ....P*I.

just because of this

Edited: 9 Dec 2013, 1:23 p.m.

Hi Michael,

I do not disagree with you, all I am saying is that newcomers to the HP world may have less expectations of how it is "supposed" to work and look more for guidance in the manual. Being able to create variables on the fly would be far better than my understanding of the current system suggests.

Cheers,

Terje

OHHHH YESSSSS you are right,

let me explain, on the hp48gx we can deal easyly with our own formulla.

on a previons thread CYRILLE xeplain me in prime i can't deal with more than 10 equation at a time.

the solution was to copy the APPS solver each time i need a new formulla group.

In my actual group i write equation for inductor and capacitor, and you are right i do in my example a big mix, a big soup
excuse me.
fab

Quote:
Or, create a custom menu at the top directory. Just save:

{ UPDIR HOME } 'CST' STO

Now you don't have to recreate 'BACK' in each subdirectory. Just go to the custom menu and use the shortcuts there.


Why not just use the built-in HOME key? Just press and hold down the left-shift key, then press VAR. VoilĂ : HOME. No programming or custom menus or key assignments needed.

Quote:

.....No programming or custom menus or key assignments needed.




Well where's the fun in that :)