Question

syms a(t) b(t) c(t) d(t) e(t) f(t)

S = dsolve(
        diff(a) == -kd*a*b^2, ...
        diff(b) == -kf*b*c^2, ...
        diff(c) == kd*a*b^2 - ke*a*d, ...
        diff(d) == kd*a*b^2, ...
        diff(e) == -ke*a*d, ...
        diff(f) == kf*b*c^2)

It returns this error:

Warning: Explicit solution could not be found. 
> In dsolve at 194
  In hw8 at 14 

S =     
   [ empty sym ]
Was it helpful?

Solution

This non-linear system of ODEs is not easily solved analytically. You can try Mathematica if you have it (it tends to be better at symbolic math than MATLAB's MuPad):

DSolve[{a'(t) = -k*d(t)*a(t)*b(t)^2, b'(t) = -k*f(t)*b(t)*c(t)^2, c'(t) = k*d(t)*a(t)*b(t)^2 - k*e(t)*a(t)*d(t), d'(t) = k*d(t)*a(t)*b(t)^2, e'(t) = -k*e(t)*a(t)*d(t), f(t) = k*f(t)*b(t)*c(t)^2}, {a(t),b(t),c(t),d(t),e(t),f(t)}, t]

(I can't test this because the input is too long for the free version of Wolfram|Alpha :)

Anyway, it's easy to do it numerically in MATLAB:

function top

    %// Initial values (random for this example)
    y0 = 125*randn(6,1);

    %// Time span to simulate
    tspan = [0 +1];

    %// Solve system numerically
    [t,y] = ode45(@deriv, tspan, y0);

    %// Make a nice plot
    plot(t,y)
    xlabel('t'), ylabel('function values')
    legend('a(t)', 'b(t)', 'c(t)', 'd(t)', 'e(t)', 'f(t)')

end

function dydt = deriv(~,y)

    %// Set the value for your 'k'
    k = 1e-4;

    %// rename the variables for clarity
    [a,b,c,d,e,f] = deal(y(1),y(2),y(3),y(4),y(5),y(6));

    %// Compute the derivative
    dydt = k * [
        -d*a*b^2
        -f*b*c^2
        +a*(d*b^2 - e*d)
        +d*a*b^2
        -e*a*d
        +f*b*c^2
    ];

end

One of the funkier solutions I got with this:

enter image description here

Out of curiosity: what do these equations describe? I'd say concentrations of substances undergoing a chemical reaction, but it'd be pretty strange (for some initial values you'll find negative concentrations, singularities, etc., stuff you just wouldn't expect in such systems, so...my curiosity is triggered :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top