As you can see below, i’m trying to make a function. But how can I avoid that the unit in the result is duplicated? I would like it to just calculate the result with one unit (GJ/t)
Hi,
no it should not be shown as you say. Note that m has no units. You have the value of 0.1 and you subtract it from 1, which has no units. that means the the second term of H_v does not have any units either, just as the (1-m) expression in the first term. The thinh his that the first term is multiplied by t, which does have units. That means that your equation is inconsistent and should not simplify as you say.
It would also be useful if you typed in the equations instead of using a screenshot.
pille = Quantity[19.0, "Gigajoules"/"MetricTons"];
Subscript[Hnew, v][m_, t_] := t*(1 - m) - Quantity[2.442, "Gigajoules"/"MetricTons"] * m
Subscript[Hnew, v][0.1, pille]
gives the result that you expect.
Cheers,
Marco
Thanks Marco, it makes sence.

