How to solve a differential equation with a integral equation on the right side
Show older comments
Hi, I am a new user of Matlab, now I am facing a coding problem which take me a lot of time. I do not know how to solve a differential equation with a integral equation on the right side. The equations are:

My code is attached here. If anyone has the right answer, please tell me how to do it. It really drive me crazy in these days.
Answers (1)
Torsten
on 11 May 2015
I did not check your integrand in detail, but you will have to avoid sinh(2*pi*tau) to become zero at tau=0 in the denominator. Further, I don't know whether the integral converges. This is an acceptable code without modifying the integrand. You can also use ODE45 or some other ODE integator instead of your own for-loop.
Best wishes
Torsten.
% Floating Stage : 101kpa to 10 kpa, intitial bubble radius 15 um, initial contact angle 160,t1=2s.
Ci=2.248*10^(-2); %kg/m3 stuarated air in water in 1 atm
Cs=2.686*10^(-4); %kg/m3 sturated air in water-bubble interface in 35 kpa
sigma=71.97*10^(-3); % N/m
P0=100930.2; % N/m2 101kpa
t1= 2; %s
R1=14.6913*10^(-6); % m
rho=1.29; %kg/m3
D=1.733*10^(-8); % m2/s
n=1000;
dt=t1/1000;
theta0=(22.7/180)*pi;
theta=theta0;
f=@(Tau)((1+cosh(2.*theta.*Tau)).*tanh((pi-theta).*Tau))./sinh(2.*pi.*Tau);
th=zeros(1,1000);
th(1)=theta0;
for i=1:1000
ftheta=sin(theta)/(1+cos(theta))+4*quad(f,0,100);
dth_dt=D*(Ci-Cs*(1+2*sigma/(R1*P0)))*ftheta/(rho*(1-(cos(theta))^2)*R1^2);
th(i+1)=th(i)+dth_dt(i)*dt;
theta=th(i+1);
end
Categories
Find more on Numerical Integration and Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!