# ModelingToolkit -- limits to parameter blocks, etc.?

**URL:** <https://discourse.julialang.org/t/modelingtoolkit-limits-to-parameter-blocks-etc/119608>\
**Category:** Modelling & Simulations\
**Created:** [September 19, 2024, 2:36pm UTC](https://discourse.julialang.org/t/modelingtoolkit-limits-to-parameter-blocks-etc/119608 "2024-09-19T14:36:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [September 19, 2024, 2:36pm UTC](https://discourse.julialang.org/t/modelingtoolkit-limits-to-parameter-blocks-etc/119608/1 "2024-09-19T14:36:39Z")

</div>

Assume I create a ModelingToolkit “instantiator”, say:

```julia
@mtkmodel Tank begin
@structural_parameters
    case = :std
@parameters begin
    ...
end
@variables begin
    ...
end
@equations begin
    ...
end
end

```

**Questions** :

1. Is it permissible to have more than one “block” of each type, e.g., can I split parameters into two `@parameters` blocks, e.g.,

```julia
@parameters begin 
    a = 2
end
@parameters begin 
    b = 2
end

```

Would this be the same as?

```julia
@parameters 
    a = 1
    b = 2
end

```

1. If yes, can I do the same for other “blocks”, e.g., `@variables`, etc.?
2. Can I mix the order?, e.g.,

```julia
@parameters begin
    a = 1
end
@variables begin
    x(t)=5
end
@parameters begin
    b = 2
end
@variables begin
    y(t) = 3
end

```

1. Can I have several tests of parameters/structural parameters in the equation block? E.g.

```julia
@equations begin
    if case == :std
        x ~ 2y
    else
        x ~ -2y
    end
    y ~z
    if case == :std
        w ~z
    else
        w ~ -z
    end
end

```

or do I need to collect cases in a single block?

[I’m getting very strange results when instantiating the model… goes from working to giving warning/error message if I put an equation into an if-test, even if the if test is true…]
