Comprehensive Coverage of the New, Easy-to-Learn C# Although C, C++, Java, and Fortran are well-established programming languages, the relatively new C# is much easier to use for solving complex scientific and engineering problems. Numerical Methods, Algorithms and Tools in C# presents a broad collection of practical, ready-to-use mathematical routines employing the exciting, easy-to-learn C# programming language from Microsoft. The book focuses on standard numerical methods, novel object-oriented techniques, and the latest Microsoft .NET programming environment. It covers complex number functions, data sorting and searching algorithms, bit manipulation, interpolation methods, numerical manipulation of linear algebraic equations, and numerical methods for calculating approximate solutions of non-linear equations. The author discusses alternative ways to obtain computer-generated pseudo-random numbers and real random numbers generated by naturally occurring physical phenomena. He also describes various methods for approximating integrals and special functions, routines for performing statistical analyses of data, and least squares and numerical curve fitting methods for analyzing experimental data, along with numerical methods for solving ordinary and partial differential equations. The final chapter offers optimization methods for the minimization or maximization of functions. Exploiting the useful features of C#, this book shows how to write efficient, mathematically intense object-oriented computer programs. The vast array of practical examples presented can be easily customized and implemented to solve complex engineering and scientific problems typically found in real-world computer applications.
Author(s): Waldemar Dos Passos
Publisher: CRC Press
Year: 2010
Language: English
Pages: 575
Title Page......Page 3
Front Cover......Page 1
Copyright and ISBN......Page 4
Preface......Page 5
Acknowledgements......Page 8
Contents......Page 11
1.1 C# and the .NET Framework......Page 18
1.3 Overview of Object-Oriented Programming (OOP)......Page 20
1.4 Your First C# Program......Page 21
1.5 Overview of the IDE Debugger......Page 26
1.6 Overview of the C# Language......Page 28
1.6.1 Data Types......Page 29
1.6.2 Value Types......Page 30
1.6.3 Reference Types......Page 31
1.6.4 Type-Parameter Types......Page 33
1.6.6 Variable Declaration......Page 34
1.6.10 Characters......Page 35
1.6.12 Formatting of Output Data......Page 36
1.6.13 Type Conversion......Page 37
1.6.14 Reading Keyboard Input Data......Page 40
1.6.15 Basic Expressions and Operators......Page 41
Selection Statements......Page 44
Loop Sequences......Page 45
1.6.17 Jump Statements......Page 46
1.6.18 Arrays......Page 47
1.6.20 Structures......Page 49
1.6.21 Exceptions......Page 50
1.6.22 Classes......Page 51
Constructors and Destructors......Page 54
Methods......Page 55
1.6.24 OverloadingMethods, Constructors and Operators......Page 59
1.6.25 Delegates......Page 60
1.6.26 Events......Page 63
1.6.27 Collections......Page 74
1.6.28 File Input/Output......Page 77
1.6.29 Output Reliability, Accuracy and Precision......Page 82
2.2.1 The Math.PI and Math.E Fields......Page 90
2.3.2 The Power, Exponential and Logarithmic Methods......Page 91
2.3.3 Special Multiplication, Division and Remainder Methods......Page 93
2.3.4 The Absolute Value Method......Page 94
2.3.6 Angular Units of Measurement......Page 95
2.3.7 The Trigonometric Functions......Page 98
2.3.8 The Inverse Trigonometric Functions......Page 99
2.3.9 The Hyperbolic Functions......Page 103
2.3.10 The Inverse Hyperbolic Functions......Page 105
The Ceiling Method......Page 106
The Truncation Method......Page 107
The Round Method......Page 108
3.1 Introduction......Page 114
3.2 A Real Number Vector Library in C#......Page 115
3.3 A Real Number Matrix Library in C#......Page 123
4.2 Fundamental Concepts......Page 138
4.3 Complex Number Arithmetic......Page 140
4.4.2 Logarithms......Page 142
4.4.3 Powers and Roots......Page 144
4.4.4 Trigonometric and Hyperbolic Functions......Page 145
4.4.5 Inverse Trigonometric and Hyperbolic Functions......Page 147
4.5 A Complex Number Library in C#......Page 149
4.6 A Complex Number Vector Library in C#......Page 168
4.7 A Complex Number Matrix Library in C#......Page 175
4.8 Generic vs. Non-Generic Coding......Page 185
5.1 Introduction......Page 188
5.2 Sorting Algorithms......Page 189
5.3.1 Bubble Sort......Page 192
5.3.3 Odd-Even Sort......Page 195
5.3.4 Comb Sort......Page 196
5.3.5 Gnome Sort......Page 197
5.3.6 Quicksort......Page 198
5.3.7 Insertion Sort......Page 199
5.3.8 Shell Sort......Page 200
5.3.9 Selection Sort......Page 201
5.3.10 Merge Sort......Page 202
5.3.11 Bucket Sort......Page 203
5.3.12 Heap Sort......Page 204
5.4 Count Sort......Page 205
5.5 Radix Sort......Page 206
5.6 Search Algorithms......Page 208
5.6.1 Linear Search......Page 209
5.6.3 Interpolation Search......Page 210
5.6.4 Searching for the Maximum and Minimum Values......Page 211
5.6.5 Searching for the N-th Largest or M-th Smallest Value......Page 212
5.6.6 Some Useful Utilities......Page 213
6.2 Numeric Systems......Page 216
6.3 Bit Manipulation and Bitwise Operators......Page 219
6.4 Assorted Bits and Bytes......Page 240
7.1 Introduction......Page 246
7.2 Linear Interpolation......Page 247
7.3 Bilinear Interpolation......Page 248
7.4.1 Lagrange Interpolation......Page 251
7.4.2 Barycentric Interpolation......Page 253
7.4.3 Newton’s Divided Differences Interpolation......Page 255
7.5 Cubic Spline Interpolation......Page 259
7.5.1 Natural Cubic Splines......Page 261
7.5.2 Clamped Cubic Splines......Page 264
8.1 Introduction......Page 268
8.2 Gaussian Elimination......Page 270
8.3 Gauss-Jordan Elimination......Page 271
8.4 LU Decomposition......Page 273
8.5.1 Gauss-Jacobi Iteration......Page 276
8.5.2 Gauss-Seidel Iteration......Page 278
8.6 Eigenvalues and Jacobi’s Algorithm......Page 281
9.1 Introduction......Page 288
9.2 Linear Incremental Method......Page 289
9.3 Bisection Method......Page 291
9.4 The Secant Method......Page 293
9.5 False Positioning Method......Page 294
9.6 Fixed Point Iteration......Page 296
9.7 Newton-Raphson Method......Page 297
10.1 Introduction......Page 300
10.2 The C# Built-In Random Number Generator......Page 301
10.3 Other Random Number Generators......Page 307
10.4 True Random Number Generators......Page 312
10.5 Random Variate Generation Methods......Page 316
10.6 Histograms......Page 326
Bernoulli Distribution......Page 329
Binomial Distribution......Page 332
Geometric Distribution......Page 334
Negative Binomial Distribution......Page 337
Poisson Distribution......Page 339
Uniform Distribution (discrete)......Page 343
Beta Distribution......Page 345
Beta Prime Distribution......Page 347
Cauchy Distribution......Page 349
Chi Distribution......Page 351
Chi-Square Distribution......Page 354
Erlang Distribution......Page 357
Exponential Distribution......Page 360
Extreme Value Distribution......Page 362
Gamma Distribution......Page 364
Laplace Distribution......Page 366
Logistic Distribution......Page 369
Lognormal Distribution......Page 371
Normal Distribution......Page 373
Pareto Distribution......Page 376
Rayleigh Distribution......Page 378
Student-t Distribution......Page 380
Triangular Distribution......Page 382
Uniform Distribution (continuous)......Page 385
Weibull Distribution......Page 387
10.8 Shuffling Algorithms......Page 389
10.9 Adding Random Noise to Data......Page 393
10.10 Removing Random Noise from Data......Page 396
11.2 Finite Difference Formulas......Page 400
11.2.1 Forward Difference Method......Page 402
11.2.2 Backward DifferenceMethod......Page 404
11.2.3 Central Difference Method......Page 407
11.2.4 Improved Central Difference Method......Page 409
11.3 Richardson Extrapolation......Page 412
11.4 Derivatives by Polynomial Interpolation......Page 418
12.1 Introduction......Page 422
12.2.1 Rectangle Method......Page 423
12.2.2 Midpoint Method......Page 425
12.2.3 Trapezoidal Method......Page 426
Simpson’s 1/3 Method......Page 428
Simpson’s 3/8 Method......Page 429
12.3 Romberg Integration......Page 431
12.4 Gaussian Quadrature Methods......Page 433
12.4.1 Gauss-Legendre Integration......Page 434
12.4.2 Gauss-Hermite Integration......Page 436
12.4.3 Gauss-Leguerre Integration......Page 438
12.4.4 Gauss-Chebyshev Integration......Page 440
12.5 Multiple Integration......Page 441
12.6 Monte Carlo Methods......Page 443
12.6.1 Monte Carlo Integration......Page 444
12.6.2 The Metropolis Algorithm......Page 445
12.7 Convolution Integrals......Page 448
13.2 Some Useful Tools......Page 452
13.3.1 Mean and Weighted Mean......Page 455
13.3.2 Geometric and Weighted Geometric Mean......Page 456
13.3.3 Harmonic and Weighted Harmonic Mean......Page 457
13.3.5 Root Mean Square......Page 458
13.3.6 Median, Range and Mode......Page 459
13.3.8 Mean Deviation of the Mean......Page 461
13.3.10 Variance and Standard Deviation......Page 462
13.3.11 Moments About the Mean......Page 464
13.3.12 Skewness......Page 465
13.3.13 Kurtosis......Page 466
13.3.14 Covariance and Correlation......Page 468
13.3.15 Miscellaneous Utilities......Page 470
13.3.16 Percentiles and Rank......Page 473
14.2 Factorials......Page 478
14.3.1 Combinations......Page 481
14.3.2 Permutations......Page 484
14.4 Gamma Function......Page 487
14.6 Error Function......Page 489
14.7 Sine and Cosine Integral Functions......Page 491
14.8 Laguerre Polynomials......Page 492
14.9 Hermite Polynomials......Page 493
14.10 Chebyshev Polynomials......Page 494
14.11 Legendre Polynomials......Page 496
14.12 Bessel Functions......Page 497
15.1 Introduction......Page 500
15.2 Least Squares Fit......Page 501
15.2.1 Straight-Line Fit......Page 502
15.3.1 Weighted Straight-Line Fit......Page 505
15.4 Linear Regression......Page 509
15.4.1 Polynomial Fit......Page 513
15.4.2 Exponential Fit......Page 514
15.5 The X…......Page 516
16.1 Introduction......Page 520
16.2 Euler Method......Page 522
16.3 Runge-Kutta Methods......Page 523
16.3.1 Second-Order Runge-Kutta Method......Page 524
16.3.2 Fourth-Order Runge-Kutta Method......Page 525
16.3.3 Runge-Kutta-FehlbergMethod......Page 527
16.4 Coupled Differential Equations......Page 530
17.1 Introduction......Page 534
17.2 The Finite Difference Method......Page 537
17.3 Parabolic Partial Differential Equations......Page 538
17.3.1 The Crank-Nicolson Method......Page 542
17.4 Hyperbolic Partial Differential Equations......Page 544
17.5 Elliptic Partial Differential Equations......Page 549
18.1 Introduction......Page 556
18.2 Gradient Descent Method......Page 558
18.3 Linear Programming......Page 561
18.3.1 The Revised Simplex Method......Page 563
18.4 Simulated Annealing Method......Page 567
18.5 Genetic Algorithms......Page 572
References......Page 588