Difference between Real and Virtual Calculator
|
10-04-2017, 07:40 AM
Post: #1
|
|||
|
|||
Difference between Real and Virtual Calculator
Hi to all. I'm current using a real Calculator with 12066 (2017 07 10) software version and Virtual calculator on my laptop with 11226 (2016 12 08) software version. As I know those version are the mos updated. Yesterday i wrote this simple code:
Code:
Can someone explain me why it happens? I always use the virtual calculator as "beta tester" for my programs, because is easier and quicker to write, save and test, but now i'm getting different behavior, I'm confused. |
|||
10-04-2017, 11:04 AM
Post: #2
|
|||
|
|||
RE: Difference between Real and Virtual Calculator
The program provided doesn't work on either the physical calculator or the virtual calculator. There are several changes that could make this program run without error, which you might find useful.
Before suggesting anything, though, it would be helpful to provide an example of r,t,d input values, and a known result, (to confirm the program's output). -Dale- |
|||
10-04-2017, 11:30 AM
Post: #3
|
|||
|
|||
RE: Difference between Real and Virtual Calculator
The program is working on my real calculator with no problem.
the purpose of this program is to check and calibrate thermocouples. the thermocouple is a sensor that is giving a resistance (in Ohm) changing with the temperature. PT100 is a thermocouple that give 100 Ohm at 0°C PT1000 is a thermocouple that give 1000 Ohm at 0°C They follow the equation: R=D*(1+A*T+B*T^2+C*(T-100)*T^3) where T is the temperature, D is the 0°C-resistance (100 or 1000) and the remaining parameters A, B and C are: A = 3.9083E10^-3 B = -5.7750E10^-7 C = -4.1830E10=12 for t<0 or 0.0 for t>=0 Syntax: RTD(r,t,d) r= Reststance t= Temperature d=Thermocouple Type. the most common values are 100 or 1000 Example: RTD(0,26.5,100) will give 110.397549938, that is the Resistance value for 26.5°C for a PT100 sensor RTD(124.5,0,100) will give 62.1074171403, that is the Temperature value for 124.5 Ohm for a PT100 sensor |
|||
10-04-2017, 12:13 PM
Post: #4
|
|||
|
|||
RE: Difference between Real and Virtual Calculator
As far as I can see, your program relies on the active app being "Solve". Try pressing Apps, selecting "Solve", then "Home" and enter RTD(0,26.5,100).
|
|||
10-04-2017, 12:23 PM
Post: #5
|
|||
|
|||
RE: Difference between Real and Virtual Calculator
Maybe i'm not well explained.
My program works well on my physical calculator, I have no problem with that. The problem is on Virtual Calculator on PC. I got a syntax error on line 33, I'm asking about the difference between physical and real calculators, both of them updated with the latest software version. Thank you |
|||
10-04-2017, 12:36 PM
Post: #6
|
|||
|
|||
RE: Difference between Real and Virtual Calculator
I set the active app to Solve, as Didier suggests, and the program does work, then, on the virtual calculator, with RTD(0,26.5,100) as the command entry line. 110.40 is the displayed result, and the Solve Symbolic View, E1, shows up as R=D*(1+A*T+B*T^2+C*(T-100)*T^3).
That was probably your design intention, so, I can confirm it works on this virtual calc, at least when Solve is the active app. STARTAPP() and STARTVIEW() might also be useful for you. |
|||
10-04-2017, 02:30 PM
(This post was last modified: 10-04-2017 02:31 PM by Tim Wessman.)
Post: #7
|
|||
|
|||
RE: Difference between Real and Virtual Calculator
As stated, the issue here is you are mixing application variables/functions with a global program that may or may not be active.
Is there a specific reason you are trying to store things into content of the Solve application? If so, the best way to handle things is make a copy of your solve app, and then put your program in the application program source file. If you don't need the solve app, I'd recommend using the FNROOT command which is the correct global root finder. If you want to keep it as a global program, and also want to blow out any content in the Solve app's E1, just qualify your call to the app function SOLVE. Solve.SOLVE(E1... TW Although I work for HP, the views and opinions I post here are my own. |
|||
10-05-2017, 07:34 AM
Post: #8
|
|||
|
|||
RE: Difference between Real and Virtual Calculator
Quote:If you don't need the solve app, I'd recommend using the FNROOT command which is the correct global root finder.I checked in the manual, but the explanation of this command is very poor. My equation have many variables and needs to be solved for two of them, according to the requirements. can you, if you can, make an example? Because i don't really need to solve the equation in the solve app, i just need to solve it ;-) moreover i repeat my question: why the same code is working in my real calculator and is not working in the virtual? Maybe some wrong setting? If yes, where I can check? |
|||
10-06-2017, 05:49 AM
Post: #9
|
|||
|
|||
RE: Difference between Real and Virtual Calculator
Hello,
You should be able to use Solve.SOLVE(equation, var); directly... As in Solve.SOLVE(sin(A)=B,A,1); // the 1 here is a guess This would remove a lot of dependencies and most likely make things work better for you. Cyrille Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP. |
|||
10-06-2017, 04:01 PM
Post: #10
|
|||
|
|||
RE: Difference between Real and Virtual Calculator
(10-05-2017 07:34 AM)simone_71 Wrote: moreover i repeat my question: why the same code is working in my real calculator and is not working in the virtual? Hello, Several people answered this already. You do NOT have the Solve app running/selected when you are editing your source file. Thus when it checks the code, it can't find SOLVE which is a solve app function and not a global system function Solve.SOLVE fully qualifies the command and tells the system where to look. You currently have a dependency on the Solve app being active to use your program. Solve.SOLVE replacing "SOLVE" would fix it. SOLVE is basically identical to FNROOT. You aren't simultaneously solving with SOLVE - it can't do that. FNROOT is a drop in replacement in your source and will have no dependency on the solve app. If you got rid of storing into E1, you'd no longer be using anything in the solve app. FNROOT(X^2-2,X,-2) -> ~-1.41 FNROOT(X^2-2,X,2) -> ~1.41 TW Although I work for HP, the views and opinions I post here are my own. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)