How to set up Paris Law Integral

10 次查看(过去 30 天)
I am trying to set up an integral for the Paris law equation. My integral should go from 0.1 to 1.1365. I am using a polynomial function for K. I am getting lots of error. It has been a while since I have tried to set up an integral, and I tried to use the format below. Thank you in advance for help!
C=1.6*10^-9;
Alpha=2.6;
xmin=0.1;
xmax=1.1365;
K=40000*sqrt(pi*x)*[1.1216+6.5200*((x/10)^2)-12.3877*((x/10)^4)+89.0554*((x/10)^6)-188.6080*((x/10)^8)+207.3870*((x/10)^10)-32.0524*((x/10)^12)];
fun= @(x) (C^-1)*(K)^-Alpha;
Nf = integral(fun,xmin,xmax);

采纳的回答

Star Strider
Star Strider 2022-7-24
Since ‘K’ is a funciton of ‘x’ it needs to be created as an anonymous function, and for whatever reason, the integrand ‘fun’ creates an array, so use the 'ArrayValued' name-value pair —
C=1.6*10^-9;
Alpha=2.6;
xmin=0.1;
xmax=1.1365;
K= @(x) 40000*sqrt(pi*x)*[1.1216+6.5200*((x/10)^2)-12.3877*((x/10)^4)+89.0554*((x/10)^6)-188.6080*((x/10)^8)+207.3870*((x/10)^10)-32.0524*((x/10)^12)];
fun= @(x) (1/C)*(K(x))^-Alpha;
Nf = integral(fun,xmin,xmax, 'ArrayValued',1)
Nf = 3.7898e-04
.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by