clear all
close all
clc
z=3; r=1;
model=createpde;
model.Geometry=multisphere(r);
figure( 'Position', [100 100 900 600],'Color','w')
subplot(2,2,1);hold on;title('Labelled Faces')
pdegplot(model,'facelabels','on','FaceAlpha',0.5);
specifyCoefficients(model,'m',0,'d',0,'c',1,'a',0,'f',0);%定方程系数
% 边界条件
Q=10; delta=1.5;
f=@(region,state)Q*sin(0.5*pi*(region.z-delta));
applyBoundaryCondition(model,'dirichlet','Face',1,'u',-Q);
applyBoundaryCondition(model,'dirichlet','Face',2,'u',Q);
applyBoundaryCondition(model,'dirichlet','Face',3,'u',f);
% 设置网格
generateMesh(model);
subplot(2,2,2);hold on;title('Meshed Geometry')
pdeplot3D(model,'Mesh','on')
% 求解
results = solvepde(model);
subplot(2,2,3);hold on;title('Electric Potential On the Surface')
pdeplot3D(model,'ColorMapData',results.NodalSolution)
% 电势线和电场线
[X,Y,Z] = meshgrid(-r:0.1:r,-r:0.1:r,0.5:0.1:2.5);
u = interpolateSolution(results,X,Y,Z);
u = reshape(u,size(X));
subplot(2,2,4);view(45,10);axis equal;axis off;hold on
title('Equipotential Lines and Electric Field Lines')
contourslice(X,Y,Z,u,[],[],0.5:0.4:2.5)
colormap jet;colorbar
[Ex,Ey,Ez]=gradient(-u);
[sx,sy,sz]=meshgrid(-0.9:0.2:0.9,-0.9:0.2:0.9,0.5:0.5:2.5);
streamline(X,Y,Z,Ex,Ey,Ez,sx,sy,sz);
matlab有限元法绘制静电透镜电势线电场线.zip
版权申诉
132 浏览量
2021-08-07
11:17:02
上传
评论
收藏 1KB ZIP 举报
木子奇奇~
- 粉丝: 470
- 资源: 26
最新资源
- 重启进行BIOS快捷方式,不需要开机按BIOS键
- 威纶通触摸屏编程软件Easy builder pro V6.09.01.556安装包(2024.04).txt
- WindowsAdminCenter
- 老飞飞搭建基础通用数据库V19数据库.rar
- jquery.js
- 机械设计多工位ACF贴胶带&预压设备sw18可编辑非常好的设计图纸100%好用.zip
- 基于Pytorch复现Point-Transformer,用于ShapeNet数据集点云分割
- 【医学影像分析】2D超声图像的分割检测(Ultrasound Nerve Segmentation - Kaggle数据集)
- 嘎嘎香的五款神仙谷歌插件
- .arch书源导入教程.mp4
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈