18 August 2010 04:14:19 PM FD1D_BURGERS_LEAP: C++ version Solve the non-viscous time-dependent Burgers equation, using the leap-frog method. Equation to be solved: du/dt + u * du/dx = 0 for x in [ a, b ], for t in [t_init, t_last] with initial conditions: u(x,o) = u_init and boundary conditions: u(a,t) = u_a(t), u(b,t) = u_b(t) -1 <= X <= 1 Number of nodes = 21 DX = 0.1 0 <= T <= 3 Number of time steps = 30 DT = 0.1 X: -1 -0.9 -0.8 -0.7 -0.6 -0.5 -0.5 -0.4 -0.3 -0.2 -0.1 0 0 0.1 0.2 0.3 0.4 0.5 0.5 0.6 0.7 0.8 0.9 1 1 STEP = 0 TIME = 0 0.5 0.466525 0.429553 0.3888 0.344042 0.295167 0.242238 0.185547 0.125666 0.063451 0 -0.063451 -0.125666 -0.185547 -0.242238 -0.295167 -0.344042 -0.3888 -0.429553 -0.466525 -0.5 STEP = 1 TIME = 0.1 0.5 0.482957 0.446247 0.405424 0.360149 0.310192 0.255515 0.196362 0.133338 0.0674379 0 -0.0674379 -0.133338 -0.196362 -0.255515 -0.310192 -0.360149 -0.405424 -0.446247 -0.482957 -0.5 STEP = 2 TIME = 0.2 0.5 0.492485 0.464152 0.423706 0.378339 0.327624 0.271323 0.209538 0.142856 0.072443 0 -0.072443 -0.142856 -0.209538 -0.271323 -0.327624 -0.378339 -0.423706 -0.464152 -0.492485 -0.5 STEP = 3 TIME = 0.3 0.5 0.500611 0.478171 0.441783 0.3965 0.345253 0.287554 0.223281 0.152922 0.0777868 0 -0.0777868 -0.152922 -0.223281 -0.287554 -0.345253 -0.3965 -0.441783 -0.478171 -0.500611 -0.5 STEP = 4 TIME = 0.4 0.5 0.503413 0.492282 0.459787 0.416614 0.365238 0.306397 0.239599 0.165106 0.0843384 0 -0.0843384 -0.165106 -0.239599 -0.306397 -0.365238 -0.416614 -0.459787 -0.492282 -0.503413 -0.5 STEP = 5 TIME = 0.5 0.5 0.504497 0.499647 0.476575 0.435891 0.385508 0.32605 0.257134 0.178557 0.0917115 0 -0.0917115 -0.178557 -0.257134 -0.32605 -0.385508 -0.435891 -0.476575 -0.499647 -0.504497 -0.5 STEP = 6 TIME = 0.6 0.5 0.503591 0.506233 0.490171 0.456309 0.407582 0.348253 0.277524 0.194643 0.100714 0 -0.100714 -0.194643 -0.277524 -0.348253 -0.407582 -0.456309 -0.490171 -0.506233 -0.503591 -0.5 STEP = 7 TIME = 0.7 0.5 0.501358 0.50644 0.501046 0.473577 0.42955 0.371343 0.299764 0.212972 0.111315 0 -0.111315 -0.212972 -0.299764 -0.371343 -0.42955 -0.473577 -0.501046 -0.50644 -0.501358 -0.5 STEP = 8 TIME = 0.8 0.5 0.500362 0.506391 0.506638 0.490168 0.451497 0.396448 0.324998 0.234777 0.124421 0 -0.124421 -0.234777 -0.324998 -0.396448 -0.451497 -0.490168 -0.506638 -0.506391 -0.500362 -0.5 STEP = 9 TIME = 0.9 0.5 0.49816 0.503263 0.509266 0.500605 0.471864 0.421493 0.352307 0.260063 0.140526 0 -0.140526 -0.260063 -0.352307 -0.421493 -0.471864 -0.500605 -0.509266 -0.503263 -0.49816 -0.5 STEP = 10 TIME = 1 0.5 0.498737 0.500802 0.507991 0.508891 0.488827 0.446841 0.381871 0.289854 0.160967 0 -0.160967 -0.289854 -0.381871 -0.446841 -0.488827 -0.508891 -0.507991 -0.500802 -0.498737 -0.5 STEP = 11 TIME = 1.1 0.5 0.49776 0.498628 0.505156 0.510357 0.502196 0.469285 0.412256 0.324093 0.187183 0 -0.187183 -0.324093 -0.412256 -0.469285 -0.502196 -0.510357 -0.505156 -0.498628 -0.49776 -0.5 STEP = 12 TIME = 1.2 0.5 0.49942 0.497114 0.502066 0.510402 0.509454 0.489048 0.441728 0.362798 0.221631 0 -0.221631 -0.362798 -0.441728 -0.489048 -0.509454 -0.510402 -0.502066 -0.497114 -0.49942 -0.5 STEP = 13 TIME = 1.3 0.5 0.499201 0.497313 0.498485 0.506587 0.513075 0.502406 0.468024 0.403943 0.26759 0 -0.26759 -0.403943 -0.468024 -0.502406 -0.513075 -0.506587 -0.498485 -0.497313 -0.499201 -0.5 STEP = 14 TIME = 1.4 0.5 0.500761 0.49747 0.497443 0.503011 0.511598 0.511682 0.487811 0.443762 0.329722 0 -0.329722 -0.443762 -0.487811 -0.511682 -0.511598 -0.503011 -0.497443 -0.49747 -0.500761 -0.5 STEP = 15 TIME = 1.5 0.5 0.500468 0.498963 0.495728 0.499466 0.508639 0.514578 0.501156 0.474097 0.413909 0 -0.413909 -0.474097 -0.501156 -0.514578 -0.508639 -0.499466 -0.495728 -0.498963 -0.500468 -0.5 STEP = 16 TIME = 1.6 0.5 0.50128 0.499835 0.497194 0.496563 0.503912 0.515532 0.508098 0.485126 0.525955 0 -0.525955 -0.485126 -0.508098 -0.515532 -0.503912 -0.496563 -0.497194 -0.499835 -0.50128 -0.5 STEP = 17 TIME = 1.7 0.5 0.500551 0.501006 0.497356 0.49613 0.49908 0.51242 0.516606 0.465434 0.669063 0 -0.669063 -0.465434 -0.516606 -0.51242 -0.49908 -0.49613 -0.497356 -0.501006 -0.500551 -0.5 STEP = 18 TIME = 1.8 0.5 0.500776 0.501436 0.499618 0.495707 0.495782 0.506552 0.532371 0.414167 0.83736 0 -0.83736 -0.414167 -0.532371 -0.506552 -0.495782 -0.495707 -0.499618 -0.501436 -0.500776 -0.5 STEP = 19 TIME = 1.9 0.5 0.499832 0.501587 0.500218 0.498032 0.493703 0.493886 0.565789 0.339118 1.01587 0 -1.01587 -0.339118 -0.565789 -0.493886 -0.493703 -0.498032 -0.500218 -0.501587 -0.499832 -0.5 STEP = 20 TIME = 2 0.5 0.499983 0.501242 0.501396 0.498952 0.497829 0.47095 0.619937 0.261536 1.18186 0 -1.18186 -0.261536 -0.619937 -0.47095 -0.497829 -0.498952 -0.501396 -0.501242 -0.499983 -0.5 STEP = 21 TIME = 2.1 0.5 0.499211 0.500878 0.501366 0.499812 0.507643 0.436379 0.695612 0.192155 1.32497 0 -1.32497 -0.192155 -0.695612 -0.436379 -0.507643 -0.499812 -0.501366 -0.500878 -0.499211 -0.5 STEP = 22 TIME = 2.2 0.5 0.499545 0.500163 0.501931 0.495814 0.530031 0.388924 0.789823 0.140602 1.43646 0 -1.43646 -0.140602 -0.789823 -0.388924 -0.530031 -0.495814 -0.501931 -0.500163 -0.499545 -0.5 STEP = 23 TIME = 2.3 0.5 0.499129 0.499685 0.503549 0.48588 0.564298 0.33534 0.891742 0.101236 1.52694 0 -1.52694 -0.101236 -0.891742 -0.33534 -0.564298 -0.48588 -0.503549 -0.499685 -0.499129 -0.5 STEP = 24 TIME = 2.4 0.5 0.499702 0.497954 0.508883 0.466297 0.61498 0.279119 0.998583 0.0762976 1.59104 0 -1.59104 -0.0762976 -0.998583 -0.279119 -0.61498 -0.466297 -0.508883 -0.497954 -0.499702 -0.5 STEP = 25 TIME = 2.5 0.5 0.500152 0.495113 0.519658 0.436407 0.679409 0.228269 1.09428 0.056033 1.64833 0 -1.64833 -0.056033 -1.09428 -0.228269 -0.679409 -0.436407 -0.519658 -0.495113 -0.500152 -0.5 STEP = 26 TIME = 2.6 0.5 0.502146 0.488296 0.53939 0.396581 0.756391 0.184418 1.18706 0.0452522 1.6834 0 -1.6834 -0.0452522 -1.18706 -0.184418 -0.756391 -0.396581 -0.53939 -0.488296 -0.502146 -0.5 STEP = 27 TIME = 2.7 0.5 0.506029 0.476927 0.569129 0.350348 0.839887 0.148846 1.25947 0.0335723 1.72451 0 -1.72451 -0.0335723 -1.25947 -0.148846 -0.839887 -0.350348 -0.569129 -0.476927 -0.506029 -0.5 STEP = 28 TIME = 2.8 0.5 0.513822 0.458202 0.61143 0.301721 0.92563 0.121964 1.33224 0.0296399 1.7413 0 -1.7413 -0.0296399 -1.33224 -0.121964 -0.92563 -0.301721 -0.61143 -0.458202 -0.513822 -0.5 STEP = 29 TIME = 2.9 0.5 0.527505 0.432203 0.664806 0.255547 1.00628 0.0992544 1.38247 0.0214479 1.77612 0 -1.77612 -0.0214479 -1.38247 -0.0992544 -1.00628 -0.255547 -0.664806 -0.432203 -0.527505 -0.5 STEP = 30 TIME = 3 0.5 0.549585 0.39886 0.728872 0.21446 1.0829 0.0846251 1.43981 0.021197 1.77939 0 -1.77939 -0.021197 -1.43981 -0.0846251 -1.0829 -0.21446 -0.728872 -0.39886 -0.549585 -0.5 FD1D_BURGERS_LEAP: Normal end of execution. 18 August 2010 04:14:19 PM