The following warnings occurred:
Warning [2] Undefined array key 256253 - 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 256266 - 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 256267 - 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 256272 - 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 256266 - 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 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 256272 - 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 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





HP Prime - vector question



#4

I define the following 3d-vector:

[2*a 3*a 4*a] Sto v(a)

Naturally v(2) = [4 6 8] and 3*v=[6*a 9*a 12*a]

But the HP Prime don't show these results. Why not?


#5

You have created the CAS program function v(CAS):

(c)->Begin
2*a;
3*a;
4*a;
END:

What you are seeing is the last result which is 4*a. This is not a vector.

#6

Quote:
I define the following 3d-vector:

[2*a 3*a 4*a] Sto v(a)

Naturally v(2) = [4 6 8] and 3*v=[6*a 9*a 12*a]

But the HP Prime don't show these results. Why not?

You are expecting v to be both a function of a and also a vector. Based only on syntax, how would anyone distinguish between the functional notation v(x), or the index notation v(i) -- as in the i-th element of v -- or even multiplication? The only way to determine what is meant is based on context.

So whatever it is you want v to be (a vector vs a function), it cannot be both. To create a function so that v(2) is [ 4 6 8 ] you can do:

v(a):=[[ 2*a, 3*a, 4*a ]]

or

[[2*a, 3*a, 4*a]] > v(a) // ">" is the STO character and note the double brackets

Now v is more like a function that returns a vector. However, 2*v would be a function. If you just want a vector, then either

v:=[2*a, 3*a, 4*a]

or

[2*a, 3*a, 4*a] > v // ">" is the STO character

To get the equivalent of v(2) you would do

a:=2; eval(v);

or

v|a=3

And 3v would return the expected vector object [3a, 9a, 12a]. However, v(2) would return the second element of the vector v.

That said, there is an issue with the way vectors are interpreted, however -- or at least there is an issue with expected behavior and actual behavior. That is, I too expected that

[2a, 3a, 4a] > v(a) // ">" represents the STO character

to create a function so that v(2) returns [4, 6, 8]. However, it neither returns [4,6,8] nor even the second element of the vector! Unfortunately, the way vectors and matrices are implemented is quite confusing. This has been discussed (somewhat) before but I feel as though I was on the losing side of the argument in suggesting that [[ a11, a12], [a21, a22]] be matrices whereas [ v1, v2, v3, … , vn ] be vectors.

Edited: 18 Nov 2013, 8:33 p.m. after one or more responses were posted


#7

You might be able to find more useful info here:

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP Prime: adding an entry to a vector Alberto Candel 12 3,911 12-02-2013, 01:18 PM
Last Post: Alberto Candel
  HP Prime Matrix TERRIBLE bug and question uklo 19 4,965 11-25-2013, 12:10 PM
Last Post: Mic
  Question about transfering programs to the HP Prime Namir 10 3,321 11-17-2013, 04:01 PM
Last Post: Namir
  Another HP Prime CAS question Michael de Estrada 3 1,788 11-09-2013, 10:56 AM
Last Post: Michael de Estrada
  XCas / Prime "solve" question Nigel J Dowrick 4 1,946 11-08-2013, 04:01 AM
Last Post: Nigel J Dowrick
  Non-Prime question alert: Hp-41 and synthetic instructions Marcel Samek 11 3,956 11-04-2013, 09:31 PM
Last Post: sjthomas
  [HP-Prime CAS] Vector Calculus Library CompSystems 7 2,680 10-31-2013, 12:48 PM
Last Post: Han
  HP-Prime/Xcas: vector/list indexing fhub 6 2,774 10-27-2013, 04:52 PM
Last Post: fhub
  HP PRIME - APP Programing question dg1969 2 1,305 10-27-2013, 10:23 AM
Last Post: dg1969
  WP-34S (Prime Number Test) question Barry Mead 3 1,681 10-20-2013, 05:28 PM
Last Post: Dieter

Forum Jump: