Converting Berkeley Madonna Codes to Simbiology

14 次查看(过去 30 天)
Hello
I noticed there is a file to exchange codes from Berkeley Madonna to Simbiology. I am currently working on a PBPK model and would like to implement that in Simbiology. I was wondering how to use the since there are no instructions there.
Best regards
Ekram
  2 个评论
Jeremy Huard
Jeremy Huard 2021-1-4
Hi Ekram,
the instructions can be found in the file.
help sbioimportBerkeleyMadonna
This command will show you how to use that function.
Please use the "Save equations as ..." function within Berkeley Madonna to export the original file into a text file as stated in the help notes.
Then, you can call:
simbioModel = sbioimportBerkeleyMadonna(FileName);
where FileName is a string or char array.
Best regards,
Jérémy
Ekram Ahmed Chowdhury
Dear Jeremy
Thank you so much for the feedback. We were able to convert a simple 2 compartment model from BM to Simbiology codes. However, we are facing some problems converting a full PBPK model in the same manner.
When we try to convert the codes we are getting the following error:
>> MODEL = sbioimportBerkeleyMadonna('BM_SMB_ADAPT_CONV_CODE_2.txt')
This key is not supported: dt
Adding ODEs as rate rules ...
Operands to the || and && operators must be convertible to logical scalar values.
Error in sbioimportBerkeleyMadonna>parseRateRules2Reac (line 952)
if indicesRR{k}-1 ~= 0 && rhs{j}(indicesRR{k}-1) == '-'
Error in sbioimportBerkeleyMadonna (line 265)
parseRateRules2Reac(simbioModel);
We were wondering if you could suggest what these errors mean and how we can trouble shoot this issue.
Looking forward to your suggestions.
Best regards
Ekram

请先登录,再进行评论。

回答(1 个)

Imran
Imran 2022-11-2
Hello Ekram,
I understand that you want to implement PBPK model in SimBiology.
For importing "Berkeley Madonna" model files into SimBiology model you can invoke ''sbioimportBerkeleyMadonna" function in your script. The documentation can be found here.
In MATLAB, the "&&" operator is the "short-circuit and" operator and can only be used if the two sides compute scalars.
For example, in the below expression,
A && B
MATLAB does not evaluate condition B at all if condition A is zero (scalar). Once it is determined that A is zero (scalar), the value of B cannot change the outcome of the operation.
The "&" operator on the other hand, is "element-wise logical and". When two arrays of compatible size are present, it computes each element on the left "and" the element on the right, doing array expansion if needed. The result is a logical array of size implied by any necessary expansions. To logically compare vectors (which is done per element), you must use "&". If you want to see if two vectors are equal, use the below function instead.
isequal(a,b)
I hope this helps.

社区

更多回答在  SimBiology Community

类别

Help CenterFile Exchange 中查找有关 Extend Modeling Environment 的更多信息

标签

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by