# Amplitude function error

**URL:** <https://calculix.discourse.group/t/amplitude-function-error/1708>\
**Category:** Uncategorized\
**Created:** [June 15, 2023, 2:16pm UTC](https://calculix.discourse.group/t/amplitude-function-error/1708 "2023-06-15T14:16:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![daxiangxiang](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@daxiangxiang](https://calculix.discourse.group/u/daxiangxiang)\
**Post date:** [June 15, 2023, 2:16pm UTC](https://calculix.discourse.group/t/amplitude-function-error/1708/1 "2023-06-15T14:16:58Z")

</div>

Hi，  
I was using calculix, precice, openfoam to implement fluid-structure coupling and was having strange problems running calculix, so I tried to run calculix’s inp file separately and the inp file looked like this:

```auto
*INCLUDE, INPUT=all.msh
*INCLUDE, INPUT=fix1.nam
*INCLUDE, INPUT=surface.nam

*MATERIAL, Name=EL
*ELASTIC
5.6000E+6, 0.4
*DENSITY
 1000
*SOLID SECTION, Elset=Eall, Material=EL
*STEP, INC=1000000
*DYNAMIC, ALPHA=0.0, DIRECT
0.0005, 0.5

*BOUNDARY
Nfix1, 1, 3

**------The "MyTimeFunction-sin-fun.txt" file is a sin function and the "mynewamplitude-line-fun.txt" file is a linear function.
**------File "MyTimeFunction-sin-fun.txt" runs incorrectly, and file "mynewamplitude-line-fun.txt" runs successfully.

*AMPLITUDE,NAME=MyAmplitude
*INCLUDE, INPUT="MyTimeFunction-sin-fun.txt"
**INCLUDE, INPUT="mynewamplitude-line-fun.txt"
**0,0,0.36,0.05

*BOUNDARY,AMPLITUDE=MyAmplitude
Nfix1, 2, 2 ,1

*CLOAD
 Nsurface, 1, 0.0
 Nsurface, 2, 0.0
 Nsurface, 3, 0.0
	
*NODE FILE
 U
*EL FILE
 S, E
*END STEP

```

**The diagram below is a schematic of my simulation model**

 ![0000](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/3/32092fbfdfbbf3d4465d0e1c9f8e9e95e71b9792.jpeg)

**The question is this:**  
Give the fix1 node set a **sin function** displacement amplitude, the plate produces a chaotic motion:

 ![error1](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/a/ac13d8c7ab797159e4b58c59671038d2f76933cc.jpeg)

Given the fix1 node set **linear function** displacement amplitude, the plate moves normally:

 ![linear-correct](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/9/992b19aebccc8b4f0500607f0540916fd8c4f4f7.jpeg)

I used the **same inp fil** e and changed **only** these three lines of code,but the results varied widely.What is the reason for this?

```auto
*AMPLITUDE,NAME=MyAmplitude
*INCLUDE, INPUT="MyTimeFunction-sin-fun.txt"
**INCLUDE, INPUT="mynewamplitude-line-fun.txt"

```

**MyTimeFunction-sin-fun.txt** file looks like this：

```auto
0,0
0.0005,0.000125
0.001,0.000249999
0.0015,0.000374996
0.002,0.000499992
0.0025,0.624985
0.003,0.000749972
0.0035,0.000874955
0.004,0.000999933
0.0045,0.001124905
0.005,0.00124987
......

```

**mynewamplitude-line-fun.txt** file looks like this：

```auto
0,0
0.0005,6.94E-05
0.001,0.000138889
0.0015,2.08E-04
0.002,0.000277778
0.0025,3.47E-04
0.003,0.000416667
0.0035,4.86E-04
0.004,0.000555556
0.0045,0.000625
0.005,6.94E-04
0.0055,0.000763889
0.006,8.33E-04
......

```

The simulation files are stored here:  
[https://drive.google.com/drive/folders/1PQcixcik2-4xOIXbKCXKt1DsvhPx0TwI?usp=sharing](https://drive.google.com/drive/folders/1PQcixcik2-4xOIXbKCXKt1DsvhPx0TwI?usp=sharing)  
Any help is appreciated!  
xiangxiang

---

<div class="post-metadata">

**Author:** ![daxiangxiang](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@daxiangxiang](https://calculix.discourse.group/u/daxiangxiang)\
**Post date:** [June 15, 2023, 2:23pm UTC](https://calculix.discourse.group/t/amplitude-function-error/1708/2 "2023-06-15T14:23:01Z")

</div>

The running results of the two functions (sin and linear) are stored here, which is the result file of steps 0-100  
**Very strange results** :  
[[linear-fun.avi - Google Drive](https://drive.google.com/file/d/11u6fqta-90jj5LYcmORQolXFR8VKG-XS/view?usp=sharing), [sin-fun.avi - Google Drive](https://drive.google.com/file/d/19R6n-hIrtUsvJKWvXnO_FZ5U4osSmiED/view?usp=sharing)]

---

<div class="post-metadata">

**Author:** ![daxiangxiang](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@daxiangxiang](https://calculix.discourse.group/u/daxiangxiang)\
**Post date:** [June 15, 2023, 2:27pm UTC](https://calculix.discourse.group/t/amplitude-function-error/1708/3 "2023-06-15T14:27:58Z")

</div>

Different attempts:

I tried to modify the time step and elastic modulus, which did not seem to be the cause of the problem, because I only modified the \*AMPLITUDE function.

---

<div class="post-metadata">

**Author:** ![fgr](https://avatars.discourse-cdn.com/v4/letter/f/f4b2a3/32.png) [@fgr](https://calculix.discourse.group/u/fgr)\
**Post date:** [June 15, 2023, 6:57pm UTC](https://calculix.discourse.group/t/amplitude-function-error/1708/4 "2023-06-15T18:57:38Z")

</div>

@daxiangxiang  
Your sine function has some weird errors, look below, I believe if you correct these values the sine function will run comparable to your line function.

```auto
0,0
0.0005,0.000125
0.001,0.000249999
0.0015,0.000374996
0.002,0.000499992
0.0025,0.624985 <<<<<< value doesn't belong to the sine function
0.003,0.000749972
0.0035,0.000874955
0.004,0.000999933
0.0045,0.001124905
0.005,0.00124987
0.0055,0.001374827
0.006,0.001499775
0.0065,0.001624714
0.007,0.001749643
0.0075,0.001874561
0.008,0.001999467
0.0085,0.212437 <<<<<< value doesn't belong to the sine function
0.009,0.002249241

```

---

<div class="post-metadata">

**Author:** ![daxiangxiang](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@daxiangxiang](https://calculix.discourse.group/u/daxiangxiang)\
**Post date:** [June 16, 2023, 2:17am UTC](https://calculix.discourse.group/t/amplitude-function-error/1708/5 "2023-06-16T02:17:51Z")

</div>

Thank you, Sir. I will carefully examine the cause of the problem. Have a good weekend.
