Download presentation
Presentation is loading. Please wait.
Published byKenneth Fletcher Modified over 8 years ago
1
Scientific Computing Lab Results Worksheet 4 Dr. Miriam Mehl Institut für Informatik Scientific Computing in Computer Science
2
Worksheet 4 – Solution 1) m-file Euler.m x_old=x_m; %time step for k=2:N_x+1 for m=2:N_y+1 x_m(k,m) = x_old(k,m) + dt*(d_1*(x_old(k-1,m)+x_old(k+1,m))+… end
3
Worksheet 4 – Solution 2) m-file Euler_implicit.m while (res>0.0001) res=0.0; for m=2:N_y+1 for k=2:N_x+1 x_m(k,m)=(d_1*(x_m(k-1,m)+x_m(k+1,m))+… end for m=2:N_y+1 for k=2:N_x+1 res=res+(b((m-2)*N_x+k-1)+a_ii*x_m(k,m)-… end res=sqrt(res/(N_x*N_y)); end
4
Worksheet 4 – Solution 3) m-file worksheet4.m while (t<T_end) if (n==1) x_m=Euler(N_x,N_y,dt,x_m); else x_m=Euler_implicit(N_x,N_y,dt,x_m); end t=t+dt;
5
Worksheet 4 – Solution N x = N y =3, dt=1/64 t=0
6
Worksheet 4 – Solution N x = N y =3, dt=1/64 t=1/8
7
Worksheet 4 – Solution N x = N y =3, dt=1/64 t=2/8
8
Worksheet 4 – Solution N x = N y =3, dt=1/64 t=3/8
9
Worksheet 4 – Solution N x = N y =3, dt=1/64 t=4/8
10
Worksheet 4 – Solution N x = N y =7, dt=1/64 t=0
11
Worksheet 4 – Solution N x = N y =7, dt=1/64 t=1/8
12
Worksheet 4 – Solution N x = N y =7, dt=1/64 t=2/8
13
Worksheet 4 – Solution N x = N y =7, dt=1/64 t=3/8
14
Worksheet 4 – Solution N x = N y =7, dt=1/64 t=4/8
15
Worksheet 4 – Solution N x = N y =7, dt=1/256 t=0
16
Worksheet 4 – Solution N x = N y =7, dt=1/256 t=1/8
17
Worksheet 4 – Solution N x = N y =7, dt=1/256 t=2/8
18
Worksheet 4 – Solution N x = N y =7, dt=1/256 t=3/8
19
Worksheet 4 – Solution N x = N y =7, dt=1/256 t=4/8
20
Worksheet 4 – Solution N x = N y =15, dt=1/256 t=0
21
Worksheet 4 – Solution N x = N y =15, dt=1/256 t=1/8
22
Worksheet 4 – Solution N x = N y =15, dt=1/256 t=2/8
23
Worksheet 4 – Solution N x = N y =15, dt=1/256 t=3/8
24
Worksheet 4 – Solution N x = N y =15, dt=1/256 t=4/8
25
Worksheet 4 – Solution N x = N y =15, dt=1/1024 t=0
26
Worksheet 4 – Solution N x = N y =15, dt=1/1024 t=1/8
27
Worksheet 4 – Solution N x = N y =15, dt=1/1024 t=2/8
28
Worksheet 4 – Solution N x = N y =15, dt=1/1024 t=3/8
29
Worksheet 4 – Solution N x = N y =15, dt=1/1024 t=4/8
30
Worksheet 4 – Solution N x = N y =31, dt=1/4096 t=0
31
Worksheet 4 – Solution N x = N y =31, dt=1/4096 t=1/8
32
Worksheet 4 – Solution N x = N y =31, dt=1/4096 t=2/8
33
Worksheet 4 – Solution N x = N y =31, dt=1/4096 t=3/8
34
Worksheet 4 – Solution N x = N y =31, dt=1/4096 t=3/8
35
Worksheet 4 – stable cases
36
Worksheet 4 – unstable cases
37
Worksheet 4 – Solution x------1/32 xxx----1/16 xxxxx--1/8 xxxxxxx1/4 1/40961/20481/10241/5121/2561/1281/64h/dt dt<h 2 /2
38
Worksheet 4 – Solution N x = N y =7, dt=1/64 implicit t=0
39
Worksheet 4 – Solution N x = N y =7, dt=1/64 implicit t=1/8
40
Worksheet 4 – Solution N x = N y =7, dt=1/64 implicit t=2/8
41
Worksheet 4 – Solution N x = N y =7, dt=1/64 implicit t=3/8
42
Worksheet 4 – Solution N x = N y =7, dt=1/64 implicit t=4/8
43
Worksheet 4 – Solution N x = N y =15, dt=1/64 implicit t=0
44
Worksheet 4 – Solution N x = N y =15, dt=1/64 implicit t=1/8
45
Worksheet 4 – Solution N x = N y =15, dt=1/64 implicit t=2/8
46
Worksheet 4 – Solution N x = N y =15, dt=1/64 implicit t=3/8
47
Worksheet 4 – Solution N x = N y =15, dt=1/64 implicit t=4/8
48
Worksheet 4 – Solution N x = N y =31, dt=1/64 implicit t=0
49
Worksheet 4 – Solution N x = N y =31, dt=1/64 implicit t=1/8
50
Worksheet 4 – Solution N x = N y =31, dt=1/64 implicit t=2/8
51
Worksheet 4 – Solution N x = N y =31, dt=1/64 implicit t=3/8
52
Worksheet 4 – Solution N x = N y =31, dt=1/64 implicit t=4/8
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.