User functions or step-cost functions are powerful ways to model complex cost structures within your supply chain, whether they be variable or fixed in nature. Within Supply Chain Architect, all cost Functions (both variable and fixed) are specified in the UserFunctions Tables.
Simple Variable and Fixed Cost Functions:
UserFunctions
UserFunction - Name of the function - User Defined- does not have to be named Variable/Fixed
Reference Variable:
Flow - Function will be evaluated based on unit-flow
Weight - Function will be evaluated based on Flow*Product Weight (Products Table)
Cube - Function will be evaluated based on Flow*Product Cube (Products Table)
Other - Function will be evaluated based on Flow*OtherUOM (Products Table)
Note** Weight/Cube/Other values are only valid when attached to tables with product as part of the definition (eg. IntersiteLanes, CustomerLanes, SiteProducts
Inventory - Function will be calculated based on inventory in multiperiod models (only applicable on InventoryCostModel column in SiteProducts Table)
UserFunctionSteps
Attaching Variable Cost Function in InterSiteLanes Table:
Attaching Fixed Cost Function in Sites Table:
In the above tables we've created 2 simple cost functions. The first is a variable cost function that we plan to use in our IntersiteLanes Table. The second is a fixed cost function that we plan to use in our Sites Table.
Example Explanation:
Variable Function:
Since this is attached to the InterSiteLanes table in the RateCostModel column, the function will be used to evaluate the rate used for this particular origin-destination-product-mode combination. The ReferenceVariable column from our UserFunctions Tables is "weight". So this means that if the total amount of volume flowed on this lane is between 0 and 1000 pounds the rate for this like will be $3.20. If the total amount of weight flowed was greater than 1000 and less than or equal to 10000, then the rate will be $2.50. If the total weight flowed was over 10,000 then the rate will be $0.90.
Please note that the rate is applied for all flow for this lane. eg. if the weight on this lane is 1001, all 1001 are evaluated at a cost of $2.50. The first 1000 are not evaluated at the higher cost of the previous step.
Fixed Function
Since this is attached to the RateCostModel of the Sites Table, and the ReferenceVariable is set to Flow - it means that the fixed cost for this site will be evaluated based on the total unit-flow happening for this site. If the unit flow is less than or equal to 100,000 units, the fixed cost will be evaluated at $500,000. If the Unit-flow is more than 100,000 units, then the fixed cost is evaluated at $10,000,000.
Fixed cost functions need to have an increasing cost at every step. Eg. the Value column needs to be greater for step 2 than step 1. This applies only to fixed cost functions. Violating this rule may not cause infeasibility in models, but may result in unexpected model behavior.
Function Tips:
Variable Cost Functions - Are applied over the entire population. That is - if you make it to a next tier of a step- the new cost is applied over the entire
User functions are not inherently variable or fixed by nature. The usage depends on where you use the function in other modeling tables. All Fixed-Cost function usages are used in tables where the column name "FixedCostModel" can be found. All other usages of cost models are Variable cost models. The "FixedCostModel" column can be found in the following tables:
Important Note*** - It is recommended for the final step of any function to be left null in the StepEnd column of the UserFunctionSteps table (in UserFunctions Tables). If the final step end is not left null it effectively acts as a maximum flow constraint for where this function is applied.




