Skip to content

Commit

Permalink
add constraints to axis lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
mualal committed Nov 9, 2023
1 parent dc0d888 commit 4494677
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions matlab/lattice_lattice_interface.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
m_1 = 1;
m_2 = 0.5;
c = 0.75;
omega = 1.8;
a = 2;
gamma = pi/6;
omega = 1;
a = 1;
gamma = pi/4.5;

%k_1 = asin(omega/2 * sqrt(m_1/c)) * 2 / a;

Expand Down Expand Up @@ -72,6 +72,7 @@
%g_1 = a * sqrt(c/m_1) * cos(k_1*a/2);
g_1 = sqrt(c/m_1)*(a*cos(gamma)*cos(cos(gamma)*k_1*a/2)*sin(cos(gamma)*k_1*a/2)-a*sin(gamma)*cos(sin(gamma)*k_1*a/2)*sin(sin(gamma)*k_1*a/2))/(sqrt((cos(sin(gamma)*k_1*a/2))^2+(sin(cos(gamma)*k_1*a/2))^2));

% initial conditions
for i=1:length(num_x)
for j=1:length(num_y)
%disp(j, i) = u_0 * exp(-beta_x^2/2 * (num_x(i) - n_0)^2) * exp(-beta_y^2/2 * (num_y(j))^2);
Expand All @@ -86,14 +87,15 @@
end
end

figure; hold on
figure('Position',[50,50,850,650]); hold on
[X,Y] = meshgrid(num_x,num_y);
surf(X/a,Y/a,disp,'FaceAlpha',0.9,'EdgeAlpha',0.5);
plot3(x_coord/a,y_coord/a,max(max(disp))*ones(1,length(x_coord)),'LineWidth',2,'Color','Black')
title('Цветовая карта перемещений в момент времени t = 0');
xlabel('Номер частицы по оси Ox');
ylabel('Номер частицы по оси Oy');
colorbar;
pbaspect([1,(right_y-left_y)/(right_x-left_x),1]);
view(17,22);
hold off

Expand All @@ -116,7 +118,8 @@
end
end

figure(2); hold on

figure('Position',[50,50,850,650]); hold on
s1 = surf(X/a,Y/a,disp,'FaceAlpha',0.9,'EdgeAlpha',0.7);
title('Цветовая карта перемещений в момент времени t = '+string(t_max));
xlabel('Номер частицы по оси Ox');
Expand All @@ -126,12 +129,13 @@
caxis([-1 1])
%s1.EdgeColor = 'none';
%view(17,22);
pbaspect([1,(right_y-left_y)/(right_x-left_x),1]);
for i = 1:length(result)
title('Цветовая карта перемещений в момент времени t = '+string((i-1)*save_time));
s1.XData = X/a;
s1.YData = Y/a;
s1.ZData = result{i};
l1.ZData = max(max(result{i}))*ones(1,length(x_coord));
title('Цветовая карта перемещений в момент времени t = '+string((i-1)*save_time));
if write_video
filename = 'wave-with-angle-to-interface-1.gif';
frame = getframe(2);
Expand Down

0 comments on commit 4494677

Please sign in to comment.