Is it possible to normalize the output using GUI?

1 vue (au cours des 30 derniers jours)
Hassan Hijazi
Hassan Hijazi le 28 Mai 2020
Commenté : Hassan Hijazi le 28 Mai 2020
Let us say you have x that yeilds y. In the simulation you want to visualize the fraction of conversion: y/x+y i.e the converted x (y herein) over the non-converted x + y.
If you write an initial assignment with this rule to y you will get an error which is reasonably expected. Alternatively, adding new species will add another reaction which doesn't make sense. Using the graphical interface, how can this be resolved? Or should we use the line command instead?
  1 commentaire
Rik
Rik le 28 Mai 2020
Have a read here and here. It will greatly improve your chances of getting an answer.
A GUI only changes the way a user interacts with your functions, not the functions themselves. You need to make sure your functions work in scripts or the command line first, then you can create a GUI. For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread.

Connectez-vous pour commenter.

Réponse acceptée

Jeremy Huard
Jeremy Huard le 28 Mai 2020
Hi Hassan,
in the SimBiology Model Analyzer App you add a step to your program to define and calculate an observable.
This new observable could be defined like this:
fraction = y./x+y
with unit = dimensionless.
It is important to use ./ instead of / because this new observable will be calculated after the simulation using the resulting time-dependent vectors x and y.
Alternatively, you could also define a repeated assignment inside your model with the same equation as above. In this case, you will have to define fraction in your model as a non-constant parameter. fraction is then calculated at each simulation step like any other non-constant model quantity.
Best regards,
Jérémy

Plus de réponses (0)

Communautés

Plus de réponses dans  SimBiology Community

Catégories

En savoir plus sur Extend Modeling Environment dans Help Center et File Exchange

Tags

Produits


Version

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by