Making the assumption to be the same as results
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Kevin Isakayoga
el 26 de Oct. de 2020
Comentada: KSSV
el 26 de Oct. de 2020
Hi everyone! I dont know how to fit the parameter of b and n in my code to get the calculation of area equal 1. Could someone help me to modify it? I literally confuse how to fix this up. Thank you in advance before!
ro_init=0.2:0.1:100;
b=0.0517; % assume
n=1.0145; % assume
cdfVdp=(1-exp(-b*((2*ro_init).^n)));
pdfvdp=2*b*n*exp(-b*(2*ro_init).^n).*(2*ro_init).^(n-1);
area=trapz(ro_init,pdfvdp); %this results should be 1
2 comentarios
Respuesta aceptada
KSSV
el 26 de Oct. de 2020
Editada: KSSV
el 26 de Oct. de 2020
ro_init=0.2:0.1:100;
r = 200 ; c = 200 ; % Try increasing these values
B = linspace(0,0.1,r) ;
N = linspace(0.8,2,c) ;
[B,N] = meshgrid(B,N) ;
A = zeros(r,c) ;
for i = 1:r
for j = 1:c
b=B(i,j) ; % 0.0517; % assume
n=N(i,j) ; % 1.0145; % assume
% cdfVdp=(1-exp(-b*((2*ro_init).^n)));
pdfvdp=2*b*n*exp(-b*(2*ro_init).^n).*(2*ro_init).^(n-1);
area=trapz(ro_init,pdfvdp); %this results should be 1
A(i,j) = area ;
end
end
% GEt area equal to one
idx = abs(A-1)<10^-3 ;
[B(idx) N(idx)] % these are the values of b and n
3 comentarios
Kevin Isakayoga
el 26 de Oct. de 2020
Editada: Kevin Isakayoga
el 26 de Oct. de 2020
KSSV
el 26 de Oct. de 2020
Try decreasing the tolerance value.
idx = abs(A-1)<10^-2 ;
Más respuestas (0)
Ver también
Categorías
Más información sobre Numerical Integration and Differentiation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!