Matlab toolbox to model the magnetization of soft magnetic materials.
1 Download
Updated 10 Jul 2024

Image Image

a Matlab toolbox for magnetization analysis

Table of contents

  1. Authors
  2. Statement of need
  3. Setup and usage instructions
  4. Description of the files and directory structure
  5. External libraries
  6. Explanation document
  7. Examples
  8. Cite as
  9. Contact us
  10. License
  11. Acknowledgement


  • Matías Ignacio González
  • Tomás Francisco González
  • Josefina María Silveyra
  • Juan Manuel Conde Garrido

University of Buenos Aires – CONICET, Buenos Aires, Argentina.

Statement of need

The accurate description of magnetization is crucial for designing devices with soft magnetic cores. MagAnalyst is an easy-to-use MATLAB toolbox that models the magnetization of soft magnetic materials. It implements a physically based approach, proposed by Silveyra and Conde Garrido, to describe the ideal anhysteretic curve. The equation of state is simple yet accurate for various material scenarios. The toolbox first plots a set of curves to help the user determine the number of component magnetizations to model and the seeds for the fitting process. It then retrieves the model parameters without the need for programming or optimization skills. As a result, even noisy data from challenging scenarios can be accurately described by a single analytic function, with continuous and differentiable magnetization and susceptibility. We believe that MagAnalyst will be a valuable resource for the magnetic materials community.

Setup and usage instructions

You need to create a copy on a local directory on your machine to use MagAnalyst. Obtain a copy by downloading and unzipping the latest release or clone MagAanalyst instead e.g. using: git clone You can place the MagAnalyst folder anywhere on your machine.

We recommend using GitHub Desktop, which allows users to easily synchronize with the latest version of MagAnalyst.

After downloading the main folder and placing it in a suitable location, MagAnalyst is ready to use.

We recommend using the C:\ drive for the proper functioning of the project samples here provided. Otherwise, after opening a sample project you will need to import the curve sample file again.

To start using the application with the graphical user interface, simply run the app.mlapp file.

If you prefer to run MagAnalyst using command lines, you can follow the instructions in the mag-analyst\src\demo.m and mag-analyst\src\demo_2_components.m files.

MagAnalyst was implemented and tested with the Matlab 2022b version on Windows 10. Authors cannot guarantee that the code can run on previous versions.

Description of the files and directory structure

├── app.mlapp                     # App controller
├── data                          # IO data
├── assets                        # Logos
├── articles                      # Articles
└── src
    ├── AnhystereticCurve         # Data and modeled anhyesteretic curve
    ├── ErrorCalculator
    ├── MagneticParameters
    ├── Parser                    # Input parser
    ├── Plotter
    ├── ResidueCalculator
    ├── minimize                  # minimize library files
    ├── colorDialog.mlapp
    └── fit.m

External libraries

MagAnalyst currently uses the following third-party libraries:

  • minimize to find the constrained minimum of the objective function starting at the user’s initial estimates.

Explanation document

In this Explanation document, we provide additional documentation and know-how to understand the background of MagAnalyst.


These are the examples provided in the \data\sampleData folder with the current release:

  • Mn-Zn ferrite: A soft ferrite (Mn0.51Zn0.44Fe2.05O4) with very low anisotropy. Similar to the curve analyzed in JMMM article and in AIP Advances article. The example is illustrated by a video available in YouTube, fitted with one component magnetization and two component magnetizations.
  • Finemet - TA: Finemet (r) alloy (Fe73.5Si13.5B9Nb3Cu1) nanocrystallized under transverse field annealing and measured along the longitudinal direction of the ribbon. Analyzed in JOM article.
  • JNEX-900: A non-oriented electrical steel. Analyzed in AIP Advances article.
  • GOSS - 67 MPa: A grain-oriented silicon steel sheet, cut parallel to the rolling direction, longitudinally compressed up to 67 MPa. Analyzed in JOM article.

The files provided include:

  • data tables of either anhysteretic curves or hysteresis loops in CSV format, where the first and second column correspond to the horizontal and vertical axes field, respectively (the headers specify the fields and units)
  • saved projects in TXT format, where the anhysteretic curves have been fitted with either one or two components

Cite as

If you use MagAnalyst in your work, please cite:

  • J. M. Silveyra, M. I. González, T. F. González, and J. M. Conde Garrido, "MagAnalyst: A MATLAB Toolbox for Anhysteretic Magnetization Analysis," IEEE Transactions on Magnetics, 2024.

You may also cite the following papers on the approach used by MagAnalyst to describe anhysteretic curves:

  • J. M. Silveyra and J. M. Conde Garrido, "A physically based model for soft magnets’ anhysteretic curve," JOM, pp. 1-14, 2023.
  • J. M. Silveyra and J. M. Conde Garrido, "On the anhysteretic magnetization of soft magnetic materials," AIP Advances, vol. 12, p. 035019, 2022.
  • J. M. Silveyra and J. M. Conde Garrido, "On the modelling of the anhysteretic magnetization of homogeneous soft magnetic materials," Journal of Magnetism and Magnetic Materials, vol. 540, p. 168430, 2021.

If you don't have access to any of these articles, request them through ResearchGate! We will be happy to share them with you.

Contact us

If you encounter bugs or problems using MagAnalyst, have any suggestions for improving the software, or are interested in receiving email updates about MagAnalyst, please write us to


MagAnalyst is provided under the MIT License.


The University of Buenos Aires (UBA) and CONICET provided financial support for this project. Any opinions, findings, conclusions, or recommendations expressed in this website are those of the author(s) and do not necessarily reflect the views of UBA or CONICET.

Cite As

Matias Gonzalez (2024). mag-analyst (, GitHub. Retrieved .

J. M. Silveyra, M. I. González, T. F. González, and J. M. Conde Garrido, "MagAnalyst: A MATLAB Toolbox for Anhysteretic Magnetization Analysis," IEEE Transactions on Magnetics, 2024.

Silveyra, Josefina M., et al. “MagAnalyst: A MATLAB Toolbox for Anhysteretic Magnetization Analysis.” IEEE Transactions on Magnetics, Institute of Electrical and Electronics Engineers (IEEE), 2024, pp. 1–1, doi:10.1109/tmag.2024.3408681.

View more styles
MATLAB Release Compatibility
Created with R2024a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.