Post Reply 
Works in Mathematica
03-02-2014, 03:11 PM
Post: #1
Works in Mathematica
Integral from zero to infinity of e^s*t dt; didn't work on Prime or 50G. Using Home Edition of Mathematica 9 this was the result:

ConditionalExpression[1/s, Re[s] > 0]

Having had the Prime just over a month, I like it and will keep it. There will be updates over time that may expand its ability to handle symbolic equations.
Find all posts by this user
Quote this message in a reply
03-02-2014, 03:49 PM
Post: #2
RE: Works in Mathematica
Your answer or your input is wrong. You must make an assumption on s to get an answer: assume(s<0); int(exp(s*t),t,0,inf)
Find all posts by this user
Quote this message in a reply
03-02-2014, 03:59 PM
Post: #3
RE: Works in Mathematica
My post should have been e^-st; I used the integral template.
Find all posts by this user
Quote this message in a reply
03-03-2014, 07:46 PM
Post: #4
Assume Command
I didn't know that command existed, but it is in the Prime and HP 50G. So, I typed Assume(s>0), and then used the integral template following the comma. Answer:

[s 1/2].
Find all posts by this user
Quote this message in a reply
03-03-2014, 09:27 PM
Post: #5
RE: Works in Mathematica
(03-02-2014 03:49 PM)parisse Wrote:  Your answer or your input is wrong. You must make an assumption on s to get an answer: assume(s<0); int(exp(s*t),t,0,inf)

Thanks, Parisse, to take your time to help us.

I have both calculators, so I decided to test it as well.

The HP-50G has no issues finding the answer, using your solution, but using the 50G uppercase commands and variables syntax - Got the mentioned answer: -1/S

However the HP-Prime is another different kind of "animal".
I tried in CAS (Radians), one expression at a time, and then both expressions in a single line as suggested, and then I have used the "infinite" symbol in place of "inf", and at last I used the Prime integral template, but the only answer I can get from it is:
"Undef/Unsigned Inf encountered in limit"
Also, it doesn't matter if I use the "assume(s<0)" sentence or not, the above result is the only thing I can get from it. In fact, the answer Prime is giving to "assume(s<0)" is just "s".

This only tells me that I'm not really prepared to deal with the Prime, as it seems it is too picky and requires so much more understanding of it before one can really use it with more success.

Anyone can get a good answer using the Prime for this integral and share how to do it?

Jose Mesquita
RadioMuseum.org member

Find all posts by this user
Quote this message in a reply
03-03-2014, 10:05 PM (This post was last modified: 03-03-2014 10:33 PM by jebem.)
Post: #6
RE: Works in Mathematica
(03-03-2014 07:46 PM)dan_h Wrote:  I didn't know that command existed, but it is in the Prime and HP 50G. So, I typed Assume(s>0), and then used the integral template following the comma. Answer:

[s 1/2].

Ok, I tried the second variant of the original expression on the HP-Prime. So, if now the expression is:

assume(s>0); int(exp(-(s*t)),t,0,inf)

This time the Prime can find the answer for this definite integral: s 1/s

Also, if we try the indefinite integral, the Prime answer seems OK, and it is exactly the same as one can find in wolframalpha:
https://www.wolframalpha.com/input/?i=in...0%2Cinf%29

So, the only issue here is to find out why the Prime is not able to find the answer for the original expression posted here:
assume(s<0); int(exp(s*t),t,0,inf)

Jose Mesquita
RadioMuseum.org member

Find all posts by this user
Quote this message in a reply
03-04-2014, 09:38 AM
Post: #7
RE: Works in Mathematica
The problem is with sign, sign(s) should return -1. It's a Prime specific bug (related to error handling), on Xcas it works, it is now fixed in source code.
Find all posts by this user
Quote this message in a reply
03-04-2014, 03:03 PM
Post: #8
RE: Works in Mathematica
(03-04-2014 09:38 AM)parisse Wrote:  The problem is with sign, sign(s) should return -1. It's a Prime specific bug (related to error handling), on Xcas it works, it is now fixed in source code.

Thank You so much for your information, Parisse!
It is good to know that are good experts handling and fixing these issues in our new HP Prime machine.
Let us wait for the next firmware update!

Jose Mesquita
RadioMuseum.org member

Find all posts by this user
Quote this message in a reply
03-04-2014, 07:43 PM
Post: #9
RE: assume() Command
(03-03-2014 07:46 PM)dan_h Wrote:  I didn't know that command existed, but it is in the Prime and HP 50G. So, I typed Assume(s>0), and then used the integral template following the comma. Answer:

[s 1/2].

The UG is very sparse with information about assume(), as is the online help, and they suggest this function is for programs.

At CAS command line, must it be used on the same command separated by semicolon (as in Parrise's example) or can it be used separately on a prior command?

If so, how long is the specified "assumption" maintained?

When does it expire, if at all?

On the 50g, one could "unassume" to remove the new assertion, but no such equivalent seems to be available on Prime. How do I remove it?

Can more than 1 assume() be issued and maintained simultaneously?

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-04-2014, 09:46 PM
Post: #10
RE: Works in Mathematica
(03-04-2014 07:43 PM)rprosperi Wrote:  
(03-03-2014 07:46 PM)dan_h Wrote:  I didn't know that command existed, but it is in the Prime and HP 50G. So, I typed Assume(s>0), and then used the integral template following the comma. Answer:

[s 1/2].

The UG is very sparse with information about assume(), as is the online help, and they suggest this function is for programs.

At CAS command line, must it be used on the same command separated by semicolon (as in Parrise's example) or can it be used separately on a prior command?

If so, how long is the specified "assumption" maintained?

When does it expire, if at all?

On the 50g, one could "unassume" to remove the new assertion, but no such equivalent seems to be available on Prime. How do I remove it?

Can more than 1 assume() be issued and maintained simultaneously?

It stays as an assumption until either you store something into a, or you use purge(a).

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
03-04-2014, 10:59 PM
Post: #11
RE: Works in Mathematica
(03-04-2014 09:46 PM)Han Wrote:  It stays as an assumption until either you store something into a, or you use purge(a).

If you need more than one assume statement use the "additionally" command. To see what assumptions are associated with a CAS variable, use the "about()" command.

Example, to define -pi < s < pi:

assume(s>-pi)
additionally(s<pi)
about(s)

   

Mark Hardman

Ceci n'est pas une signature.
Find all posts by this user
Quote this message in a reply
03-05-2014, 04:30 AM
Post: #12
RE: assume() Command
(03-04-2014 09:46 PM)Han Wrote:  It stays as an assumption until either you store something into a, or you use purge(a).

Thanks Han. I suppose purge() should have been obvious to me. But it wasn't.

(03-04-2014 10:59 PM)Mark Hardman Wrote:  If you need more than one assume statement use the "additionally" command. To see what assumptions are associated with a CAS variable, use the "about()" command.

Example, to define -pi < s < pi:

assume(s>-pi)
additionally(s<pi)
about(s)

Mark Hardman
Thanks Mark, especially the simple but clear example that explains it all. After posting, I realized I forgot to include the question on how to see the current assumptions, and you even answered that as well.

Very helpful replies guys, thanks!

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-05-2014, 07:24 AM
Post: #13
RE: Works in Mathematica
(03-04-2014 10:59 PM)Mark Hardman Wrote:  Example, to define -pi < s < pi:

assume(s>-pi)
additionally(s<pi)
about(s)
Or in one command assume(s>-pi && s<pi)
Find all posts by this user
Quote this message in a reply
03-05-2014, 12:14 PM
Post: #14
RE: assume() Command
(03-05-2014 07:24 AM)parisse Wrote:  
(03-04-2014 10:59 PM)Mark Hardman Wrote:  Example, to define -pi < s < pi:

assume(s>-pi)
additionally(s<pi)
about(s)
Or in one command assume(s>-pi && s<pi)

Thanks Parisse, very useful hint (for many uses); also I find it more concise this way.

Can I use assume() to assert that a variable must be real (to exclude imaginary solutions)?

Also, does the above example automatically impy only real solutions?

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-05-2014, 01:13 PM
Post: #15
RE: Works in Mathematica
assume(x,DOM_FLOAT) will simplify re(x) and im(x) if you have checked complex variables. and conversely assume(x,DOM_COMPLEX) will leave re(x) and im(x) as is. This information is not used for solve/csolve currently (maybe for a future version).
Find all posts by this user
Quote this message in a reply
03-05-2014, 10:02 PM
Post: #16
RE: Works in Mathematica
(03-05-2014 01:13 PM)parisse Wrote:  assume(x,DOM_FLOAT) will simplify re(x) and im(x) if you have checked complex variables. and conversely assume(x,DOM_COMPLEX) will leave re(x) and im(x) as is. This information is not used for solve/csolve currently (maybe for a future version).

Is this the full list of domain ENUMs:

DOM_INT
DOM_FLOAT
DOM_COMPLEX

Or are there others?

Mark Hardman

Ceci n'est pas une signature.
Find all posts by this user
Quote this message in a reply
03-06-2014, 03:05 AM
Post: #17
RE: Works in Mathematica
There are others; in the CAS view, use type() -- all lowercase -- to see the others. For example, type([1 2]) is DOM_LIST. I'm sure you could also find them in the xcas/giac documents.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
03-06-2014, 12:27 PM (This post was last modified: 03-06-2014 05:12 PM by Joe Horn.)
Post: #18
RE: Works in Mathematica
(03-06-2014 03:05 AM)Han Wrote:  There are others; in the CAS view, use type() -- all lowercase -- to see the others. For example, type([1 2]) is DOM_LIST. I'm sure you could also find them in the xcas/giac documents.

Interesting... The list of types shown in the help screen for TYPE (uppercase) is not the same as returned by the type (lowercase) function.

In CAS, if you add zero to a DOM_WHATEVER (or take its absolute value, etc.), you get its numerical equivalent. Here are the ones I've seen while playing around.

#: DOM_name (example)
1: DOM_FLOAT (1.23)
2: DOM_INT (123)
4: DOM_COMPLEX (3+4i)
6: DOM_IDENT ('x')
7: DOM_LIST ({1,2,3})
8: DOM_SYMBOLIC ('1+2')
10: DOM_RAT (2/3)
12: DOM_STRING ("HELLO")
13: DOM_FUNC ('tan')
15: none? [modular number] (2 %% 5)
17: none? [table] (table("PPC" = 1537))

What are the missing ones?

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
03-06-2014, 09:56 PM
Post: #19
RE: Works in Mathematica
(03-06-2014 12:27 PM)Joe Horn Wrote:  
(03-06-2014 03:05 AM)Han Wrote:  There are others; in the CAS view, use type() -- all lowercase -- to see the others. For example, type([1 2]) is DOM_LIST. I'm sure you could also find them in the xcas/giac documents.



#: DOM_name (example)
1: DOM_FLOAT (1.23)
2: DOM_INT (123)
4: DOM_COMPLEX (3+4i)
6: DOM_IDENT ('x')
7: DOM_LIST ({1,2,3})
8: DOM_SYMBOLIC ('1+2')
10: DOM_RAT (2/3)
12: DOM_STRING ("HELLO")
13: DOM_FUNC ('tan')
15: none? [modular number] (2 %% 5)
17: none? [table] (table("PPC" = 1537))

What are the missing ones?

How about these: DOM_LONGFLOAT and DOM_MATRIX? I found them while looking through the strings of the emulator executable.
Find all posts by this user
Quote this message in a reply
03-06-2014, 11:37 PM (This post was last modified: 03-06-2014 11:44 PM by Joe Horn.)
Post: #20
RE: Works in Mathematica
(03-06-2014 09:56 PM)DGM Wrote:  How about these: DOM_LONGFLOAT and DOM_MATRIX? I found them while looking through the strings of the emulator executable.

Cool! DOM_LONGFLOAT is type number 3. Anybody know how to create a longfloat in CAS? It might not be possible, since the "longfloat library" which is used by Xcas is not in Prime's CAS.

DOM_MATRIX seems to be a synonym for DOM_LIST. If you type DOM_MATRIX in CAS, it turns into DOM_LIST.

Here's another CAS objct type buried in the executable:
0: DOM_int ? unknown

... and here's one that's buried in the Xcas documentation:
9: none? [monomial] ( %%%{ 1,[2] %%%})

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: