i want to solve definite integral with variable limits . can i apply trapezoidal rule for the same?

2 vues (au cours des 30 derniers jours)
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 commentaire
John D'Errico
John D'Errico le 25 Mai 2018
Modifié(e) : John D'Errico le 25 Mai 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

Connectez-vous pour commenter.

Réponse acceptée

John D'Errico
John D'Errico le 25 Mai 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 commentaires
John D'Errico
John D'Errico le 29 Mai 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.
neetika sharma
neetika sharma le 31 Mai 2018
Sir can you plz tell the correct method to solve the above problem in Matlab with the required parameter

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming 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!

Translated by