Signal Comparison Block

madtorresga
Mon, 21 Jul 2025 13:32:45 +0000
New to Julia

Hello,

I’m trying to compare 3 signals from the cells array like this:

...
  @equations begin
        # Series connect all cells
        [connect(cells[i].n, cells[i+1].p) for i in 1:length(cells)-1]
        v_max ~ maximum([cells[i].v for i in eachindex(Qs1)])
        v_min ~ minimum([cells[i].v for i in eachindex(Qs1)])
        v_output ~ ifelse(v_min <= 2.5, v_min, v_max)
    end
...

But is there a better way to get the max and min of several input signals? Like a predefined Block?
I’m afraid the whole ifelse comparison makes the system slow when more than a few signals are being compared.

3 posts - 3 participants