(Matlab)如何根据参数绘制两个ODE的相图(不是图中的x(1),x(2))
亲爱的大家,我是 matlab 的新用户,正在做一个关于动态系统的项目。我有两个方程,其中 T0、epsilon (E)、a 是固定的。我想查看当 b 和 c 分别在 (0, 4) 和 (0, 100) 范围内选择时的噬菌体图。图中,I 区代表不稳定极限环,II 区代表单稳态,II 区代表双稳态。
事实上,我认为我可以通过首先在b、c噬菌体中任意选择一个点,然后计算x1和x2的相应值,使ODE的左边部分等于0来绘制图形。然后计算右边部分的雅可比矩阵,判断矩阵是否为特征值。如果它大于零,则系统不稳定。
结果应该如下图所示。
但是我真的不知道如何确定图形分界线上的点。请提供您有用的建议。提前致谢。
PS: T0 = 0.1,epsilon = 0.1 a = 0.1 0 <= b <= 4.0; 0 <= c <= 100;
PP.S: 图表和方程摘自 http://www.ncbi。 nlm.nih.gov/pmc/articles/PMC2527901/(第二部分:生化振荡网络的景观与通量)
我当前的解决方案应该如下,但我无法cat J. %条件:
%(1) F1 = F2 = 0 (2) 雅可比行列式 = 0
%目的:
%获得 b 和 c 的非线性方程;
a = 0.1; epslion = 0.1; T0=5.0;
%使用符号计算
syms xybc
F = [((epslion ^ 2 + x ^ 2 ) / ( 1 + x ^ 2) ) / (1 + y) - a * x; b / T0 - y / ( T0 * (1 + c * x ^ 2) )]; V = [x, y];
%计算雅可比矩阵
J = 雅可比(F, V);
%ODE的符号解:
%分别写出方程
S1 = dsolve ('Dx = ((epslion ^ 2 + x ^ 2 ) / ( 1 + x ^ 2) ) / (1 + y) - a * x') ; S2 = dsolve('Dy = b / T0 - y / ( T0 * (1 + c * x ^ 2) )');
BC_cal = [J(1) J(2) S1 S2]; *%%%错误,不能加入S1,因为S1 =solve(sum)****,不能计算?*
fsolve(BC_cal);
Dear all, I am a new user of matlab on a project about dynamic system. I have two equations, in which T0, epsilon (E), a are fixed. I want to see the phage diagram when the b and c is choosen in the range in (0, 4) and (0, 100), respectively. In the graph, region I represent the unstable limit cycle while the region II the monostable and the region II the bistable region.
In fact, I think that I may be able to draw the graph by firstly arbitrarily choosing a point in b, c phage and then calculating corresponding values of x1 and x2 which enables the left part of the ODEs equals to zero. Then calculate the jacobian matrix of the right part to determine whether the egenvalue of the matrix. If it is greater than zero, then the system is unstable.
The result should be like the graph below.
But I really don't know how to determine the point on the demarcating line of the graph. Please offer your useful suggestions. Thanks in advance.
P.S:
T0 = 0.1, epsilon = 0.1 a = 0.1
0 <= b <= 4.0;
0 <= c <= 100;
PP.S:
The graph and equations is an excerpt from the http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2527901/ (part two: landscape and flux of biochemical oscillation network)
My current solution should be the following, but I cannot cat J.
%Condition:
%(1) F1 = F2 = 0 (2) Jacobian = 0
%Aim:
%Obtain a non-linear equation for b and c;
a = 0.1; epslion = 0.1; T0 = 5.0;
%use the symbolic calcution
syms x y b c
F = [((epslion ^ 2 + x ^ 2 ) / ( 1 + x ^ 2) ) / (1 + y) - a * x;
b / T0 - y / ( T0 * (1 + c * x ^ 2) )];
V = [x, y];
%calculate the jacobian matrix
J = jacobian(F, V);
%the symbolic solution of ODE:
%write the equation separately
S1 = dsolve ('Dx = ((epslion ^ 2 + x ^ 2 ) / ( 1 + x ^ 2) ) / (1 + y) - a * x');
S2 = dsolve ('Dy = b / T0 - y / ( T0 * (1 + c * x ^ 2) )');
BC_cal = [J(1) J(2) S1 S2];
*%%%wrong, cannot join S1, because S1 = solve(sum)****, not be calculated?*
fsolve(BC_cal);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个棘手的问题,我想你需要决定如何解决它(蛮力与技巧):要么严格数字化,要么代数+数字化。对于前者,Matlab 就可以了,后者需要一些颂歌的技巧。
我不认为查看雅可比矩阵是正确的选择,尽管我可能是错的。以下是我的一些想法:
案例 1:使用 matlab 中的 ode 求解器和扩展向量输入:
[x1 dx1/dt x2 dx2/dt]
并改变 for(或 parfor 中的 b 和 c ) 循环。当 dx1/dt 或 dx2/dt → 时,变量稳定。 0 为 t -> oo。请参阅此问题的第二个解决方案弄清楚如何去做。最终,您将得到一个很好的近似解决方案,但您将陷入大量数据之中。情况 2:重写两个方程,使每个方程只有一个(x1 或 x2)变量。这并不太难,但是得到的微分方程将很难看。然后你可以尝试用数值方法求解这些方程(我怀疑mathematica应该能够做到这一点),从而确定a、b和c如何直接影响你的解决方案
顺便说一句,我认为正确的术语是阶段 图表
that's a tough question and I guess you need to make a decision on how to solve it (brute force vs finesse): either strictly numerically or algebraically + numerically. For the former, Matlab will do fine, the latter requires some skills with ode's.
I don't think looking at the jacobian is the way to go, although I could be wrong. Here are a couple of my ideas:
Case 1: use the ode solver in matlab with an expanded vector input:
[x1 dx1/dt x2 dx2/dt]
and vary b and c in for(or parfor) loops. Stability for the variables occur when dx1/dt or dx2/dt -> 0 as t ->oo. See the second solution of this question to figure out how to do it. Eventually, you'll have a good approximation of your solution, but you'll be stuck with a lot of data.Case 2: rewrite both equations to only have one (x1 or x2) variable per equation. It's not too hard but the resulting differential equations will be ugly like hell. You can then try and solve those equation with numerical methods (I suspect mathematica should be able to do this), and thus determine how a,b and c directly influence your solution
btw I think the proper term is phase diagram