# How to invert resistivity or to conductivity

**URL:** https://simpeg.discourse.group/t/how-to-invert-resistivity-or-to-conductivity/32
**Category:** Electromagnetics
**Created:** [January 15, 2020, 3:33pm UTC](https://simpeg.discourse.group/t/how-to-invert-resistivity-or-to-conductivity/32 "2020-01-15T15:33:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jcbarreto](https://yyz2.discourse-cdn.com/free1/user_avatar/simpeg.discourse.group/jcbarreto/32/108_2.png) [@jcbarreto](https://simpeg.discourse.group/u/jcbarreto)
#### Post date: [January 15, 2020, 3:33pm UTC](https://simpeg.discourse.group/t/how-to-invert-resistivity-or-to-conductivity/32/1 "2020-01-15T15:33:48Z")

</div>

Hello I would like to know where I have to change in the code for inverting to resistivity/conductivity

---

<div class="post-metadata">

### Author: ![thibaut.astic](https://yyz2.discourse-cdn.com/free1/user_avatar/simpeg.discourse.group/thibaut.astic/32/109_2.png) [@thibaut.astic](https://simpeg.discourse.group/u/thibaut.astic)
#### Post date: [January 16, 2020, 12:40am UTC](https://simpeg.discourse.group/t/how-to-invert-resistivity-or-to-conductivity/32/2 "2020-01-16T00:40:17Z")

</div>

Hi jcbarreto,

Most examples we provide actually invert for Log-Conductivity. You can identify that by looking at the `Problem` object. if it is created with a `sigmaMap`, it will invert for conductivity. And we usually give it a `Maps.ExpMap` to invert for the Log. For example the following is how we specify the model to be `Log-Conductivity`:

```auto
from SimPEG import EM, Maps
mapping = Maps.ExpMap(mesh)
prb = EM.TDEM.Problem3D_b(mesh, sigmaMap=mapping)

```

I have actually never tried it myself but it seems you can switch to resistivity by setting a `rhoMap` instead. Like:

```auto
prb = EM.TDEM.Problem3D_b(mesh, rhoMap=mapping)

```

Another way would be to use a `ReciprocalMap` (which is what happens under the hood I think).

```auto
mapping = Maps.ReciprocalMap(mesh)

```

I hope this helps.

---

<div class="post-metadata">

### Author: ![lheagy](https://yyz2.discourse-cdn.com/free1/user_avatar/simpeg.discourse.group/lheagy/32/6_2.png) [@lheagy](https://simpeg.discourse.group/u/lheagy)
#### Post date: [January 19, 2020, 5:37pm UTC](https://simpeg.discourse.group/t/how-to-invert-resistivity-or-to-conductivity/32/3 "2020-01-19T17:37:26Z")

</div>

Yep, thanks @thibaut.astic! One quick comment to also just be careful if you are using an `InjectActiveCells` Map in the inversion to make sure that the inactive cells are in units of Ohm-m if you provide a `rhoMap` to the simulation and in units of S/m if you are using a `sigmaMap`

---

<div class="post-metadata">

### Author: ![jcbarreto](https://yyz2.discourse-cdn.com/free1/user_avatar/simpeg.discourse.group/jcbarreto/32/108_2.png) [@jcbarreto](https://simpeg.discourse.group/u/jcbarreto)
#### Post date: [January 20, 2020, 12:12pm UTC](https://simpeg.discourse.group/t/how-to-invert-resistivity-or-to-conductivity/32/4 "2020-01-20T12:12:49Z")

</div>

Good Point! thanks for reminding me
