Processing time too long

591 views
Skip to first unread message

tmgimgz

unread,
Oct 5, 2017, 7:14:09 AM10/5/17
to gprMax-users
Hi,

We are trying to simulate stepped frequency gpr, using gprMax. We generate the signal from Matlab script and import in our gprMax file. We managed to  obtain A scan and range profile, but we want to form a B scan also. In attachment, there are 2 files ( the imported signal and the script ). We want to utilize MPI, but the time we get is too long (2000 h).

System specifications 
X550LD; 1 x Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz (2 cores, 4 cores with Hyper-Threading); 7.68GiB RAM; Linux (4.4.0-67-generic, debian)

We run the script with the following command
python -m gprMax gprmaxsfcw.py -n 60 -mpi 61 --geometry-fixed

Can you suggest some solution ?
Thanks in advance.

Kind regards,
tmgimgz


signalpola.txt
gprmaxsfcw.py

Craig Warren

unread,
Oct 5, 2017, 8:53:12 AM10/5/17
to gprMax-users
Hi tmgimgz,

Welcome to the forum!

Simulating a stepped-frequency GPR system using FDTD is never going to be very efficient. What is the pulse shape that you are trying to use?

The principle reason for your model taking so long to run is the length of the time window you are using, 9e-5 seconds, which will result in ~19M iterations! Why do you need such a long time window? I understand that a longer time window will give better frequency resolution if you are doing a FFT.

Secondly, the MPI task farm functionality is designed for a machine (typically a HPC) with many cores and nodes. Your machine has a mobile spec CPU with 2 cores, so there is no benefit in using MPI. Also the clock frequency is rather low (1.8GHz) which won't help either.

Kind regards,

Craig
Message has been deleted

tmgimgz

unread,
Oct 5, 2017, 9:25:35 AM10/5/17
to gprMax-users
Hi,

Thanks for the fast response :)
First, the signal we are using is cosine steeped frequency waveform, with incremental frequency step (df) of 10 MHz ( there is a figure attach in this mail ).

Second, about the long time window. We constantly get this warring WARNING: Numerical dispersion analysis not carried out as either no waveform detected or waveform does not fit within specified time window and is therefore being truncated.  So, we thought that we will solve this by increasing the time. Our pulse length is 0.05e-6 (s) and T (period between pulses) is 0.1e-6 (s). We also have a train of 100 repetitions, giving us the time of 100*0.1e-6(s). We thought that this time is needed for the source to transmit the signal and the same time for the receiver to receive the signal. Thus, giving us time od 2* 100*0.1e-6(s) + propagation time .. we assume that this analysis is not correct because we still get the warrning.

We can change the CPU frequency to performance if that helps.


Thanks,
tmgimgz
generiranTxSignal.png

Craig Warren

unread,
Oct 5, 2017, 11:52:42 AM10/5/17
to gprMax-users
Hi tmgimgz,

If I understand correctly what you are trying to do, I don't think this approach will work. To simulate a SF GPR you will need to run a separate simulation for each frequency step, you can't combine all the frequency steps into a single model. I think this is what you are trying to do? Hence, the long time window?

Having said that, there is a (advanced) workaround that can alleviate this problem but you need to have a good understanding of FDTD and take care when using it.

Kind regards,

Craig

Antonis Giannopoulos

unread,
Oct 5, 2017, 12:34:15 PM10/5/17
to gprMax-users
Hi tmgimgz

FDTD - which gprMax is based upon - is suited to time-domain problems and you are trying to simulate a frequency domain GPR process. The two are equivalent but a brute force time approach is not efficient as you have found out. One way to approach this is to use the 'impulse' excitation in gprMax (not documented) that creates an output due to a Dirac delta excitation. This needs to be treated cautiously (that is why is not documented !!!) as the response as it is is not useable unless further processed. If you convolve this response (use Python or MATLAB) with your forcing function (i.e. excitation pulse) You will get the same response as if you had run the model with this function. So, you can do things in post-processing faster in your case. 

There are a number of pitfalls in this approach!!! You need to know what you are doing and you are going to have truncation errors as your impulse response might be too short or might not have died down sufficiently. You might need or want or have to use some windowing function etc. 

So, approach with caution this feature and if you can use it to your advantage then it is good. Otherwise, you will find that a brute force approach will take forever as FDTD is not really designed to be used that way.

Hope this helps!


Antonis

tmgimgz

unread,
Oct 6, 2017, 7:56:11 AM10/6/17
to gprMax-users
Hi, 

Thanks for the ideas :)

There is file attached in this post with gprMax code. Although, this model does not take in concern the ( recommended ) settings for the PML region and the position of the elements in relation to the region, the output signal is identical as the one we import in the simulation (only different phase, but the waveform is the same). The problem is that after processing in matlab we don't get correct distance from the object and the ground (cross-talk).

When we run the model attached in the first post, we get correct results ( 2 peaks, on correct positions ). To check the reflections, we ran the same model without cylinder, and we processed the output signal. As expected, we get only one peak ( the first peak from the original model ). When we subtract the aforementioned signals, we get only the second peak.
What bothers us, is that this model ( correct PML and object positioning ), outputs weird signal ( nothing like the imported signal), but the results are correct.


The idea about running the simulation in multiple iterations ( changing the frequency only ) sounds great, but we need to automate that, because we have 100 pulses, plus we want B scan .

About the idea with convolution .. You suggest to generate dirac delta function from matlab and to import in gprmax and run the simulation.. or there is build in dirac impulse in gprmax that we can use ( if so, please can you tell us the syntax for the impulse )

Thanks for the help,
tmgimgz

p.s we run modified models with smaller time window .. i will report for results :)

faxproba2e-5.py

Antonis Giannopoulos

unread,
Oct 6, 2017, 8:33:49 AM10/6/17
to gprMax-users
You need to use a waveform command and use 'impulse' as the excitation type. You need to specify a frequency but this is ignored internally.

Antonis

tmgimgz

unread,
Oct 6, 2017, 10:00:25 AM10/6/17
to gprMax-users
Hi, 

This is code example for A scan from the manual .. I only changed the waveform .. I get this error AttributeError: 'bool' object has no attribute 'ID'

#title: A-scan from a metal cylinder buried in a dielectric half-space
#domain: 0.240 0.210 0.002
#dx_dy_dz: 0.002 0.002 0.002
#time_window: 3e-9
#material: 6 0 1 0 half_space
#waveform: impulse 1 1.5e9 ricker
#hertzian_dipole: z 0.100 0.170 0 ricker
#rx: 0.140 0.170 0
#box: 0 0 0 0.240 0.170 0.002 half_space
#cylinder: 0.120 0.080 0 0.120 0.080 0.002 0.010 pec
#geometry_view: 0 0 0 0.240 0.210 0.002 0.002 0.002 0.002 cylinder_half_space n

Thanks,
tmgimgz


Craig Warren

unread,
Oct 25, 2017, 12:07:01 PM10/25/17
to gprMax-users
Hi tmgimgz,

Thanks for spotting this. The 'dispersion analysis' function, which is designed to warn users of potential numerical dispersion in their simulation, was not handling the case where the impulse (Dirac delta) waveform was used. This should now be corrected if you update gprMax and pull the latest code from the master GitHub branch.

Kind regards,

Craig

tmgimgz

unread,
Oct 27, 2017, 3:38:20 AM10/27/17
to gprMax-users
Hi,

Thanks for your continuous and thoroughly support :)..we will definitely try the code in couple of days.
I would like to mention that we succeeded to simulate models using the stepped frequency waveform and they look great. Maybe in future, we should chose different antenna type for obtaining more narrower radiation angle ( now we are using the dipole model, but it "catches" the object from long distance ). Can you suggest some existing antenna model with more narrower radiation angle ( the working frequency is between 10 MHz and 1 GHz ).

yan zhang

unread,
Aug 3, 2020, 10:52:35 AM8/3/20
to gprMax-users
Hi, tmgimgz,

Thanks for your post and your shared code. I am currently also working on simulating a SFCW radar. Could you please tell me how you finally managed to simulate the SFCW radar with gprMax? 
Did you use the impulse waveform and then do convolution or just put all the sine waves in a single excitation file?

Thanks,
Yan
Reply all
Reply to author
Forward
0 new messages