DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Scalar vs Vector units in quantity based calculation

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? 

0 Kudos
Message 1 of 5
(4,438 Views)

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. 

 

 

0 Kudos
Message 2 of 5
(4,425 Views)

Hi RussellSenior,

 

I'm still not clear on exactly what is going on. Can you provide some screen shots?

0 Kudos
Message 3 of 5
(4,397 Views)

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
0 Kudos
Message 4 of 5
(4,383 Views)

Interesting... Well, if the problem surfaces again, don't hesitate to post. 

0 Kudos
Message 5 of 5
(4,374 Views)