# Thread: How to make a boolean function for describing a switching system?

1. ## How to make a boolean function for describing a switching system?

Hey,

how to make the output of this function $\displaystyle res=|F_{real}(s)-F_{nominal}(s)|$ boolean to describe these conditions?

$\displaystyle switch(s)=1 \Leftrightarrow |F_{real}(s)-F_{nominal}(s)| =0$
$\displaystyle switch(s)=0 \Leftrightarrow |F_{real}(s)-F_{nominal}(s)| \neq 0$

I need it for mathematical description of the switching system:

$\displaystyle F_{real}(s)=F_{real1}(s).switch(s) + F_{real2}(s).NOR(switch(s))$

I don't even know if I can mix it up this way.

($\displaystyle F$ are closed-loop transfer functions.)

Thank you

Liptak

2. Why don't you define switch(s) as you said?
$\displaystyle \mathop{\mbox{switch}}(s)= \begin{cases} 1, & |F_{real}(s)-F_{nominal}(s)| =0\\ 0, & \mbox{otherwise} \end{cases}$

I have an impression that there may be some issues with rounding (can one always distinguish whether a given real number that is a result of a measurement equals 0?), but I don't know anything about your problem.

Also, what is NOR(x)? It can't be the negation of OR because the latter takes two arguments. Is it just negation, i.e., 1 - x?

Originally Posted by emakarov
Why don't you define switch(s) as you said?
$\displaystyle \mathop{\mbox{switch}}(s)= \begin{cases} 1, & |F_{real}(s)-F_{nominal}(s)| =0\\ 0, & \mbox{otherwise} \end{cases}$
I was just wondering if there is any form I can describe it in some kind of discrete function.

I have an impression that there may be some issues with rounding (can one always distinguish whether a given real number that is a result of a measurement equals 0?), but I don't know anything about your problem.
Thank you for your concern, but it's okay... and it's no problem to change the switch(s) condition.

Also, what is NOR(x)? It can't be the negation of OR because the latter takes two arguments. Is it just negation, i.e., 1 - x?
Oops, yeah, you're right, I meant negation.

Ok, thank you, I'm gonna describe it your way:

$\displaystyle \mathop{\mbox{switch}}(s)= \begin{cases} 1, & |F_{real}(s)-F_{nominal}(s)| =0\\ 0, & \mbox{otherwise} \end{cases}$

$\displaystyle F_{real}(s)=F_{real1}(s).switch(s) + F_{real2}(s).(\neg switch(s))$

4. And how to make the switch for more than 2 controllers? For example, consider 4 controllers and this switching condition:

$\displaystyle \mathop{\mbox{switch}}(s)= \begin{cases} 1, & 0<x<5 \\ 2, & 5 \leq x<10\\ 3, & 10 \leq x<15\\ 4, & 15 \leq x<20 \end{cases}$

Simple negation of the switch function is not enough