# Coulomb and Viscous Friction

Model discontinuity at zero, with linear gain elsewhere

• Library:

HDL Coder / Discontinuities

• ## Description

The Coulomb and Viscous Friction block models Coulomb (static) and viscous (dynamic) friction. The block models a discontinuity at zero and a linear gain otherwise.

The block output matches the MATLAB® result for:

`y = sign(x) .* (Gain .* abs(x) + Offset)`

where `y` is the output, `x` is the input, `Gain` is the signal gain for nonzero input values, and `Offset` is the Coulomb friction.

The block accepts one input and generates one output. The input can be a scalar, vector, or matrix with real and complex elements.

• For a scalar input, `Gain` and `Offset` can have dimensions that differ from the input. The output is a scalar, vector, or matrix depending on the dimensions of `Gain` and `Offset`.

• For a vector or matrix input, `Gain` and `Offset` must be scalar or have the same dimensions as the input. The output is a vector or matrix of the same dimensions as the input.

## Ports

### Input

expand all

The input signal to the model of Coulomb and viscous friction.

Data Types: `single` | `double` | `int8` | `int16` | `int32` | `int64` | `uint8` | `uint16` | `uint32` | `uint64` | `fixed point`

### Output

expand all

The output signal calculated by applying the friction models to the input.

Data Types: `single` | `double` | `int8` | `int16` | `int32` | `int64` | `uint8` | `uint16` | `uint32` | `uint64` | `fixed point`

## Parameters

expand all

To edit the parameters for the Coulomb and Viscous Friction block, double-click the block icon.

Specify the offset that applies to all input values.

#### Programmatic Use

 Block Parameter: `offset` Type: character vector Value: real values Default: ```'[1 3 2 0]'```

Specify the signal gain for nonzero input values.

#### Programmatic Use

 Block Parameter: `gain` Type: character vector Value: real values Default: `'1'`

## Block Characteristics

 Data Types `double` | `fixed point` | `integer` | `single` Direct Feedthrough `no` Multidimensional Signals `no` Variable-Size Signals `no` Zero-Crossing Detection `no`
{"ft_lang_label":"__label__en","ft_lang_prob":0.6821583,"math_prob":0.907788,"size":1070,"snap":"2021-43-2021-49","text_gpt3_token_len":257,"char_repetition_ratio":0.12851782,"word_repetition_ratio":0.056818184,"special_character_ratio":0.20560747,"punctuation_ratio":0.110552765,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9767398,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-19T17:51:03Z\",\"WARC-Record-ID\":\"<urn:uuid:90b0e788-c9d5-4669-8f71-98bdfeaa1798>\",\"Content-Length\":\"83209\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:dc42665c-6605-4ac1-901f-f0f53be7d890>\",\"WARC-Concurrent-To\":\"<urn:uuid:25806822-9d7f-4d67-ab17-8cb390b5e08a>\",\"WARC-IP-Address\":\"23.13.150.165\",\"WARC-Target-URI\":\"https://la.mathworks.com/help/simulink/slref/coulombandviscousfriction.html\",\"WARC-Payload-Digest\":\"sha1:VPMNEKFFE446MEXNQFTPLMFF7UZRAUKB\",\"WARC-Block-Digest\":\"sha1:HTOGOO64TOLDTEVM6AWK43LPXZBW7YA7\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323585280.84_warc_CC-MAIN-20211019171139-20211019201139-00276.warc.gz\"}"}