User:©TriMoon™/Sandbox

Separation of: Code-Data
See this thread for my suggestion. />For example-use using &lt;inputbox&gt;&lt;/inputbox&gt;, see the data page.
 * Code templates intended to be protected from regular editors.
 * /Code/xxx are meant to set Variables using Template-arguments.
 * User:©TriMoon™/Code/Locodata
 * User:©TriMoon™/Code/Wagondata
 * /Code/Info/xxx are meant to generate visual output using Template-arguments.
 * User:©TriMoon™/Code/Info/Locodata
 * User:©TriMoon™/Code/Info/Wagondata
 * User:©TriMoon™/Code/Info/Calculated
 * /Code/xxx/Info are meant to be called using subst: or safesubst: to set Template-arguments for /Code/Info/xxx using Variables.
 * User:©TriMoon™/Code/Locodata/Info
 * User:©TriMoon™/Code/Wagondata/Info
 * User:©TriMoon™/Code/CalculatedInfo
 * /Code/preload-xxx are meant to be used as the preload-page for aided-creation of new pages under /Data/xxx<br
 * User:©TriMoon™/Data/preload-loco
 * User:©TriMoon™/Data/preload-wagon
 * Data templates intended to be adjusted by trusted editors.
 * /Data/Loco/xxx are meant to set Variables for individual Locomotives using /Code/Locodata
 * /Data/Wagon/xxx are meant to set Variables for individual using /Code/Wagondata
 * User:©TriMoon™/Presentation
 * User:©TriMoon™/Presentation/Info/Locodata
 * User:©TriMoon™/Presentation/Info/Wagondata
 * User:©TriMoon™/Presentation/Info/Calculated

Examples
User:©TriMoon™/Sandbox/test1|1 User:©TriMoon™/Sandbox/test2|2 User:©TriMoon™/Sandbox/test3|3 User:©TriMoon™/Sandbox/test4|4

MathML test
$$ {\color{lime}f(\mbox{Part}\#_2^\infty)\to} $$

Gain Per Train

 * Category:Destinations_(Cargo)
 * Category:Destinations_(Non-Cargo)
 * Sub-formula definitions:



 Base yield for destination as shown in table: $$ Y_\text{dest} = Y_\text{base} [ \dots,\dots,\dots ] $$

 Wagon bonus multiplier percentage: $$ \begin{align} W_\text{bm} &= f ( W_\text{amount}, W_\text{bonus} ) \\ &= 100 + ( W_\text{amount} \times W_\text{bonus} ) \end{align} $$

 Loco bonus multiplier percentage: $$ \begin{align} L_\text{bm} &= f ( L_\text{type}, W_\text{type} ) \\ &= 100 + \begin{cases} \\ 40 &\mbox{IF}~L_\text{type} = \mbox{Diesel loco AND}~W_\text{type} = \mbox{cargo wagon} \\ 100 &\mbox{IF}~L_\text{type} = \mbox{Electric loco AND}~W_\text{type} = \mbox{non-cargo wagon} \\ 0 & \mbox{Otherwise} \\ \end{cases} \end{align} $$

 Yield Per Train: $$ \begin{align} Y_\text{pt} &= f ( \text{dest}, L_\text{type} , W_\text{type} ) \\ &= \frac{ Y_\text{base} [ \text{dest} ] \times L_\text{bm} ( L_\text{type}, W_\text{type} ) }{100} \\ &\equiv \frac{ \\ Y_\text{base} [ \text{dest} ] \times \left ( 100 + \begin{cases} \\ 40 &\mbox{IF}~L_\text{type} = \mbox{Diesel loco AND}~W_\text{type} = \mbox{cargo wagon} \\ 100 &\mbox{IF}~L_\text{type} = \mbox{Electric loco AND}~W_\text{type} = \mbox{non-cargo wagon} \\ 0 & \mbox{Otherwise} \\ \end{cases} \right ) \\ }{100} \\ \end{align} $$

 Gain Per Train: $$ \begin{align} G_\text{pt} &= f ( \text{dest}, L_{type} , W_{type} , W_\text{amount} , W_{bonus_x} ) \\ &= Y_\text{pt} \times \frac{ W_\text{bm} }{100} \\ &= \frac{ Y_\text{base} [ \text{dest} ] \times L_\text{bm} ( L_\text{type}, W_\text{type} ) }{100} \times \frac{ W_\text{bm} }{100} \\ &\equiv \frac{ Y_\text{base} [ \text{dest} ] \times L_\text{bm} ( L_\text{type}, W_\text{type} ) \times W_\text{bm} }{100 \times 100} \\ \end{align} $$

 Result formula: $$ \begin{align} {}_\text{Diesel-cargo}G_\text{pt}&\equiv \frac{ Y_\text{base} [ \text{dest} ] \times 140 \times W_\text{bm} }{10000} \\ {}_\text{Electric-non-cargo}G_\text{pt}&\equiv \frac{ Y_\text{base} [ \text{dest} ] \times 200 \times W_\text{bm} }{10000} \\ {}_\text{Other}G_\text{pt}&\equiv \frac{ Y_\text{base} [ \text{dest} ] \times 100 \times W_\text{bm} }{10000} \\ \end{align} $$