# CellmlToolkit.jl: How to get observables?

**URL:** https://discourse.julialang.org/t/cellmltoolkit-jl-how-to-get-observables/69151
**Category:** Modelling & Simulations
**Tags:** question
**Created:** [October 3, 2021, 9:02pm UTC](https://discourse.julialang.org/t/cellmltoolkit-jl-how-to-get-observables/69151 "2021-10-03T21:02:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![andreypikunov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andreypikunov/32/29674_2.png) [@andreypikunov](https://discourse.julialang.org/u/andreypikunov)
#### Post date: [October 3, 2021, 9:02pm UTC](https://discourse.julialang.org/t/cellmltoolkit-jl-how-to-get-observables/69151/1 "2021-10-03T21:02:00Z")

</div>

Hello!

Using Beeler-Reuter model from the [README](https://github.com/SciML/CellMLToolkit.jl#cellmltoolkitjl) I can list **observables** :

```julia
julia> ml = CellModel("models/beeler_reuter_1977.cellml.xml")
julia> observed(ml.sys)
39-element Vector{Equation}:
 slow_inward_current_f_gate₊V(time) ~ membrane₊V(time)
 slow_inward_current₊f(time) ~ slow_inward_current_f_gate₊f(time)
 ⋮
 time_dependent_outward_current₊i_x1(time) ~ membrane₊i_x1(time)
 slow_inward_current₊i_s(time) ~ membrane₊i_s(time)
julia> ml.sys.membrane₊i_Na
var"##ODESystem#257₊membrane₊i_Na"(time)

```

But I do not understand how to get them calculated over time (and then plot, for example) after I solve the model.

For example, I would like to do this like:

```julia
prob = ODEProblem(ml, (0, 42.0))
sol = solve(prob)
sol[membrane₊i_Na]

```

but this does not work.  
Could you help me?

---

<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: [October 4, 2021, 2:56pm UTC](https://discourse.julialang.org/t/cellmltoolkit-jl-how-to-get-observables/69151/2 "2021-10-04T14:56:36Z")

</div>

> [@andreypikunov](#):
>
> ```julia
> prob = ODEProblem(ml, (0, 42.0))
> sol = solve(prob)
> sol[membrane₊i_Na]
> 
> ```

```julia
prob = ODEProblem(ml, (0, 42.0))
sol = solve(prob)
sys = ml.sys
sol[@nonamespace sys.membrane₊i_Na]

```

This is missing docs so I just pinged @YingboMa to make sure the namespacing gets documented.

---

<div class="post-metadata">

### Author: ![andreypikunov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andreypikunov/32/29674_2.png) [@andreypikunov](https://discourse.julialang.org/u/andreypikunov)
#### Post date: [October 20, 2021, 2:15pm UTC](https://discourse.julialang.org/t/cellmltoolkit-jl-how-to-get-observables/69151/3 "2021-10-20T14:15:39Z")

</div>

Thank you!  
`@nonamespace` did everything I needed.  
🙂

---

<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: [October 20, 2021, 2:19pm UTC](https://discourse.julialang.org/t/cellmltoolkit-jl-how-to-get-observables/69151/4 "2021-10-20T14:19:59Z")

</div>

And we can make that a bit more automatic in the near future.
