%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Hm7cg.m - B-H interpolation routine % Used by joint.m % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function y = Hm7cg(Btx) % B-H values that follow are valid for M-7, 0.014 in. ESS % in the cross-grain region. 90% B value with grain direction. B=[0 20 30 40 50 60 65 70 80 85 90 95 100 105 110 115 ... 117 120 125 130 140 210 ]*1000*0.90; H=[ 0 0.4 0.51 0.61 0.71 0.80 0.85 0.90 1.04 1.18 1.35 1.7 2.4 ... 4.4 9.0 18 26 100 400 1000 10000 100000 ]; % Activate to plot B-H curve % m=16; plot(H(1:m),B(1:m)); grid; pause; % Linear plot % m=21; semilogx(H(2:m),B(2:m));grid; pause; % Semilog plot n=length(B); k=0; if Btx==0; k=-1; y=0; end if Btx<0; k=-1; y=0; disp('WARNING - Btx < 0, Htx = 0 returned'); end if Btx>B(n); y=H(n); k=-1; disp('CAUTION - Beyond B-H curve'); end for i=1:n if k==0 & (Btx-B(i))<=0; k=i; break; end end if k>0; y=H(k-1)+(Btx-B(k-1))/(B(k)-B(k-1))*(H(k)-H(k-1)); else; end