利用MATLAB绘图(4)--各种磁结构(畴壁,斯格明子,磁半子)

总测试函数—生成对应绘图结构D

D1 = Domainwall(11,11,1,-1);
D2 = Domainwall(11,11,2,-1);
D3 = Domainwall(11,11,3,-1);
D4 = Domainwall(11,11,4,-1);

然后依次运行
Arrow002(D1)
Arrow002(D2)
Arrow002(D3)
Arrow002(D4)
即可得到不同类型畴壁示意图

面外磁畴里的Neel型畴壁

DW1

面内磁畴里的Bloch畴壁

在这里插入图片描述

面内磁畴里的Neel畴壁

在这里插入图片描述

面外磁畴里的Bloch畴壁

在这里插入图片描述

生成不同类型畴壁函数—domainwall()

function [D] = Domainwall(m,n,domainwall_type,c)
%% m,n ~ length,width (m>4)
%% c ~ chirality 
% -1 ~ Left-handed 
% +1 ~ Right-handed
%% domainwall_type
% 1 ~ Neel-DW in OOP domain
% 2 ~ Neel-OOP-DW in IP domain
% 3 ~ Neel-IP-DW in IP domain
% 4 ~ Bloch-DW in OOP domain
%% Three columns in center are DW

xx = (-m/2+1/2):(m/2-1/2);
yy = (-n/2+1/2):(n/2-1/2);
[xa,ya] = meshgrid(xx,yy);
D.X = xa;
D.Y = -ya;
D.Z = zeros(n,m);
D.U = zeros(n,m);
D.V = zeros(n,m);
D.W = zeros(n,m);
if mod(m,2) == 0
    m = m+1;
end
i = (m+1)/2;

switch domainwall_type
    case 1
        if c == -1
            D.U(:,i) = -1;
            D.U(:,i+1) = -sqrt(2)/2;
            D.U(:,i-1) = -sqrt(2)/2;
        elseif c ==1
            D.U(:,i) = 1;
            D.U(:,i+1) = sqrt(2)/2;
            D.U(:,i-1) = sqrt(2)/2;
        end

        for j = 1:i-2
            D.W(:,j) = 1;
        end

        D.W(:,i-1) = sqrt(2)/2;
        D.W(:,i)   = 0;
        D.W(:,i+1) = -sqrt(2)/2;

        for j = i+2:m
            D.W(:,j) = -1;
        end

    case 2
        i = (m+1)/2;

        D.U(:,i-1) = sqrt(2)/2;
        D.U(:,i) = 0;
        D.U(:,i+1) = -sqrt(2)/2;

        for j = 1:i-2
            D.U(:,j) = +1;
        end

        if c == -1
            D.W(:,i-1) = sqrt(2)/2;
            D.W(:,i)   = 1;
            D.W(:,i+1) = sqrt(2)/2;
        elseif c == 1
            D.W(:,i-1) = -sqrt(2)/2;
            D.W(:,i)   = -1;
            D.W(:,i+1) = -sqrt(2)/2;
        end

        for j = i+2:m
            D.U(:,j) = -1;
        end

    case 3
        D.U(:,i-1) = sqrt(2)/2;
        D.U(:,i) = 0;
        D.U(:,i+1) = -sqrt(2)/2;

        for j = 1:i-2
            D.U(:,j) = +1;
        end

        if c == -1
            D.V(:,i-1) = sqrt(2)/2;
            D.V(:,i)   = 1;
            D.V(:,i+1) = sqrt(2)/2;
        elseif c == 1
            D.V(:,i-1) = -sqrt(2)/2;
            D.V(:,i)   = -1;
            D.V(:,i+1) = -sqrt(2)/2;
        end

        for j = i+2:m
            D.U(:,j) = -1;
        end

    case 4
        if c == -1
            D.V(:,i) = -1;
            D.V(:,i+1) = -sqrt(2)/2;
            D.V(:,i-1) = -sqrt(2)/2;
        elseif c ==1
            D.V(:,i) = 1;
            D.V(:,i+1) = sqrt(2)/2;
            D.V(:,i-1) = sqrt(2)/2;
        end

        for j = 1:i-2
            D.W(:,j) = 1;
        end

        D.W(:,i-1) = sqrt(2)/2;
        D.W(:,i)   = 0;
        D.W(:,i+1) = -sqrt(2)/2;

        for j = i+2:m
            D.W(:,j) = -1;
        end
end

end
### 使用Matlab绘制斯格明子图像 为了在Matlab中创建斯格明子的可视化效果,可以采用`meshgrid`来定义空间坐标,并通过特定的数学表达式模拟斯格明子结构。下面是一个简单的例子,用于展示如何构建并显示类似于径向斯格明子或手性斯格明子的空间分布。 #### 定义参数和网格 首先设定绘图区域大小以及分辨率: ```matlab % 设置计算范围 [-L, L] 和步长 d L = 5; % 半宽 d = 0.1; % 步长 [x,y] = meshgrid(-L:d:L); r = sqrt(x.^2 + y.^2); % 计算半径 r theta = atan2(y,x); % 计算角度 theta ``` #### 构建斯格明子模型 接着根据所选类型的斯格明子构造相应的场配置。这里给出两种不同类型的斯格明子实例——径向斯格明子和手性斯格明子。 对于**径向斯格明子**(也称为刺猬斯格明子),其方向沿径向变化: ```matlab mx_radial = cos(r).*cos(theta); my_radial = cos(r).*sin(theta); mz_radial = sin(r); figure; surf(x, y, zeros(size(x)), mx_radial, 'EdgeColor', 'none'); hold on; quiver3(x(:),y(:),zeros(numel(x),1), ... mx_radial(:), my_radial(:), mz_radial(:)); axis equal tight; title('Radial Skyrmion Configuration'); colorbar; view(3); shading interp; lighting gouraud; camlight; material shiny; ``` 而对于**手性斯格明子**,则表现出更复杂的螺旋状排列模式: ```matlab kappa = pi/4; % 调整此值改变旋涡密度 phi = kappa*r; mx_chiral = -sin(phi).*cos(theta); my_chiral = -sin(phi).*sin(theta); mz_chiral = cos(phi); figure; surf(x, y, zeros(size(x)), mx_chiral, 'EdgeColor', 'none'); hold on; quiver3(x(:),y(:),zeros(numel(x),1), ... mx_chiral(:), my_chiral(:), mz_chiral(:)); axis equal tight; title('Chiral Skyrmion Configuration'); colorbar; view(3); shading interp; lighting gouraud; camlight; material shiny; ``` 上述代码片段展示了如何基于给定的空间位置生成两个典型形态的斯格明子场,并将其作为三维矢量图形呈现出来[^1]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

NBb-666

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值