How to define a piecewise functions ?

How to define a piecewise functions ? - 消息

#1 已发布: 2011/4/7 08:52:35
kilele

kilele

134个赞,共397个帖子。

组: User

Newbie question :
How can I define a function by different expressions on various intervals ?
In Mathcad, the way to create the vertical line is either the square bracket, or go to 'add line'
from the 'programming' toolbar.

#2 已发布: 2011/4/8 04:06:56
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: Moderator

Hello,
Wrote

How can I define a function by different expressions on various intervals ?
In Mathcad, the way to create the vertical line is either the square bracket, or go to 'add line'
from the 'programming' toolbar.


In SMath is the same. Did you try it?

Here are the examples of making piecewise functions.

The lines are not connected - it is due to choosing "Graph by points" from the "Plot" side panel.
Try "Graph by lines" to see the difference.
Btw, pay attention that a logical expression like x < y < z iz not working in SMath like in Mathcad.
[MATH=eng]5<4<6=1[/MATH]
Use parenthesis when mixing logical and relational operators and in the case you are not sure about the operator precedence.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 已发布: 2011/4/8 12:28:10
Edward Ulle

Edward Ulle

21个赞,共182个帖子。

组: Moderator

Radovan,

Does this only work with 0.89.8 beta?

I duplicate what you've done but get no graph. Says f2([]) not defined.
Ed
#4 已发布: 2011/4/8 13:11:14
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: Moderator

Yes Ed - it seems you are right. I did this in v.0.89.8 but in v0.89 the f2(x) function does not work in the graph (not defined...), as you explained.
I do not know the reason, just guessing that Andrey fixed that in the 0.89.8 version.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
  • 有新帖
  • 无新帖