Saturday, May 23, 2020

สาบัญ เนื้อหา

Contents

1 Introduction to Scilab 5 
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 
1.2 Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 
   1.2.1 Windows Login . . . . . . . . . . . . . . . . . . . . . . . . 6 
   1.2.2 Mac Login . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 
1.3 Talking between Scilab and the Editor . . . . . . . . . . . . . . 6 
1.4 Basic Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 
1.5 Linear Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 
1.6 Loops and Conditionals . . . . . . . . . . . . . . . . . . . . . . . . 9 
1.7 Help in Scilab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 
   1.7.1 The Help Command . . . . . . . . . . . . . . . . . . . . . 10 
   1.7.2 The Help Window . . . . . . . . . . . . . . . . . . . . . . 11 
1.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 
1.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2 Matrix Calculations 14 
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 
2.2 Matrices and Vectors . . . . . . . . . . . . . . . . . . . . . . . . . 14 
   2.2.1 Solving Equations. . . . . . . . . . . . . . . . . . . . . . . 14 
   2.2.2 Matrices and Vectors. . . . . . . . . . . . . . . . . . . . . . 16 
   2.2.3 Creating Matrices . . . . . . . . . . . . . . . . . . . . . . . 17 
   2.2.4 Systems of Equations . . . . . . . . . . . . . . . . . . . . . 18
3 Data and Function Plots 20
 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 
 3.2 Plotting Lines and Data . . . . . . . . . . . . . . . . . . . . . . . 20 
    3.2.1 Adding a Line . . . . . . . . . . . . . . . . . . . . . . . . . 22 
   3.2.2 Hints for Good Graphs . . . . . . . . . . . . . . . . . . . . 23 
 3.3 Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
   3.3.1 Function Plotting . . . . . . . . . . . . . . . . . . . . . . . 25 
   3.3.2 Component Arithmetic . . . . . . . . . . . . . . . . . . . . 25 
   3.3.3 Printing Graphs . . . . . . . . . . . . . . . . . . . . . . . . 26 
   3.3.4 Saving Graphs . . . . . . . . . . . . . . . . . . . . . . . . . 27
Computational Science, Scilab Tutorials
4 Sparse Matrices and Direct Solvers 28 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4.2 Sparse Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4.3 Convert full to sparse matrices . . . . . . . . . . . . . . . . . . . . 28 4.4 Sparse Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 4.5 Matrix, Graph example . . . . . . . . . . . . . . . . . . . . . . . . 30 4.6 Sparse matrix Operations . . . . . . . . . . . . . . . . . . . . . . 34 4.7 Solving Matrix Equations . . . . . . . . . . . . . . . . . . . . . . 34 4.8 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5 Iterative Methods Applied to Membrane Problem 36 5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 5.2 Setup Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 5.3 Setting Boundary values . . . . . . . . . . . . . . . . . . . . . . . 37 5.4 Applying Tension . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.5 Solving the Problem . . . . . . . . . . . . . . . . . . . . . . . . . 40 5.6 Faster Creation of Matrix . . . . . . . . . . . . . . . . . . . . . . 42 5.7 Conjugate Gradient Method . . . . . . . . . . . . . . . . . . . . . 44 5.8 Faster Matrix Vector Multiplication . . . . . . . . . . . . . . . . . 47 5.9 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 6 Polynomials 50 6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 6.2 Evaluation of Polynomials . . . . . . . . . . . . . . . . . . . . . . 50 6.3 Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 6.4 Linear Least Squares (Heath Computer Problem 3.6) . . . . . . . 51 7 Interpolation 53 7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 7.2 Interpolating Runge’s Function . . . . . . . . . . . . . . . . . . . 53 7.3 Taylor Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . 54 7.4 Chebyshev Interpolation . . . . . . . . . . . . . . . . . . . . . . . 55 7.5 Spline Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . 55 7.6 Monotonic Cubic Interpolation . . . . . . . . . . . . . . . . . . . 56 8 Solving Differential Equations 57 8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 8.2 Differential Equations. . . . . . . . . . . . . . . . . . . . . . . . . 57 8.2.1 Scalar ODE’s . . . . . . . . . . . . . . . . . . . . . . . . . 57 8.2.2 Order 2 ODE’s . . . . . . . . . . . . . . . . . . . . . . . .

No comments:

Post a Comment