MATLAB: Nonlinear differential equation system

nonlinear ode;matlab

dx1dtx1x3*x1^2/(1+x1)
dx2dtx2x3*x2^2/(1+x2)
x1+x2=2
x1(0)=0.5;x2(0)=1.5;
x3(0)=1
three equations with three unknowns,how to solve it by matlab

Best Answer

Your three equations can be reduced to one equation. By using the second two equations it can be deduced that
x2 = 2 - x1
x3 = (1+x1)*(3-x1)/2
and from this a single equation in x1 can be obtained:
dx1/dt = x1-3/2*x1^2+1/2*x1^3
From this by partial fractions it follows that:
log(abs(x1*(x1-2)/(x1-1)^2)) = t-t0
for an arbitrary constant t0, and from this
x1*(x1-2)/(x1-1)^2 = ±exp(t-t0)
This is a quadratic equation that can be solved for x1 and thereby obtain explicit expressions for x1(t) in terms of exp(t-t0). For that reason you would not have to use the numerical ‘ode’ functions.
Related Question