HP Forums
Using rsolve with hp prime - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Using rsolve with hp prime (/thread-5313.html)



Using rsolve with hp prime - wawa - 12-11-2015 06:45 PM

Hi

I'm trying to get an explicit formula for the sequence
u(n)=4*u(n-1)-5*u(n-2)+2*u(n-3)
u(1)=1
u(2)=14
u(3)=43

With Xcas, I have no problem with the following line :
rsolve(u(n)=4*u(n-1)-5*u(n-2)+2*u(n-3),u(n),[u(1)=1,u(2)=14,u(3)=43])
I get the correct answer.

With the prime, I don't know how to do the same Sad It is the [u(1)=1,u(2)=14,u(3)=43] part I don't see. I tried [] and {} delimiters with no success. Do you have any idea how to solve this on the prime ?

Thank you.


RE: Using rsolve with hp prime - Helge Gabert - 12-11-2015 07:18 PM

Works for me.

I get [-3*n+2^n*8-12].

Are you sure you are running rsolve in CAS?


RE: Using rsolve with hp prime - wawa - 12-12-2015 11:24 AM

Thank you for your answer. Yes I am in cas.

I tried the rsolve command on the emulator and it does work, but on the calculator, the same command gives me nothing.
[Image: IMG_4813.jpg]


RE: Using rsolve with hp prime - DrD - 12-12-2015 01:55 PM

I get the attached result, with software version 8151, on the hardware calc:
(Find your software version: Help | Tree | About HP Prime)

[attachment=2941] [attachment=2944]

-Dale-


RE: Using rsolve with hp prime - wawa - 12-12-2015 02:58 PM

I don't get it. I have the 8151 firmware.

Here is another screenshot with the end of the line. Maybe I mistyped something or maybe there is something special with my settings but I compared with the emulator on which the rsolve command is doing OK and I don't see any difference.

[Image: rsolve.jpg]


RE: Using rsolve with hp prime - Helge Gabert - 12-12-2015 03:31 PM

Hmm . . . maybe something to do with the CAS settings? However, I can only see that unchecking "exact" throws an error message, but not empty brackets. What are your settings, especially the recursive values on p. 2?


RE: Using rsolve with hp prime - wawa - 12-12-2015 03:55 PM

my CAS settings are :
[Image: CAS1.jpg]
and
[Image: CAS2.jpg]

I tried the DrD's setting for page 2, with no more success : still empty brackets.


RE: Using rsolve with hp prime - wawa - 12-12-2015 04:15 PM

I think I figured out the problem : I have a CAS variable named n with a value of 0.

Now my problem is to purge this variable. I tried purge(n) and purge() but with no success Sad

Edit : It works ! I had a Hanoi program with an "EXPORT ...,n,..." command inside. I deleted this program and my variable n disapeared. The rsolve command is now running properly


RE: Using rsolve with hp prime - Helge Gabert - 12-12-2015 04:21 PM

Did you try restart?


RE: Using rsolve with hp prime - wawa - 12-12-2015 04:52 PM

yes I tried the restart command with no success because my variable n was exported in a program. I had to delete this program to get things work.


RE: Using rsolve with hp prime - Helge Gabert - 12-12-2015 09:25 PM

Good to know - - I'm glad you figured it out!