:orphan:
# MatFDColoringSetParameters
Sets the parameters for the sparse approximation of a Jacobian matrix using finite differences. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatFDColoringSetParameters(MatFDColoring matfd, PetscReal error, PetscReal umin)
```
Logically Collective


## Input Parameters

- ***matfd -*** the coloring context
- ***error -*** relative error
- ***umin -*** minimum allowable u-value magnitude





## Note
The Jacobian is estimated with the differencing approximation
```none
       F'(u)_{:,i} = [F(u+h*dx_{i}) - F(u)]/h where
       htype = 'ds':
         h = error_rel*u[i]                 if  abs(u[i]) > umin
           = +/- error_rel*umin             otherwise, with +/- determined by the sign of u[i]
         dx_{i} = (0, ... 1, .... 0)

       htype = 'wp':
         h = error_rel * sqrt(1 + ||u||)
```



## See Also
 `Mat`, `MatFDColoring`, `MatFDColoringCreate()`, `MatFDColoringSetFromOptions()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/matfd/fdmatrix.c.html#MatFDColoringSetParameters">src/mat/matfd/fdmatrix.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/matfd/fdmatrix.c)


[Index of all MatFD routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
