Title: Free text input, Heat Source: How to express a complex function whose amplitude varies with a square wave.
My heat source free text input for example is:
Heat Source = variable coordinate 1, coordinate 2, coordinate 3, time
MATC "(100) * (tx(2)) * ((1-tx(3))/10000) * (123*tx(1)) * (1.5 + wv1(t))"
wv1(t) is a square wave function with respect to time. How can I add that in to the above equation? ElmerGUI manual says I can make a peicewise like this: https://imgur.com/a/47ZWTk3. Still I don't know.
For referencing, my square wave will have these properties:
T = 10.43254 sec
t_high = .044859922 sec
outputting
[1] during 0 to .044859922 sec
[0] during .044859922 to 10.43254 sec
[1] during 10.43254 to 10.47739992 sec
[0] during 10.47739992 to 20.86508 sec
If you know how I can parameterize this
0 to t_high
t_high to T
T to T+t_high
T+t_high to T*2
Thank you!
Free text input, Heat Source: How to express a complex function whose amplitude varies with a square wave.
-
- Posts: 57
- Joined: 14 Mar 2021, 21:01
- Antispam: Yes
-
- Posts: 2237
- Joined: 25 Jan 2019, 01:28
- Antispam: Yes
Re: Free text input, Heat Source: How to express a complex function whose amplitude varies with a square wave.
When the function gets that complex you should use a user defined function which allows you to program your own subroutine. However MATC does allow if statements.
https://www.nic.funet.fi/pub/sci/physic ... torial.pdf
Chapter 1
https://www.nic.funet.fi/pub/sci/physic ... torial.pdf
Chapter 1
-
- Site Admin
- Posts: 4812
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: Free text input, Heat Source: How to express a complex function whose amplitude varies with a square wave.
Hi
You can use a table if you have just a few irregular steps as in your case, for example
If you would have regular square waves then use of "sign" function would make sense.
-Peter
You can use a table if you have just a few irregular steps as in your case, for example
Code: Select all
Heat Source = Variable "time"
Real
0.0 1
1.0 1
1.001 0
2.0 0
2.001 1
4.0 1
4.001 0
7.0 0
...
End
-Peter
-
- Posts: 57
- Joined: 14 Mar 2021, 21:01
- Antispam: Yes
Re: Free text input, Heat Source: How to express a complex function whose amplitude varies with a square wave.
Ah thank you so much Peter.
And I may use those procedures some day. Thank you kevinarden.
And I may use those procedures some day. Thank you kevinarden.
-
- Posts: 57
- Joined: 14 Mar 2021, 21:01
- Antispam: Yes
Re: Free text input, Heat Source: How to express a complex function whose amplitude varies with a square wave.
Peter!
Will including "variable coordinate 1" and referring to it by "tx(1)" still work within the table?
Thank you...
Will including "variable coordinate 1" and referring to it by "tx(1)" still work within the table?
Thank you...
-
- Site Admin
- Posts: 4812
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: Free text input, Heat Source: How to express a complex function whose amplitude varies with a square wave.
No, just one variable for table. If you need a distribution at the same time use rather a small fortran function. -Peter