# Get the function between ion velocity and electric field

**URL:** <https://root-forum.cern.ch/t/get-the-function-between-ion-velocity-and-electric-field/48276>\
**Category:** Garfield++\
**Created:** [January 6, 2022, 9:12am UTC](https://root-forum.cern.ch/t/get-the-function-between-ion-velocity-and-electric-field/48276 "2022-01-06T09:12:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![changjh12](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/cc9497/32.png) [@changjh12](https://root-forum.cern.ch/u/changjh12)\
**Post date:** [January 6, 2022, 9:12am UTC](https://root-forum.cern.ch/t/get-the-function-between-ion-velocity-and-electric-field/48276/1 "2022-01-06T09:12:53Z")

</div>

Hello ,I want to get the **function between ion velocity and electric field**.

According to the user guide , the **gas table** must be calculated first.  
Then use `PlotIonVelocity()` in the `View Medium` class.  
In this way, the ion velocity data is obtained.

But it takes too long to calculate the gas table. Is there any other simpler method?

thank you!

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [January 6, 2022, 9:13am UTC](https://root-forum.cern.ch/t/get-the-function-between-ion-velocity-and-electric-field/48276/2 "2022-01-06T09:13:25Z")

</div>

I guess @hschindl can help.

---

<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:** [January 6, 2022, 10:43am UTC](https://root-forum.cern.ch/t/get-the-function-between-ion-velocity-and-electric-field/48276/3 "2022-01-06T10:43:56Z")

</div>

Hi,  
you don’t need to generate a full gas table to get the ion velocity. In fact, Magboltz calculates only the electron transport properties not the ion ones.

To load a table of ion mobilities and plot the ion velocity, you can do something like this

```auto
MediumMagboltz gas;
const std::string path = std::getenv("GARFIELD_INSTALL");
gas.LoadIonMobility(path + "/share/Garfield/Data/IonMobility_Ar+_Ar.txt");
ViewMedium view;
view.SetMedium(&gas);
view.PlotIonVelocity('e');

```

see also [this example](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/Examples/GasFile/read.C)

---

<div class="post-metadata">

**Author:** ![changjh12](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/cc9497/32.png) [@changjh12](https://root-forum.cern.ch/u/changjh12)\
**Post date:** [January 6, 2022, 2:20pm UTC](https://root-forum.cern.ch/t/get-the-function-between-ion-velocity-and-electric-field/48276/4 "2022-01-06T14:20:16Z")

</div>

ohhhh , I get it, thank you!  
It’s easy!

---

<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:** [January 20, 2022, 2:20pm UTC](https://root-forum.cern.ch/t/get-the-function-between-ion-velocity-and-electric-field/48276/5 "2022-01-20T14:20:41Z")

</div>

Closed on January 20, 2022, 2:20pm UTC

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