How can I integrate this function?

6 ビュー (過去 30 日間)
Sam Oke
Sam Oke 2018 年 11 月 16 日
コメント済み: Cris LaPierre 2018 年 11 月 28 日
Please, I have been trying to simulate the following functions using MATLAB. But I am still unable to get it correctly. The functions are given below;
where;
This is the code I have written following the approach discussed by Star Strider for a similar problem. Any idea on how to make the code works?
x = 2000000; T = 1; a = 4;L = 0.000159; B = 50;
syms r w
firstint = @(w) integral(@(r) (acos (((r.^2) + (w.^2) - (B.^2))/(2 * w * r))* ((2*L * r)/(1+((r.^a)/(x*T))))), w-B, w+B, 'ArrayValued',1);
secondint = @(w) (1-(firstint(w))).*w;
answer = integral(secondint, B, Inf);
D = exp (-2 * pi * L * answer);
final = A * D;

採用された回答

Cris LaPierre
Cris LaPierre 2018 年 11 月 17 日
The approach you are taking is numeric, so don't declare symbolic variables.
x = 2000000; T = 1; a = 4;L = 0.000159; B = 50;
firstint = @(w) integral(@(r) (acos (((r.^2) + (w.^2) - (B.^2))/(2 .* w .* r))* ((2*L .* r)/(1+((r.^a)/(x.*T))))), w-B, w+B, 'ArrayValued',1);
secondint = @(w) (1-(firstint(w))*w);
answer = integral(secondint, B, Inf, 'ArrayValued',1)
This does give a warning:
Warning: Minimum step size reached near x = 3.24519e+30. There may be a singularity, or the tolerances may be too tight for this problem.
You can look into the options for tolerances of integral here.
  2 件のコメント
Sam Oke
Sam Oke 2018 年 11 月 28 日
Thanks you for your answer. It helped a lot!
Please if I want to follow analytical approach, how do I do about it?
Cris LaPierre
Cris LaPierre 2018 年 11 月 28 日
You would need to use a symbolic approach, including functions designed to work with symbolic equations (int).

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by