Post Reply 
HP Prime crashes in Function and Graph 3D App.
11-17-2020, 09:33 PM (This post was last modified: 11-17-2020 09:41 PM by lyuka.)
Post: #1
HP Prime crashes in Function and Graph 3D App.
Hi guys

I encountered a wired behavior of the HP Prime emulator in the Function App.
With a program named 'cs' in Function App. is invisible, however,
the cursor moves as if it's on the correct plot and the numerical plot is OK.
The formula -- replaced a constant to Y variable -- is OK in the Graph 3D App.
On the phisical HP Prime BS, it shows visible plot -- no problem.

And one other problem is calling a CAS version of the program (LW0C) from Home version of a program crashes on both the emulator and the Physical HP Prime.

What is wrong? usage? or an any kind of bug?

Code:

EXPORT cs(Ir, Tj, Rd)
// cs -- current source 
// Ir : reference current
// Tj : junction temperature (in Centigrade)
// Rd : degeneration resistance
BEGIN
  LOCAL k, q, Vt;
  k := 1.380649e-23; // Boltzmann constant
  q := 1.602176634e-19; // elementary charge
  Vt := k * (273.15 +  Tj) / q; // Thermal voltage
  IF Rd == 0 THEN return Ir; END;
  return Vt * LW0(Ir * Rd / Vt) / Rd;
END;

Code:

//LW0 - Principal branch of the Lambert W function
//Rev.1.40 (Nov. 12, 2020) (c) Takayuki HOSODA (aka Lyuka)
//Acknowledgments: Thanks to Albert Chan for his informative suggestions.
EXPORT LW0(x)
BEGIN
  LOCAL y, p, s, t;
  LOCAL q, r;
  HComplex := 1; // Enable complex result from a real input.
  r := 1 / e;
  s := simplify(x + r);
  IF s == 0 THEN return -1; END;
  q := e - sqrt(2) - 1;
  y := ln(r + sqrt((r + r) * s) + q * s); // approximation near x=-1/e
  r := MAXREAL;
  REPEAT
    p := y;
    q := r;
    t := exp(y);
    s := y * t;
    t := (1 + 0.5 * y) * (s + x) + t;
    IF (0 == t) THEN break; END;
    y := y - (y + 1) * (s - x) / t; // Halley's method
    r := abs(y - p); // correction radius;
  UNTIL 0 == r OR q <= r; // convergence check
  return p;
END;

HP Prime Graphing Calculator
Software Version: 2.1.14425 (2020 01 16)
Hardware Version: Emu
CAS Version: 1.5.0
Operating System: Windows 7 SP 1 (6.1)

P.S.
Atteched file is the backup of the Emulator under test.

P.P.S.
Some conditional test results.
1) A home program 'cs' that uses 'LW0' home program is OK in Graph 3D app, however, in Function App. it shows invisible plot but its value at the cursor is OK and the Function Numeric View is OK as well.
2) A home program 'csB' that uses 'LW0C' CAS program crashes in Graph 3D App. and in Function App.
3) A CAS program 'csBW' that uses LW0C CAS program is OK and plots well in both Function App. and Graph 3D App.
4) 'cs' is OK in Function App. and in Graph 3D App. with pysical HP Prime G2.
5) 'csB' is OK in Function App. with pysical HP Prime G2, however, it crashes in Graph 3D App. to show "... had a problem and will reboot in 3 seconds".
6) 'csBW' is OK in Function App. in Graph 3D App. with pysical HP Prime G2.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP Prime crashes in Function and Graph 3D App. - lyuka - 11-17-2020 09:33 PM



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