convolution integral with dde

Hi guys, I am trying to solve this differential equation using dde. I have a problem with the integral term. In the code shown below, tau is the delay but I cannot just specify a constant value because it is also in the integral which goes from 0 to t. Does anywone know how to deal with it? Thank you!
%%
function sol = exer_3
sol = dde23(@exer3f,tau,[0; 0],[0, 10]);
figure
plot(sol.x,sol.y)
function v = exer3f(t,y,Z)
k = 125; m = 5; F = 1; w = 8;
c=@(t)exp(-t^2);
ylag = Z(:,1);
v = zeros(2,1);
v(1)=y(2);
v(2) = -(k*y(1) - F*cos(w*t) + integral(@(tau)c(tau).*ylag(1), 0, t,'ArrayValued',true))./m;

4 Comments

You have an integro-differential eqution -- dde23 does not help in this case.
Try
Best wishes
Torsten.
Hi Torsten,
Thank you very much for your help! I had a look at the files. Unfortunately I could not use the idsolver for my case.
If i use the 2nd order diff eq below, then the integral term has a derivative inside and the idsolver did not work for this case.
1.PNG
Otherwise I can use the state-space below, so there would be no derivatives inside the integral. Still I could not figure out how to modify the idsolver to use the state-space.
2.PNG
Torsten
Torsten on 12 Jun 2019
Edited: Torsten on 12 Jun 2019
If you substitute
y = u'
you arrive at the integro-differential equation
y'(t) = F/m * cos(w*t) - k/m*u(0) - 1/m * integral_{0}^{t} y(s)*(c(t-s)+k) ds
which has the required form.
Hi,
can i know why there is (+k) tem in the integral "(c(t-s)+k)".
Regards,
satheesh

Sign in to comment.

Answers (0)

Categories

Find more on Numerical Integration and Differential Equations in Help Center and File Exchange

Asked:

on 10 Jun 2019

Commented:

on 20 Dec 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!