How to solve a system of integral equations?

6 ビュー (過去 30 日間)
Pavel M
Pavel M 2020 年 2 月 14 日
コメント済み: Star Strider 2020 年 2 月 14 日
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 Center および File ExchangeSystems 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