Two ways to work
- One chapter at a time (the chapter links below): the notebook fills the window, like a page of the book. This is the simplest way to start.
- The full workspace: a file browser and tabs, like a desktop programming environment. Use it to open several chapters side by side, or to look at and edit a chapter's
.m files. Open the full workspace.
Both views see the same files and the same changes.
Saving your work
- Your changes are stored inside your web browser, on your computer. They are not uploaded anywhere, so you don't need an account.
- When you come back in the same browser on the same computer, your changes are still there.
- Another computer, another browser, or a private window won't have them. Clearing your browser's history and site data deletes them.
- To keep a copy, use File → Download, which saves the notebook to your computer, usually in your Downloads folder, under a name like
chap02_chap02.ipynb. It's an ordinary Jupyter notebook file, which you can keep, email or open in other Jupyter tools. In the full workspace, you can also download a chapter's .m files: right-click a file and choose Download.
- To bring a copy back later, open the full workspace, open the chapter's folder, and click the upload button (the arrow pointing up, above the file list). Select the file from your computer. The uploaded file should appear in the folder under its own name, next to the chapter's notebook, which is not replaced, and you can open it from there.
- Once you've changed a chapter, you keep seeing your version, even if we update the book. To get the current version back, delete your copy: in the full workspace, right-click the notebook and choose Delete. The original version appears in its place. Download your copy first if you want to keep it.
Chapters
Click a chapter to open it, then run each code cell in order with Shift+Enter. You can change the code and run it again. The first chapter you open downloads Octave, which can take a minute.
- Modeling and Simulation
- Scripts (solutions)
- Loops (solutions)
- Vectors (solutions)
- Functions (solutions)
- Conditionals (solutions)
- Zero-Finding (solutions)
- Functions of Vectors
- Ordinary Differential Equations (solutions)
- Systems of ODEs (solutions)
- Second-Order Systems (solutions)
- Two Dimensions
- Optimization (solutions)
- Springs and Things (solutions)
- Under the Hood
About the book
Physical Modeling in MATLAB is an introduction to programming and to modeling and simulation of physical systems, for people who have never programmed before. It assumes some calculus and basic physics.
The examples are written for MATLAB and also run in GNU Octave. Text: CC BY-NC 4.0; code: MIT License.