# Defining variable constraint or load

**URL:** <https://www.simscale.com/forum/t/defining-variable-constraint-or-load/22617>\
**Category:** Solid Mechanics / FEA\
**Created:** [May 12, 2016, 5:02pm UTC](https://www.simscale.com/forum/t/defining-variable-constraint-or-load/22617 "2016-05-12T17:02:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmedhussain18](https://www.simscale.com/forum/user_avatar/www.simscale.com/ahmedhussain18/32/140_2.png) [@ahmedhussain18](https://www.simscale.com/forum/u/ahmedhussain18)\
**Post date:** [May 12, 2016, 5:02pm UTC](https://www.simscale.com/forum/t/defining-variable-constraint-or-load/22617/1 "2016-05-12T17:02:24Z")

</div>

Defining the constraint boundary conditions like linear motion, rotation etc. and load boundary conditions like pressure, force etc. varying with respect to either time,x,y, or z co-ordinates can be done either by using table upload or defining formula. Variation with respect to multiple entities can only be done using formula. Both cases are discussed step by step below:

## Table upload

An example below shows how to define a varying pressure over time via table upload.

1. Create a _.csv_ file having time and pressure values in first, second and third column separated by a delimiter _(compatible: comma, semicolon, tab, space)_ respectively. An example below shows a _.csv_ file data separated with comma delimited.

2. Using any nonlinear static or dynamic analysis case ( **static analysis - advanced** in current case), create a new pressure boundary condition and click table upload button ( ![defining varying pressure over time via table upload, table upload button](https://www.simscale.com/forum/uploads/default/original/2X/a/a49cba58067874288301083f90b61c3383131f7a.png "Table upload button")) then click upload file ( ![](https://www.simscale.com/forum/uploads/default/original/2X/f/f2d0848a2c017929abf8dfd3c5b5a3203a68803e.png)). A **Upload CSV file** window will pop up as shown in the figure below. Click **Choose file** and select your file. Give it a name (optional). Select **Separator** (_Comma_ in our case). Next click **Upload file**.

3. Click ![simulation uploaded data](https://www.simscale.com/forum/uploads/default/original/2X/1/16dec8349eb0ed946f77b394b270d9b397ce0f7c.png "Show' button") button to see the uploaded data whose column should look well separated as shown in the figure below (if both column values are not separated than it means that the selected **Separator** (delimiter) wasn’t right at the time of upload e.g. using _Semicolon_ as separator for file having column separated with _Comma_).

4. Once the file is uploaded, you will return to boundary condition panel with the uploaded file as shown in the figure below.

- Highlighted in red are the columns for independent and dependent quantities (time and pressure in current case respectively). This is set to _1_ and _2_ respectively since our file contain time and pressure values in first and second column respectively and we are considering pressure values of first column.

- Highlighted in green is the **Interpolation** criteria which is set to _linear_ means the data will be interpolated linearly. One can also choose _logarithmic_ or _none_ if required.

- Highlighted in blue is the **Left-sided Extrapolation** criteria which is set to _constant_. In current case it will not have any effect but if the first starting time is set to other than _0_, it would mean that any value of pressure below that time will remain constant based on the first pressure value.

- Highlighted in orange is the **Right-sided Extrapolation** criteria which is also set to _constant_. In current case it would mean that any value of pressure for time values above _2_ seconds will remain constant following the last value i.e. _0.5 MPa_.

That’s it! your time dependent pressure is now defined. You can perform the same procedure if you want to define variation of your **Force** , **Fixed Value** etc. based on either of the available quantities i.e. ![](https://www.simscale.com/forum/uploads/default/original/2X/9/9067f31150f5f791ef35bcf21599b1bb85f6f002.png)

_Example project can be seen [here](https://www.simscale.com/projects/ahmedhussain18/pressure_relief_valve_-_stress_analysis_1)._

## Formula

You can also define a constraint or load boundary condition change over time, x, y, z co-ordinate by clicking formula button ( ![define constraint or load boundary condition by clicking formula button](https://www.simscale.com/forum/uploads/default/original/2X/6/6eeb6bdfe790d322c65da104e72173e2cf8ea965.png "Formula button")). Figure below shows varying displacement over time.

Formula below will displace the selected entity i.e. face, volume etc. in positive x-direction by _0.02_ meters for _t\<1_.

 ![](https://www.simscale.com/forum/uploads/default/original/2X/9/985d9f4f8bc3a090d4a2a63a83bd4ce25889867a.png)

Formula below will displace the selected entity i.e. face, volume etc. in negative x-direction by _0.01_ meters for _t\>1_.

 ![constraint boundary conditions definition formula](https://www.simscale.com/forum/uploads/default/original/2X/c/ccd9eeec10193f22379ba9eec81e0aa8d1843678.png "This formula will displace the selected entity in negative x-direction by 0.01 meters for t>1")

P.S.: The displacements above are defined via two separate constraints.

_Example project can be seen [here](https://www.simscale.com/projects/ahmedhussain18/rubber_bellow_analysis/)._

---

<div class="post-metadata">

**Author:** ![cjquijano](https://www.simscale.com/forum/user_avatar/www.simscale.com/cjquijano/32/24358_2.png) [@cjquijano](https://www.simscale.com/forum/u/cjquijano)\
**Post date:** [May 12, 2016, 8:47pm UTC](https://www.simscale.com/forum/t/defining-variable-constraint-or-load/22617/2 "2016-05-12T20:47:24Z")

</div>

Hi @ahmedhussain18,

Can you tell me if the x, y, z coordinates are absolute values or delta values? Say for example, I want to apply a force to the end of a beam. Once the beam deflects more than 3mm then I would change the force. Is that how it works?

Thanks,  
Christopher

---

<div class="post-metadata">

**Author:** ![ahmedhussain18](https://www.simscale.com/forum/user_avatar/www.simscale.com/ahmedhussain18/32/140_2.png) [@ahmedhussain18](https://www.simscale.com/forum/u/ahmedhussain18)\
**Post date:** [May 13, 2016, 8:04am UTC](https://www.simscale.com/forum/t/defining-variable-constraint-or-load/22617/3 "2016-05-13T08:04:09Z")

</div>

Hey Christopher (@cjquijano)!

These are absolute values. So in order to change the force after _3 mm_, you have to define a new load after _3 mm_ deformation either in the same load boundary condition (same table or formula) or in another e.g. something like:

```
  x , F
0.003 , 100
0.006 ,-100

```

Hope this helps. If you have any question/s, feel free to ask.

Best,

- Ahmed
