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

Mustafa A

Uploaded by

mustafatinwala6
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 views9 pages

Mustafa A

Uploaded by

mustafatinwala6
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/ 9

ASSIGNMENT-1(CAPSTONE PROJECT)

STUDENT NAME: MUSTAFA A


PROGRAM/SEC: AI&DS-A
YEAR & SEM: 1 YEAR-2SEM
ACADEMIC YEAR: 2023-24
COURSE CODE: MA3251
COURSE TITLE: STATICS AND NUMERICAL METHODS
INTERNAL ASSESSMENT: I

PROBLEM STATEMENT:
Develop a program in python, C, C++, or any other
programming language for the problem in Page no 4.102,
problem no:12. Also, check your program by using conventional
method.
The velocity v of a particle at a dsitance S from a point in its
path is given by the table below:-
s in 0 10 20 30 40 50 60
metres
V m/sec 47 58 64 65 61 52 38

Max.Marks Marks
Criteria scored
Coding 5
Numerical Solution 5
Viva 20
Report 10
40
TOTAL
ASSIGNMENT-1(CAPSTONE PROJECT)

PROBLEM STATEMENT:
Develop a program in python, C, C++, or any other programming
language for the problem in Page no 4.102, problem no:12. Also,
check your program by using conventional method.

The velocity v of a particle at a dsitance S from a point in its


path is given by the table below:-
s in metres 0 10 20 30 40 50 60
V m/sec 47 58 64 65 61 52 38

MARKS DISTRIBUTION

Coding-5marks
Numerical Solution-5 marks
Viva-20 marks
Report-10marks

TOTAL: (40)

INTRODUCTION:
The velocity v of a particle at a dsitance S from a point in its
path is given by the table below:-
s in metres 0 10 20 30 40 50 60
V m/sec 47 58 64 65 61 52 38
We're provided with a table that pairs distances (S) from a starting point with
their corresponding velocities (V) in meters per second. Here's a snippet of the
data:

s (meters) V (m/s)
0 47
10 58
20 64
30 65
40 61
50 52
60 38

Our task is to determine the time it takes for the particle to travel a distance of
60 meters using Simpson's 1/3 rule, a numerical integration technique. This
involves approximating the area under the curve represented by the velocity-
distance graph, which ultimately gives us the time taken to reach the 60-meter
mark. This problem requires us to apply mathematical principles within a
computational framework to arrive at a precise solution."
SELECTED LANGUAGE: (JAVA)
There are many advantages of using the java language over any other
language som of them are as follows:-

1. Strong Typing: Java is statically typed, which means it helps catch errors
during compilation rather than at runtime. This can prevent many common
mistakes.

2. Object-Oriented: Java's object-oriented nature allows for the creation of well-


structured and modular code. You can encapsulate the logic for calculating
the time taken within a class, making the code easier to understand and
maintain.

3. Platform Independence: Java programs can run on any platform with a Java
Virtual Machine (JVM), making the solution accessible across different
operating systems.
4. Abundant Libraries: Java has a vast standard library and a wide range of third-
party libraries available, which can be leveraged to simplify tasks like reading
data from tables, performing numerical integration, and handling
mathematical calculations.

5. Performance: While not always the fastest language, Java offers good
performance, especially for numerical computations like those involved in
numerical integration.

6. Community Support: Java has a large and active community, which means
you're likely to find existing solutions, libraries, and resources to aid in solving
the problem efficiently.

JAVA PROGRAM:
public class Main {
public static void main(String[] args) {
System.out.println("Given Data:-");
System.out.println();
System.out.println("s in metre | 0 | 10 | 20 | 30 | 40 | 50 | 60 |");
System.out.println("V m/sec | 47 | 58 | 64 | 65 | 61 | 52 | 38 |");
System.out.println();
System.out.println("As we know the value of v = ds/dt");
System.out.println();
System.out.println("As we know that we have to find the time taken to travel
60 metres ");
System.out.println();
System.out.println("So take the limits for t = lim 0 -> 60");
System.out.println();
System.out.println("So take the value of the y = 1/v");
double h = 10;
double[] v = {47, 58, 64, 65, 61, 52, 38};
double[] y = new double[7]; // Initialize y array
for (int i = 0; i < 7; i++) {
y[i] = 1 / v[i];
System.out.println("The value of y" + i + " = " + y[i]);
}

System.out.println("The formula for the Simpson's one third rule is:");


System.out.println("t = lim 0-->60 1/v ds = h/3 [(y0+y6) + 2(y2+y4) +
4(y1 + y3 + y5)]");
System.out.println("The value of the h = 10");

double simpson = (h / 3) * ((y[0] + y[6]) + 2 * (y[2] + y[4]) + 4 * (y[1] +


y[3] + y[5])); // Corrected the formula
System.out.println("The time taken to travel 60 metres is " + simpson +
" sec.");
}
}
Output :-

HAND WRITTEN:
Values obtained by scientific calculator:
COMPARISON:
1.recision and Accuracy:
The result obtained from coding is 1.0635210872239484.
The result obtained from the calculator is 1.06338.
The result from coding appears to be more precise due to its longer
decimal representation.
2. Methodology:
The coding approach likely involved implementing Simpson's 1/3
rule to numerically integrate the velocity-distance data.
The calculator likely used built-in functions or manual calculation
techniques to perform the integration.
3. Sources of Discrepancy:
Differences in numerical precision: The coding method might have
employed higher precision data types or algorithms, leading to a
more accurate result.
Implementation details: The coding approach may have involved
additional factors or optimizations not accounted for in the calculator
method, affecting the final result.
4. Practical Implications:
Both results are very close, indicating that both methods provide
reasonably accurate estimates of the time taken for the particle to
reach the 60-meter mark.
The slight discrepancy between the results may not have significant
practical implications, depending on the context of the problem.
CONCLUSION:

In conclusion, the comparison between the results obtained from coding


(1.0635210872239484) and using a calculator (1.06338) for estimating
the time taken by the particle to reach 60 meters reveals a minor
discrepancy. Despite this difference, both values are remarkably close,
indicating the reliability of both methods in providing accurate
estimates. While factors such as numerical precision and implementation
details may contribute to the slight variation, the consistency between
the results underscores the confidence in the accuracy of the estimated
time. Overall, both the coding and calculator approaches offer valid and
practical solutions to the problem statement, demonstrating the
effectiveness of numerical methods in solving real-world problems.

Max.Mark Marks
Criteria
s scored
Coding 5
Numerical Solution 5
Viva 20
Report 10
40
TOTAL

You might also like