i want to solve definite integral with variable limits . can i apply trapezoidal rule for the same?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
neetika sharma
il 25 Mag 2018
Commentato: neetika sharma
il 31 Mag 2018
t0 = Id/(G0*(Vg-Vt-Id*Rs))
t1 = Id/(G0*(Vg-Vt-Vd+Id*Rd))
r = integral(@(t)1./(t.^2.*log(1-t)),t0,t1);
Id=A/r
where,
G0 = 0.132;
Vg = 0;
Vt = -.485;
Rs = 0.023;
Rd = 0.022;
Id = .003
1 Commento
John D'Errico
il 25 Mag 2018
Modificato: John D'Errico
il 25 Mag 2018
I fixed your code to be readable. I don't think you have the hang of it yet.
https://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup#answer_18099
Risposta accettata
John D'Errico
il 25 Mag 2018
Can you generate a set of values for t between t0 and t1? Yes. Use linspace.
Can you evaluate that function at those points? Why not?
t = linspace(t0,t1,100);
fun = @(t)1./(t.^2.*log(1-t));
trapz(t,fun(t))
Your code is incomplete, since it fails to define Vd. So I cannot run your code to show that it works.
4 Commenti
John D'Errico
il 29 Mag 2018
You cannot put a loop around that, varying the value of Vd, and plot the result?
Either store the intermediate results, and plot it all at the end of the loop, or plot each point one at a time, and use "hold on" to force each new point on the plot to be added to the existing plot.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!