Concentration in each compartment at a fixed time

조회 수: 2 (최근 30일)
Rakesh
Rakesh 2014년 5월 2일
답변: Ingrid Tigges 2014년 5월 13일
I have designed a physiological model with multiple compartments in SimBiology. I am interested in finding the concentration of drug (or species) in each compartment at a fixed time (the compartment are given a differential equation). Since, I'm new to MATLAB coding, I would appreciate if anyone can suggest me the code I could use to find the concentration in each compartment at a fixed time. I can get the graph and extract the data, but I'm looking for a simpler way.
Thank you!
  댓글 수: 1
Arthur Goldsipe
Arthur Goldsipe 2014년 5월 3일
Are you using the SimBiology desktop or the command line? What version of MATLAB are you using?

댓글을 달려면 로그인하십시오.

답변 (1개)

Ingrid Tigges
Ingrid Tigges 2014년 5월 13일
Hi Rakesh,
Since I do not know whether you are using the SimBiology Desktop, let me explain the Desktop and Command Line approach (assuming you are using a relatively new version of MATLAB). The SimBiology Desktop approach:
  • Click on Simulation Settings
  • Specify the output times
  • Click on Task Results => More => Export Data
  • If you select export data as separate variables ensure that Time and States are ticked
  • Select the row of x which represents the time point you are interested inThese are the data you are looking for.
In case you are using the programmatic approach you can the same data as follows:
sbioloadproject radiodecay.sbproj
configsetObj = getconfigset(m1);
set(configsetObj.SolverOptions, 'OutputTimes', [1:10])%Specify the output times like it is done in the command line
[time,x,names] = sbiosimulate(m1,configsetObj)
Like in the SimBiology Desktop approach you can now select the row of x you are interested. I hope this helps. Let me know if you have further questions.

커뮤니티

더 많은 답변 보기:  SimBiology Community

카테고리

Help CenterFile Exchange에서 Scan Parameter Ranges에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by