-
Notifications
You must be signed in to change notification settings - Fork 2
/
hw3.m
executable file
·42 lines (29 loc) · 735 Bytes
/
hw3.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
% moving interface hw3 main function
% function hw3
clear all
close all
clc
global x y
global h
% initial configuration of phi
phi = initial();
tf=60;
dt = 0.5*h;
for tcont = 1: tf
% reinitialization phi
phi = reinitial(phi, tcont);
% velocity extension
% F = extension(phi,signphi,Fold,tcont);
F = extension(phi,dt);
% phi evolution
phi = evolution(phi,F, dt);
if floor(tcont/10) > floor((tcont-1)/10)
figure(1)
contour(x,y,phi,[0,0]), hold on
axis([-5 5 -5 5]); axis equal
xlabel('x position');
ylabel('y position');
title('phi advancing each 10 steps');
fprintf('tcont is %d\n', tcont);
end
end