1D wave equation
Hi
I am trying to solve 1D wave equation using eulers explicit scheme.After Discretization I am getting the following equation. [Ui^(n+1)]=[v^2*U(i-1)^n]+[2(1-v^2)*Ui^n]+[v^2*U(i+1)^n]-[Ui^(n-1)]. The problem that I am facing is with the last term -Ui^(n-1).Because the values at (n-1) level are not known.We know only boundary conditions at nth level and are trying to find out at n+1 level.Then how to solve this equation. Where v=c*(delta t/delta x); Any help in this regard is higly solicilated.Thanks in advance. regards rvndr |
Re: 1D wave equation
at first time stpe say n=1 i.e n+1=2,n=1,n-1=0. You should use value of variable at n at n-1 are equal.One you solve everything at that time step the next time n=2 i.e n+1=3,n=2,n-1=1. Now you value of variable in n-1=1 and n=2 so you can proceed. Roman
|
Re: 1D wave equation
thanks..............i did the same way
|
Re: 1D wave equation
"You should use value of variable at n at n-1 are equal."
If you do that then you've effectively implemented u(x,0)=f(x) and u_t(x,0)=0 where the u_t equation is discretized with a one-sided approximation to the time derivative. Are these the initial conditions the original poster wanted ? |
Re: 1D wave equation
The easiest way to initialise the problem
u_tt = c^2.u_xx with u=f(x), u_t = g(x) at t=0 is to use Taylor series u = u(x,0) + dt.u_t(x,0) + (1/2)dt^2.u_tt + O(dt^3) ~ f(x) + dt.g(x) + (1/2)dt^3.c^2.f''(x) + O(dt^3) you can use this formula to obtain u at time level n=1, Tom. |
Re: 1D wave equation
Use forward difference if U_t is not specified at the boundary
|
All times are GMT -4. The time now is 20:32. |