2014-03-27 71 views
0
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) 

它返回此錯誤:爲什麼此係統解算器無法正常工作?

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

S =  
    [ empty sym ] 
+1

...你爲什麼感到驚訝?你有一些關於微分方程的類嗎? –

+0

我假設'kd','kf'等是指'k * d'和'k * f'? –

+0

對不起,他們只是常數... kd = .25; ke = .1; kf = 5,我正在與化學rxn和率法律... – Prefoninsane

回答

4

微分方程is not easily solved analytically的這種非線性系統。您可以嘗試Mathematica如果有的話(它往往是在符號數學比MATLAB的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] 

(我不能對此進行測試,因爲輸入過長的Wolfram|Alpha免費版本:)

不管怎麼說,這是很容易做到數字它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 

其中funkier解決方案,我用這個得了的:

enter image description here

出於好奇:做這些方程描述?我想說的經歷化學反應物質的濃度,但它會是非常奇怪的(對於一些初始值,你會發現濃度,奇異等,東西你只是不會在這些系統中期望,所以...我的好奇心被觸發:)

+0

謝謝Rody!對不起,我沒有提供更多信息,它是經歷多個rxns的不同物種的濃度: A + 2B→C + D; 2D + 3A→C + E; B + 2C→D + F; 已知: RD = kdCaCb^2 重新= keCaCd RF = kfCbCc^2 和 KD = 0.25; ke = .1; kf = 5; v0 = 10; ca0 = 1.5; cb0 = 2.0; 讓我知道這是否改變了什麼? – Prefoninsane