The following warnings occurred:
Warning [2] Undefined array key 255097 - 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 255102 - 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 255117 - 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 255181 - 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 255187 - 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 255117 - 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 255187 - 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 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





XCas / Prime "solve" question



#6

Typing

solve(6.67e-11*m/6.4e6^2=9.8,m)
into my new Prime in CAS mode gives an empty list as the answer. (nSolve works fine.) Investigating further, solving "a*m=b" fails if a is less than 10^{-12}. I find that the same thing happens with the online version of Xcas, except that the limit there is 10^{-10}.

Although this behaviour isn't a huge inconvenience, it is rather strange. Can anyone suggest why Xcas has been designed to do this? Should the HP Prime copy its behaviour in this respect?

Or am I making a silly mistake somewhere? Any comments welcome!

Nigel (UK)


#7

Anytime you use a decimal point in the CAS view, you are implicitly telling the CAS to switch over into "approximate" mode for that specific computation. So, I recommend using

solve(exact( ... your equation here ... ), var)

Once the CAS is switch over into approximation mode, it _should_ honor the epsilon value in the CAS settings as far as what to do with values that are very small (i.e. when to interpret a small number as zero). Keep in mind that the command exact() will also use the epsilon setting to convert small numbers to 0! So the above will not always work for numerical solutions. So, when you try to solve a*m=b with a=10^{-12}, that very well could be interpreted as 0=b and would produce no solutions if b is non-zero.

Generally speaking, use solve() when you are trying to find exact solutions and your equations can be stated in exact terms, and use nSolve() when your equations involve non-exact values.

This concept is fairly common in many computer algebra systems.


#8

Thank you for explaining this. I find the idea of replacing small numbers with zero rather strange - it makes sense when numbers close to one are also present, but in an equation like ax=b where there is no prior reason for the quantities to have any particular magnitude I don't think it should happen.

Changing the epsilon setting hasn't made any difference that I can see - equations with small numbers in still don't get solved. When solving an equation with one unknown in I can use nSolve, which is fine. But suppose I have an equation with two unknowns, involving small numbers as coefficients, and I want to solve the equation to express one of them in terms of the other. For example: rearranging

E=(6.63e-34*3e8/lambda)/1.6e-19
to make lambda the subject. nSolve won't do this, and solve will object to my small coefficients. Do I have to rearrange the expression step-by-step by hand, or does anyone know if is there another way?

I shall spend some time reading the Xcas documentation, I think!

Nigel (UK)

#9

If you enter a:=10^(-12) then a is exact and it will not be replaced by 0. If you enter a:=1e-12, then a is approx and may be replaced by 0 (if epsilon is greater than abs(a)). Instead of using exact, I would recommend to enter your parameters as exact numbers if you plan to use solve, or keep them approx and use fsolve.


#10

Thank you for this idea. As a physicist I still cannot understand the automatic replacement of approximate numbers less than 10^{-12} by zero, though I accept that mathematicians view the world differently!

It makes the CAS much less useful to me. Most formulae that I use involve numbers which are far from 1. Changing epsilon seems to have no effect on the calculator's behaviour (is this a bug?). If I could turn off this behaviour (by making epsilon zero, for example) it would solve the problem, but this doesn't appear possible. Using fsolve is fine if I want to solve an equation with one unknown in it, but it doesn't help me to rearrange an equation to make a different variable the subject.

Wolfram Alpha is quite happy to rearrange formulae with small approximate numbers in, as is the HP-50g and my ancient TI-89!

Thank you again for your suggestions.

Nigel (UK)

P.S. In nearly every other way I am absolutely delighted with the Prime. Please don't think of me as a complainer!


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP Prime Matrix TERRIBLE bug and question uklo 19 4,894 11-25-2013, 12:10 PM
Last Post: Mic
  HP Prime - vector question bluesun08 3 1,742 11-18-2013, 07:26 PM
Last Post: Han
  Question about transfering programs to the HP Prime Namir 10 3,315 11-17-2013, 04:01 PM
Last Post: Namir
  Another HP Prime CAS question Michael de Estrada 3 1,783 11-09-2013, 10:56 AM
Last Post: Michael de Estrada
  Non-Prime question alert: Hp-41 and synthetic instructions Marcel Samek 11 3,948 11-04-2013, 09:31 PM
Last Post: sjthomas
  HP-Prime/Xcas: vector/list indexing fhub 6 2,768 10-27-2013, 04:52 PM
Last Post: fhub
  HP PRIME - APP Programing question dg1969 2 1,303 10-27-2013, 10:23 AM
Last Post: dg1969
  Using the Prime to solve for eigenvalues Michael de Estrada 28 8,321 10-27-2013, 07:21 AM
Last Post: Tarcisi C
  HP Prime Define: Use with solve, etc. Helge Gabert 0 981 10-23-2013, 06:24 PM
Last Post: Helge Gabert
  WP-34S (Prime Number Test) question Barry Mead 3 1,663 10-20-2013, 05:28 PM
Last Post: Dieter

Forum Jump: