# What is the meaning of gradient type?

**URL:** <https://simpeg.discourse.group/t/what-is-the-meaning-of-gradient-type/115>\
**Category:** Potential Fields\
**Created:** [June 9, 2020, 2:56am UTC](https://simpeg.discourse.group/t/what-is-the-meaning-of-gradient-type/115 "2020-06-09T02:56:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhongmin](https://avatars.discourse-cdn.com/v4/letter/z/74df32/32.png) [@zhongmin](https://simpeg.discourse.group/u/zhongmin)\
**Post date:** [June 9, 2020, 2:56am UTC](https://simpeg.discourse.group/t/what-is-the-meaning-of-gradient-type/115/1 "2020-06-09T02:56:25Z")

</div>

hi,all  
Simpeg is a very powerful tools for geophysics inversion  
and I learnd some examples.  
I had a question on the gradient type when I use the regularization in the inversion problem.

the default value of gradienttype is “components” and in some case is “total” like:

[https://docs.simpeg.xyz/content/examples/20-published/plot\_laguna\_del\_maule\_inversion.html?highlight=gradienttype](https://docs.simpeg.xyz/content/examples/20-published/plot_laguna_del_maule_inversion.html?highlight=gradienttype)

what is the difference of the two options ? and why the default value is " components"

Thank you!

---

<div class="post-metadata">

**Author:** ![domfournier](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@domfournier](https://simpeg.discourse.group/u/domfournier)\
**Post date:** [June 17, 2020, 3:37pm UTC](https://simpeg.discourse.group/t/what-is-the-meaning-of-gradient-type/115/2 "2020-06-17T15:37:08Z")

</div>

Hi @zhongmin ,

Very sorry for the late reply.  
So the component type refers to how the model gradients are calculated during the IRLS.  
The mode “component” applies weights on the usual Cartesian components independently such that the model norm can be written as:

```
`\phi_x = \sum_i (D_x m)_i^2 / ( (D_x m)_i^2 + \epsilon)^(1-p/2)`

```

and so on for the gradients along y and z. (Sorry for the ugly math here, doesn’t look like it gets latex)  
As p-\>0, the inversion will try to recover “blocky” models with sharp edges lined up with the grid. Unfortunately, nature really never looks that way. So we added the option to apply gradients weights based on the “total” gradient.

```
`\phi_x = \sum_i (D_x m)_i^2 / ( (D_x m)_i^2 + (D_y m)_i^2 + (D_z m)_i^2 + \epsilon)^(1-p/2)`

```

such that the IRLS weights take into account the gradients in all directions.  
This will yield sphere-like compact bodies. Having rounded edges is more practical to approximate folded geology, so usually more desirable to work with.

---

<div class="post-metadata">

**Author:** ![zhongmin](https://avatars.discourse-cdn.com/v4/letter/z/74df32/32.png) [@zhongmin](https://simpeg.discourse.group/u/zhongmin)\
**Post date:** [June 18, 2020, 8:41am UTC](https://simpeg.discourse.group/t/what-is-the-meaning-of-gradient-type/115/3 "2020-06-18T08:41:59Z")

</div>

It’s all clear,Thank you !  
by the way,I am doing some work on self potential data (SP)  
I found the self potential package [SimPEG.EM.Static.Problem\_CC\_Jstore] under Simpeg could not work on Tree mesh,  
does this small flaw will fix in the new version ?  
I am expacting that !

---

<div class="post-metadata">

**Author:** ![domfournier](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@domfournier](https://simpeg.discourse.group/u/domfournier)\
**Post date:** [June 19, 2020, 2:35pm UTC](https://simpeg.discourse.group/t/what-is-the-meaning-of-gradient-type/115/4 "2020-06-19T14:35:06Z")

</div>

I have not tried, hopefully …
