【物理应用】基于matalb GUI界面的电偶极子【含Matlab源码 069期】

一、简介

相距为l的一对等量异号点电荷+q和-q,并且它们到观察点P的距离rl。通常的媒质分子在外电场的作用下可以形成这种电偶极子。电偶极子的特征用电偶极矩(或电矩)p=lq表示,l和p的方向规定由-q指向+q。电矩p 的国际制单位为C·m(库·米)。微观物理学中常用的单位为德拜(debye);1德拜=3.336×10C·m,它相当于典型分子内部核间距离的十分之一(约2×10m)同一个电子的电荷e=1.6×10C的乘积。

电偶极子产生的电场+q和-q分别在观察点P®产生的电位的代数和即电偶极子产生的电位

式中墷只对P点的坐标变量运算。在P点的电场强度为 。

外电场中的电偶极子若电偶极子+q和-q所在点的外电场的电位为V1和V2,则偶极子的位能W=qV1-qV2=q(l·墷)V=p·墷 V=-p·Eo,式中Eo为点偶极子所在的外电场强度。

偶极子在外电场中受到平移力 F=-墷W=墷(p·Eo)=(p·墷)Eo。

如果外电场均匀,Eo为常量,则F=0。 偶极子在外电场作用下受到的力矩 T=-дW/дθ=pEosinθ或T=p×Eo,它使电矩p同外电场强度Eo的夹角减小。如果p 同Eo平行,则力矩T=0。并可看到p的量值也就是电偶极子在单位外电场(Eo=1)下可能受到的最大力矩,故称电矩。

如果点偶极子 p1 处于另一偶极子 p2 产生的电场E2®中,则p1的位能即相互作用能为电偶极子电偶极子

电偶极子是电介质理论和原子物理学的重要模型,研究从稳恒到 X光频电磁场作用下电介质的色散和吸收,以及天线的辐射等现象,可以用振荡偶极子poe电偶极子电偶极子

来表示。

将偶极子概念加以推广,可有多极子,它是含有2个大小相等的点电荷,其中正负各半数,排列成有规律的点阵。在多极子系列中,n=0时,就是点电荷;n=1,就是电偶极子;n=2,称为四极子;n≥2,统称为高阶多极子。

高阶多级子模型应用于核物理,其中最重要的是四极子。任意点电荷集合或任意分布电荷,如果能够用一个球面包围,则球外的电位V可用集中在球心的点多极子系列的合成电位表示,称为电场的多极子展开。

二、源代码

function varargout = dianoujizi(varargin)
% dianoujizi MATLAB code for dianoujizi.fig
%      dianoujizi, by itself, creates a new dianoujizi or raises the existing
%      singleton*.
%
%      H = dianoujizi returns the handle to a new dianoujizi or the handle to
%      the existing singleton*.
%
%      dianoujizi('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in dianoujizi.M with the given input arguments.
%
%      dianoujizi('Property','Value',...) creates a new dianoujizi or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before dianoujizi_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to dianoujizi_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
 
% Edit the above text to modify the response to help dianoujizi
 
% Last Modified by GUIDE v2.5 03-May-2013 20:22:55
 
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...             %GUI结构
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @dianoujizi_OpeningFcn, ...
                   'gui_OutputFcn',  @dianoujizi_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{
    
    1})
    gui_State.gui_Callback = str2func(varargin{
    
    1});
end
 
if nargout
    [varargout{
    
    1:nargout}] = gui_mainfcn(gui_State, varargin{
    
    :});
else
    gui_mainfcn(gui_State, varargin{
    
    :});
end
% End initialization code - DO NOT EDIT
 
 
% --- Executes just before dianoujizi is made visible.
function dianoujizi_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to dianoujizi (see VARARGIN)
set(handles.a_edit,'String',2);  %设置默认值为2
set(handles.b_edit,'String',2);  %设置默认值为2
 
 
 
% Choose default command line output for dianoujizi
handles.output = hObject;
 
% Update handles structure
guidata(hObject, handles);
 
% UIWAIT makes dianoujizi wait for user response (see UIRESUME)
% uiwait(handles.figure1);
 
 
% --- Outputs from this function are returned to the command line.
function varargout = dianoujizi_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Get default command line output from handles structure
varargout{
    
    1} = handles.output;
 
function a_edit_Callback(hObject, eventdata, handles)
% hObject    handle to a_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Hints: get(hObject,'String') returns contents of a_edit as text
%        str2double(get(hObject,'String')) returns contents of a_edit as a double
 
% --- Executes during object creation, after setting all properties.
function a_edit_CreateFcn(hObject, eventdata, handles)
% hObject    handle to a_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
 
% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
 
function b_edit_Callback(hObject, eventdata, handles)
% hObject    handle to b_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Hints: get(hObject,'String') returns contents of b_edit as text
%        str2double(get(hObject,'String')) returns contents of b_edit as a double
 
 
% --- Executes during object creation, after setting all properties.
function b_edit_CreateFcn(hObject, eventdata, handles)
% hObject    handle to b_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
 
% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
 
 
% --- Executes on button press in eped_pushbutton.
function eped_pushbutton_Callback(hObject, eventdata, handles)
% hObject    handle to eped_pushbutton (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
a=str2num(get(handles.a_edit,'String'));    %获得默认值
b=str2num(get(handles.b_edit,'String'));
x=-8:0.8:8;
y=x;
q=2e-6;     %电荷
k=9e9;      %常数    
[X,Y]=meshgrid(x,y);
rp=sqrt((X-a).^2+(Y-b).^2);         %设置变量求出r-
 

三、备注

完整代码或者代写添加QQ2449341593
往期回顾>>>>>>
【Matlab 029期】【物理应用1】杨氏双缝干涉实验matlab源码
【Matlab 055期】【物理应用2】井筒多相流matlab源码
【Matlab 056期】【物理应用3】Matlab 二维对流扩散温度场
【Matlab 057期】【物理应用4】内弹道matlab源码
【Matlab 058期】【物理应用5】基于两个光纤光栅的新光子微波发生器的matlab仿真分析
【Matlab 059期】【物理应用6】matlab计算油气井井底压力
【Matlab 061期】【物理应用8】Matlab 带电粒子在放射状电场和均匀磁场下的混沌运动模拟
【Matlab 062期】【物理应用9】异构交通流matlab源码
【Matlab 063期】【物理应用10】模拟斜抛运动matlab源码含GUI界面
【Matlab 064期】【物理应用11】 计算晶体结构的x射线衍射图谱matlab源码
【Matlab 065期】【物理应用12】衍射光栅教学版matlab源码
【Matlab 066期】【物理应用13】电荷电场线和电势matlab源码
【Matlab 067期】【物理应用14】速度场找到漩涡
【Matlab 068期】【物理应用15】车道检测仿真

猜你喜欢

转载自blog.csdn.net/TIQCmatlab/article/details/113089390