Differential equations model it does not work

조회 수: 1 (최근 30일)
Dionisio Mendoza
Dionisio Mendoza 2019년 5월 13일
답변: Sulaymon Eshkabilov 2019년 5월 13일
I need to make the PDF model of G proteins, try to perform a function introducing the variables and equations, but when trying to run it the graph does not work out like the one in the document (section Example 3.2)
I do not know if I'm wrong about something or I just can not achieve the goal of the model.
The function file is: examenisb
function dydx = examenisb (x,y)
ki = 1;
ku = 1;
global Km1;
global Km2;
V1 = y(2)*ki*x(1)/(Km1+y(2));
V2 = y(1)*ku*x(1)/(Km2+y(1));
dadx = V1-V2;
dbdx = -V1-V2;
dydx = [dadx -dbdx]';
The scrypt file is: perrotrabajo
global Km1;
global Km2;
Km1=.001;
Km2=.001;
[x,y]=ode45(@examenisb,[0,2],[0.1 0.1]);
plot(x,y);
xlabel('tiempo (h)')
ylabel('biomasa')
title('Biomasa')

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019년 5월 13일
Hi,
There are a couple of minor (but essential) flaws, such as x(1) used (presumably) instead of y(1) in V1 and V2. Anyhow, to make this long script short, here is a much shorter script with correections w.r.t x(1) --> y(1).
clearvars; clc;
ki = 1; ku = 1;
Km1=.001; Km2=.001;
dydx = @(x, y)[ y(2)*ki*y(1)/(Km1+y(2))-y(1)*ku*x(1)/(Km2+y(1));(y(2)*ki*y(1)/(Km1+y(2))+y(1)*ku*x(1)/(Km2+y(1)))];
[x,y]=ode45(dydx,[0,2],[0.1 0.1]);
plot(x,y); xlabel('tiempo (h)'); ylabel('biomasa'); title('Biomasa'), grid on
Good luck

카테고리

Help CenterFile Exchange에서 Variables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by