zhidaoxiancapacity.m

来自「jji计算直导线的电容的文档和matlab程序」· M 代码 · 共 24 行

M
24
字号
clear;
syms z;
epslon=8.854*10^(-12);
snn=int(1/sqrt(0.01^2+z^2),z,-0.5,0.5);
snn1=double(snn);
%%set the elements of s
M=3;
for m=1:M
    for n=1:M
        if (m==n)
            s(m,n)=snn1;
        else
            s(m,n)=1/abs(m-n);
        end
    end
end
b=ones(M,1);
q=inv(s)*b;
B=1:M;
plot(B,q);xlabel('the length of the wire'),ylabel('the charge distribution along the line');
title('the charge distribution of the wire');
a=4*pi*epslon*q;
C=sum(a)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?