QUOTE(pearlloi @ Nov 24 2014, 06:27 PM)
no no no...what i meant was, the Tc value can only get from the equation.
http://i.pictr.com/twtj6ncxa5.pngThe T05 is the temperature of air in turbine.
After passed through Turbine the air tempeature will decreased into Tc
where Tc is the same as T6A. Thats why i code Tc = T6A which T6A never appear in the previous coding.
Besides, i also declared T6A as doubled
Sorry to confuse you guys
i got this thing stuck with my final year project
Tc = ((2 / (Ygas +1) * T05A)
until this point ur Tc is 1023.xxxx, so lets assume this value is "A"
Pc = some formula, so i presume now you Pc got some value
If (condition) then
Tc = T6 <<<<<value "A" is replaced by T6, presume value "B", so now Tc is "B"
Tc = T6A <<<<<value "B" in Tc is replaced by T6A, so now Tc have the value of "C".... so value of T6A is? if T6A is 0, then u get error 11
To break down what you have done:
Tc = some formula << not used AT ALL, coz being replaced after than by T6
Tc = T6 <<not used AT ALL, coz being replaced by T6A
Tc = T6A <<used only this. the formula below which gives you error 11 if T6A is 0 or null
no point you do so much calculation since u dont use the formula AT ALL!!
why waste so many lines of code when you dont use them?
if your purpose is to get 1023.xxxxx to D6, you should do it like this:
Tc = some formula
nn = textbox.text
Pc = some formula
if (condition) then
M6=1
Rgas = some formula
V6 = some formula
D6 = (Pc / Rgas * Tc) << there is no point assign P6 = Pc, straight put Pc here is more efficient and ignore T6 and T6A
.
.
.
This should make u get what u want...
And "where Tc is the same as T6A. Thats why i code Tc = T6A which T6A never appear in the previous coding." << this is why it is 0 or null, coz you never assign anything to it
declare a variable as double/int/or anything will not gives it a value.
This post has been edited by blackstar88: Nov 25 2014, 03:12 PM