Post Reply 
HP Prime Program using Solve function
02-02-2020, 10:11 AM
Post: #2
RE: HP Prime Program using Solve function
I see a few problems pertaining to the lines

Code:
solve(0:=1+β-q*β*((Z-β)/(Z+β*Є)/(Z+s*β)),Z,1);
msgbox(Z); //testing to see if this solves for Z

I assume "0:=" was a typo for "0=" (otherwise you are trying to assign a value to zero).

By using capital Z here you are inserting the value of the permanent global numeric variable Z, not the symbol Z. So if Z happened to be 5, then you are essentially typing:

Code:
solve(0:=1+β-q*β*((5-β)/(5+β*Є)/(5+s*β)),Z,1);

The solve command does not assign a value to the variable it is solving for. For example, in CAS, if you enter solve((x^2-3) = 0,x) it returns {{-sqrt(3),sqrt(3)} but does not assign this list to x. In your case, you might be tempted to use
Code:
Z:=solve(0:=1+β-q*β*((5-β)/(5+β*Є)/(5+s*β)),5,1);
But the global Z can only store real numbers, not lists. You could get around this problem by declaring Z local.

I assume there were no other lines intended before the final END.

Finally, I'm not familiar with fugacity, but
((Z-β)/(Z+β*Є)/(Z+s*β)) has redundant ()'s and is the same as
(Z-β)/((Z+β*Є)*(Z+s*β)). I thought I should ask if this really what you intended?

Hope this helps at least a little.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP Prime Program using Solve function - Wes Loewer - 02-02-2020 10:11 AM



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