没有合适的资源?快使用搜索试试~ 我知道了~
Matlab在物理上的应用举例.pdf
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 6 浏览量
2021-10-30
04:50:17
上传
评论
收藏 103KB PDF 举报
温馨提示
![preview](https://dl-preview.csdnimg.cn/35454436/0001-d5e800527d89445f3ffc9964f611dfbc_thumbnail.jpeg)
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
试读
26页
MATLAB
资源推荐
资源详情
资源评论
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/release/download_crawler_static/35454436/bg1.jpg)
1.
%%
t=0:0.001:10;
A=input(' A=');
w=input(' w=');
a=input('a=');
y=A.*sin(w.*t+a);
plot(t,y);
pause(1),sound(y);
ylabel('y'),xlabel('t')
2. %%
Lambda=500e-9; %
a=input('a='); % 0.2e-3,1e-3,2e-3
z=1 %
ymax=3*Lambda*z/a; %
Ny=51; %
ys=linspace(-ymax,ymax,Ny); %
NPoints=51; %
yPoint=linspace(-a/2,a/2,NPoints); %
for j=1:Ny %
L=sqrt((ys(j)-yPoint).^2+z^2); %
Phi=2*pi.*(L-z)./Lambda; %
SumCos=sum(cos(Phi)); %
SumSin=sum(sin(Phi)); %
B(j)=(SumCos^2+SumSin^2)/NPoints^2; %
end
clf,plot(ys,B,'*',ys,B);grid; %
3. %%
mu0=4*pi*1e-7;
I0=5.0; Rh=1;
C0=mu0/(4*pi)*I0;
NGx=21;NGy=21;
x=linspace(-Rh,Rh,NGx);
y=linspace(-3,3,20);y=x;
Nh=20;
theta0=linspace(0,2*pi,Nh+1);
theta1=theta0(1:Nh);
y1=Rh*cos(theta1);
z1=Rh*sin(theta1);
theta2=theta0(2:Nh+1);
y2=Rh*cos(theta2);
z2=Rh*sin(theta2);
![](https://csdnimg.cn/release/download_crawler_static/35454436/bg2.jpg)
dlx=0;dly=y2-y1;dlz=z2-z1;
xc=0;
yc=(y2+y1)/2;
zc=(z2+z1)/2;
for i=1:NGy
for j=1:NGx
rx=x(j)-xc;
ry=y(i)-yc;
rz=0-zc;
r3=sqrt(rx.^2+ry.^2+rz.^2).^3;
dlXr_x=dly.*rz-dlz.*ry;
dlXr_y=dly.*rx-dlx.*rz;
Bx(i,j)=sum(C0*dlXr_x./r3);
By(i,j)=sum(C0*dlXr_y./r3);
end
end
clf;
quiver(x,y,Bx,By);
4. %%
x0=500;v=50;y0=20;
c=330;w=1000;
t=0:0.001:30;
r=sqrt((x0-v*t).^2+y0.^2);
t1=t-r/c;
u=sin(w*t)+sin(1.1*w*t);
u1=sin(w*t1)+sin(1.1*w*t1);
sound(u);pause(5);sound(u1);
5.
clear all
mu0=4*pi*1e-7;
I0=5.0;Rh=1;
C0=mu0/(4*pi)*I0;
NGx=21;NGy=21;
x=linspace(-Rh,Rh,NGx);
y=linspace(-Rh,Rh,NGy);
Nh=20;
theta0=linspace(0,2*pi,Nh+1);
theta1=theta0(1:Nh);
y1=Rh*cos(theta1);
z1=Rh*sin(theta1);
theta2=theta0(2:Nh+1);
y2=Rh*cos(theta2);
z2=Rh*sin(theta2);
![](https://csdnimg.cn/release/download_crawler_static/35454436/bg3.jpg)
dlx=0;dly=y2-y1;dlz=z2-z1;
xc=0;
yc=(y2+y1)/2;
zc=(z2+z1)/2;
for i=1:NGy
for j=1:NGx
rx=x(j)-xc;
ry=y(i)-yc;
rz=0-zc;
r3=sqrt(rx.^2+ry.^2+rz.^2).^3;
dlXr_x=dly.*rz-dlz.*ry;
dlXr_y=dly.*rx-dlx.*rz;
Bx(i,j)=sum(C0*dlXr_x./r3);
By(i,j)=sum(C0*dlXr_y./r3);
end
end
Bax=Bx(:,11:21)+Bx(:,1:11);
Bay=By(:,11:21)+By(:,1:11);
subplot(1,2,1)
mesh(x(11:21),y,Bax);xlabel('x');ylabel('y');
subplot(1,2,2),
plot(y,Bax),grid,xlabel('y');ylabel('Bx');
clear all;
N=input(' N ');
for ic=1:N %
fprintf('-----\n #%g\n',ic);
rc=input(' [x y] ');
x(ic)=rc(1); %
y(ic)=rc(2); %
q(ic)=input(' ');
end
E0=8.85e-12; %
C0=1/(4*pi*E0); %
for ic=1:N
Fx=0.0; Fy=0:0; %
for jc=1:N %
if(ic~=jc) %
xij=x(ic)-x(jc); yij=y(ic)-y(jc);
Rij=sqrt(xij^2+yij^2); %
Fx=Fx+C0*q(ic)*xij/Rij^3;
Fy=Fy+C0*q(ic)*yij/Rij^3;
end
end
![](https://csdnimg.cn/release/download_crawler_static/35454436/bg4.jpg)
fprintf(' #%g \n',ic); %
fprintf('x %gN\n',Fx);
fprintf('y %gN\n',Fy)
end
% lisaru.m
syms t a1 a2 w1 w2
x=cos(w1.*t+a1);
y=sin(w2.*t+a2);
a1=input('a1=');
a2=input('a2=');
w1=input('w1=');
w2=input('w2=');
tf=10;
Ns=1000;t=linspace(0,tf,Ns);
dt=tf/(Ns-1); % Ns , dt
xplot=eval(x);yplot=eval(y); % Ns x(t),y(t)
figure(gcf);
subplot(1,2,1),
for i=1:750
plot(yplot(1:i),xplot(1:i)); %
axis('equal'); grid ; %
pause(0.01)
end
m1=2;m2=2;K1=16;K2=4; %???????
x0=[1;0];xd0=[6;6];tf=10; %????
M=[m1,0;0,m2];K=[K1+K2,-K2;-K2,K1+K2] ; %??????u(:,s)?
[u,L]=eig(K,M) ; %???????????
t=linspace(0,tf,101);x=zeros(2,101); %????????????
for s=1:2 %????????
alfa=sqrt(u(:,s)'*M*u(:,s)) ; %??????
u(:,s)= u(:,s)/alfa; %????????
w(j)=sqrt(L(j,j)); %?????????????
xt=u(:,j)*(u(:,j)'*M*x0*cos(w(j)*t)+u(:,j)'*M*xd0/w(j)*sin(w(j)*t));
x=x+xt; %???????
end
for r=1:2 %???x1,x1??
subplot(2,1,r)
plot(t.x(r,:)),grid;
xlabel('xxx');
ylabel(['yyy',num2str(r)]);
end
![](https://csdnimg.cn/release/download_crawler_static/35454436/bg5.jpg)
%%
t=0:0.001:10;
a1=input('??1=');w1=input('??1=');
a2=input('??2=');w2=input('??2=');
y1=a1*sin(w1*t);
y2=a2*sin(w2*t);
y=y1+y2;
subplot(3,1,1),plot(t,y1),ylabel('y1')
subplot(3,1,2),plot(t,y2),ylabel('y2')
subplot(3,1,3),plot(t,y),ylabel('y'),xlabel('t')
pause,sound(y1);pause(5),sound(y2);pause(5),sound(y),pause
subplot(1,1,1)
m1=input('m1=');
m2=input('m2=');
theta=input('theta( )=');
theta=theta*pi/180; g=9.81;
A=[m1*cos(theta),-m1,-sin(theta),0;...
m1*sin(theta),0,cos(theta),0;...
0,m2, -sin(theta),0;...
0,0,-cos(theta),1];
B=[0,m1*g,0,m2*g]'; X=A\B;
a1=X(1), a2=X(2), N1=X(3),N2=X(4)
%%xunhuan
R=8.31;
gama=1.4; %( : MATLAB , gama ?)
nMoles=0.5;
P(1)=1e5;
V(1)=0.012;
WTotal=0;
QTotal=0;
iPoint=1;
NCurve=100;
PPlot=P(1);
VPlot=V(1);
% nMoles P1 V1
% R8.314 WTotal=0; iPoint=1;
% NCurve=100;P V PPlot=P(1);VPlot=V(1)
T(1)=P(1)*V(1)/(nMoles*R); %
剩余25页未读,继续阅读
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
jishuyh
- 粉丝: 0
- 资源: 7万+
![benefits](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-1.c8e153b4.png)
下载权益
![privilege](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-2.ec46750a.png)
C知道特权
![article](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-3.fc5e5fb6.png)
VIP文章
![course-privilege](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-4.320a6894.png)
课程特权
![rights](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-icon.fe0226a8.png)
开通VIP
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)