Explore chapters and articles related to this topic
Iterative Methods
Published in Jeffery J. Leader, Numerical Analysis and Scientific Computation, 2022
These packages provide a great resource. If your problems should outgrow the capabilities of MATLAB, or you need greater control of the parameters, or you need a fully compiled version, you may need to use them. If you're working in Fortran, C++, Python (which has numerical libraries called NumPy and SciPy available), etc., and you can't find what you need within them, you should absolutely be making heavy use of these libraries and, if possible, the BLAS. Browse www.netlib.org now to see what is available. (There is a naming convention, and learning it will make it easier to find what you're looking for there.) While MATLAB is unparalleled for rapid prototyping of ideas, after determining that an algorithm will work in MATLAB you'll often need to recode it. (Sometimes an executable MATLAB .mex file will suffice; see help mex.) There are many resources available to you as you write your own scientific code.
®: Dynamic System Simulation for MATLAB®
Published in Perelroyzen Evgeni, Digital Integrated Circuits, 2018
At the third stage the make utility generates executable C-code, that is, the real-time exe-file. The exe-file is generated from the above-mentioned files and from the Custom Makefile, the mk-file, generated previously on the basis of the tmf-file. At this stage the S-function codes are added to the generated file if they are found in the Simulink model. If the S-function is written in C language or in FORTRAN, it is preliminarily compiled and converted into a MEX-file. The generated MEX-file is dynamically connected to alternative model components whenever necessary.
An Introduction to Sliding Mode Control
Published in Christopher Edwards, Sarah K. Spurgeon, Sliding Mode Control: Theory and Applications, 1998
Christopher Edwards, Sarah K. Spurgeon
1dSPACE is the registered trademark of dSPACE GmbH. observer was translated into a MEX file 2 written in C. The controller structure in SimulinK is shown in Figure 8.9.
Frequency domain finite-element and spectral-element acoustic wave modeling using absorbing boundaries and perfectly matched layer
Published in Waves in Random and Complex Media, 2018
Amin Rahimi Dalkhani, Abdolrahim Javaherian, Hadi Mahdavi Basir
This example contains a simple anticline model with a smooth topography (Figure 8). Modeling is done with the frequency domain SEM2. The multi-source modeling is performed with 105 source points on the top of the model in order to generate zero-offset sections of Figure 9. The boundary condition for the top of the model is the free surface and boundary condition for the other sides of the model is PML100 with R = 0.015 in Figure 9(a), and CE-ABC2 in Figures 9(b)–(d). The maximum time of modeling is 2 s and a Ricker wavelet with a peak frequency of 15 Hz is used as the source. The modeling is performed for 120 frequency components up to 60 Hz. The minimum P-wave velocity in the model is 1500 m/s. Spatial discretization is conducted with 6 nodes per minimum wavelength, hence the grid point interval is 6.25 m and the vertical and the horizontal dimensions of the model are 281 × 417 grid points, respectively. Employing the four-core machine and MATLAB software, the CPU times needed to perform modeling using CE-ABC2 are 2 min and 3 h in single-source and multi-source cases, respectively. The CPU times needed to perform modeling using PML100 is 4.3 min and 6.7 h in single-source and multi-source cases, respectively. It must be noted that recalculating and assembling stiffness matrix for the PML layer at each frequency step is a very time-consuming task in MATLAB [4]. To increase PML computation efficiency, we performed this part of computer program code using a C++ compiler by building a MEX file in MATLAB. The computation time for the multi-source case considering PML100 was 28 h before using the C++ compiler.
Laguerre tessellations and polycrystalline microstructures: a fast algorithm for generating grains of given volumes
Published in Philosophical Magazine, 2020
D. P. Bourne, P. J. J. Kok, S. M. Roper, W. D. T. Spanjer
The function power_bounded is limited to 2D, and so for our 3D computations we used (a slightly modified version of) the C++ library Voro++ [42] combined with a MEX file so that we could run Voro++ via MATLAB. In 3D, we also tried the MATLAB function powerDiagramWrapper from the MATLAB File Exchange [45], combined with our own code to crop the diagram to a cuboid , but we found Voro++ to be faster. Another advantage of Voro++ is that it can create periodic Laguerre diagrams.
VTT – a virtual test truck for modern simulation tasks
Published in Vehicle System Dynamics, 2021
Georg Rill, Florian Bauer, Mathias Kirchbeck
For the integration of the VTT into MATLAB/Simulink, a C MEX S-function can be used. Starting from templates that contain a skeleton implementation, a wrapper to integrate the code of the VTT is written. The code is then compiled as a MEX file that can be integrated into any MATLAB/Simulink model using the S-function block. Additional parameters like the path to the vehicle parameter file and the initial values are passed to the S-function.