> For the complete documentation index, see [llms.txt](https://tlcfem.gitbook.io/suanpan-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tlcfem.gitbook.io/suanpan-manual/material/material1d/viscosity/customviscosity.md).

# CustomViscosity

Viscous Material Using Custom Model

Reference:

1. [10.1016/j.ymssp.2021.108795](https://doi.org/10.1016/j.ymssp.2021.108795)

## Syntax

```
material CustomViscosity (1) (2)
# (1) int, unique material tag
# (2) int, expression tag
```

## Remarks

The expression needed takes strain and strain rate as the inputs and returns the damping coefficient and its derivatives as the outputs.

The input size shall be 2 and the output size shall be 3.

## Example

Imaging to model the linear viscous material such that

$$
\sigma=1234\dot{\epsilon},
$$

One can define the expression as

```
expression SimpleVector 1 x|2 y|3 y[0]:=1234*x[1];y[1]:=0;y[2]:=1234;
```

The strain maps to `x[0]` and the strain rate maps to `x[1]`.

The stress output maps to `y[0]` and its derivatives regarding strain and strain rate maps to `y[1]` and `y[2]` respectively.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://tlcfem.gitbook.io/suanpan-manual/material/material1d/viscosity/customviscosity.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
