How do I calculate a derivative of a time-variable parameter in SimBiology ?
이전 댓글 표시
In SimBiology project I have a parameter that is time dependent. I need its time derivative to use in a formula. How do I calculate the time derivative in Simbiology ?
댓글 수: 3
Ingrid Tigges
2015년 9월 9일
How does the equation for your parameter look like? Can you post an example? In principle you can calculate it using delta parameter/delta t but I am not sure whether this what you are looking for.
Sergey Ermakov
2015년 9월 9일
Ingrid Tigges
2015년 9월 11일
Can you post a small example (the .sbproj file) here?
채택된 답변
추가 답변 (1개)
Chao'en Li
2015년 10월 20일
0 개 추천
I met the same problem.
For a reaction a + b = c, I set unknown Kinetic Law, with Reaction Rate as k*Ca*Cb,(Ca and Cb are concentrations of a and b)and repeated assignments: dc_dt = k*Ca*Cb, and Ca = Ca_0 + time*dc_dt (dc_dt is the derivative dc/dt, Ca_0 is the initial concentration of a).
But I got error message as "Repeated assignment rules cannot create algebraic loops (for example, 'x = y' and 'y = x'). The following rules introduce algebraic loops into the model: Ca = Ca + time*dc_dt'"
How to write the following rules: dc/dt(i)=k*Ca(i)*Cb(i), Ca(i+1)=Ca(i)+dc/dt(i)*dt(i)?
댓글 수: 1
Arthur Goldsipe
2015년 10월 21일
Repeated assignments are not systems of equations that are solved simultaneously. They are simple assignments that are evaluated sequentially at each time step, so they must have a well-defined order of evaluation. You cannot simultaneously have a repeated assignment rule for dc_dt that depends on Ca and a repeated assignment rule for Ca that depends on dc_dt.
I think the real problem is that the rule for Ca isn't really doing what you want. You want Ca to be defined by integrating dc_dt. In SimBiology, you do that with a rate rule. So what I think you want to do is:
- Add a repeated assignment rule, "dc_dt = k*Ca*Cb", and
- Add a rate rule, "Ca = dc_dt"
One thing that is potentially confusing here is that the left-hand side of the rate rule really means "the time derivative of Ca". In other words, a more traditional mathematical representation of this rate rule would be "d(Ca)/dt = dc_dt".
카테고리
도움말 센터 및 File Exchange에서 Extend Modeling Environment에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!