0% found this document useful (0 votes)
7 views6 pages

Snip

The PowerPoint presentation covers the C programming implementation of Simpson’s One-Third Rule for numerical integration. It includes an introduction to numerical integration, the derivation and algorithm of Simpson's rule, and a detailed C code example with explanations. Additionally, it discusses applications of the method in various fields and highlights its advantages over other numerical methods.

Uploaded by

vivekprasad3830
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

Snip

The PowerPoint presentation covers the C programming implementation of Simpson’s One-Third Rule for numerical integration. It includes an introduction to numerical integration, the derivation and algorithm of Simpson's rule, and a detailed C code example with explanations. Additionally, it discusses applications of the method in various fields and highlights its advantages over other numerical methods.

Uploaded by

vivekprasad3830
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Here are the first five slides of your PowerPoint presentation:

Slide 1: Title Slide


Title: C Programming of Simpson’s One-Third Rule
Content:

 Presented by: [Your Name]


 Department: [Your Department]
 Class Roll No.: [Your Class Roll No.]
 University Roll No.: [Your University Roll No.]
(Keep this slide simple and professional.)

Slide 2: Introduction to Numerical Integration


Title: What is Numerical Integration?
Content:

 Definition:
o Numerical integration is a technique used to approximate the
integral of a function when an analytical solution is difficult or
impossible.
 Why is it Important?
o Used in engineering, physics, and applied mathematics.
o Helps in solving real-world problems where exact integration is
complex.
 Common Methods of Numerical Integration:
o Trapezoidal Rule (Linear Approximation)
o Simpson’s One-Third Rule (Parabolic Approximation)
(Include a simple graph comparing the trapezoidal rule and Simpson’s rule.)

Slide 3: Overview of Simpson’s One-Third Rule


Title: Understanding Simpson’s One-Third Rule
Content:

 What is Simpson’s One-Third Rule?


o A numerical method to estimate definite integrals.
o Uses parabolic interpolation to approximate the function.
h
 Formula: I =
3
[ f (x 0 )+ 4 ∑ f (x o d d )+2 ∑ f (x e v e n)+ f (x n)]
o h = step size
o x₀, xₙ = first and last points
o f(x_odd), f(x_even) = function values at odd and even indices
 Why use Simpson’s Rule?
o More accurate than the Trapezoidal Rule.
o Works well for smooth functions.
(Add a diagram of a curve with parabolic interpolation.)

Slide 4: Derivation of Simpson’s One-Third


Rule
Title: How is Simpson’s Rule Derived?
Content:

 Concept:
o Approximates a function using a second-degree polynomial.
o Uses Lagrange interpolation to fit a parabola through three
points.
 Steps:
o Take three points (x 0 , f (x 0 )) , (x 1 , f (x 1)), and (x 2 , f (x 2)).
o Fit a quadratic polynomial: f (x)≈ a+b x + c x 2
o Integrate from x 0 to x 2 and simplify to get Simpson’s formula.
 Final Result:
o The integral is approximated by the sum of weighted function
values.
(Include a step-by-step breakdown with equations.)

Slide 5: Algorithm for Simpson’s One-Third


Rule
Title: Step-by-Step Algorithm
Content:
1. Define Function f (x) to Integrate.
2. Take Inputs:
o Lower limit a, upper limit b.
o Number of sub-intervals n (must be even).
b− a
3. Calculate Step Size:h=
n
4. Apply the Simpson’s Formula:
o Compute function values at odd and even indices.
o Compute the final integral using weighted summation.
5. Display the Result.
(Add a flowchart of the algorithm.)

Would you like me to continue with the remaining slides or create a PPT file
for you? 😊

Here are slides 6 to 10 of your PowerPoint presentation on "C


Programming of Simpson’s One-Third Rule":

Slide 6: Implementation in C Programming


Title: C Program Structure for Simpson’s One-Third Rule
Content:

 Key components of the program:


o Define the function f (x) to be integrated.
o Accept input values for limits a , b and number of sub-intervals n
.
o Ensure n is an even number.
b− a
o Compute the step size h= .
n
o Apply Simpson’s formula iteratively.
o Display the final result.
 Why use C for numerical integration?
o Efficient execution for mathematical computations.
o Simple implementation of numerical algorithms.
(Include a small code snippet highlighting function definition and input
handling.)
Slide 7: C Program for Simpson’s One-Third
Rule
Title: C Code Implementation
Content:

#include <stdio.h>
#define f(x) (x * x + 1) // Example function

float simpsonsOneThird(float a, float b, int n) {


float h = (b - a) / n;
float sum = f(a) + f(b);

for (int i = 1; i < n; i++) {


float x = a + i * h;
if (i % 2 == 0)
sum += 2 * f(x);
else
sum += 4 * f(x);
}

return (h / 3) * sum;
}

int main() {
float a, b;
int n;
printf("Enter lower limit, upper limit, and number of
intervals (even number): ");
scanf("%f %f %d", &a, &b, &n);

if (n % 2 != 0) {
printf("Error! Number of intervals must be even.\n");
return 1;
}

printf("Result: %f\n", simpsonsOneThird(a, b, n));


return 0;
}

 Explanation of the code:


o Defines a function f (x) .
o Implements Simpson’s formula.
o Ensures n is even for correct calculations.
o Outputs the computed integral value.
(Include syntax highlighting and code formatting for readability.)

Slide 8: Code Explanation


Title: Understanding the C Code
Content:

 Function Definition:
o #define f(x) (x * x + 1): Defines the function to integrate.
 Step-by-Step Execution:
o Input Handling: Takes lower limit a , upper limit b , and
number of intervals n .
o Validation: Ensures that n is even.
b− a
o Step Size Calculation: h= .
n
o Summation using Loop:
 Adds function values with appropriate weights (4 for odd
indices, 2 for even).
o Final Calculation: Multiplies by h /3 to compute the result.
 Why this approach?
o Simple and efficient for parabolic approximation of an
integral.
(Include a flowchart or commented code snippets for clarity.)

Slide 9: Example Problem and Output


Title: Testing the C Program with an Example
Content:
2
Problem: Compute the integral I =∫ (x +1) d x using Simpson’s One-
2

0
Third Rule with n = 4 sub-intervals.
 Inputs:
o Lower limit: 0
o Upper limit: 2
o Number of intervals: 4
 Expected Output Calculation:
o Using Simpson’s rule, the computed integral should be close to
the actual value.
 Output of the Program:
(Include a table comparing computed and exact integral values.)

Slide 10: Applications of Simpson’s One-Third


Rule
Title: Where is Simpson’s Rule Used?
Content:

 Scientific and Engineering Applications:


o Physics: Calculating area under curves in motion analysis.
o Engineering: Stress analysis, fluid dynamics, and electrical
circuits.
o Computer Graphics: Surface rendering and image
processing.
 Why use Simpson’s Rule over the Trapezoidal Rule?
o Higher accuracy for smooth functions.
o Less error compared to linear approximation methods.
 Limitations:
o Requires even number of sub-intervals.
o Less accurate for highly irregular functions.
(Add real-world images or diagrams related to applications.)

This completes slides 6-10. Do you want me to generate a PPT file for this
content? 😊

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy