How numerically solve an complex integral using the MATLAB -


i'm trying solve equation:

k=sqrt((r*t)/(4*pi*lambda))*integral -inf inf of exp(-((lambda+f*neta)/r*t-x)^2*r*t/4*lambda)/exp(x)+1 regard x

where, neta interval 0 1 , others symbols (r, t, f, lambda , pi) have constant values.

i tried use these codes:

code 1

clear all; close all; clc; f = 96485.34; r = 8.3145; t = 298.15; lambda = 0.2; neta=0:0.1:1; pi=3.1415; f=@(x) exp(-((lambda+f*neta)/r*t-x).^2*r*t/4*lambda)/(exp(x)+1); q=integral(f,-inf,inf); k= sqrt((r*t)/(4*pi*lambda)).*q 

code 2

clear all; close all; clc; f = 96485.34; r = 8.3145; t = 298.15; lambda = 0.2; neta=0:0.1:1; pi=3.1415; x= 0:100; f(x)=exp(-((lambda+f*neta)/r*t-x).^2*r*t/4*lambda)/(exp(x)+1); q=quadl('f', 0, 100); k= sqrt((r*t)/(4*pi*lambda)).*q 

but these codes return errors not know solve. can me, please?

thanks

the problem neta. if scalar value code fine. how propose integrate on neta interval respect different variable? mean? tried taking individual values neta 0 1 , calculating q value each, each q returns 0.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -