Skip to main content Accessibility help
×
Hostname: page-component-77c89778f8-m42fx Total loading time: 0 Render date: 2024-07-24T03:26:57.811Z Has data issue: false hasContentIssue false

Appendix: MATLAB program examples

Published online by Cambridge University Press:  05 June 2012

Taras Gerya
Affiliation:
Swiss Federal Institute of Technology (ETH-Zurich)
Get access

Summary

Introduction

Program 1: Visualisation_is_important.m (Exercise Introduction.2) – visualisation of ‘sin’ and ‘cos’ functions with ‘plot’, ‘pcolor’, ‘contour’ and ‘surf’.

Chapter 1

Program 2: Divergence.m (Exercise 1.2) – computation and visualisation of velocity, divergence of velocity and time derivatives of density with ‘pcolor’ and ‘quiver’.

Chapter 2

Program 3: Periclase_EOS.m (Exercise 2.2) – computation and visualisation of density, thermal expansion and compressibility for periclase (MgO) using external Gibbs free energy function G_periclase.m.

Program 4: Density_map.m (Exercise 2.3) – loading from data files (m895_ro, morn_ro) and visualising density maps for pyrolite (m895_ro) and MORB (morn_ro) and density difference between pyrolite and MORB.

Chapter 3

Program 5: Poisson1D.m (Exercise 3.1) – solution of 1D Poisson equation with finite differences on a regular grid using direct solver ‘\’.

Program 6: Poisson2D_direct.m (Exercise 3.2) – solution of 2D Poisson equation with finite differences on a regular grid using direct solver ‘\’.

Program 7: Poisson2D_Gauss_Seidel.m (Exercise 3.3) – solution of 2D Poisson equation with finite differences on a regular grid using Gauss–Seidel iteration.

Program 8: Poisson2D_Jacobi.m (Exercise 3.4) – solution of 2D Poisson equation with finite differences on a regular grid using Jacobi iteration.

Chapter 4

Program 9: Strain_rate.m (Exercise 4.2) – computation and visualisation of velocity field, strain rate, deviatoric strain rate, and second strain rate invariant.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2009

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×