Two equations for one node

The front end.
Post Reply
id8021
Posts: 2
Joined: Sat Oct 03, 2020 4:51 pm

Two equations for one node

Post by id8021 »

Hello!
I wonder if it is possible to assign two states to an equation node, with two different equations for each state. Basically, my node is a component which can rather survive or fail, therefore I have a function for the probability of failure, and the survival is 1-p(failure). May I do this in the same node? or do I have to do build two separate nodes?
Kind regards!
marek [BayesFusion]
Site Admin
Posts: 430
Joined: Tue Dec 11, 2007 4:24 pm

Re: Two equations for one node

Post by marek [BayesFusion] »

Sure, this is possible, although you would need two separate nodes (this is closer to what your problem really is, I believe).

Please look at the model in our model repository (should be also included among the example models on your disk) called "Heat Equations Autodiscretized Hybrid.xdsl". The nodes "Season" and "Outside Air Temperature" do exactly what you want.

What you need to do is have a discrete parent (e.g., "Component") with states "Survive" and "Fail" and a continuous child that uses one of the Conditional functions, such as If, Choose or Switch to define the two cases, depending on the value of the parent.

I hope this helps,

Marek
id8021
Posts: 2
Joined: Sat Oct 03, 2020 4:51 pm

Re: Two equations for one node

Post by id8021 »

Dear Marek,

Thank you for your answer. I did it as you suggested and the temperature model was a good example.

I used "Choose", but now I'm trying to use "If" for a different step. Is it possible to define two conditions in an "if" function?

I mean, right now if I want to verify if condition 1 and condition 2 are equal to some state, I'm doing two "if" functions:

System=If(Cond1=2,If(Cond2=2,....))

Is there any operator like in Excel and some programming languages to verify the two conditions like this: System=If(Cond1=2 & Cond2=2, ...)

Kind regards!
marek [BayesFusion]
Site Admin
Posts: 430
Joined: Tue Dec 11, 2007 4:24 pm

Re: Two equations for one node

Post by marek [BayesFusion] »

Of course! You can make the logical conditions as complex as you wish with "Logical functions" such as And(), Max(), Min(), Or() and Xor(). You can also arbitrarily nest If() statements.
Cheers,

Marek
Post Reply