📄 deltab.m
字号:
function B=deltaB(x,y,z,P,varargin)
% do not check the currents set P
% deltaB will be not greater than Bmax
% P should be int, and vary by 1 as the step
l=length(varargin);
B0max=1;
Cmax=512;
if l==1
B0max=varargin{1};
elseif l==2
B0max=varargin{1};
Cmax=varargin{2};
end
xmax=0.4;
ymax=0.4;
zmax=4;
x=x/xmax;
y=y/ymax;
z=z/zmax;
B=P(1)*z+P(2)*x+P(3)*y+P(4)*z^2+P(5)*z*x+P(6)*z*y+P(7)*x*y+P(8)*(x^2-y^2);
%B=B+P(9)*x^3+P(10)*y^3+P(11)*z^3*x+P(12)*z^3*y+P(13)*z^3+P(14)*z^4+P(15)*z^5;
B=B0max*B/Cmax;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -