Contents
Contents
Computational Methods Using MATLAB
An introduction for physicists
P K Thiruvikraman
Department of Physics, BITS Pilani Hyderabad Campus, Telangana 500078, India
IOP Publishing, Bristol, UK
IOP Publishing Ltd 2022
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior permission of the publisher, or as expressly permitted by law or under terms agreed with the appropriate rights organization. Multiple copying is permitted in accordance with the terms of licences issued by the Copyright Licensing Agency, the Copyright Clearance Centre and other reproduction rights organizations.
Permission to make use of IOP Publishing content other than as set out above may be sought at .
P K Thiruvikraman has asserted his right to be identified as the author of this work in accordance with sections 77 and 78 of the Copyright, Designs and Patents Act 1988.
Multimedia content is available for this book from https://iopscience.iop.org/book/978-0-7503-3791-5.
ISBN 978-0-7503-3791-5 (ebook)
ISBN 978-0-7503-3789-2 (print)
ISBN 978-0-7503-3792-2 (myPrint)
ISBN 978-0-7503-3790-8 (mobi)
DOI 10.1088/978-0-7503-3791-5
Version: 20220301
IOP ebooks
British Library Cataloguing-in-Publication Data: A catalogue record for this book is available from the British Library.
Published by IOP Publishing, wholly owned by The Institute of Physics, London
IOP Publishing, Temple Circus, Temple Way, Bristol, BS1 6HG, UK
US Office: IOP Publishing, Inc., 190 North Independence Mall West, Suite 601, Philadelphia, PA 19106, USA
Supplementary MATLAB programs to accompany this book are available at https://iopscience.iop.org/book/978-0-7503-3791-5.
Preface
Computers have invaded every aspect of our lives. From the common man to the scientist, everyone now needs a minimal level of computer literacy. For most scientists and engineers, a basic familiarity with using and programming computers is almost essential. So much so, that if Descartes were alive today, he probably would have said, I compute, therefore I am.
In past times, experimentation and theoretical investigation were the two ways of doing research. Computation has now become the third way of doing physics, and in many instances it complements experiment and theory. Computation can not only be used as a tool for research in physics, but it can serve as an invaluable tool for a student to learn physics. In order to write a program to simulate a physical system, a student needs to have a very solid understanding of the underlying physics. This solid understanding will help the student to break down the problem into small parts and instruct the computer to perform the simulation.
There are many books on computational physics or computational methods. Do we need one more? Books on computational physics describe numerical methods which even date back to the time of Isaac Newton. So there are a large number of books on numerical methods and numerical analysis. This book differs from earlier books in its emphasis on various topics and tries to strike a balance between the analysis of numerical methods and their implementation using programs.
The MATLAB software package is widely used by many scientists and engineers. The various toolboxes which are part of MATLAB, immensely simplify the task of writing programs to implement numerical methods. However, in this book, I have tried to emphasise the underlying algorithms and eschewed the use of built-in MATLAB functions, which render the implementation opaque to the user. Built-in MATLAB functions are also mentioned along with the discussion of the underlying algorithms.
This book is based on a one-semester course I have been offering to students of physics for many years. I have tried to select topics which would help students in the other courses they typically study, namely, classical mechanics, quantum mechanics, statistical mechanics, electromagnetic theory, and solid-state physics. In each chapter, the application of numerical methods to various areas of physics is mentioned immediately after the discussion of methods, so that the reader can easily grasp the relevance of the numerical methods and be motivated to study them.
I suspect that some instructors may find one semester insufficient to deal with all the topics included here. In such cases, the last chapter (nonlinear dynamics and chaos) or chapter eight (which deals with application of Monte Carlo methods) can be excluded. Exercises are given at the end of each chapter and students should diligently strive to solve them before verifying the solutions.
Programming assignments are also given along with the exercises. Some of these have hints for developing the program. The author can be reached through email at .
Acknowledgements
Writing a book requires access to resources and a conducive atmosphere. I wholeheartedly thank Birla Institute of Technology and Science for providing me with the resources and time for writing this book. This book was possible as I was allowed to teach a course on computational physics for the last five years. Feedback from my colleagues and students enabled me to tweak the contents of this book to make it more accessible and reader-friendly. I thank my colleagues and students for their suggestions and comments. Encouragement provided by my family members was very crucial for the completion of this book. I thank IoP publishing and John Navas in particular, for giving me an opportunity to write another book, and the painstaking efforts of the editorial staff minimized the errors in this book.
Author biography
P K Thiruvikraman
P K Thiruvikraman is currently a professor of physics at the Birla Institute of Technology and Science, Pilani (Hyderabad Campus). He has more than two decades of experience in teaching courses in many areas of physics. He obtained his Masters degree in physics from the Indian Institute of Technology, Madras, and a PhD in Physics from Mangalore University. During his teaching, he has come to realise that most subjects that are typically offered by different departments are intimately interrelated. He tries to convey this to students by quoting examples from different areas of science and engineering. An avid reader of both fiction and non-fiction and a sports and movie enthusiast, he also tries to use these to enliven his classes. He has also authored a book titled A Course on Digital Image Processing with MATLAB.
IOP Publishing
Computational Methods Using MATLAB
An introduction for physicists
P K Thiruvikraman
Chapter 1
Introduction
Traditionally, physicists were classified into those who do theoretical physics and those who do experimental physics. Experimental physicists perform experiments to study natural phenomena under carefully controlled conditions in the laboratory. Theoretical physicists come up with models and theories to account for the results of experiments and also work out the consequences of their theories. A third way of doing physics, namely, computational physics, has gained prominence in the last few decades. Interestingly, computational physics has features of both experimental and theoretical physics. In computational physics, we attempt to solve differential and algebraic equations using numerical techniques. In that sense, it is like theoretical physics. We can also simulate a system based on the underlying physical laws, which is like doing a virtual experiment. Hence, computational physics has something in common with theoretical as well as experimental physics.