# Macros for compositional modeling in Catalyst not working

**URL:** https://discourse.julialang.org/t/macros-for-compositional-modeling-in-catalyst-not-working/116568
**Category:** Modelling & Simulations
**Tags:** question
**Created:** [July 3, 2024, 7:23am UTC](https://discourse.julialang.org/t/macros-for-compositional-modeling-in-catalyst-not-working/116568 "2024-07-03T07:23:55Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![VincentW](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vincentw/32/202719_2.png) [@VincentW](https://discourse.julialang.org/u/VincentW)
#### Post date: [July 3, 2024, 7:23am UTC](https://discourse.julialang.org/t/macros-for-compositional-modeling-in-catalyst-not-working/116568/1 "2024-07-03T07:23:55Z")

</div>

Dear all,  
I try to get into compositional modeling of reaction systems using the Catalyst.jl package.  
However, when I want to execute just their tutorial from the [documentation](https://docs.sciml.ai/Catalyst/dev/model_creation/compositional_modeling/),

```julia
using Catalyst
degradation_component = @network_component begin
  d, X --> 0
end

```

I will get the error that the macro `@network_component` is not defined.  
I am using the latest stable release of catalyst v13.5.1 and Julia v1.10.4.

Anyone a suggestion where this error could originate from?

Thanks a lot in advance.

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [July 3, 2024, 7:24am UTC](https://discourse.julialang.org/t/macros-for-compositional-modeling-in-catalyst-not-working/116568/2 "2024-07-03T07:24:53Z")

</div>

@Torkel

---

<div class="post-metadata">

### Author: ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)
#### Post date: [July 3, 2024, 11:56am UTC](https://discourse.julialang.org/t/macros-for-compositional-modeling-in-catalyst-not-working/116568/3 "2024-07-03T11:56:42Z")

</div>

You are looking at the dev version of the documentation, which contains information regarding unreleased features that are only available on the master branch. The normal documentation is available here: [Home · Catalyst.jl](https://docs.sciml.ai/Catalyst/stable/)

The `@network_component` macro will be available on v14, which should be released any day now, possibly already tomorrow (unless something unexpected happens).

---

<div class="post-metadata">

### Author: ![VincentW](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vincentw/32/202719_2.png) [@VincentW](https://discourse.julialang.org/u/VincentW)
#### Post date: [July 3, 2024, 12:28pm UTC](https://discourse.julialang.org/t/macros-for-compositional-modeling-in-catalyst-not-working/116568/4 "2024-07-03T12:28:15Z")

</div>

Ahh, I see. Thanks a lot for your help.

Then I will happily but impatiently wait for the new release.  
I think this compositional modeling is a really cool feature and I am looking forward to try it out.

---

<div class="post-metadata">

### Author: ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)
#### Post date: [July 3, 2024, 12:45pm UTC](https://discourse.julialang.org/t/macros-for-compositional-modeling-in-catalyst-not-working/116568/5 "2024-07-03T12:45:50Z")

</div>

Great!

(you are actually able to do compositional modelling right now: [Compositional Modeling of Reaction Systems · Catalyst.jl](https://docs.sciml.ai/Catalyst/stable/catalyst_functionality/compositional_modeling/), there are just some minor differences coming in the new release, here is a summary of the important differences coming: [Version 14 Migration Guide · Catalyst.jl](https://docs.sciml.ai/Catalyst/dev/v14_migration_guide/))

---

<div class="post-metadata">

### Author: ![VincentW](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vincentw/32/202719_2.png) [@VincentW](https://discourse.julialang.org/u/VincentW)
#### Post date: [July 4, 2024, 9:13am UTC](https://discourse.julialang.org/t/macros-for-compositional-modeling-in-catalyst-not-working/116568/6 "2024-07-04T09:13:51Z")

</div>

Thanks for the remark.  
Since we are already on that topic.  
If I build a compartment-based model as in the documentation. Is there a way to use the same parameter in the different compartment.  
So far it will prefix the parameter names with the compartment name and treat them as separate. However, I kind of want to have compartments with the same dynamics within and just different movement between them.

---

<div class="post-metadata">

### Author: ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)
#### Post date: [July 8, 2024, 9:11pm UTC](https://discourse.julialang.org/t/macros-for-compositional-modeling-in-catalyst-not-working/116568/7 "2024-07-08T21:11:45Z")

</div>

Sorry for the delay, you should be able to find some info here [Composing Models and Building Reusable Components · ModelingToolkit.jl](https://docs.sciml.ai/ModelingToolkit/stable/basics/Composition/#Variable-scope-and-parameter-expressions)
