Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature de centrado de ciclo de histéresis #171

Open
jsilveyra opened this issue Jun 23, 2024 · 0 comments
Open

feature de centrado de ciclo de histéresis #171

jsilveyra opened this issue Jun 23, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jsilveyra
Copy link
Collaborator

jsilveyra commented Jun 23, 2024

agregar feature de centrado del ciclo de histéresis, después de convertirlo a M vs H en A/M y antes de calcular la curva anhisterética. No debería correrse con una curva input anhisterética.

Podría ofrecerse con un box con tic que dijera "Center hysteresis loop" y que por default esté marcada:

Image

Este es el algoritmo de centrado (M y H left corresponden a la rama de la izq del ciclo de histéresis y M y H right a la de la derecha)

% Center hysteresis loop

% Center vertical axis
Mneg = min(Mleft);
Mpos = max(Mright);
Mshift = (Mpos+Mneg)/2;
Mleft = Mleft - Mshift;
Mright = Mright - Mshift;

% Center horizontal axis
Hcneg = interp1(Mleft, Hleft, 0, 'linear'); % linear interpolation
Hcpos = interp1(Mright, Hright, 0, 'linear'); % linear interpolation
Hshift = (Hcneg+Hcpos)/2;
Hleft = Hleft - Hshift;
Hright = Hright - Hshift;

Hshifted = [flip(Hleft) Hright];
Mshifted = [flip(Mleft) Mright];

@jsilveyra jsilveyra added the enhancement New feature or request label Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant