# Maybe a bug in garfield++

**URL:** <https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635>\
**Category:** Garfield++\
**Created:** [November 12, 2021, 12:45am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635 "2021-11-12T00:45:15Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [November 12, 2021, 12:45am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/1 "2021-11-12T00:45:15Z")

</div>

when i used garfield++ to calculate gas properties like ElectronVelocity, ElectronDiffusionL, ElectronDiffusionT, ElectronTownsend, ElectronAttachment. while the electricfield is set as from 50V/cm to 1000V/cm，as calculating the 700.0000 VOLTS/CM points, the errors occured:

“WARNING ENERGY OUT OF RANGE,INCREASE ELECTRON ENERGY INTEGRATION RANGE”

but when the electricfield is set as from 650V/cm to 850V/cm, everything works ok.

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [November 12, 2021, 6:39am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/2 "2021-11-12T06:39:28Z")

</div>

What is the gas mixture you are using and for what pressure are you running the calculation?

---

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [November 12, 2021, 7:25am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/3 "2021-11-12T07:25:34Z")

</div>

The gas is CH4 + Ar, the ratio of CH4 is from 0 to 50%，the pressure is 760 mm Hg

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [November 12, 2021, 7:45am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/4 "2021-11-12T07:45:30Z")

</div>

Thanks. At what fraction of CH4 specifically do you get this error message?

---

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [November 12, 2021, 8:06am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/5 "2021-11-12T08:06:14Z")

</div>

CH4 is 0%, Ar is 100%

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [November 14, 2021, 9:37am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/6 "2021-11-14T09:37:02Z")

</div>

Hi,  
running Magboltz for pure Argon at atmospheric pressure and 700 V/cm, I can’t reproduce the problem. Is one of the parameters different in your program?

```auto
          PROGRAM MAGBOLTZ 2 VERSION 11.13

          MONTE CARLO SOLUTION FOR MIXTURE OF 1 GASES.
     ------------------------------------------------------

       GASES USED PERCENTAGE USED 

      ARGON ANISOTROPIC 2014 100.0000

  GAS TEMPERATURE = 20.0 DEGREES CENTIGRADE.
  GAS PRESSURE = 760.0 TORR.
  INTEGRATION FROM 0.0 TO 11.31 EV. IN 4000 STEPS. 

 PENNING EFFECTS NOT INCLUDED

 ANISOTROPIC SCATTERING TYPE 2 (OKHRIMOVSKYY) USED IF AVAILABLE

 LONG DECORRELATION LENGTH =2000000 COLLISIONS.

 THERMAL MOTION OF GAS NOT INCLUDED

  ELECTRIC FIELD = 700.0000 VOLTS/CM.
  MAGNETIC FIELD = 0.0000 KILOGAUSS.
  ANGLE BETWEEN ELECTRIC AND MAGNETIC FIELD = 90.000 DEGREES.
  CYCLOTRON FREQ. = 0.000D+00 RADIANS/PICOSECOND

  INITIAL ELECTRON ENERGY = 0.226 EV.

  TOTAL NUMBER OF REAL COLLISIONS = 400000000

```

---

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [November 15, 2021, 12:43am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/7 "2021-11-15T00:43:05Z")

</div>

I will reply you later.

---

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [November 15, 2021, 1:31am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/8 "2021-11-15T01:31:21Z")

</div>

GASES USED PERCENTAGE USED

```
  ARGON ANISOTROPIC 2014 100.0000

```

GAS TEMPERATURE = 20.0 DEGREES CENTIGRADE.  
GAS PRESSURE = 760.0 TORR.

INTEGRATION FROM 0.0 TO 11.31 EV. IN 4000 STEPS.

PENNING EFFECTS NOT INCLUDED

ANISOTROPIC SCATTERING TYPE 2 (OKHRIMOVSKYY) USED IF AVAILABLE

LONG DECORRELATION LENGTH =2000000 COLLISIONS.

THERMAL MOTION OF GAS NOT INCLUDED

ELECTRIC FIELD = 700.0000 VOLTS/CM.  
MAGNETIC FIELD = 0.0000 KILOGAUSS.  
ANGLE BETWEEN ELECTRIC AND MAGNETIC FIELD = 90.000 DEGREES.  
CYCLOTRON FREQ. = 0.000D+00 RADIANS/PICOSECOND

INITIAL ELECTRON ENERGY = 0.226 EV.

TOTAL NUMBER OF REAL COLLISIONS = 400000000

NULL COLLISION FREQUENCY AT 8 EQUALLY SPACED ENERGY INTERVALS (\*10\*\*12/SEC)  
0.111D+02 0.111D+02 0.111D+02 0.111D+02  
0.111D+02 0.111D+02 0.111D+02 0.111D+02

REAL COLLISION FREQUENCY AT 8 EQUALLY SPACED ENERGY INTERVALS (\*10\*\*12/SEC)  
0.958D-01 0.741D+00 0.171D+01 0.291D+01  
0.447D+01 0.632D+01 0.834D+01 0.103D+02

```
VEL POS TIME ENERGY COUNT DIFXX DIFYY DIFZZ

 3.84 0.690D-01 0.180D+08 3.8728 20 4042.5 4778.6 0.0

```

WARNING ENERGY OUT OF RANGE,INCREASE ELECTRON ENERGY INTEGRATION RANGE  
(base) root@llh-virtual-machine:/home/llh/Garfield/Patent/build#

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [November 15, 2021, 5:25am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/9 "2021-11-15T05:25:39Z")

</div>

And, just to be sure, you are also using the HEAD version of Garfield++, i. e. the first line of the Magboltz output is this one?

> [@hschindl](#):
>
> `PROGRAM MAGBOLTZ 2 VERSION 11.13`

---

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [November 15, 2021, 6:08am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/10 "2021-11-15T06:08:40Z")

</div>

sorry, the first line of my Magboltz output is this one:  
PROGRAM MAGBOLTZ 2 VERSION 11.11

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [November 15, 2021, 6:27am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/11 "2021-11-15T06:27:30Z")

</div>

Can you update your installation of Garfield++ to the latest version from the repository, re-build the project and try again?

---

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [November 15, 2021, 7:02am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/12 "2021-11-15T07:02:14Z")

</div>

yes, i will update my program

---

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [November 15, 2021, 8:36am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/13 "2021-11-15T08:36:17Z")

</div>

sorry, the same problem occurs:  
PROGRAM MAGBOLTZ 2 VERSION 11.13

```
      MONTE CARLO SOLUTION FOR MIXTURE OF 1 GASES.
 ------------------------------------------------------

   GASES USED PERCENTAGE USED 

  ARGON ANISOTROPIC 2014 100.0000

```

GAS TEMPERATURE = 20.0 DEGREES CENTIGRADE.  
GAS PRESSURE = 760.0 TORR.

INTEGRATION FROM 0.0 TO 11.31 EV. IN 4000 STEPS.

PENNING EFFECTS NOT INCLUDED

ANISOTROPIC SCATTERING TYPE 2 (OKHRIMOVSKYY) USED IF AVAILABLE

LONG DECORRELATION LENGTH =2000000 COLLISIONS.

THERMAL MOTION OF GAS NOT INCLUDED

ELECTRIC FIELD = 700.0000 VOLTS/CM.  
MAGNETIC FIELD = 0.0000 KILOGAUSS.  
ANGLE BETWEEN ELECTRIC AND MAGNETIC FIELD = 90.000 DEGREES.  
CYCLOTRON FREQ. = 0.000D+00 RADIANS/PICOSECOND

INITIAL ELECTRON ENERGY = 0.226 EV.

TOTAL NUMBER OF REAL COLLISIONS = 400000000

NULL COLLISION FREQUENCY AT 8 EQUALLY SPACED ENERGY INTERVALS (\*10\*\*12/SEC)  
0.111D+02 0.111D+02 0.111D+02 0.111D+02  
0.111D+02 0.111D+02 0.111D+02 0.111D+02

REAL COLLISION FREQUENCY AT 8 EQUALLY SPACED ENERGY INTERVALS (\*10\*\*12/SEC)  
0.958D-01 0.741D+00 0.171D+01 0.291D+01  
0.447D+01 0.632D+01 0.834D+01 0.103D+02

```
VEL POS TIME ENERGY COUNT DIFXX DIFYY DIFZZ

 3.84 0.690D-01 0.180D+08 3.8728 20 4042.5 4778.6 0.0

```

WARNING ENERGY OUT OF RANGE,INCREASE ELECTRON ENERGY INTEGRATION RANGE  
root@llh-virtual-machine:/home/llh/Garfield/Patent/build#

---

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [November 15, 2021, 8:39am UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/14 "2021-11-15T08:39:06Z")

</div>

i meant:

while the electricfield is set as from 50V/cm to 1000V/cm，the error is produced.

but:  
while the electricfield is set as from 650V/cm to 850V/cm, everythings work well.

the increments are all 50V/cm.

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [November 19, 2021, 3:02pm UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/15 "2021-11-19T15:02:49Z")

</div>

Sorry for my late reply. That’s strange, the calculation of the energy range for a given electric field should normally be independent of the previously set electric field. Will try if I can reproduce this.

As a pragmatic short-term solution, you could generate separate gas files: one covering the range of electric fields from 50 V/cm to 600 V/cm and one covering the range 650 - 1000 V/cm. And then merge the two gas files (see the section “Merging gas files” on [this page](https://garfieldpp.web.cern.ch/garfieldpp/examples/gasfiles/)).

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [December 3, 2021, 3:02pm UTC](https://root-forum.cern.ch/t/maybe-a-bug-in-garfield/47635/16 "2021-12-03T15:02:51Z")

</div>

Closed on December 3, 2021, 3:02pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
