i want to solve definite integral with variable limits . can i apply trapezoidal rule for the same?
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
John D'Errico
2018 年 5 月 25 日
編集済み: John D'Errico
2018 年 5 月 25 日
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
採用された回答
John D'Errico
2018 年 5 月 25 日
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 件のコメント
John D'Errico
2018 年 5 月 29 日
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.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!