function y=volterra(g,k,x) % - Solving the Volterra integral equation by laplace transform % - y=g(x)+integral(K(x-t)*y(t),t,0:x)=g(x)+(K convolution y)=g(x)+K@y % - % - Let F= laplace(sym('y')) % - then laplace(k@y)= laplace(k) times F % - phi1=laplace(g) % - phi2=laplace(k) % - F= phi1/(1-phi2) % - % - so y=inverse laplace transform of F % - return y=ilaplace(Y) % - usage syms x define x g k y=volterra(g,k,x) % - example % - syms x g k % - g=1+x; k=exp(x); y=volterra(g,k,x); % - note in some cases when g=constant=say(5) you should write it g=5+0*x % - see also the last option on examples on laplace and volterra. % - syms x s phi1 phi2 disp(' you are solving y=g+ K o y ') disp(' by laplace transform F= L(g)/(1-L(k))') disp(' the solution y is ilaplace(F)') disp(' where g(x)= ');disp(g) disp( ' and k(x)= ');disp(k) phi1=laplace(g); disp('phi1=laplace(g)=') phi1=simplify(phi1) phi2=laplace(k); disp('phi2=laplace(k)=') phi2=simplify(phi2) F=simplify(phi1/(1-phi2)); F=factor(F) y=ilaplace(F); t=x; y=subs(y); return