The following warnings occurred:
Warning [2] Undefined array key 251887 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251888 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251896 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251900 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251901 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251903 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251906 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251909 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251910 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251900 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 251910 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





Programming with CAS commands (e.g., arcLen)



#2

arcLen() works fine in CAS view, but in home view there are problems.

For example, arcLen(x^3,0,2) in CAS gives the correct answer approx. 8.63...

In home view, arcLen(X^3,0,2) returns 2 ???

Other CAS commands work correctly in home view, e.g., diff(X^2,X) returns 2*X.

This also presents a challenge for programming.

This simple program

EXPORT TPP()
BEGIN
LOCAL QQ,RR,SS;
INPUT({QQ,RR,SS});
arcLen(QQ,RR,SS);
END;

gives the wrong answer if entering X^3 into QQ.

But I can't enter lower case x^3 into QQ. Why? Syntax error. I tried quotes around the symbolic expression, but to no avail. Any ideas?


#3

The home parser requires all objects exist on parse time. Mixing CAS stuff with HOME stuff is not a great thing to do at this moment as there are just so many cases that will misbehave.

TW


#4

OK, so how do I, on the Prime, write a program where the user can enter a function, start and end values, and run something like arcLen? (This is just an example).

Sorry for the bad formatting in the post before; hopefully, this reads better.

EXPORT TPP() 
BEGIN
LOCAL QQ,RR,SS;
INPUT({QQ,RR,SS});
arcLen(QQ,RR,SS);
END;

Is it not possible to do this at all? Not even workarounds?

#5

Quote:
arcLen() works fine in CAS view, but in home view there are problems.

For example, arcLen(x^3,0,2) in CAS gives the correct answer approx. 8.63...

In home view, arcLen(X^3,0,2) returns 2 ???

Other CAS commands work correctly in home view, e.g., diff(X^2,X) returns 2*X.

This also presents a challenge for programming.

This simple program

EXPORT TPP()
BEGIN
LOCAL QQ,RR,SS;
INPUT({QQ,RR,SS});
arcLen(QQ,RR,SS);
END;
gives the wrong answer if entering X^3 into QQ.

But I can't enter lower case x^3 into QQ. Why? Syntax error. I tried quotes around the symbolic expression, but to no avail. Any ideas?


When you enter X^3, are you entering that as just X^3, 'X^3', or "X^3" as all three are handled differently. X^3 converts into a number first, so the arclength is just SS-RR. I am still trying to figure out when the second and third cases are treated the same and when they are not... :-(


#6

I tried everything I could think of.

Ideally you should be able to enter lower case "X", i.e., x^3, into the variable on the INPUT screen, but at runtime the parser doesn't let you.


#7

Quote:
I tried everything I could think of.

Ideally you should be able to enter lower case "X", i.e., x^3, into the variable on the INPUT screen, but at runtime the parser doesn't let you.


I have found that pretty much anytime I need to do anything with symbolic expressions, I end up have to use expr(" blah "); And even this can break the calculator. For example,

F0:=expr("'X-F1(X)/(" + diff(F1(X),X) + "')");

works fine within a program. However,

BEGIN EXAMPLE()
LOCAL QQ, RR, SS;
QQ:=""; // this will enable you to enter a string, now
INPUT({QQ,RR,SS});

CAS.arcLen(EXPR("'"+QQ+"'"),RR,SS); // warmstarts even without RR,SS at end

END;

causes a warmstart on my actual calculator. I can type: X^2-5 for QQ and it shows up properly during the input screen. But it seems to fail once inputs are entered. In sum, working with built-in variables _usually_ works. Most of the time, anything with CAS seems broken. Then again, I have yet to consult the manual regarding CAS operations (assuming I can find it in there).


Edited: 1 Oct 2013, 2:47 p.m.


#8

Thanks so much for looking at this problem as well!

All this (storing and evaluating symbolic expressions with the CAS) works fine on the 50G, so when I tried this out on my Prime, I first thought I was going crazy!

As for a Prime CAS reference, maybe this XCAS manual will be of help:

http://www-fourier.ujf-grenoble.fr/~parisse/giac/cascmd_en.pdf

Covers the HP Prime CAS commands (and then some). I don't know if there is a newer edition.

I guess for now we'll just have to be content using the CAS commands and functions in CAS view, and in interactive mode only.


#9

EXPORT AL()
BEGIN
LOCAL RR,SS;
INPUT({F1,RR,SS}); // changing F1 to CAS.F1 causes warmstart.
CAS.arcLen(CAS.F1,RR,SS);
END;

Allows you to enter in a function, and at least does not crash. Heading out a.t.m. so didn't test if it correctly returns the result we want.

Edited: 1 Oct 2013, 3:53 p.m.


#10

For arcLen(x^3,0,2), that returns 2*sqrt(2), so it is not correct (sigh).

Running CAS.arcLen(F1, RR, SS) gives an error message "expecting an expression, not a function."


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP Prime: CAS taylor Alberto Candel 5 3,876 12-13-2013, 09:45 PM
Last Post: Alberto Candel
  HP Prime CAS curiosity bluesun08 11 4,712 12-10-2013, 01:03 PM
Last Post: Han
  [HP-Prime CAS] "Warning, ^ (Command) Is ambiguous on non square matrices"?? CompSystems 1 2,141 12-07-2013, 07:15 PM
Last Post: CompSystems
  HP Prime: complex numbers in CAS. Alberto Candel 1 1,856 12-06-2013, 02:36 PM
Last Post: parisse
  [HP Prime] plotfunc() bug in CAS Chris Pem10 2 2,362 12-04-2013, 02:46 PM
Last Post: Chris Pem10
  HP Prime: Home/CAS? Alasdair McAndrew 11 3,780 11-26-2013, 02:48 PM
Last Post: Alberto Candel
  HP Prime numerical precision in CAS and HOME Javier Goizueta 5 2,354 11-16-2013, 03:51 AM
Last Post: Paul Dale
  Need CAS help Michael de Estrada 6 2,586 11-13-2013, 01:29 AM
Last Post: cyrille de Brébisson
  HP Prime - CAS functions in Spreadsheet App CR Haeger 6 2,398 11-11-2013, 12:37 AM
Last Post: Michael de Estrada
  Another HP Prime CAS question Michael de Estrada 3 1,787 11-09-2013, 10:56 AM
Last Post: Michael de Estrada

Forum Jump: