How to define a piecewise functions ?

How to define a piecewise functions ? - Сообщения

#1 Опубликовано: 07.04.2011 08:52:35
kilele

kilele

133 сообщений из 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 Опубликовано: 08.04.2011 04:06:56
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: 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 Опубликовано: 08.04.2011 12:28:10
Edward Ulle

Edward Ulle

20 сообщений из 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 Опубликовано: 08.04.2011 13:11:14
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: 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!"
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений