HP Forums
Math Template - what is this? - 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: Math Template - what is this? (/thread-15767.html)



Math Template - what is this? - spiff72 - 10-22-2020 02:05 AM

Just messing around with the calculator after receiving it 2 days ago...

There is a template that I am not familiar with in the top row of the templates, third from left (between the exponent and derivative). It looks like a vertical bar with two entry items offset vertically. It's been almost 30 years since I took calculus classes, and this one struck me as unfamiliar.

Can someone tell me what this one is? I tried the help function but it just gave general info on the template button.


RE: Math Template - what is this? - spiff72 - 10-22-2020 02:40 AM

I may have answered my own question...

I found a reference on this page:
http://computerlearningservice.com/Academy/HP-Prime/hp-prime.html

It appears to be the "with operator". So you can enter x*2 | x=12 and it evaluates to 24 (as a simple example).

I am not sure what the value of this is, as it would be easier to just enter 12*2, but maybe there is a programmatic application for this?


RE: Math Template - what is this? - spiff72 - 10-22-2020 02:48 AM

Hmm, I just tried the BITOR function in CAS, and tried it with the template, and I see that indeed they do the same thing BITOR(1,2) = 3 and 1 | 2 = 3

Initially I was trying the symbol (from the template) and couldn't get it to work in the Home screen (I was getting "Invalid Input" when I did it with just numbers. But it works in Home with the arguments I showed in the previous post.


RE: Math Template - what is this? - pinkman - 10-22-2020 05:41 AM

It is the substitution operator, the built in help is located just after the last “z” entry.

It works the same way in Home and CAS, with lowercase var names.
X*e^X|X=2 -> 14.7781121979
x*e^x|x=2 -> 2*e^2


RE: Math Template - what is this? - spiff72 - 10-22-2020 12:11 PM

(10-22-2020 05:41 AM)pinkman Wrote:  It is the substitution operator, the built in help is located just after the last “z” entry.

It works the same way in Home and CAS, with lowercase var names.
X*e^X|X=2 -> 14.7781121979
x*e^x|x=2 -> 2*e^2

I am still struggling with finding this in the built in help. Where do you go to see this help (where are the "z" entries found?


RE: Math Template - what is this? - Didier Lachieze - 10-22-2020 12:43 PM

(10-22-2020 12:11 PM)spiff72 Wrote:  I am still struggling with finding this in the built in help. Where do you go to see this help (where are the "z" entries found?

Press the Toolbox Key to open the Catalog, press the 2 key (Z) to go to the functions starting by z, then go down and after ztrans you have |, highlight it and press the Help key.


RE: Math Template - what is this? - pinkman - 10-22-2020 12:49 PM

Thank you Didier, I might have been more precise!
My apologies to spiff72.


RE: Math Template - what is this? - spiff72 - 10-22-2020 12:54 PM

Got it now - thanks!


RE: Math Template - what is this? - Arno K - 10-22-2020 01:17 PM

You select Toolbox, press z, scroll to | (where) , slowly perform a long press on it (select, but not copy to entry line) press Help and you will see.
Arno


RE: Math Template - what is this? - spiff72 - 10-22-2020 01:39 PM

I did some more digging online about this operator, and I think I see the application of it for the calculator more clearly, as it lets you specify something like an integral, and you can then follow it with a with operator to specify that you want to constrain a variable (imagine evaluating it from -r to r), stating ... | r>0 for a situation where you want to restrict r to be only positive numbers (so you don't get "double negatives" if r happened to be negative).

I probably didn't explain that well, but it made sense to me :-)


RE: Math Template - what is this? - Wes Loewer - 10-24-2020 05:52 AM

(10-22-2020 02:40 AM)spiff72 Wrote:  It appears to be the "with operator". So you can enter x*2 | x=12 and it evaluates to 24 (as a simple example).

I am not sure what the value of this is, as it would be easier to just enter 12*2, but maybe there is a programmatic application for this?

The operator can be a real time saver. For example, it's easier to type
SIN(X)/(X^2+X+1)|X=1.2345
than
SIN(1.2345)/(1.2345^2+1.2345+1)

Also, if you want to then evaluate the expression at some other X value, all you have to is edit just the one value. In fact you can evaluate at multiple values simultaneously.

SIN(X)/(X^2+X+1)|X={1,2,3}

It's especially useful for evaluating a derivative at a point.

∂(SIN(X)/(X^2+X+1),X)|(X=1)

You could do all this by either storing a value in X, or by defining a function, but | is more convenient.

Whenever I read this out loud, I usually say "at X=1" or "where X=1".