>> seti = runtests()
 
################ -------- tests of IPscatt ------- ################
 
 
################ --- Closed code is available ---- ################
 
Cleared all variables except of "inseti" in setInput.m
   Parameter inseti = tests.
Make dir: output/20190221T182755_tests.
 
## diary -- start diary log ---------------------------------------
 
 
## tests: all -- run all tests-----------------------------
 
 
## testDerivative -- 2D -----------------------------------
 
# setGeomSim
Compute FF(q) and ADFFq
Elapsed time is 7.070558 seconds.
make Jacobi Matrices
Elapsed time is 6.670494 seconds.
t = 1.000000e-01 | Numerator: 8.801949e-02 | Denominator: 9.989684e-02 | double prec. (default)
t = 1.000000e-01 | Numerator: 8.801949e-02 | Denominator: 9.989684e-02 | single prec.
t = 1.000000e-02 | Numerator: 4.563018e-03 | Denominator: 9.989684e-03 | double prec. (default)
t = 1.000000e-02 | Numerator: 4.563018e-03 | Denominator: 9.989684e-03 | single prec.
t = 1.000000e-03 | Numerator: 5.843800e-05 | Denominator: 9.989684e-04 | double prec. (default)
t = 1.000000e-03 | Numerator: 5.843819e-05 | Denominator: 9.989684e-04 | single prec.
t = 1.000000e-04 | Numerator: 6.008286e-07 | Denominator: 9.989684e-05 | double prec. (default)
t = 1.000000e-04 | Numerator: 6.057494e-07 | Denominator: 9.989684e-05 | single prec.
t = 1.000000e-05 | Numerator: 6.034486e-09 | Denominator: 9.989684e-06 | double prec. (default)
t = 1.000000e-05 | Numerator: 5.593690e-08 | Denominator: 9.989684e-06 | single prec.
t = 1.000000e-06 | Numerator: 6.361387e-11 | Denominator: 9.989684e-07 | double prec. (default)
t = 1.000000e-06 | Numerator: 1.263586e-07 | Denominator: 9.989684e-07 | single prec.

Choose random vector g ...
In test case: y = 0 was choosen.
<FF'(q)^ast[FF(q)-y],g> - <FF(q)-y, FF'(q)[g]> = 2.32442e-12+i3.09922e-12 
 
-----
 
 
## testDerivative -- 3D -----------------------------------
 
# setGeomSim
Compute FF(q) and ADFFq
Elapsed time is 8.145636 seconds.
make Jacobi Matrices
Elapsed time is 8.335892 seconds.
t = 1.000000e-01 | Numerator: 9.507396e-01 | Denominator: 3.829222e-02 | double prec. (default)
t = 1.000000e-02 | Numerator: 4.692476e-02 | Denominator: 3.829222e-03 | double prec. (default)
t = 1.000000e-03 | Numerator: 5.675439e-04 | Denominator: 3.829222e-04 | double prec. (default)
t = 1.000000e-04 | Numerator: 5.811856e-06 | Denominator: 3.829222e-05 | double prec. (default)
t = 1.000000e-05 | Numerator: 6.533161e-08 | Denominator: 3.829222e-06 | double prec. (default)

Choose random vector g ...
In test case: y = 0 was choosen.
<FF'(q)^ast[FF(q)-y],g> - <FF(q)-y, FF'(q)[g]> = -1.15831e-11+i-5.50056e-11 
 
-----
 
 
## testMimo -- 2D -----------------------------------------
 
# setGeomSim
testing mimo for dim = 2, model = helmholtz2D

        |         | rel. error  | rel. error  | grid. gen.  |        
Points  | Points  | of u_s      | of u_s      | +ref.u gen. | comp.  
in CD(N)| in CD(M)| on ROI      | at RX       | time        | time.  
------- + ------- + ----------- + ----------- + ----------- + --------
   31^2 |     0^2 |    0.056808 |    0.057822 |    0.071109 | 0.008929
   32^2 |     0^2 |    0.104797 |    0.105357 |    0.059198 | 0.002332
   63^2 |     0^2 |    0.087199 |    0.087586 |    0.097491 | 0.002872
   64^2 |     0^2 |    0.160126 |    0.160703 |    0.065914 | 0.002611
  127^2 |     0^2 |    0.066372 |    0.066652 |    0.225652 | 0.006655
  128^2 |     0^2 |    0.046566 |    0.046770 |    0.261417 | 0.005034
  255^2 |     0^2 |    0.011359 |    0.011400 |    1.001695 | 0.016714
  256^2 |     0^2 |    0.011959 |    0.012000 |    1.008931 | 0.014802
  511^2 |     0^2 |    0.005534 |    0.005556 |    4.009052 | 0.077240
  512^2 |     0^2 |    0.004406 |    0.004423 |    4.017141 | 0.044686

 
-----
 
 
## testMimo -- 3D -----------------------------------------
 
# setGeomSim
testing mimo for dim = 3, model = helmholtz3D

        |         | rel. error  | rel. error  | grid. gen.  |        
Points  | Points  | of u_s      | of u_s      | +ref.u gen. | comp.  
in CD(N)| in CD(M)| on ROI      | at RX       | time        | time.  
------- + ------- + ----------- + ----------- + ----------- + --------
   63^3 |     0^3 |    0.014940 |    0.013880 |   14.011336 | 0.033449
   64^3 |     0^3 |    0.016725 |    0.015647 |   14.290801 | 0.024314
  127^3 |     0^3 |    0.044609 |    0.045257 |  119.544487 | 0.418931
  128^3 |     0^3 |    0.004786 |    0.004850 |  120.368297 | 0.230722
  255^3 |     0^3 |    0.003975 |    0.004018 |  1021.672221 | 2.894913
  256^3 |     0^3 |    0.009856 |    0.009993 |  1040.489240 | 2.195025

 
-----
 
 
## testGridscale -- 2D ------------------------------------
 
test gridScale: gridUp and gridDown
 
 1) test up- and downscaling
grid upscaling
Elapsed time is 0.001963 seconds.
grid downscaling
Elapsed time is 0.148283 seconds.
dim (length(size(A)): 2 | dim (length(size(B2))): 2
nInv = 127, D = 0 | 
 
 2) test down- and upscaling (several times...) (2D)
number of down- and upscalings: ndu = 2
gridDown...
Elapsed time is 0.008332 seconds.
gridUp...
Elapsed time is 0.000596 seconds.
gridDown...
Elapsed time is 0.012287 seconds.
gridUp...
Elapsed time is 0.000595 seconds.
nInv = 127, err = 0.0158233 | 
 
-----
 
 
## testGridScale -- 3D ------------------------------------
 
test gridScale: gridUp and gridDown
 
 1) test up- and downscaling
grid upscaling
Elapsed time is 0.000316 seconds.
grid downscaling
Elapsed time is 0.045635 seconds.
dim (length(size(A)): 3 | dim (length(size(B2))): 3
nInv = 15, D = 0 | 
 
-----
 
 
## Test mimo (2D) and compare near and far field results --
 
 
-- testset 1 --
 
Compute reference solution
Elapsed time is 5.693701 seconds.
Compute solution
Elapsed time is 0.084913 seconds.
Compute reference solution
Elapsed time is 5.662685 seconds.
Compute solution
Elapsed time is 0.070641 seconds.
testset = 1: planeWave, incNb = 1
compare scatterd near field with reference solution
compare scatterd far field with reference solution
compare scatterd near and far field (near field with huge radius)
ROI: usNear       against usNearRef:   0.001077
RX : usNear       against usNearRef:   0.001275
ROI: usFar        against usFarRef :   0.001077
RX : usFar        against usFarRef :   0.001275
ROI: usFar        against usNearRef:   0.001077
RX : usFarNear    against usNearRef:   0.001230
ROI: usFarRef     against usNearRef:   0.000000
RX : usFarRefNear against usNearRef:   0.000447
 
-- testset 2 --
 
No reference solution available (so no comparison with ref. sol.).
Compute solution
Elapsed time is 1.178495 seconds.
No reference solution available (so no comparison with ref. sol.).
Compute solution
Elapsed time is 1.072445 seconds.
testset = 2: pointSource; Fresnel, op. 1
compare scatterd near and far field
usNearROI against usFarROI   :   0.000000
usNearRX  against usFarRXNear:   0.087751
 
-----
 
 
## Test adjoint of Kd and Kg ------------------------------
 
 - load preliminary settings with suppressed output
 
- Jacobian
Elapsed time is 7.860093 seconds.
- FF(q)
Elapsed time is 2.108365 seconds.
    diff (rel.) = 1.39588e-16 
    <Kd(xnRVD), yd>_dis,R = -0.00310687+0i | <xnRVD, Kd^*(yd)>_roi,R = -0.00310687+0i 
    diff (rel.) = 5.46039e-15 
    <Kg(xnRVD), yg>_tv,R = -8.96806e-08+0i | <xnRVD, Kg^*(yg)>_roi,R = -8.96806e-08+0i 
 
-- Test: is normTVinv2 induced by innergrad? Yes: 
    diff (rel.) = 0 
    ||yg||_tv,R,2 = 0.164651+0i | sqrt(abs(<yg,yg>_tv,R)) = 0.164651+0i 
 
-----
 
 
## diary -- end diary log -----------------------------------------
 

seti = 

  struct with fields:

          inseti: 'tests'
          closed: 1
      usecbarlim: 0
     plotPublish: 0
        plotFreq: 1
         savepng: 1
        saveepsc: 0
         savefig: 0
        savedata: 0
       dirOutput: 'output'
     dirDatetime: '20190221T182755'
       dirSuffix: ''
    dirSuffixAdd: ''
         dirname: 'output/20190221T182755_tests'
      fileSuffix: '_testGridScale3D'
             dim: 2
             rCD: 0.2000
             nCD: 256
          gscale: 0
          nCDinv: 256
               k: 83.7758
           model: 'helmholtz2D'
        contrast: 'fresnel_op1_twodielTM'
         incType: 'pointSource'
        measType: 'farField'
           incNb: 36
          measNb: 72
          radSrc: 0.7200
         radMeas: 0.7600
             tol: 1.0000e-06
        colormap: 'litman'
     faceColor3D: 'red'
     pubFontSize: 20
     plotVisible: 'off'
    plotFreqiPda: 0
               h: 0.0016
              dV: 2.4414e-06
            grid: [2x65536 double]
        ballMask: [256x256 logical]
            nROI: 91
         gridROI: [2x8281 double]
         ROImask: [256x256 logical]
     ballMaskROI: [91x91 logical]
            GROI: @(x)reshape(x,reshapeVecROI)
             GCD: @(x)reshape(x,reshapeVecCD)
               G: @(q)seti.GROI(q)
              iG: @(x)x(:)
            nInv: 91
            hInv: 0.0016
           dVinv: 2.4414e-06
            GInv: @(x)reshape(x,reshapeVecROI)
              GU: @(qROI)qROI
              GD: @(qROI)qROI
               S: @(hz)[real(hz);imag(hz)]
               R: @(hs)hs(1:size(hs,1)/2,:,:,:)
               I: @(hs)hs(size(hs,1)/2+1:size(hs,1),:,:,:)
               T: @(hs)seti.R(hs)+1i.*seti.I(hs)
            kHat: [256x256 double]
         incPnts: [2x36 double]
           dSInc: 0.1255
        measPnts: [2x72 double]
          dSMeas: 0.0872
        incField: [8281x36 double]
         measKer: [72x8281 double]
       qROIexact: [8281x1 double]
             mCD: 0
           qBall: 0.5000
           rBall: 0.5000
     incPntsType: 'circle'
    measPntsType: 'circle'
           invNo: 6
      useWavelet: 0
               p: 2
             inv: 'pda'
              tF: {'fd'  'fg'}
              tG: {'fs'  'fp'}
           alpha: 500
            beta: 1.0000e-05
             tau: 2.5000
           pNorm: 2
           qNorm: 1
         recname: 'contrast'
      physBounds: [-1 3 0 3]
        tolDelta: 1.0000e-14
          useDis: 1
            nOut: 30
            pdaN: 50
     pdaStepsize: 'fix'
        vartheta: 0.5000
          usefp2: 0
       useTolOut: 0
        useTolIn: 0
    saveqROIcomp: 'output/20190221T182755_tests/save_qROIcomp_iOutStop_testGridScale3D.mat'
    loadqROIcomp: []
          lambda: 0.0750
          shrkRe: [function_handle]
          shrkIm: [function_handle]
              Kd: [function_handle]
           KdAdj: @(yd,JA,JB)seti.S(seti.GD(ADFFqFast(seti.T(yd),JA,JB,seti)))
              vd: @(FFq)seti.S(FFq-seti.FmeasDelta)
              fd: @(DFFqh,FFq)(1/2)*normws(seti.S(DFFqh)+seti.vd(FFq),seti)^2
              vs: @(qCVU)seti.S(seti.GD(qCVU))
              fs: @(qCVU,xnRVD)seti.alpha*normroi(xnRVD+seti.vs(qCVU),seti)
              Kg: [function_handle]
           KgAdj: @(yg)seti.beta*gradientNeumannAdj(yg,seti)
              vg: @(qCVU)seti.Kg(seti.S(seti.GD(qCVU)))
              fg: @(qCVU,xnRVD)normTVinv1(seti.Kg(xnRVD)+seti.vg(qCVU),seti)
              fp: [function_handle]
             fp2: [function_handle]

>> 

