# reactionMechanismSimulator.jl idealGas() call fails due to no default for stoichmatrix

**URL:** https://discourse.julialang.org/t/reactionmechanismsimulator-jl-idealgas-call-fails-due-to-no-default-for-stoichmatrix/61502
**Category:** Modelling & Simulations
**Tags:** question
**Created:** [May 20, 2021, 8:46am UTC](https://discourse.julialang.org/t/reactionmechanismsimulator-jl-idealgas-call-fails-due-to-no-default-for-stoichmatrix/61502 "2021-05-20T08:46:43Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ziolai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ziolai/32/23422_2.png) [@ziolai](https://discourse.julialang.org/u/ziolai)
#### Post date: [May 20, 2021, 8:46am UTC](https://discourse.julialang.org/t/reactionmechanismsimulator-jl-idealgas-call-fails-due-to-no-default-for-stoichmatrix/61502/1 "2021-05-20T08:46:43Z")

</div>

The basic example of idealGas in reactionMechanism.jl fails to due no default for stoichmatrix.

Advice to fix is much appreciated. Thx!

```
    using ReactionMechanismSimulator

phaseDict = readinput("src/superminimal.rms")
spcs = phaseDict["phase"]["Species"]
rxns = phaseDict["phase"]["Reactions"]
ig = IdealGas(spcs,rxns,name="gas")
# ERROR: LoadError: Field 'stoichmatrix' has no default, supply it with keyword.
# Stacktrace:
# [1] error(s::String)
# @ Base ./error.jl:33
# [2] IdealGas(species::Vector{Species}, reactions::Vector{ElementaryReaction}; name::String, diffusionlimited::Bool)
# @ ReactionMechanismSimulator ~/.julia/packages/ReactionMechanismSimulator/MW0YP/src/Phase.jl:32
# [3] top-level scope
# @ ~/Projects/SIR/src/RMS.jl:6

initialconds = Dict(["T"=>1000.0,"P"=>1e5,"H2"=>0.67,"O2"=>0.33]) # Initial Temp and Pressure
domain,y0,p = ConstantTPDomain(phase=ig,initialconds=initialconds)

react = Reactor(domain,y0,(0.0,150.1);p=p)
sol = solve(react.ode,CVODE_BDF(),abstol=1e-20,reltol=1e-12)

bsol = Simulation(sol, domain)

```

---

<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: [May 20, 2021, 9:57am UTC](https://discourse.julialang.org/t/reactionmechanismsimulator-jl-idealgas-call-fails-due-to-no-default-for-stoichmatrix/61502/2 "2021-05-20T09:57:29Z")

</div>

I don’t think Matt uses this so you might want to email him directly.

---

<div class="post-metadata">

### Author: ![ziolai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ziolai/32/23422_2.png) [@ziolai](https://discourse.julialang.org/u/ziolai)
#### Post date: [May 20, 2021, 10:13am UTC](https://discourse.julialang.org/t/reactionmechanismsimulator-jl-idealgas-call-fails-due-to-no-default-for-stoichmatrix/61502/3 "2021-05-20T10:13:25Z")

</div>

Apologies for being slow in my comprehension.

Who is Matt? What do I tell him?

Thx, Domenico.

---

<div class="post-metadata">

### Author: ![mjohnson541](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mjohnson541/32/25271_2.png) [@mjohnson541](https://discourse.julialang.org/u/mjohnson541)
#### Post date: [May 20, 2021, 1:16pm UTC](https://discourse.julialang.org/t/reactionmechanismsimulator-jl-idealgas-call-fails-due-to-no-default-for-stoichmatrix/61502/4 "2021-05-20T13:16:55Z")

</div>

Thanks Chris for the ping. I’m having trouble reproducing this issue on master or on v0.3.2. My guess is this is a call syntax thing, it’s possible this might be dependent on julia version, I’m using v1.4.2. I think:

ig = IdealGas(spcs,rxns;name=“gas”)

Should definitely work.

---

<div class="post-metadata">

### Author: ![ziolai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ziolai/32/23422_2.png) [@ziolai](https://discourse.julialang.org/u/ziolai)
#### Post date: [May 20, 2021, 4:13pm UTC](https://discourse.julialang.org/t/reactionmechanismsimulator-jl-idealgas-call-fails-due-to-no-default-for-stoichmatrix/61502/5 "2021-05-20T16:13:04Z")

</div>

Sincere thx! I will look into it further. To be continued.

---

<div class="post-metadata">

### Author: ![ziolai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ziolai/32/23422_2.png) [@ziolai](https://discourse.julialang.org/u/ziolai)
#### Post date: [May 24, 2021, 7:02am UTC](https://discourse.julialang.org/t/reactionmechanismsimulator-jl-idealgas-call-fails-due-to-no-default-for-stoichmatrix/61502/6 "2021-05-24T07:02:59Z")

</div>

Is there any reason why this would no longer work under Julia 1.6? What is a good way to gain more understanding in this matter? Thx again.

---

<div class="post-metadata">

### Author: ![mjohnson541](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mjohnson541/32/25271_2.png) [@mjohnson541](https://discourse.julialang.org/u/mjohnson541)
#### Post date: [June 29, 2021, 10:19pm UTC](https://discourse.julialang.org/t/reactionmechanismsimulator-jl-idealgas-call-fails-due-to-no-default-for-stoichmatrix/61502/7 "2021-06-29T22:19:23Z")

</div>

I figured out the bug and the fix is merged to master now, but I haven’t had time to do a new release yet.

---

<div class="post-metadata">

### Author: ![ziolai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ziolai/32/23422_2.png) [@ziolai](https://discourse.julialang.org/u/ziolai)
#### Post date: [June 30, 2021, 6:51am UTC](https://discourse.julialang.org/t/reactionmechanismsimulator-jl-idealgas-call-fails-due-to-no-default-for-stoichmatrix/61502/8 "2021-06-30T06:51:04Z")

</div>

Thank you so much! We will get back to you on this.
