MATLAB – A FUNDAMENTAL TOOL FOR SCIENTIFIC COMPUTING AND ENGINEERING APPLICATIONS – VOLUME 1 Edited by Vasilios N. Katsikis MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1 http://dx.doi.org/10.5772/2557 Edited by Vasilios N. Katsikis Contributors A.B. Campo, Tomas Vydra, Daniel Havelka, Christophe Batard, Frédéric Poitiers, Christophe Millet, Nicolas Ginot, Jacques Fanjason Ramahaleomiarantsoa, Eric Jean Roy Sambatra, Nicolas Héraud, Jean Marie Razafimahenina, Ergin Kosa, Levent Trabzon, Umit Sonmez, Huseyin Kizil, Kosol Oranpiroj, Worrajak Moangjai, Wichran Jantee, Sven Fagerstrom, Nagy Bengiamin, Khalid Chikh, Mohamed Khafallah, Abdallah Saâd, Konrad Urbanski, Adel Aktaibi, M. Azizur Rahman, Mostefa Ghassoul, Octavio Ramos-Leaños, Jose Luis Naredo, Jose Alberto Gutierrez-Robles, M. Ould Ahmedou, M. Ferfra, M. Chraygane, M. Maaroufi, Viliam Fedák, Tibor Balogh, Pavel Záskalický, S. Chountasis, V.N. Katsikis, D. Pappas, Mohammed Z. Al-Faiz, Abbas H. Miry, Ramy Saad, Sebastian Hoyos, Samuel Palermo, Momoh-Jimoh E. Salami, Ismaila B. Tijani, Abdussamad U. Jibia, Za’im Bin Ismail, David Ernesto Troncoso Romero, Gordana Jovanovic Dolecek, Nur Diyana Kamarudin, Kamaruddin Abd. Ghani, Siti Noormiza Makhtar, Baizura Bohari, Noorlina Zainuddin Published by InTech Janeza Trdine 9, 51000 Rijeka, Croatia Copyright © 2012 InTech All chapters are Open Access distributed under the Creative Commons Attribution 3.0 license, which allows users to download, copy and build upon published articles even for commercial purposes, as long as the author and publisher are properly credited, which ensures maximum dissemination and a wider impact of our publications. After this work has been published by InTech, authors have the right to republish it, in whole or part, in any publication of which they are the author, and to make other personal use of the work. Any republication, referencing or personal use of the work must explicitly identify the original source. Notice Statements and opinions expressed in the chapters are these of the individual contributors and not necessarily those of the editors or publisher. No responsibility is accepted for the accuracy of information contained in the published chapters. The publisher assumes no responsibility for any damage or injury to persons or property arising out of the use of any materials, instructions, methods or ideas contained in the book. Publishing Process Manager Ivona Lovric Typesetting InTech Prepress, Novi Sad Cover InTech Design Team First published September, 2012 Printed in Croatia A free online edition of this book is available at www.intechopen.com Additional hard copies can be obtained from [email protected] MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1, Edited by Vasilios N. Katsikis p. cm. ISBN 978-953-51-0750-7 Contents Preface IX Section 1 MATLAB Applications in Engineering 1 Chapter 1 PID Control Design 3 A.B. Campo Chapter 2 Post Processing of Results of EM Field Simulators 19 Tomas Vydra and Daniel Havelka Chapter 3 Simulation of Power Converters Using Matlab-Simulink 43 Christophe Batard, Frédéric Poitiers, Christophe Millet and Nicolas Ginot Chapter 4 Performances of the PCA Method in Electrical Machines Diagnosis Using Matlab 69 Jacques Fanjason Ramahaleomiarantsoa, Eric Jean Roy Sambatra, Nicolas Héraud and Jean Marie Razafimahenina Chapter 5 Dynamic and Quasi-Static Simulation of a Novel Compliant MEMS Force Amplifier by Matlab/Simulink 89 Ergin Kosa, Levent Trabzon, Umit Sonmez and Huseyin Kizil Chapter 6 Voltage Sag Waveform Using SagWave GUI 111 Kosol Oranpiroj, Worrajak Moangjai and Wichran Jantee Chapter 7 Modelling and Characterization of Power Electronics Converters Using Matlab Tools 133 Sven Fagerstrom and Nagy Bengiamin Chapter 8 Improved DTC Algorithms for Reducing Torque and Flux Ripples of PMSM Based on Fuzzy Logic and PWM Techniques 167 Khalid Chikh, Mohamed Khafallah and Abdallah Saâd VI Contents Chapter 9 Position Estimation of the PMSM High Dynamic Drive at Low Speed Range 195 Konrad Urbanski Chapter 10 Digital Differential Protection of Power Transformer Using Matlab 219 Adel Aktaibi and M. Azizur Rahman Chapter 11 PH Control Using MATLAB 243 Mostefa Ghassoul Chapter 12 An Advanced Transmission Line and Cable Model in Matlab for the Simulation of Power-System Transients 269 Octavio Ramos-Leaños, Jose Luis Naredo and Jose Alberto Gutierrez-Robles Chapter 13 A New Modeling of the Non-Linear Inductances in MATLAB 305 M. Ould Ahmedou, M. Ferfra, M. Chraygane and M. Maaroufi Chapter 14 Dynamic Simulation of Electrical Machines and Drive Systems Using MATLAB GUI 317 Viliam Fedák, Tibor Balogh and Pavel Záskalický Section 2 Image and Signal Processing 343 Chapter 15 Image Reconstruction Methods for MATLAB Users – A Moore-Penrose Inverse Approach 345 S. Chountasis, V.N. Katsikis and D. Pappas Chapter 16 Artificial Human Arm Driven by EMG Signal 365 Mohammed Z. Al-Faiz and Abbas H. Miry Chapter 17 Analysis and Modeling of Clock-Jitter Effects in Delta-Sigma Modulators 393 Ramy Saad, Sebastian Hoyos and Samuel Palermo Chapter 18 Matlab-Based Algorithm for Real Time Analysis of Multiexponential Transient Signals 423 Momoh-Jimoh E. Salami, Ismaila B. Tijani, Abdussamad U. Jibia and Za’im Bin Ismail Chapter 19 Digital FIR Hilbert Transformers: Fundamentals and Efficient Design Methods 445 David Ernesto Troncoso Romero and Gordana Jovanovic Dolecek Chapter 20 Detection of Craters and Its Orientation on Lunar 483 Nur Diyana Kamarudin, Kamaruddin Abd. Ghani, Siti Noormiza Makhtar, Baizura Bohari and Noorlina Zainuddin Preface "If you would be a real seeker after truth, it is necessary that at least once in your life you doubt, as far as possible, all things." Rene Descartes It is well known that MATLAB is a numerical computing environment that not only provides numerical calculations but also facilitates analytical calculations in most engineering applications of computers. This is the first book in a three-volume series deploying MATLAB-based applications in almost every branch of science. The present textbook contains a collection of 20 high quality articles. In particular, the book consists of two sections, the first one is devoted to MATLAB applications in engineering and the second is devoted to image and signal processing. In what follows, we present a short summary focusing on the key concepts of each chapter. Section 1: MATLAB applications in engineering In chapter 1 some script MATLAB codes and Simulink models about the PID structure applied to closed loop systems are presented. The closed loop control is used at several industrial applications. The most used control structure is the Proportional-Integral- Derivative (PID) controller. The MATLAB software offer several resources to analyzes dynamical systems and to tune the parameters of this kind of controller. Chapter 2 should give readers overall information about processing of rough data obtained from numeric simulator of electromagnetic field (EM). Many possibilities of visualization are be discussed with regard to practical use and with concrete examples from researcher's practice. Part of this chapter is dedicated to processing of multisource simulations, while the main purpose is to aid many researchers and students in the vast field of EM research. The authors present, in detail, their knowledge and tips which they have gathered through their studies and research activities. In chapter 3 the ability to simulate power converters is presented by using only Simulink. Traditionally two approaches are used to simulate power electronic systems: X Preface - The first, so called fixed topology, where semiconductors are impedances with low or high values based on their on-state or off-state. Equations system does not depend on the state of the semiconductor. Despite its simplicity, this approach raises problems of compromise between accuracy of the results and stability of numerical integration methods. - The second, so called variable topology, assimilates the switches to open-circuits or short-circuits. The system equations then depend on the state of the semiconductor. There are no accuracy problems but writing the equations of different configurations can be laborious as well as obtain switching conditions of the semiconductor. In this chapter, the authors propose a method for simulating static converters with Simulink based on the variable topology approach where switching conditions of semiconductor are realized by switching functions. Chapter 4 deals with the faults diagnosis of a wound rotor synchronous machine (WRIM) by the principal component analysis (PCA) method. This work intends to show the strength of the PCA method in the faults diagnosis of systems, using the WRIM as the application device. To do this, the authors propose an accurate analytical model of the WRIM without or in the presence of faults. This model provides the matrix data of the several characteristic quantities of the machine. These data are included as input variables of the PCA method. Then, the authors present a complete approach of the PCA method based on the study of residues. Simulation results show the efficiency of the detection but require a good choice of the number of principal components. All of above work has been then implemented in the MATLAB software. In chapter 5 position, quasi-static behavior, velocity, acceleration and dynamic simulations are modelled and run by MATLAB/Simulink in order to analyze the dynamic and quasi-static behavior of the compliant MEMS amplifier. Chapter 6 proposes the SagWave software as a visual interactive capability to generated data for the dsPIC controller. The SagWave software can show the waveform and the phasor of the three-phase voltage. The simulation and experimental results have shown the simple control algorithm for generating the sag signal for testing. The SagWave software is based on MATLAB graphic user interface (GUI) and the hardware is based on dsPIC microcontroller. In chapter 7 the authors use the capabilities of MATLAB and its associated SimPower and Simulink toolboxes in the modeling and simulation of power electronics devices. Design and analysis steps were illustrated using MATLAB and Simulink as an engineering tool. The effectiveness of the SimPower toolbox was demonstrated via typical examples which lead the way for further investigation. The presented methodologies facilitate analysis, characterization, and design of efficient buck/boost converters. Researchers and practicing engineers should find practical value in the Preface XI presented material. The chapter is self-contained in the sense of providing sufficient background and theoretical development on the subject. Chapter 8 discusses Permanent Magnet Synchronous Motors (PMSM's). In particular, another solution has been presented to overcome the problems associated to DTC for PMSM in case of motor parameters variation and/or nonlinear operating conditions, which utilize speed FLC and an independent stator resistance estimator. In chapter 9 the authors deal with the problem of estimation the rotor position and speed in sensorless PMSM drive. At low speed range position estimation is particularly difficult due to the small value of the input and estimated signals, which are covered by measured noises and disturbances. Additional problem is to obtain high dynamic of the proposed drive system in the observer presence in control loop. The research was realized using MATLAB/Simulink. In chapter 10 it is explained how to simulate a digital differential relay using MATLAB. The following major sections are featured: a) General explanation about the differential protection algorithm, b) The problems that is aimed to be solved using the differential protection, c) General idea about the digital algorithms used to implement the differential protection, d) Explanation how to implement some of the digital algorithms using MATLAB. Chapter 11 develops a PH control strategy using MATLAB interfaced to NI acquisition card. The control strategy was developed using MATLAB Block Sets for fuzzy logic. To enhance the validity of this technique, a tuned Proportional-Integral-Derivative (PID) controller was developed and the results obtained were nowhere near those discussed in this chapter no matter how the fine tuning of the PID. In chapter 12 a detailed analysis and description of a line and cable model that is based on the principles of the Universal Line Model (ULM) is discussed. Moreover, a comprehensive description of the theoretical basis of ULM, phase domain line model is presented. The model structure being implemented in MATLAB is provided as well while the included application examples illustrate the model capabilities and provide benchmarks for further model development by readers interested in the subject. Chapter 13 presents a new approach for modeling the non-linear inductances by an analytic expression under the MATLAB/Simulink code. The current representation is based on the introducing point by point, by a Lookup Table bloc in Simulink, the values of its characteristic Φ(i) outcome deduced from the values of the magnetizing curve B-H and the geometric parameters of the corresponding portion of the magnetic circuit. This approach can solve many problems of modeling, simulation and optimization of the electrical networks and electric machines. In chapter 14 the principles of development virtual models in GUI MATLAB for chosen electrical machines and controlled drives are discussed. Moreover, it discusses methodology and results at design of a unified series of virtual models for electrical