Mustafa A
Mustafa A
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.
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.
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]);
}
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:
Max.Mark Marks
Criteria
s scored
Coding 5
Numerical Solution 5
Viva 20
Report 10
40
TOTAL