Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ octave --no-gui heatEquation2.m
- Nx = 10
- Nt = 5
- dx = 0.10000
- dt = 0.0050000
- c = 1
- xmin = 0
- xmax = 1
- tmin = 0
- tmax = 1
- r = 0.50000
- rr = 2.2204e-16
- Vectors x
- ans =
- 0.00000
- 0.10000
- 0.20000
- 0.30000
- 0.40000
- 0.50000
- 0.60000
- 0.70000
- 0.80000
- 0.90000
- 1.00000
- Vector t
- ans =
- 0.000000
- 0.005000
- 0.010000
- 0.015000
- 0.020000
- 0.025000
- Result traspose(u)
- ans =
- Columns 1 through 8:
- 0.00000 0.30902 0.58779 0.80902 0.95106 1.00000 0.95106 0.80902
- 0.00000 0.29389 0.55902 0.76942 0.90451 0.95106 0.90451 0.76942
- 0.00000 0.27951 0.53166 0.73176 0.86024 0.90451 0.86024 0.73176
- 0.00000 0.26583 0.50564 0.69595 0.81814 0.86024 0.81814 0.69595
- 0.00000 0.25282 0.48089 0.66189 0.77809 0.81814 0.77809 0.66189
- 0.00000 0.24044 0.45735 0.62949 0.74001 0.77809 0.74001 0.62949
- Columns 9 through 11:
- 0.58779 0.30902 0.00000
- 0.55902 0.29389 0.00000
- 0.53166 0.27951 0.00000
- 0.50564 0.26583 0.00000
- 0.48089 0.25282 0.00000
- 0.45735 0.24044 0.00000
- Result u - Result of PDE explicit method.
- u =
- 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
- 0.30902 0.29389 0.27951 0.26583 0.25282 0.24044
- 0.58779 0.55902 0.53166 0.50564 0.48089 0.45735
- 0.80902 0.76942 0.73176 0.69595 0.66189 0.62949
- 0.95106 0.90451 0.86024 0.81814 0.77809 0.74001
- 1.00000 0.95106 0.90451 0.86024 0.81814 0.77809
- 0.95106 0.90451 0.86024 0.81814 0.77809 0.74001
- 0.80902 0.76942 0.73176 0.69595 0.66189 0.62949
- 0.58779 0.55902 0.53166 0.50564 0.48089 0.45735
- 0.30902 0.29389 0.27951 0.26583 0.25282 0.24044
- 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
- Result uu - Result of PDE anlytical solution u(x, t) = exp(-pi^2 * t) * sin(pi * x) method.
- uu =
- 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
- 0.30902 0.29414 0.27997 0.26649 0.25366 0.24145
- 0.58779 0.55948 0.53254 0.50690 0.48249 0.45926
- 0.80902 0.77006 0.73298 0.69769 0.66410 0.63212
- 0.95106 0.90526 0.86167 0.82018 0.78069 0.74310
- 1.00000 0.95185 0.90602 0.86239 0.82087 0.78134
- 0.95106 0.90526 0.86167 0.82018 0.78069 0.74310
- 0.80902 0.77006 0.73298 0.69769 0.66410 0.63212
- 0.58779 0.55948 0.53254 0.50690 0.48249 0.45926
- 0.30902 0.29414 0.27997 0.26649 0.25366 0.24145
- 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
- Error between analytical solution and computed PDE explicit metod solution
- ans =
- 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
- 0.0000000 0.0002451 0.0004665 0.0006657 0.0008446 0.0010045
- 0.0000000 0.0004663 0.0008873 0.0012663 0.0016065 0.0019106
- 0.0000000 0.0006418 0.0012213 0.0017430 0.0022111 0.0026297
- 0.0000000 0.0007545 0.0014357 0.0020490 0.0025993 0.0030914
- 0.0000000 0.0007933 0.0015096 0.0021544 0.0027331 0.0032505
- 0.0000000 0.0007545 0.0014357 0.0020490 0.0025993 0.0030914
- 0.0000000 0.0006418 0.0012213 0.0017430 0.0022111 0.0026297
- 0.0000000 0.0004663 0.0008873 0.0012663 0.0016065 0.0019106
- 0.0000000 0.0002451 0.0004665 0.0006657 0.0008446 0.0010045
- 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
- Maximum absolute error
- ans = 0.0032505
- Plot results
Add Comment
Please, Sign In to add comment