how to find ascending and descending of hysteresis loop?

I had ploted tow vectors: current=[........]; flux=[.........], which is hysteresis loop. plot(current,flux) I want to find the ascending and descending points in loop. note: see the attachement

 Accepted Answer

This code:
s = load('Zaid_20140517.mat')
x = s.current;
y = s.flux;
z = linspace(min(x),max(x),length(x))
[cmin,cxix] = (min(x))
[cmax,cnix] = (max(x))
[fmin,fxix] = (min(y))
[fmax,fnix] = (max(y))
figure(1)
plot(x, y)
hold on
plot([cmin cmax], [fmin fmax], '+r', 'MarkerSize', 5, 'LineWidth',1.5)
hold off
grid
text(cmin-0.2,fmin-0.02, sprintf('(%.3f, %.3f)',cmin, fmin), 'FontSize',8, 'FontName', 'Consolas', 'FontWeight', 'bold')
text(cmax-0.4,fmax+0.02, sprintf('(%.3f, %.3f)',cmax, fmax), 'FontSize',8, 'FontName', 'Consolas', 'FontWeight', 'bold')
produces this plot:

4 Comments

thank you for very helpful answer. the answer is not what i mean but it has very good code that i need it, however,as you know the loop is increasing from minimum negative value up to zero then from zero to maximum positive value, this is ascending points or curve, then start to decrease from maximum value to zero, then from zero to minimum negative value again to make a loop, and this is called descending points or curve. so could you please help me how to find these tow curves (ascending and descending?
I found a paper on modeling hysteresis that I used to fit the equations.
This works:
Phi1 = @(b,I) -(b(1) .* atan(-b(2)*I+b(3)) - b(1).*I.*b(4)); % Descending
Phi2 = @(b,I) (b(1) .* atan(-b(2)*I+b(3)) + b(1).*I.*b(4)); % Ascending
ixd = fix(length(x)/2);
vi2 = 1:ixd;
vi1 = ixd:length(x);
opts = statset('MaxIter', 5000, 'MaxFunEvals', 10000);
B1 = nlinfit(x(vi1), y(vi1), Phi1, ones(4,1), opts );
B2 = nlinfit(x(vi2), y(vi2), Phi2, ones(4,1), opts );
FitPhi1 = Phi1(B1,x);
FitPhi2 = Phi2(B2,x);
figure(1)
plot(x(vi1), y(vi1), x, FitPhi1, '-r', 'LineWidth', 2)
hold on
plot(x(vi2), y(vi2), x, FitPhi2, '-g', 'LineWidth', 2)
hold off
grid
legend('Data', 'Descending', 'Ascending', 'Location', 'NW')
producing this plot:
The ‘Ascending’ is green. MATLAB glitched in the legend.
The estimated parameters for the descending are:
B1 =
253.0176e-003
12.5475e+000
-2.2488e+000
176.5498e-003
and for the ascending:
B2 =
246.5556e-003
-12.7726e+000
-2.4544e+000
224.5136e-003
I will leave you to make sense of them. This is not an area of my expertise.
thank you very much.

Sign in to comment.

More Answers (0)

Categories

Asked:

on 17 May 2014

Commented:

on 19 May 2014

Community Treasure Hunt

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

Start Hunting!