- 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
x[i]=x0+i*h
y[i]=f(x[i])print y[i] - Initialize se=0,s0=0
- Do the following using a loop
if i%2=0
s0=s0+y[i]Otherwise
se=se+y[i] - ans=h/3*(y[0]+y[n]+4*s0+2*se)
- print the ans
- stop
Flow Chart:
Ph.D. 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 software from time to time. Can code in most of the popular languages. I like to share my knowledge in Physics and applications using this Blog and a YouTube channel.
[wpedon id="7041" align="center"]