Please someone can help how to plot the following numerical
integration with respect to "z". Here "z" varies from "0" to "1". The
integral need to be done by numerical integration method.

 채택된 답변

Star Strider
Star Strider 2020년 10월 23일

0 개 추천

Try this:
zv = linspace(0, 1);
for k = 1:numel(zv)
z = zv(k);
u_int(k) = integral(@(u) sqrt(u)/((exp(u)/z)-1) + z/(1-z), 0, Inf, 'ArrayValued',1);
end
figure
semilogy(zv, u_int)
grid
xlabel('z')
ylabel('Integrated Value')
.

댓글 수: 6

P Rakesh Kumar Dora
P Rakesh Kumar Dora 2020년 10월 23일
Thanks. Here can we change the step size of "z" in your code?
It can be whatever you want. This plots 100 points, so the step size is about 0.01. If you want more or fewer, use the third argument to linspace to define how many.
Example —
zv = linspace(0, 1, 20);
creates ‘zv’ as a 20-element vector and would result in a step size of about 0.05. The number of elements can be anything the computer memory permits.
P Rakesh Kumar Dora
P Rakesh Kumar Dora 2020년 10월 23일
Ok, Thanks. Do you know how to do this in mathmaticae.Actually i am trying by using
"Nintegrate" function in mathematica , but unable to get the final answer.
Star Strider
Star Strider 2020년 10월 23일
My pleasure!
I do not have Mathematica and have no experience with it. MATLAB does essentially everything I need to do.
If my Answer helped you solve your problem, please Accept it!
.
P Rakesh Kumar Dora
P Rakesh Kumar Dora 2020년 10월 23일
Please can you tell how to locate precise value of the integrand corresponding
to precise value of "z" in the plot?
Star Strider
Star Strider 2020년 10월 23일
The ‘z’ values are the elements of the ‘zv’ vector. They correspond to the elements of ‘u_int’. So ‘z=0’ corresponds to ‘u_int(1)’, ‘z=1’ to ‘u_int(end)’, with end depending on how many elements of ‘u_int’ you choose to calculate.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2020년 10월 23일

댓글:

2020년 10월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by