MathLab ProblemSet 2
MathLab ProblemSet 2
Instructions
• This problem set consists of 3 sections and you need to solve all 3 sections to complete
this course.
• You are supposed to write your answers and upload it in the submission link given. You can
submit a typed document or a handwritten document on a tablet. Anything works as long as
it is legible and clear!
• This assignment requires you to write code, generate plots and submit the same. You
are advised to submit the code and the plots by attaching them in your submission
document directly. If that is not possible then please upload your code and plots to your
Google Drive and add the links to those files in your submission. Make sure to give us
access to those files.
• Try to answer all the questions in a clear and readable manner and mention all your assump-
tions/reasons explicitly.
• It is fine even if you aren’t able to solve a question completely after your best attempt. But
show us your working or thought-process and the attempts that you have made in order
to clear the course.
• Feel free to reach out to us for doubts! Contact information of the problem-set creators:
– Aditi Vaidya - +91 95451 49055
– Pranjal Varshney - +91 77806 61602
Final Expected Submission: Description of your new variant of Euler’s method, error
analysis of your method and a few points analysing other features of your method.
1
Mathematics Club IITM
MathLab: Problem Set 2
Aditi Vaidya and Pranjal Varshney — 19 June 2024
If you’re developing your own method write out all the approximations and assumptions clearly,
Remember: Taylor is always your friend and the approach always carries more importance than
the final answer.
Final Expected Submission: A script written in MATLAB or GNU Octave that implements
the following:
• Your own new algorithm for approximating integrals OR Simpson’s method for calculating a
definite integral.
• Tests out your algorithm on some integral (for example x2 dx or any integral of your choice
R2
0
for that matter) and see if your integrator is working.
Note:
1. You are free to use any example function which has to be integrated in your code to demonstrate
that your integrator works.
2. If you are submitting your code via a Google Drive link make sure to enable access for all, so
that we will be able to access your submission.
2
Mathematics Club IITM
MathLab: Problem Set 2
Aditi Vaidya and Pranjal Varshney — 19 June 2024
∂2u 2
2∂ u
= c
∂t2 ∂x2
It’s given that c = 1, L = 1, and the initial condition is u(x, 0) = 2x(1 − x) (that is the displacement
of each point x when t = 0). The string is released from rest at t = 0.
Plot the displacement (u) vs. time (t) graph of the points on the string at T = 1 second, by writing
a code on GNU Octave or MATLAB. Use dx = 0.1 units and dt = 0.1 seconds.
3
Mathematics Club IITM
MathLab: Problem Set 2
Aditi Vaidya and Pranjal Varshney — 19 June 2024
Hint 1: Use the Method of Differences that has been taught to you in Part 2 of Session 2 to get an
equation.
Hint 2: Its given that the string is released from rest, hence ∂u
∂t = 0 at t = 0. Use Central difference
approximation to get an equation.
Final Expected Submission: A script written in MATLAB or GNU Octave that implements the
following:
• Solves the given problem using numerical methods in accordance with the given parameters.
Note:
If you are submitting your code and plot via Google Drive links make sure to enable access for all,
so that we will be able to access your submission.