Hi Ditlev,
I believe this does have an analytic solution that is not overly complicated, of the form
x = (a+be^(-ct)) / (f+ge^(-ct))
First of all the scaling of this problem is not too good so I went to the variables (I used y in place of your x2)
u = km*t x = (kp/km) x_old y = (kp/km) y_old
in which case the equations are
x' = 2y - 2x^2
y' = -y + x^2
where differentiation is d/du. The starting value for the new x is
The most complicated the algebra gets is the roots of a quadratic eqn. The code below plots both a numerical and analytic solution.
Eventually the solution gets to the fixed point
x = r1 = 18.9966 y = -r1/2 + C = 360.8721
at which point x^2 = y and both derivatives are zero.
kp = 2*10^7;
km = 0.27*10^-4;
x0 = (kp/km)*1e-9
y0 = 0;
[unum xynum] = ode45(@(u,xy) fun(u,xy), [0 .01], [x0 y0]);
C = x0/2;
r = roots([1,1/2,-C]);
r1 = max(r);
r2 = min(r);
alpha = 2*(r1-r2);
D = (x0-r1)/(x0-r2);
u = 0:1e-4:.01;
x = (r1-D*r2*exp(-alpha*u))./(1-D*exp(-alpha*u));
y = -x/2 + C;
figure(1)
plot(unum,xynum,u,x,'o',u,y,'o')
grid on
function dxy = fun(u,xy)
dxy = zeros(2,1);
dxy(1) = 2*xy(2)-2*xy(1)^2;
dxy(2) = -xy(2) + xy(1)^2;
end
.
Best Answer