# Sim\_plot error "type NamedTuple has no field cp" Bug

**URL:** <https://discourse.pumas.ai/t/sim-plot-error-type-namedtuple-has-no-field-cp-bug/746>\
**Category:** Pumas issues\
**Created:** [August 26, 2022, 2:44pm UTC](https://discourse.pumas.ai/t/sim-plot-error-type-namedtuple-has-no-field-cp-bug/746 "2022-08-26T14:44:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![achamzas](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/achamzas/32/339_2.png) [@achamzas](https://discourse.pumas.ai/u/achamzas)\
**Post date:** [August 26, 2022, 2:44pm UTC](https://discourse.pumas.ai/t/sim-plot-error-type-namedtuple-has-no-field-cp-bug/746/1 "2022-08-26T14:44:02Z")

</div>

Hello,

I think I found a bug using the sim\_plot function.

When the @derived block is written as “cp := @. (Central/Vc)” and I try to run the sim\_plot with observation on :cp then i get the error “type NamedTuple has no field cp”.

I found that if I remove the “:” from the derived block it works, meaning @derived “cp = @. (Central/Vc)” .

I have attached the 2 photos, one that doesn’t work and one that does work

Does not work

 ![sim_plotBug](https://canada1.discourse-cdn.com/flex030/uploads/pumas/original/1X/778abc24705c794b30a3753635671c59c7ca2cc7.png)

Work

 ![sim_plotBug2](https://canada1.discourse-cdn.com/flex030/uploads/pumas/original/1X/06d2a41fc70efa7423eda36baedfc28c13eaab44.png)

Athanasios Chamzas

---

<div class="post-metadata">

**Author:** ![donaldlee3](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/donaldlee3/32/165_2.png) [@donaldlee3](https://discourse.pumas.ai/u/donaldlee3)\
**Post date:** [August 26, 2022, 2:59pm UTC](https://discourse.pumas.ai/t/sim-plot-error-type-namedtuple-has-no-field-cp-bug/746/2 "2022-08-26T14:59:02Z")

</div>

Hi Athanasios,

This is actually not a bug. The ‘:=‘ suppresses cp from being saved in the output after using the model. So if you want to potentially use cp outside of the model, you just use =.

---

<div class="post-metadata">

**Author:** ![achamzas](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/achamzas/32/339_2.png) [@achamzas](https://discourse.pumas.ai/u/achamzas)\
**Post date:** [August 26, 2022, 5:04pm UTC](https://discourse.pumas.ai/t/sim-plot-error-type-namedtuple-has-no-field-cp-bug/746/3 "2022-08-26T17:04:37Z")

</div>

Oh i am sorry, thank you very much!
