필터 지우기
필터 지우기

Nested integral and how to plot

조회 수: 1 (최근 30일)
Orongo
Orongo 2017년 10월 15일
Hi, I have this exercise to calculate D_x that is defined as following:
So far my program looks like this..
main.m:
% main.m
delta = 0.028559;
x=61;
mu_x=@(t) mu(t);
lx = @(x) exp(-integral(@(t) mu_x(t),0,x));
Dx = integral(@(t) exp(-delta*t)*lx(x+t)/lx(x), 0, inf,'ArrayValued', true);
mu.m
function res=mu(x)
a=0.006782872;
b=5.44781E-08;
c=0.137849468;
res = zeros(size(x));
ind = x>97;
res(~ind) = a+b*exp(c*x(~ind));
res(ind) = a+b*exp(c*97)+(x(ind)-97)*0.001;
end
There are 2 main questions I struggle with this one. 1) Is the program correct? I get a higher value then expected and I don't understand how Matlab assign integrals. 2) How to I plot the results? Say x=61:101 for mu_x, l(x) and D_x?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by