species go to negative values

2 ビュー (過去 30 日間)
Day
Day 2024 年 5 月 14 日
コメント済み: Day 2024 年 5 月 30 日
Hi
I developed a model in Simbiology simulating the effect of a drug on a tissue mass. Sometime, I received a message that the integration toerance does not met and other times I had a mass species with negative values.Why does the software allow the value of a species representing the mass of this tissue go to negative values? what is the cause of this issue and how can I solve it? I want the content of this species to go as small as it can go without jumping to negative values.
Thank you
  2 件のコメント
emjey
emjey 2024 年 5 月 14 日
In general it is not impossible to get negative values as solutions. Imagine for example zero-order degradation in your system, it will lead to negative solutions eventually.
To help you with your specific issue it would be good to have a concrete example.
Day
Day 2024 年 5 月 30 日
Thank you

サインインしてコメントする。

回答 (2 件)

John D'Errico
John D'Errico 2024 年 5 月 14 日
編集済み: John D'Errico 2024 年 5 月 14 日
Remember that the software does not truly understand your model, and what you are attempting to simulate in that model. It only understands numbers. And numbers have no non-negativity constraint, so in certain circumstances, you could have a problem where negative numbers made sense.
I would suggest you work in terms of the log of the mass, I'll call it m. Wherever you need the mass itself (M) all you need do is use the simple transformation
M = exp(m)
Note that the log of the mass now has no constraints, and the mass will always be a positive value. This simple transformation makes a lot of sense when you have a problem where a value can span orders of magnitude, as otherwise, there will often be numerical problems. This sort of transformation is often appropriate when you have a variable which really only works in terms of positive numbers.
  1 件のコメント
Day
Day 2024 年 5 月 30 日
Thank you

サインインしてコメントする。


Jeremy Huard
Jeremy Huard 2024 年 5 月 15 日
I would also recommend to have a look at the Model Debugger for SimBiology. This tool will allow you to define breakpoint conditions (e.g. negative species values) to pause a model simulation and investigate which term is problematic.
  1 件のコメント
Day
Day 2024 年 5 月 30 日
Thank you

サインインしてコメントする。

コミュニティ

その他の回答  SimBiology コミュニティ

カテゴリ

Help Center および File ExchangeExtend Modeling Environment についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by