How to solve a system of integral equations?

8 次查看(过去 30 天)
I want to solve the system of integral equations, but limits on integrals contain an unknown ( x(2) ) which i want to find.
I try this:
function S = Integralsystem(x, t1, t2, n, a, b, Umax1, Umax2);
fun = @(T) x(2) - (Umax1/n)*(exp(a*(T*1e-6)) - exp(b*(T*1e-6)));
t01 = fzero(fun, 0.1);
fun = @(T) x(2) - (Umax2/n)*(exp(a*(T*1e-6)) - exp(b*(T*1e-6)));
t02 = fzero(fun, 1.1);
fun1 = @(T) ((Umax1/n)*(exp(a*(T*1e-6)) - exp(b*(T*1e-6)))) - x(2);
fun2 = @(T) ((Umax1/n)*(exp(a*(T*1e-6)) - exp(b*(T*1e-6)))) - x(2);
S(1) = x(1) - (integral(fun1,t01,t1));
S(2) = x(1) - (integral(fun2,t02,t2));
end
s = fsolve(@(x) Integralsystem(x, t1, t2, n, a, b, Umax1, Umax2),[100 1000])
but Matlab cant find solution.

回答(1 个)

Star Strider
Star Strider 2020-2-14
It is probably best to use the more robust fsolve in the function instead of fzero.
Try this:
function S = Integralsystem(x, t1, t2, n, a, b, Umax1, Umax2);
fun1 = @(T) x(2) - (Umax1/n)*(exp(a*(T*1e-6)) - exp(b*(T*1e-6)));
t01 = fsolve(fun1, 0.1);
fun2 = @(T) x(2) - (Umax2/n)*(exp(a*(T*1e-6)) - exp(b*(T*1e-6)));
t02 = fsolve(fun2, 1.1);
fun3 = @(T) ((Umax1/n)*(exp(a*(T*1e-6)) - exp(b*(T*1e-6)))) - x(2);
fun4 = @(T) ((Umax1/n)*(exp(a*(T*1e-6)) - exp(b*(T*1e-6)))) - x(2);
S(1) = x(1) - (integral(fun3,t01,t1));
S(2) = x(1) - (integral(fun4,t02,t2));
end
s = fsolve(@(x) Integralsystem(x, t1, t2, n, a, b, Umax1, Umax2),[100 1000])
This slightly revised code (with random scalar values for the other agruments) ran without error and produced a (1x2) vector for ‘s’.
  2 个评论
Pavel M
Pavel M 2020-2-14
i use fzero because tmin - limit of integral has such condition t0 = f(x(2))
Star Strider
Star Strider 2020-2-14
With the random scalars I supplied to test your function, fzero threw errors. That was the reason I substituted fsolve. Use whatever works best in your application.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Systems of Nonlinear Equations 的更多信息

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by