Converting Berkeley Madonna Codes to Simbiology

1 Ansicht (letzte 30 Tage)
Ekram Ahmed Chowdhury
Ekram Ahmed Chowdhury am 4 Jan. 2021
Beantwortet: Imran am 2 Nov. 2022
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 Kommentare
Jeremy Huard
Jeremy Huard am 4 Jan. 2021
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
Ekram Ahmed Chowdhury am 16 Jan. 2021
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

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Imran
Imran am 2 Nov. 2022
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.

Communitys

Weitere Antworten in  SimBiology Community

Kategorien

Mehr zu Extend Modeling Environment finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by