Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

How to pass one equation from negative to 0?

How to pass one equation from negative to 0?

what I want it is very simple, I do not know if exist some sample code that transform one negative equation to 0, for ex:

y=ax+b

if y<0
y=0
else
y=y
end if

but I have a lote of this examples and will be nice if some simple equation like

y(y<0)=0

existe something like this?

Re: How to pass one equation from negative to 0?

y=min(ax+b,0)

Re: How to pass one equation from negative to 0?

thanks for the reply.

but this one just give me the lower case until 0.

Re: How to pass one equation from negative to 0?

sorry, I meant to write max(ax+b,0) current/sad

Re: How to pass one equation from negative to 0?

thank you very much current/big_smile

There are 0 guests and 0 other users also viewing this topic
You are here: