Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- figure(3); clf; hold on; box on;
- B = BH(:,1); H = BH(:,2);
- v = H ./ B; v(1) = v(2); %calculate reluctivity; get rid of the v(1) = NaN
- plot(B.^2, v, 'ro'); %plot reluctivity w.r.t B^2
- pp2 = spline(B.^2, v); %spline interpolation w.r.t. B^2
- B2 = linspace(0, 10, 1000); %for plotting
- plot(B2, ppval(pp2, B2), 'b') %plotting interpolated values
- figure(4); clf; hold on;
- ppder2 = derivate_pp(pp2); %derivative of spline: dv / dB^2
- plot(B2, ppval(ppder2, B2), 'b') %plotting derivative of spline
- plot(B(2:end).^2, diff(v)./diff(B.^2), 'ro'); %plotting direct numerical derivative dv / dB^2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement