First time here? Checkout the FAQ!
x
0 votes
by (220 points)

Hello,

is there an easy way to define a variable as a state variable so it is initialised and afterwards changed based on the most recent value? For example in python this would just be:

x = 0.74

z = x/(0.009*y)

x = z - 0.001/y

1 Answer

+1 vote
by (19.1k points)
selected by
 
Best answer

I think you can use the .store() markup to directly set the new value for x:

https://opencarp.org/documentation/examples/01_ep_single_cell/05_easyml#recognized-markup

Welcome to openCARP Q&A. Ask questions and receive answers from other members of the community. For best support, please use appropriate TAGS!
architecture, carputils, documentation, experiments, installation-containers-packages, limpet, slimfem, website, governance
MathJax.Hub.Config({ tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], config: ["MMLorHTML.js"], jax: ["input/TeX"], processEscapes: true } }); MathJax.Hub.Config({ "HTML-CSS": { linebreaks: { automatic: true } } });
...