Converting Berkeley Madonna Codes to Simbiology

조회 수: 8 (최근 30일)
Ekram Ahmed Chowdhury
Ekram Ahmed Chowdhury 2021년 1월 4일
답변: Imran 2022년 11월 2일
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
Ekram Ahmed Chowdhury 2021년 1월 16일
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