01-25-2016 09:46 AM
How do I specify in Diadem that I want to work with a vector unit, not a scalar unit, when doing quantity based calculation.
Specifically, when calculating engine power, the equation is "power = engine speed * torque". With quantity based calculation, this works fine and produces Watts. But, if I try "torque = power / engine speed", I get Joules (which is scalar Nm), since it seems Diadem assumes scalar quantities. Is there any way to get Nm the vector quantity instead?
01-25-2016 02:34 PM
I think I need to clarify a little. It does appear that the Power = Speed * Torque and Torque = Power / Speed works. I thought that would be easier to explain, but I guess I should be specific... Anyway, Mean Effective Pressure is (work/cycle)/Displacement. So MEP (bar) = 0.1257 * [Torque(Nm)/displacement(Liter)]. I can calculate MEP by dividing torque by displacement, but if I multiply MEP by displacement, I get Joules. Anyway to get Nm with the calculator.
I have a very large calculation function that takes in a table of calculations with a target unit. If I put desired unit of Nm into the calculate function when the result is J, I get an error, even though they are the same value.
01-26-2016 07:19 PM
Hi RussellSenior,
I'm still not clear on exactly what is going on. Can you provide some screen shots?
01-27-2016 05:58 AM
So, I must have changed something... The other day, when I ran this script, and asked for the second desired unit to be in Nm, I got an error saying Diadem cannot convert J to Nm. But, now it's doing it no problem...
Option Explicit 'Forces the explicit declaration of all the variables in a script.
Dim MyValues(2), MySymbol(2), MyUnit(2), DesiredUnit, MyFormula, CQB
CQB=CalcQuantityBased
CalcQuantityBased=true
Set MyValues(0) = CreateValueWithUnit(360,"ft-lb")
Set MyValues(1) = CreateValueWithUnit(5,"l")
Set MyValues(2) = CreateValueWithUnit(Null,"")
MySymbol(0)="Torque"
MySymbol(1)="Displacement"
MySymbol(2)="MEP"
MyFormula="MEP = Torque / Displacement"
DesiredUnit="bar"
Call Calculate(MyFormula,MySymbol,MyValues,DesiredUnit)
MsgBox("Result: " & Round(MyValues(2).Value,2) & " " & MyValues(2).UnitSymbol)
DesiredUnit="default"
'DesiredUnit="Nm"
MyFormula="Torque = MEP * Displacement"
Call Calculate(MyFormula,MySymbol,MyValues,DesiredUnit)
MsgBox("Result: " & Round(MyValues(0).Value,0) & " " & MyValues(0).UnitSymbol)
CalcQuantityBased = CQB
01-27-2016 10:43 AM
Interesting... Well, if the problem surfaces again, don't hesitate to post.