Post Reply 
pointed bracket or singular function
11-25-2014, 07:09 AM
Post: #1
pointed bracket or singular function
in creating a function for that deflection of a beam requires, I am told, the use of pointed brackets or a singular function. If the term within the brackets < > evaluates less than zero, the term becomes zero, something like this

y = -5*x^3 + 180*<x-1>^2 - 10/12 * <x-2>^4 + 10/12*<x-4>^4 - 10*<x-5>^3 - 535*x

is there anyway to input this formula into the HP Prime where the terms in < > will drop out if they evaluation less than zero????
Find all posts by this user
Quote this message in a reply
11-25-2014, 01:24 PM
Post: #2
RE: pointed bracket or singular function
(11-25-2014 07:09 AM)resolved Wrote:  in creating a function for that deflection of a beam requires, I am told, the use of pointed brackets or a singular function. If the term within the brackets < > evaluates less than zero, the term becomes zero, something like this

y = -5*x^3 + 180*<x-1>^2 - 10/12 * <x-2>^4 + 10/12*<x-4>^4 - 10*<x-5>^3 - 535*x

is there anyway to input this formula into the HP Prime where the terms in < > will drop out if they evaluation less than zero????

Would a piecewise function fit your needs?
\[ f(x) = -5x^3 - 535x +
\begin{cases}
180(x-1)^2, & x \ge 1\\
0, & x<1
\end{cases}
+ \begin{cases}
-\frac{10}{12}(x-2)^4, & x \ge 2\\
0, & x < 2
\end{cases}
+ \begin{cases}
+\frac{10}{12}(x-4)^4, & x \ge 4\\
0, & x < 4
\end{cases}
+ \begin{cases}
-10(x-5)^3, & x\ge 5\\
0, & x<5
\end{cases}
\]
The piecewise functions can be created via the template key

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
11-25-2014, 05:30 PM
Post: #3
RE: pointed bracket or singular function
(11-25-2014 07:09 AM)resolved Wrote:  in creating a function for that deflection of a beam requires, I am told, the use of pointed brackets or a singular function. If the term within the brackets < > evaluates less than zero, the term becomes zero, something like this

y = -5*x^3 + 180*<x-1>^2 - 10/12 * <x-2>^4 + 10/12*<x-4>^4 - 10*<x-5>^3 - 535*x

is there anyway to input this formula into the HP Prime where the terms in < > will drop out if they evaluation less than zero????

You can use the MAX (maximum) function (Math menu, Arithmetic) and type (for example) MAX(0,x-1).

Nigel (UK)
Find all posts by this user
Quote this message in a reply
11-26-2014, 10:32 AM
Post: #4
RE: pointed bracket or singular function
thanks Han and Nigel, both worked, much better than my solution of creating five different equations in Solver to evaluate
Find all posts by this user
Quote this message in a reply
12-01-2014, 04:11 PM (This post was last modified: 12-01-2014 04:29 PM by Han.)
Post: #5
RE: pointed bracket or singular function
(11-26-2014 10:32 AM)resolved Wrote:  thanks Han and Nigel, both worked, much better than my solution of creating five different equations in Solver to evaluate

Take care as they are not equivalent. For example, MAX((x-2)^2,0) is always the same as just (x-2)^2, whereas MAX((x-2)^3,0) is the same as
\[ f(x) = \begin{cases} (x-2)^3, & x\ge 3\\ 0, & x<3 \end{cases} \]

I'm not quite sure which it is you want, though your original post says that that if the expression inside the < > is negative, then entire term is 0. That is not the same thing as using the MAX() function. Thus <x-2>^2 should be 0 for x<2. However, MAX((x-2)^2,0) is positive if x<2.

Edit: I may have misinterpreted the posts. If you indeed meant what you originally wrote, then MAX(x-2,0)^2 (note the square on the outside) would work just fine.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
12-04-2014, 10:45 AM
Post: #6
RE: pointed bracket or singular function
thanks Han for your thoughts, yes I wanted the pointed bracets evaluated before it is squared.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)