% This function is used to calculate the self-field flux penetration % process in HTS material with rectagular cross section. It is based on % Bean model using Brandt's calculation method. % The output is the current distribution at different time. And a gif would % be automatically generated in the working directory. % % This program was first coded by Gu Chen in 2004, revised and upgraded % by Lai Lingfeng in 2020. % Please contact me (lailingfeng@eastfs.com) if you have any questions. % % Dr. Lai Lingfeng % Beijing Eastforce Superconducting Technology Co., Ltd. % 2020/03/05 function [result_jj]=slf_rec_acti() Nx=40;Ny=20;Imax=800;fre=50;cycle=2;sub_step=16000; a= 0.004; b = 0.002; n = 20; Pi = 3.14159265; N = Nx*Ny; X = zeros(N,1); Y = zeros(N,1);P1=zeros(N,1); Q = zeros(N); step=cycle*sub_step step_t=zeros(step,1); step_I=zeros(step,1); real_I=zeros(step,1); phi=zeros(step,1); J = zeros(N,1); Jn = zeros(N,1); dotJ = zeros(N,1);mu=4*Pi*1e-7; Ec=0.0001; Jc=100000000; ee = 0.00015*a*b/N; %ee=0.000000001; c1 = 0.3/((Nx^2)*n); c2 = 0.01; % Define Variables and Constants for i=1:step step_t(i)=i*((1*cycle/fre)/step); step_I(i)=Imax*sin(2*Pi*fre*step_t(i)); end for i = 1 : N k = mod(i-1,Nx); l = (i-k-1)/Nx; X(i,1) = k*a/Nx+0.5*a/Nx; Y(i,1) = l*b/Ny+0.5*b/Ny; J(i,1) = 0; dotJ(i,1) = 0; Jn(i,1)=0; P1(i,1)=1; end % Define coordinates of the grid for i = 1 : N for j = 1 : N R1 = (X(i,1)-X(j,1))^2+(Y(i,1)-Y(j,1))^2; R2 = (X(i,1)-X(j,1))^2+(Y(i,1)+Y(j,1))^2; R3 = (X(i,1)+X(j,1))^2+(Y(i,1)-Y(j,1))^2; R4 = (X(i,1)+X(j,1))^2+(Y(i,1)+Y(j,1))^2; Q(i,j) = (1/(4*Pi))*log((R1+ee)*(R2+ee)*(R3+ee)*(R4+ee)); end end % Calculate Q matrix with correction of the diagonal elements P = inv(Q); kk=1; a1=step_t(1)*(N/(mu*a*b)); P2=(a*b/N); P1=P*P1; phi(1)=step_I(1)/sum(P2*a1*P1); phi_max=-phi(1)/cos(step_t(i)); % for i=1:step % phi(i)=-phi_max*cos(2*Pi*fre*step_t(i)); % end num_M = 1; result_jj = zeros(int32(step/100), Ny, Nx); % M=moviein(16); while kk