Can anybody help me understanding this mentioned line of code?

조회 수: 4 (최근 30일)
lurkingleo
lurkingleo 2016년 11월 19일
댓글: lurkingleo 2016년 11월 20일
Nx=100;
FldLngt=8e-3;
DeltLngt=FldLngt/Nx;
--->PDz2(i,j)=(P(i-1,j-1)+P(i,j-1)+P(i+1,j-1)+P(i-1,j)+P(i+1,j)+P(i-1,j+1)+P(i,j+1)+P(i+1,j+1)-8*P(i,j))/(DeltLngt^2*2);<---
PDt2(i,j)=C(i,j)^2*PDz2(i,j);
where
Nx=grid points in x direction
FldLngt= length of simulation field
Delt is for Delta
PDz2= 2nd derivation of pressure with respect to z direction
PDt2=2nd derivation of pressure with respect to time t
I know that it is wave equation calculated using laplacian mask but i couldn't understand the denominator in mentioned line.

채택된 답변

Roger Stafford
Roger Stafford 2016년 11월 20일
The numerator is the Laplacian under the assumption that there is unit distance spacing between adjacent grid points of the pressure array P. The ‘DeltLngt^2’ in the denominator corrects this so that it becomes the Laplacian assuming the actual distance values between adjacent grid points in both the x and y directions. I don’t know what the ‘2’ means in the denominator.
  댓글 수: 1
lurkingleo
lurkingleo 2016년 11월 20일
thanks for helping me out..This '2' was confusing me also. Can you please explain these lines too i couldnt find which equation of pressure is applied here.
PDt1(i,j)=PDt2(i,j)*DeltT+PDt1(i,j); P(i,j)=PDt1(i,j)*DeltT+P(i,j);
where DeltT=0.04e-6; %time step;

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by