functionlinspace_2Dedge
Create a linearly spaced 2D matrix from the linear interpolation of 4 edge values
Extends from TRANSFORM.Icons.Function (Icon for functions).
Information
For example:
For x1=0, x2=10, x3=-5, x4 = 5, n1=5, and n2=3.
The returned matrix is y[5,3]
-2.5 |
0 |
2.5 |
-5 |
1.25 |
5 |
-5 |
2.5 |
5 |
-5 |
3.75 |
5 |
2.5 |
10 |
7.5 |
Notice that the center edge values are consistent with the specified input. The corner vlaues are linear interpolations of the adjacent values.
The exposeState options either hold the edge value (=true) or ignore the edge value (=false) and apply linear interpolation appropriately. This capability was made to assist with initialization of discritized models.
With the same input as above but with exposeState={true,false,true,false} the result is:
0 |
0 |
2.5 |
-1.25 |
1.5625 |
5 |
0 |
2.5 |
5 |
1.25 |
3.4375 |
5 |
2.5 |
5 |
5 |
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | x1 | Edge value x[1,:] | |
| Real | x2 | Edge value x[end,:] | |
| Real | x3 | Edge value x[:,1] | |
| Real | x4 | Edge value x[:,end] | |
| Integer | n1 | Number of rows | |
| Integer | n2 | Number of columns | |
| Boolean[4] | exposeState | {true, true, true, true} | = true then set edge to value specified else linspace_1D |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[n1,n2] | y | 2-D matrix |