asmd7879
10-19-2007, 03:09 AM
Hi ..:)
It's my first post on this forum.
I have to write a programs which i have to add code to calculate /interpolate the loss density from the flux density.
Can anyone help me...
These are the sample of Pseudocode of my program (as below):
# Find the modulus flux density
Bmod = sqrt(Bx*Bx + By*By)
# Find the angle of the field in the element with respect to the x-axis
FieldAngle = atan(By/Bx)
# Find the angle of the field in the element with respect to the rolling direction
Angle = mod(FieldAngle - RollingAngle)
if ( Angle > 90 ) Angle = 180 - Angle
# Find the loss density according to the particular case
if ( 0 =< Angle < 22.5 ) then
if ( Bmod =< 1 ) then
LossLower = Case_0_Loss(0) * Bmod
LossUpper = Case_22.5_Loss(0) * Bmod
endif
if ( 1 < Bmod =< 1.7 ) then
LossLower = interpolate( Bmod, Case_0_Loss )
LossUpper = interpolate( Bmod, Case_22.5_Loss )
endif
if ( 1.7 < Bmod ) then
LossLower = extrapolate( Bmod, Case_0_Loss )
LossUpper = extrapolate( Bmod, Case_22.5_Loss )
endif
# Now interpolate the loss for the actual angle from the Lower and Upper bounds
ElementLossDensity = ( (Angle - 0)*LossUpper + (22.5 - Angle)*LossLower ) / 22.5
endif
if ( 22.5 =< Angle < 45 ) then
if ( Bmod =< 1 ) then
LossLower = Case_22.5_Loss(0) * Bmod
LossUpper = Case_45_Loss(0) * Bmod
endif
if ( 1 < Bmod =< 1.7 ) then
LossLower = interpolate( Bmod, Case_22.5_Loss )
LossUpper = interpolate( Bmod, Case_45_Loss )
endif
if ( 1.7 < Bmod ) then
LossLower = extrapolate( Bmod, Case_22.5_Loss )
LossUpper = extrapolate( Bmod, Case_45_Loss )
endif
# Now interpolate the loss for the actual angle from the Lower and Upper bounds
ElementLossDensity = ( (Angle - 22.5)*LossUpper + (45 - Angle)*LossLower ) / 22.5
endif
if ( 45 =< Angle < 67.5 ) then
if ( Bmod =< 1 ) then
LossLower = Case_45_Loss(0) * Bmod
LossUpper = Case_67.5_Loss(0) * Bmod
endif
if ( 1 < Bmod =< 1.7 ) then
LossLower = interpolate( Bmod, Case_45_Loss )
LossUpper = interpolate( Bmod, Case_67.5_Loss )
endif
if ( 1.7 < Bmod ) then
LossLower = extrapolate( Bmod, Case_45_Loss )
LossUpper = extrapolate( Bmod, Case_67.5_Loss )
endif
# Now interpolate the loss for the actual angle from the Lower and Upper bounds
ElementLossDensity = ( (Angle - 45)*LossUpper + (67.5 - Angle)*LossLower ) / 22.5
endif
if ( 67.5 =< Angle =< 90 ) then
if ( Bmod =< 1 ) then
LossLower = Case_67.5_Loss(0) * Bmod
LossUpper = Case_90_Loss(0) * Bmod
endif
if ( 1 < Bmod =< 1.7 ) then
LossLower = interpolate( Bmod, Case_67.5_Loss )
LossUpper = interpolate( Bmod, Case_90_Loss )
endif
if ( 1.7 < Bmod ) then
LossLower = extrapolate( Bmod, Case_67.5_Loss )
LossUpper = extrapolate( Bmod, Case_90_Loss )
endif
# Now interpolate the loss for the actual angle from the Lower and Upper bounds
ElementLossDensity = ( (Angle - 67.5)*LossUpper + (90 - Angle)*LossLower ) / 22.5
endif
It's my first post on this forum.
I have to write a programs which i have to add code to calculate /interpolate the loss density from the flux density.
Can anyone help me...
These are the sample of Pseudocode of my program (as below):
# Find the modulus flux density
Bmod = sqrt(Bx*Bx + By*By)
# Find the angle of the field in the element with respect to the x-axis
FieldAngle = atan(By/Bx)
# Find the angle of the field in the element with respect to the rolling direction
Angle = mod(FieldAngle - RollingAngle)
if ( Angle > 90 ) Angle = 180 - Angle
# Find the loss density according to the particular case
if ( 0 =< Angle < 22.5 ) then
if ( Bmod =< 1 ) then
LossLower = Case_0_Loss(0) * Bmod
LossUpper = Case_22.5_Loss(0) * Bmod
endif
if ( 1 < Bmod =< 1.7 ) then
LossLower = interpolate( Bmod, Case_0_Loss )
LossUpper = interpolate( Bmod, Case_22.5_Loss )
endif
if ( 1.7 < Bmod ) then
LossLower = extrapolate( Bmod, Case_0_Loss )
LossUpper = extrapolate( Bmod, Case_22.5_Loss )
endif
# Now interpolate the loss for the actual angle from the Lower and Upper bounds
ElementLossDensity = ( (Angle - 0)*LossUpper + (22.5 - Angle)*LossLower ) / 22.5
endif
if ( 22.5 =< Angle < 45 ) then
if ( Bmod =< 1 ) then
LossLower = Case_22.5_Loss(0) * Bmod
LossUpper = Case_45_Loss(0) * Bmod
endif
if ( 1 < Bmod =< 1.7 ) then
LossLower = interpolate( Bmod, Case_22.5_Loss )
LossUpper = interpolate( Bmod, Case_45_Loss )
endif
if ( 1.7 < Bmod ) then
LossLower = extrapolate( Bmod, Case_22.5_Loss )
LossUpper = extrapolate( Bmod, Case_45_Loss )
endif
# Now interpolate the loss for the actual angle from the Lower and Upper bounds
ElementLossDensity = ( (Angle - 22.5)*LossUpper + (45 - Angle)*LossLower ) / 22.5
endif
if ( 45 =< Angle < 67.5 ) then
if ( Bmod =< 1 ) then
LossLower = Case_45_Loss(0) * Bmod
LossUpper = Case_67.5_Loss(0) * Bmod
endif
if ( 1 < Bmod =< 1.7 ) then
LossLower = interpolate( Bmod, Case_45_Loss )
LossUpper = interpolate( Bmod, Case_67.5_Loss )
endif
if ( 1.7 < Bmod ) then
LossLower = extrapolate( Bmod, Case_45_Loss )
LossUpper = extrapolate( Bmod, Case_67.5_Loss )
endif
# Now interpolate the loss for the actual angle from the Lower and Upper bounds
ElementLossDensity = ( (Angle - 45)*LossUpper + (67.5 - Angle)*LossLower ) / 22.5
endif
if ( 67.5 =< Angle =< 90 ) then
if ( Bmod =< 1 ) then
LossLower = Case_67.5_Loss(0) * Bmod
LossUpper = Case_90_Loss(0) * Bmod
endif
if ( 1 < Bmod =< 1.7 ) then
LossLower = interpolate( Bmod, Case_67.5_Loss )
LossUpper = interpolate( Bmod, Case_90_Loss )
endif
if ( 1.7 < Bmod ) then
LossLower = extrapolate( Bmod, Case_67.5_Loss )
LossUpper = extrapolate( Bmod, Case_90_Loss )
endif
# Now interpolate the loss for the actual angle from the Lower and Upper bounds
ElementLossDensity = ( (Angle - 67.5)*LossUpper + (90 - Angle)*LossLower ) / 22.5
endif