Plot a function with an integral involved
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dear all
I would like to plot the following function
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/283373/image.png)
where f(E-V,T) is
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/283374/image.png)
with μ set to zero , k_B*T = 0.0362 (unit : meV) and E replaced by E-V. So actually dependence on "T" is eliminated.
For the rest of the function
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/283375/image.png)
Here, delta is assumed to be 1.5 (meV) and Z = 1.
beta is as follow![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/283376/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/283376/image.png)
I've tried so many methods but all of them have failed.
(Each part of the function is checked without errors)
when I drop the part of the derivativ of the function f, it works.
However, when I put it back, the result is trivial (without calculating the equation but returning somthing like int( ~~~~~, E, -3/2, 3/2) only)
Code
---------------------
syms E
V = [-5:0.1:5]
G = int ((exp((E-V)./ 0.362)./( 0.362*(exp((E-V)./ 0.362) + 1).^2)).*((2*(1+(E./(abs(1.5^2-E.^2)).^0.5).^2))./(((E./(abs(1.5^2-E.^2)).^0.5).^2)+(1+2*1^2)^2)), E, -1.5, 1.5) ...
+ int ((exp((E-V)./ 0.362)./( 0.362*(exp((E-V)./ 0.362) + 1).^2)).*((2*(E./(abs(1.5^2-E.^2)).^0.5))./(1+(E./(abs(1.5^2-E.^2)).^0.5)+2*1^2)), E, -inf, -1.5) ...
+ int ((exp((E-V)./ 0.362)./( 0.362*(exp((E-V)./ 0.362) + 1).^2)).*((2*(E./(abs(1.5^2-E.^2)).^0.5))./(1+(E./(abs(1.5^2-E.^2)).^0.5)+2*1^2)), E, 1.5, inf) ;
plot(V, G)
I did use integral instead of int to acquire the data but it only works when the variable V is dropped from the equation (Let V=zero)
Code
----------------------
fun = @(E)(exp((E)./ 0.362)./( 0.362*(exp((E)./ 0.362) + 1).^2)).*((2*(1+(E./(abs(1.5^2-E.^2)).^0.5).^2))./(((E./(abs(1.5^2-E.^2)).^0.5).^2)+(1+2*1^2)^2))
y = integral(fun, -1.5, 1.5)
Don't know how to sweep V while using the above code
Thanks for the help in advance
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!