Getting value of TIME STEP while leaving out its unit
Posted: Tue Nov 29, 2022 2:59 pm
Hello all,
I have a small request to which I have unfortunately not yet found a solution.
There are cases in which dividing or multiplying by the TIME STEP is helpful in assigning a time unit to a variable and thereby avoiding unit errors.
Example: I want to determine total cost of all annual public transport subscriptions. The annual subscriptions could be given in persons/year and costs per subscription in dollars/person/year. Total cost of all subscriptions would then be determined by subscriptions*subscription cost. To assign a time unit to the total cost of all subscriptions I multiply by the TIME STEP. That leads to subscriptions*subscription cost*TIME STEP.
However, if TIME STEP is not 1, actual cost of all subscriptions would be changed. Therefore, I again divide by the absolute value of the TIME STEP: subscriptions*subscription cost*TIME STEP/(1/32) (if TIME STEP = 1/32).
My question is whether there is a more elegant solution to this. In most cased, TIME STEP is probably not changed. So it shouldn’t be a problem having “1/32” as a fixed value in the equation. However, is there a way of getting the absolute value of the TIME STEP and leaving out its unit? With TIME STEP/TIME STEP time reference would be shortened directly.
I'm really looking forward to your responses!
Best wishes,
Marvin
I have a small request to which I have unfortunately not yet found a solution.
There are cases in which dividing or multiplying by the TIME STEP is helpful in assigning a time unit to a variable and thereby avoiding unit errors.
Example: I want to determine total cost of all annual public transport subscriptions. The annual subscriptions could be given in persons/year and costs per subscription in dollars/person/year. Total cost of all subscriptions would then be determined by subscriptions*subscription cost. To assign a time unit to the total cost of all subscriptions I multiply by the TIME STEP. That leads to subscriptions*subscription cost*TIME STEP.
However, if TIME STEP is not 1, actual cost of all subscriptions would be changed. Therefore, I again divide by the absolute value of the TIME STEP: subscriptions*subscription cost*TIME STEP/(1/32) (if TIME STEP = 1/32).
My question is whether there is a more elegant solution to this. In most cased, TIME STEP is probably not changed. So it shouldn’t be a problem having “1/32” as a fixed value in the equation. However, is there a way of getting the absolute value of the TIME STEP and leaving out its unit? With TIME STEP/TIME STEP time reference would be shortened directly.
I'm really looking forward to your responses!
Best wishes,
Marvin