# How to use matlab to a simple convolution problem (a convolution of the solution of the diffusion equation with continuous sources)?

I assume this is a simple problem, but since I don't have a strong maths background, I have trouble to implement this in matlab. Could anyone help me with it? Many thanks!

The concentration of a molecule A can be written as a convolution of of the diffusion equation solution with continuous sources. The concentration of A at position r at time t is

or simply speaking

, where f is the function of the continuous point source and h is the diffusion function.

I want to plot the concentration of A versus time t and also I need to use this equation to produce A(r,t) for a set of ODEs.

Hint: define some discrete time interval for t and scale the $t_i$ as you want ($t=[t_0,t_1,..., t_m]$). Do the same with $\tau=[\tau_0,\tau_1,..., \tau_n]$, for each $t_i$ evaluate $d_i=t_i-\tau$ then Evaluate $f(\tau)$ and $h(d_i)$ then call this function in Matlab:
$c = conv(f,h)$
Notice that the shape of $c$ will not be the same as the one of $f$ and $h$, you can just consider the data of the area of interest.