Skip to content

getu seems broken for ArraySymbolic #95

Open
@hexaeder

Description

@hexaeder

If getu(sys, sym::ArraySymbolic) with an ArraySymbolic, sym used to be collected. Now, it resolves the indices, idx = variable_indices(sys, sym) which, in my case, returns something like Int[1,2]. However this ends up as some _getp call

ts_idxs = get_all_timeseries_indexes(sys, sym_arr)
if !(ContinuousTimeseries() in ts_idxs)
return getp(sys, sym)
end

because sym_arr = [1,2] which is neither variable nor parameter of my inpr thus the timeseries idx do not contain ContinuousTimeseries().

Can be solved if get_all_timeseries_indexes(inpr, sym) returns Set([SII.ContinuousTimeseries()]) for random inputs (in this case: integers). But does this really make sense? For example, that's not how it is defined in SymbolCache, which just returns an empty set.

function get_all_timeseries_indexes(sc::SymbolCache, sym)
if is_variable(sc, sym) || is_independent_variable(sc, sym)
return Set([ContinuousTimeseries()])
elseif is_timeseries_parameter(sc, sym)
return Set([timeseries_parameter_index(sc, sym).timeseries_idx])
else
return Set()
end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions