A MATLAB® Primer for Technical Programming for Materials Science and Engineering

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

A MATLAB® Primer for Technical Programming for Materials Science and Engineering draws on examples from the field, providing the latest information on this programming tool that is targeted towards materials science. The book enables non-programmers to master MATLAB® in order to solve problems in materials science, assuming only a modest mathematical background. In addition, the book introduces programming and technical concepts in a logical manner to help students use MATLAB® for subsequent projects. This title offers materials scientists who are non-programming specialists with a coherent and focused introduction to MATLAB®.

Author(s): Leonid Burstein
Series: Woodhead Publishing Series in Technology and Engineering
Publisher: Elsevier Inc
Year: 2020

Language: Polish
Pages: 275

Front matter
Copyright
Dedication
Preface
Introduction
Some history
Purpose and audience of the book
About the book topics
The structure of the chapters
About MATLAB versions
Order of presentation
Basics of MATLAB®
Launching MATLAB
MATLAB Desktop and its toolstrip and windows
Toolstrip
Command window
Workspace window
Current folder window
Interactive calculations with elementary math functions
Help commands and Help Window
About toolboxes
About variables and commands to variable management
Output formats
Output commands
Application examples
Bravais lattice: Volume of the triclinic crystal unit cell
Brinell hardness number
Friction coefficient
Stress intensity factor
Vectors, matrices, and arrays
Vectors and matrices: Generation and handling
Generation of vectors
Generation of matrices and arrays
Matrix operations
Addition and subtraction
Multiplication
Division
Array operations
Commands for generation of some special matrices
Displaying table with the disp and fprintf commands
Application examples
Volume via vectors
Generating table of names of statistical measures
Diffusion coefficient statistics
Mean time between failures
Flow control
Relational and logical operators
Relational operators
Logical operators
Application example: Screening of the metals in respect to their density
The If statements
Loops in MATLAB
Application examples
Isothermal liquid density: Defining coefficients of the linear fit
Bulk modulus of a material
Molar concentration
Questions and exercises for self-testing
Answers to selected questions and exercises
Graphics and presentations
Two- and three-dimensional plots
Two-dimensional plots
Multiple curves on the 2D plot
The plot command for multiple curves
The hold command for generating multiple curves
Several plots on the same page
Formatting 2D plots using commands or the Plot Tools editor
Commands for 2D plot formatting
The Image 103 commands
The axis commands
The xlabel, ylabel, and title commands
The gtext and text commands
The legend command
Formatting text strings
About interactive plot formatting
Three-dimensional plots
Presenting line in 3D plots
Presenting mesh in 3D plots
Surfaces in 3D plots
Formatting and rotating 3D plots
Setting the figure colors with the colormap command
The view command, viewpoint, and different 3D projections of the graph
About the 3D plot rotation
Specialized two- and threedimensional plots
Plot with error bars
Plot with semilogarithmic axes
Plot with two y-axes
Statistical plots
The hist command
The bar command
The Data Statistics tool
Supplementary commands for generating 2D and 3D graphs
Application examples
Surface tension of fluid as a function of temperature
Stress-strain graph generated by the experimental data
The Lennard-Jones interatomic potential
Transient one-dimensional diffusion
Temperature of a square plate
Velocity distribution of the gas molecules
Questions and exercises for self-testing
Answer to selected questions and exercises
Writing programs for technical computing
Scripts and script files
How to create, save, and run the script file
Saving the script file
About the Current folder
Running script file
Input the variable values from the Command Window
User-defined functions and function files
Creating the user-defined function
Definition line of the function
Lines with the help comments
Function body, local, and global variables
Function file
Running a user-defined function
Script and user-defined function files, comparison
Selected MATLAB functions and its applications in MSE
The interp1 function for interpolation and extrapolation
Nonlinear algebraic equation solution
Finding of the extremal points of a function
Integration
The quad function
The trapz function
Derivative calculation
Supplementary commands for interpolation, equation solution, integration, and differentiation
Live Editor
Launching the Live Editor
Creating the life script with the Live Editor
Supplementary information for using the Live Editor
Creating Live Function
Opening the existing script as a live script and user-defined function as a live function
Text formatting options
About the interactive controls
Application examples
Convertor from Brinell to Vickers and Rockwell hardness
Dynamic viscosity: Reyn to pascal-second and vice versa convertor
Thermal conductivity data interpolation
Density of a solid at given pressure and temperature
Maximal radiance of a surface by the Planck's law
Isochoric thermal pressure coefficient of a substance in the solid state
Isothermal compressibility for a gaseous substance
Questions and exercises for self-testing
Answers to selected questions and exercises
Curve fitting commands and the Basic Fitting tool
Fitting with polynomials and some other functions
Fitting by polynomials
Fitting with nonpolynomial functions
About the goodness of fit
Interactive fitting with the Basic Fitting interface
The ``Plot fits´´ panel items
``Select data´´ field
``Center and scale x data´´ box
``Check to display fits on figure´´ area
``Show equation´´ box and ``Significant digits´´ field
``Plot residuals´´ box with two adjacent fields
``Show norm of residuals´´ box
The ``Numerical results´´ panel items
``Fit´´ dropdown list
``Coefficients and norm of residuals´´ box
``Save to workspace´´ button
The ``Find y=f(x)´´ panel items
``Enter value(s) or a valid MATLAB expression´´
``Save to workspace´´ button
``Plot evaluated results´´ box
An example of using the ``Basic Fitting´´ tool
Single- and multivariate fitting via optimization
Application examples
Fitting of the compressibility factor with the virial series
Thermal conductivity fitting with the 3rd and 4th degree polynomials
Fitting the stress-strain data by the nonpolynomial equation
Fitting of the specific heat of a metal with the Basic Fitting interface
Fitting the dynamical viscosity-temperature-pressure data by optimization
Questions and exercises for self-testing
Answers to selected questions and exercises
ODE-, PDEPE-solvers, and PDE Modeler tool with applications
Ordinary differential equations and ODE solver
About numerical methods for solving ODEs
The ode45 and ode15s commands for solving ODEs
ODE solution steps
Extended command forms of the ODE solver
Supplementary commands of the ODE solver
Solving partial differential equations with PDE solver
About numerical methods for solving PDEs
The pdepe command for solving one-dimensional PDEs
The steps for solving a PDE with the pdepe command
Partial differential equations with the PDE toolbox interface
Solution steps in the PDE Modeler
Exporting the obtained solution and mesh to the MATLAB workspace
Conversion of the solution from the triangular to rectangular grid
Drawing in PDE Modeler
Application examples
Examples with the ODE applications
Heat transfer with a temperature-dependent material property
Polymeric materials kinetics; step-growth polymerization
Examples with one-dimensional PDEs
One-dimensional diffusion equation with Neumann boundaries
The diffusion Brusselator PDEs
Examples with solving the two-dimensional PDEs with the PDE Modeler
Two-dimensional heat transfer equation with temperature-dependent property of a material
Two-dimensional transient diffusion equation with coordinate-dependent initial conditions
Questions and exercises for self-testing
Answers to selected questions and exercises
Appendix: Characters, operators,
and commands for mastering
programs
Index