clc,clear;
step = pi/15;
phase = 10*pi:-step:step;
H = 31;
W = 31;
[Y,Z] = meshgrid(1:W,1:H);
Y = Y - floor(0.5*W);
Z = Z - floor(0.5*H);
Amplitude = 12;
x_shift = -25;
% Rotation matrix x axis
Rm = @(Theta)[cos(Theta),-sin(Theta);
sin(Theta),cos(Theta)];
smaxa = linspace(1,2,floor(0.5*length(phase))+1); % semi-major axis
smaxa = [smaxa fliplr(smaxa(1,2:end-1))];
smaxa = [smaxa(floor(0.75*length(smaxa))+1:end) smaxa(1:floor(0.75*length(smaxa)))];
sminb = linspace(2,1,floor(0.5*length(phase))+1); % semi-minor axis
sminb = [sminb fliplr(sminb(1,2:end-1))];
sminb = [sminb(floor(0.75*length(sminb))+1:end) sminb(1:floor(0.75*length(sminb)))];
% Display parameters
time_lapse = 0.2;
title_text = '引力波变对LISA航天器运动的影响';
title_on = true;
filename = '地球引力波对LISA影响.gif';
polarization = '+';
az = 49;
el = 27;
% Display settings
h = figure;
set(h,'Position',get(0,'ScreenSize'));
set(gcf,'Color',[0 0 0]);
axis tight manual;
for k = 1:length(phase)
signal = Gw_model2(Amplitude,phase(k),polarization);
M = sin_2D_wave(H,W,phase(1,length(phase)-k+1),smaxa(1,k),sminb(1,k),polarization)+x_shift; % space delay in x axis; default value: -25
[C,V,ny,nz,Tc,nb_pts] = LISA_triangle(M,Y,Z);
mesh(M,Y,Z,M), hold on;
colormap('bone');
alpha 0;
% Draw wave
if strcmp(polarization,'+')
if k <= floor(0.5*length(phase))
line(signal(1,:),1+signal(2,:),1+signal(3,:),'Color',[0 1 1],'Linewidth',1), hold on;
line(signal(1,:),1+signal(4,:),1+signal(5,:),'Color',[0 0 1],'Linewidth',2), hold on;
line(signal(1,:),1-signal(4,:),1-signal(5,:),'Color',[0 0 1],'Linewidth',2), hold on;
elseif k > floor(0.5*length(phase))
line(signal(1,:),1+signal(3,:),1+signal(2,:),'Color',[0 1 1],'Linewidth',1), hold on;
line(signal(1,:),1+signal(5,:),1+signal(4,:),'Color',[0 0 1],'Linewidth',2), hold on;
line(signal(1,:),1-signal(5,:),1-signal(4,:),'Color',[0 0 1],'Linewidth',2), hold on;
end
elseif strcmp(polarization,'x')
if k <= floor(0.5*length(phase))
line(signal(1,:),1+signal(2,:),1+signal(3,:),'Color',[0 1 1],'Linewidth',1), hold on;
line(signal(1,:),1+signal(4,:),1+signal(5,:),'Color',[0 0 1],'Linewidth',2), hold on;
line(signal(1,:),1-signal(4,:),1-signal(5,:),'Color',[0 0 1],'Linewidth',2), hold on;
elseif k > floor(0.5*length(phase))
line(signal(1,:),1+signal(2,:),1-signal(3,:),'Color',[0 1 1],'Linewidth',1), hold on;
line(signal(1,:),1+signal(4,:),1-signal(5,:),'Color',[0 0 1],'Linewidth',2), hold on;
line(signal(1,:),1-signal(4,:),1+signal(5,:),'Color',[0 0 1],'Linewidth',2), hold on;
end
end
% Signal axis
plot3([signal(1,1) signal(1,end)],[1 1],[1 1],'Color',[1 0 1]), hold on;
plot3([signal(1,end) signal(1,end)],[1 -Amplitude],[1 1],'Color',[1 0 1]), hold on;
plot3([signal(1,end) signal(1,end)],[1 1],[1 Amplitude],'Color',[1 0 1]), hold on;
% Draw LISA triangles
for m = 1:3
T = Rm(phase(1,k))*V;
X = interp2(Y,Z,reshape(C(1,:),nz,ny),1+T(2,:),1+T(1,:),'cubic');
line(X,1+T(1,:),1+T(2,:),'Color',[1 0 0],'Linewidth',3), hold on;
plot3(X(1,1),1+T(1,1),1+T(2,1),'o','Color',[1 0 1],'Linewidth',3), hold on;
plot3(X(1,(nb_pts+2)/3),1+T(1,(nb_pts+2)/3),1+T(2,(nb_pts+2)/3),'o','Color',[0 1 1],'Linewidth',3), hold on;
plot3(X(1,2*(nb_pts+2)/3-1),1+T(1,2*(nb_pts+2)/3-1),1+T(2,2*(nb_pts+2)/3-1),'o','Color',[1 1 0],'Linewidth',3), hold on;
end
% Features & other settings
ax = gca;
ax.Clipping = 'off';
set(ax,'Color',[0 0 0]);
axis square, axis equal, axis off;
if title_on
text(-2,12,19,title_text,'Color',[1 1 1],'FontSize',16);
end
view([az,el]);
camdolly(0,0.09,0);
zoom(1.5);
drawnow;
frame = getframe(h);
im = frame2im(frame);
[imind,cm] = rgb2ind(im,256);
% Write to the .gif file
if k == 1
imwrite(imind,cm,filename,'gif', 'Loopcount',Inf,'DelayTime',time_lapse);
else
imwrite(imind,cm,filename,'gif','WriteMode','append','DelayTime',time_lapse);
end
clf;
end
阿里matlab建模师
- 粉丝: 4646
- 资源: 2870
最新资源
- uniad.zip转onnx代码调试
- 互联网保险研究报告.pdf
- 互动社交时代的季播节目与收视.pdf
- 互联网众筹研究报告.pdf
- 家•爱——2016年度春节指数蓝皮书.pdf
- c#WPF MVVM 大屏看板3D可视化 1,WPF编程设计; 2,自定义工业控件设计; 3,数据库设计; 4,最原始的MVVM架构设计,利于基础学习; 5,典型三层架构设计,BLL - DLL -
- 家居用品行业研究报告.pdf
- 梅花网研究院:2015Q3化妆品行业媒体广告投放报告.pdf
- 迈向Small Cell 2020的五大趋势.pdf
- 母婴移动健康医疗大数据与商业价值研究.pdf
- 企鹅智酷:2015中国二三线城市互联网跨界经济报告.pdf
- 气候变化与精准扶贫.pdf
- 汽车后市场行业研究报告.pdf
- 趋势2015 影响设计与创新之最新趋势.pdf
- 全球公司在中国 - 博雅公关.pdf
- 探究回文串的特性及其多领域应用
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈