How to set up Paris Law Integral

21 vues (au cours des 30 derniers jours)
Kristine
Kristine le 24 Juil 2022
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);

Réponse acceptée

Star Strider
Star Strider le 24 Juil 2022
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
.

Plus de réponses (0)

Catégories

En savoir plus sur Numerical Integration and Differentiation dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by