# 2D arrays with ModelingToolkit

**URL:** <https://discourse.julialang.org/t/2d-arrays-with-modelingtoolkit/107448>\
**Category:** Modelling & Simulations\
**Tags:** question, package, modelingtoolkit\
**Created:** [December 11, 2023, 2:33pm UTC](https://discourse.julialang.org/t/2d-arrays-with-modelingtoolkit/107448 "2023-12-11T14:33:53Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [December 12, 2023, 11:52am UTC](https://discourse.julialang.org/t/2d-arrays-with-modelingtoolkit/107448/7 "2023-12-12T11:52:05Z")

</div>

> [@ufechner7](#):
>
> This seams to be a bit fragile. It is not clear to me if the order of the states in the state vector is well defined.

Don’t do this, the order can (and often do) change with any patch release of MTK.

The initial condition is supposed to be supplied as a dict

```julia
Dict(var => value, ...)

```

since symbolic arrays are a bit buggy, you probably have to do

```julia
Dict([
  collect(array_var1) .=> values1;
  collect(array_var2) .=> values2;
])

```

---

_[View the full topic](https://discourse.julialang.org/t/2d-arrays-with-modelingtoolkit/107448)._
