Preface |
|
xv | |
|
|
1 | (170) |
|
1 Introduction to Matlab® |
|
|
3 | (44) |
|
|
3 | (2) |
|
1.2 Using Matlab as a simple calculator |
|
|
5 | (4) |
|
|
9 | (1) |
|
1.4 Using Matlab as a scientific calculator |
|
|
10 | (6) |
|
1.4.1 Trigonometric functions |
|
|
10 | (3) |
|
1.4.2 Inverse trigonometric functions |
|
|
13 | (2) |
|
1.4.3 Other elementary functions |
|
|
15 | (1) |
|
|
16 | (2) |
|
1.6 Using Matlab for plotting |
|
|
18 | (3) |
|
|
20 | (1) |
|
|
21 | (1) |
|
|
22 | (5) |
|
|
22 | (1) |
|
1.8.2 Plotting resolution |
|
|
23 | (1) |
|
|
24 | (3) |
|
1.9 Writing simple functions in Matlab |
|
|
27 | (4) |
|
|
31 | (3) |
|
|
34 | (8) |
|
|
42 | (5) |
|
|
47 | (56) |
|
|
48 | (21) |
|
2.1.1 Arrays of point coordinates in the plane |
|
|
48 | (4) |
|
2.1.2 The perimeter of a polygon - for loops |
|
|
52 | (3) |
|
|
55 | (1) |
|
2.1.4 Arrays of point coordinates in solid geometry |
|
|
56 | (5) |
|
2.1.5 Geometrical interpretation of vectors |
|
|
61 | (2) |
|
2.1.6 Operating with vectors |
|
|
63 | (2) |
|
|
65 | (1) |
|
|
66 | (3) |
|
|
69 | (4) |
|
2.2.1 Forces. The resultant of two or more forces |
|
|
69 | (3) |
|
2.2.2 Work as a scalar product |
|
|
72 | (1) |
|
2.2.3 Velocities. Composition of velocities |
|
|
72 | (1) |
|
|
73 | (5) |
|
2.3.1 Introduction - the matrix product |
|
|
73 | (4) |
|
|
77 | (1) |
|
|
78 | (4) |
|
2.4.1 The vector product. Parallelogram area |
|
|
78 | (2) |
|
2.4.2 The scalar triple product. Parallelepiped volume |
|
|
80 | (2) |
|
|
82 | (6) |
|
2.5.1 Translation --- Matrix addition and subtraction |
|
|
82 | (1) |
|
|
83 | (1) |
|
2.5.3 Homogeneous coordinates |
|
|
84 | (4) |
|
2.6 Matrices in Mechanics |
|
|
88 | (5) |
|
|
88 | (1) |
|
|
89 | (2) |
|
2.6.3 Moments as vector products |
|
|
91 | (2) |
|
|
93 | (5) |
|
|
98 | (5) |
|
|
103 | (48) |
|
|
103 | (1) |
|
3.2 Linear equations in geometry |
|
|
103 | (6) |
|
3.2.1 The intersection of two lines |
|
|
103 | (1) |
|
|
104 | (1) |
|
3.2.3 Matlab's solution of linear equations |
|
|
105 | (2) |
|
3.2.4 An example of an ill-conditioned system |
|
|
107 | (2) |
|
3.2.5 The intersection of three planes |
|
|
109 | (1) |
|
3.3 Linear equations in statics |
|
|
109 | (3) |
|
|
109 | (3) |
|
3.4 Linear equations in electricity |
|
|
112 | (4) |
|
|
112 | (2) |
|
3.4.2 The method of loop currents |
|
|
114 | (2) |
|
3.5 On the solution of linear equations |
|
|
116 | (16) |
|
3.5.1 Homogeneous linear equations |
|
|
116 | (3) |
|
3.5.2 Overdetermined systems --- least-squares solution |
|
|
119 | (4) |
|
3.5.3 Underdetermined system |
|
|
123 | (3) |
|
|
126 | (2) |
|
3.5.5 Another singular system |
|
|
128 | (4) |
|
|
132 | (2) |
|
|
134 | (1) |
|
|
135 | (8) |
|
3.8.1 Matlab representation of polynomials |
|
|
135 | (1) |
|
3.8.2 The Matlab root function |
|
|
135 | (2) |
|
3.8.3 The Matlab function conv |
|
|
137 | (6) |
|
3.9 Iterative solution of equations |
|
|
143 | (5) |
|
3.9.1 The Newton-Raphson method |
|
|
143 | (4) |
|
3.9.2 Solving an equation with the command fzero |
|
|
147 | (1) |
|
|
148 | (1) |
|
|
149 | (2) |
|
4 Processing and publishing the results |
|
|
151 | (20) |
|
|
151 | (1) |
|
|
152 | (1) |
|
4.3 Exporting and processing figures |
|
|
152 | (1) |
|
|
153 | (4) |
|
4.4.1 Interactive plotting and curve fitting |
|
|
153 | (4) |
|
4.5 The Matlab®spline function |
|
|
157 | (8) |
|
4.6 Importing data from Excel® - histograms |
|
|
165 | (2) |
|
|
167 | (2) |
|
|
169 | (2) |
|
II Programming in Matlab® |
|
|
171 | (72) |
|
5 Some facts about numerical computing |
|
|
173 | (42) |
|
|
173 | (1) |
|
5.2 Computer-aided mistakes |
|
|
174 | (6) |
|
5.2.1 A loop that does not stop |
|
|
175 | (1) |
|
5.2.2 Errors in trigonometric functions |
|
|
176 | (1) |
|
|
176 | (2) |
|
5.2.4 Other unexpected roots |
|
|
178 | (1) |
|
5.2.5 Accumulating errors |
|
|
179 | (1) |
|
5.3 Computer representation of numbers |
|
|
180 | (4) |
|
5.4 The set of computer numbers |
|
|
184 | (2) |
|
|
186 | (1) |
|
|
187 | (4) |
|
|
191 | (2) |
|
5.8 Why the examples in Section 5.2 failed |
|
|
193 | (6) |
|
|
193 | (1) |
|
5.8.2 Correcting a non-terminating loop |
|
|
194 | (1) |
|
5.8.3 Second-degree equation |
|
|
194 | (2) |
|
5.8.4 Unexpected polynomial roots |
|
|
196 | (3) |
|
|
199 | (3) |
|
|
202 | (3) |
|
5.10.1 Definition, examples |
|
|
202 | (3) |
|
|
205 | (1) |
|
5.12 Problems that cannot be solved |
|
|
206 | (2) |
|
|
208 | (1) |
|
|
209 | (2) |
|
|
211 | (4) |
|
6 Data types and object-oriented programming |
|
|
215 | (28) |
|
|
216 | (3) |
|
6.1.1 Where structures can help |
|
|
216 | (1) |
|
6.1.2 Working with structures |
|
|
217 | (2) |
|
|
219 | (2) |
|
6.3 Classes and object-oriented programming |
|
|
221 | (17) |
|
6.3.1 What is object-oriented programming? |
|
|
221 | (1) |
|
6.3.2 Calculations with units |
|
|
222 | (2) |
|
|
224 | (5) |
|
6.3.4 Defining a subclass |
|
|
229 | (4) |
|
6.3.5 Calculating with electrical units |
|
|
233 | (5) |
|
|
238 | (2) |
|
|
240 | (3) |
|
III Progressing in Matlab® |
|
|
243 | (174) |
|
|
245 | (42) |
|
7.1 The introduction of complex numbers |
|
|
245 | (1) |
|
7.2 Complex numbers in Matlab |
|
|
245 | (3) |
|
7.3 Geometric representation |
|
|
248 | (2) |
|
7.4 Trigonometric representation |
|
|
250 | (1) |
|
7.5 Exponential representation |
|
|
250 | (3) |
|
7.6 Functions of complex variables |
|
|
253 | (2) |
|
|
255 | (4) |
|
|
259 | (12) |
|
|
259 | (2) |
|
7.8.2 Phasors in mechanics |
|
|
261 | (4) |
|
7.8.3 Phasors in electricity |
|
|
265 | (6) |
|
7.9 An application in mechanical engineering --- a mechanism |
|
|
271 | (10) |
|
7.9.1 A four-link mechanism |
|
|
271 | (1) |
|
7.9.2 Displacement analysis of the four-link mechanism |
|
|
272 | (2) |
|
7.9.3 A Matlab function that simulates the motion of the four-link mechanism |
|
|
274 | (3) |
|
|
277 | (1) |
|
7.9.5 A variant of the function FourLink |
|
|
278 | (3) |
|
|
281 | (2) |
|
|
283 | (4) |
|
|
287 | (14) |
|
|
287 | (1) |
|
|
288 | (2) |
|
|
288 | (1) |
|
8.2.2 The Matlab trapz function |
|
|
289 | (1) |
|
|
290 | (3) |
|
|
290 | (2) |
|
8.3.2 A function that implements Simpson's rule |
|
|
292 | (1) |
|
8.4 The Matlab quadl function |
|
|
293 | (2) |
|
8.5 Symbolic calculation of integrals |
|
|
295 | (2) |
|
|
297 | (1) |
|
|
298 | (3) |
|
9 Ordinary differential equations |
|
|
301 | (26) |
|
|
301 | (1) |
|
9.2 Numerical solution of ordinary differential equations |
|
|
301 | (1) |
|
|
301 | (1) |
|
9.3 Numerical solution of ordinary differential equations |
|
|
302 | (8) |
|
9.3.1 Specifying the times of the solution |
|
|
305 | (1) |
|
9.3.2 Using alternative odesolvers |
|
|
306 | (1) |
|
9.3.3 Passing parameters to the model |
|
|
306 | (4) |
|
9.4 Alternative strategies to solve ordinary differential equations |
|
|
310 | (13) |
|
9.4.1 Runge---Kutta methods |
|
|
312 | (3) |
|
9.4.2 Predictor-corrector methods |
|
|
315 | (1) |
|
|
316 | (7) |
|
9.5 Conclusion: How to choose the odesolver |
|
|
323 | (1) |
|
|
324 | (3) |
|
|
327 | (32) |
|
|
327 | (1) |
|
|
327 | (3) |
|
10.3 The cone surface and conic sections |
|
|
330 | (13) |
|
|
330 | (2) |
|
|
332 | (4) |
|
10.3.3 Developing the cone surface |
|
|
336 | (1) |
|
10.3.4 A helicoidal curve on the cone surface |
|
|
337 | (1) |
|
10.3.5 The listing of functions developed in this section |
|
|
338 | (5) |
|
10.4 GUIs - graphical user interfaces |
|
|
343 | (12) |
|
|
355 | (1) |
|
|
356 | (3) |
|
11 An introduction to Simulink® |
|
|
359 | (36) |
|
|
359 | (1) |
|
|
360 | (6) |
|
11.3 A model of the momentum law |
|
|
366 | (4) |
|
|
370 | (6) |
|
11.5 A mass---spring---dashpot system |
|
|
376 | (4) |
|
11.6 A series RLC circuit |
|
|
380 | (3) |
|
|
383 | (10) |
|
11.7.1 The mathematical and the physical pendulum |
|
|
383 | (4) |
|
|
387 | (4) |
|
11.7.3 Running the simulation from a script file |
|
|
391 | (2) |
|
|
393 | (2) |
|
12 Applications in the frequency domain |
|
|
395 | (22) |
|
|
395 | (1) |
|
|
395 | (3) |
|
12.3 A short introduction to the DFT |
|
|
398 | (2) |
|
|
400 | (7) |
|
12.5 Trigonometric expansion of a signal |
|
|
407 | (3) |
|
12.6 High frequency signals and aliasing |
|
|
410 | (2) |
|
|
412 | (2) |
|
|
414 | (1) |
|
|
415 | (2) |
Answers to selected exercises |
|
417 | (6) |
Bibliography |
|
423 | (4) |
Index |
|
427 | |