Trapezoidal Method Algorithm

  • Start
  • Define and Declare the function
  • Input initial boundary value, final boundary value and length of interval
  • Calculate number of strips, n=(final boundary value-initial boundary value)/length of interval
  • Perform the following operations in loop
    y[i]=f(x[i])print y[i]
  • Initialize se=0,s0=0
  • Do the following using a loop
    if i%2=0
  • ans=h/3*(y[0]+y[n]+4*s0+2*se)
  • print the ans
  • stop

Flow Chart:

flow chart algorithm of trapezoidal rule for definite integrals

PhD researcher at Friedrich-Schiller University Jena, Germany. I'm a physicist specializing in computational material science. I write efficient codes for simulating light-matter interactions at atomic scales. I like to develop Physics, DFT and Machine Learning related apps and softwares from time to time. Can code in most of the popular languages. Like to share my knowledge in Physics and applications using this Blog and a YouTube channel.
[wpedon id="7041" align="center"]

Leave a Reply

Your email address will not be published. Required fields are marked *