Matlab :Continuous Convolution and plotting

孤街浪徒 提交于 2019-12-21 22:15:53

问题


I would like to compute circular convolution of Input Concentration values with Output concentration equation and plot accordingly, following are my functions

The function for Input Concentration is computed as follows and the plot of Concentration Vs time is plotted

function c = Input_function(t, a1, a2, a3, b1, b2, b3, td, tmax)



c = zeros(size(t));

ind = (t > td) & (t < tmax);
c(ind) = (t(ind) - td) ./ (tmax - td) * (a1 + a2 + a3);


ind = (t >= tmax);
c(ind) = a1 * exp(-b1 * (t(ind) - tmax))+ a2 * exp(-b2 * (t(ind) - tmax)) + a3 * exp(-b3   * (t(ind) - tmax));





plot(t, c);
%plot(t,c_t);
hold all;


axis([-100 5000 -2000 80000]);
xlabel time ;
ylabel concentration ;

end

Now i would like to compute the convolution of the above function with following equation.

C_tot = ((k1*k2)/(k2+k3))*exp(-(k2+k3)*t) + (k1*k3)/(k2+k3)

where C_tot represents Output equation.

Basically i have to computed the Convolution of

C_tot and C(ind) at (t > td) & (t < tmax)

C_tot and C(ind) at (t >= tmax)

and plot the them accordingly, kindly let me know how shall i proceed this problem in matlab, the values K1,K2 K3 are user defined

来源:https://stackoverflow.com/questions/21819133/matlab-continuous-convolution-and-plotting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!