How to integrate from 0 to infinity with x and 1 varying parameter?

2 views (last 30 days)
Hey, I need to simualte and plot the following function, but can't seem to figure it out. I tried implementin it and code is down below. On my first iteration(sadly, not saved) it launched and seemed to integrate, but the process was stuck, and I assume matlab was struggling with integration till infinity. Now it just not launching. Could you help with error that I have now and further show how can i implement this formula?
(a,b,d,p are generic numbers, I just want the code to run)
Thank you in advance, guys!
clear;
clc;
syms x;
u0 = 4*pi*10^-7;
L1 = 0.88e-6;
L2 = 0.88e-6;
a = 50*10^-3;
b = 50*10^-3;
d = 20*10^-3;
%p = 0:0.1*10^-2:0.5;
p = 0;
eq1 = besselj(1, x*sqrt(a/b));
eq2 = besselj(1, x*sqrt(b/a));
eq3 = besselj(0, x*p/sqrt(a*b));
eq4 = (exp(-x*d/sqrt(a*b)));
eq5 = pi*u0*sqrt(a*b);
eqf = eq1*eq2*eq3*eq4;
M = eq5*integral(eqf, 0, inf);

Answers (1)

Walter Roberson
Walter Roberson on 9 Apr 2023
Moved: Walter Roberson on 9 Apr 2023
syms x;
Pi = sym(pi);
u0 = 4*Pi*10^-7;
L1 = sym(88)*sym(10)^(-8);
L2 = sym(88)*sym(10)^(-8);
a = sym(50)*sym(10)^-3;
b = sym(50)*sym(10)^-3;
d = sym(20)*sym(10)^-3;
%p = 0:0.1*10^-2:0.5;
p = 0;
eq1 = besselj(1, x*sqrt(a/b));
eq2 = besselj(1, x*sqrt(b/a));
eq3 = besselj(0, x*p/sqrt(a*b));
eq4 = (exp(-x*d/sqrt(a*b)));
eq5 = Pi*u0*sqrt(a*b);
eqf = eq1*eq2*eq3*eq4
eqf = 
M = eq5*int(eqf, x, 0, inf)
M = 
vpa(M, 16)
ans = 
0.00000006753694369741884

Categories

Find more on Mathematics in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!