Solving an integro-differential equation
2 次查看(过去 30 天)
显示 更早的评论
Hello, I'm trying to solve the following differential equation that also has an integral.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/244879/image.png)
I am trying to solve for L (output) with initial conditions of h0=0 and h'=0. The h is with respect to time. r, U and B are constants. The integral part of the equation is equated to A for Matlab coding. So far I have:
syms B h(t) L r U h0 Y
A = @(t,U,B) integral(@(t) exp((-U*t/B)*0.1843)*h, 0, t);
Eqn = diff(h) == (L/((-1.8775)*U*r*B))+(-0.1654)*U*h/B-...
((0.0466*U^2)/(B^2))*A(t,U,B);
hsol = dsolve(Eqn, h(0)==h0);
Lsol = solve(hsol,L);
Lsol = simplify(Lsol, 'Steps',500);
Lfcn = matlabFunction(Lsol);
Eqn normally works if I have A as constant. However, when I have it as the definite integral, Matlab wants me to have h as an input argument. How can I have Lfcn as having only r, U, B, h0, t as inpute arguments? Thank you.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Eigenvalue Problems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!