Efficiency computation with values of a 2D variation curve
Hi!
In general I want to calculate the motor efficiency in a transient magnetic flux simulation.
I have the output power and input power calculated in 2 different 2D curves:
F2D_TechTuto_BrushlessIPMMotor_overview.pdf -> Page 86 and before.
And I have found the information how to print the mean value of a 2D curve in the output area:
print (CurveVariation2D['OUTPUT_POWER'].y[0].meanValues
What I need is how to use the mean values of curves in a calculation:
Something like: CurveVariation2D['OUTPUT_POWER'].y[0].meanValues/CurveVariation2D['INPUT_POWER'].y[0].meanValues
I want to calculate the efficiency value and put it an I/O parameter or in a 2D curve to check it after postprocessing.
Thanks.
Best Answer
-
Hi,
I propose you to use the following python command (in Bold) in order to compute the efficiency.
Firstly you can store in a pyhton variable the output and input power with the following command:
Output_power=CurveVariation2D['OUTPUT_POWER'].y[0].meanValues[0]
Input_power=CurveVariation2D['INPUT_POWER'].y[0].meanValues[0]
After that create a python variable to store the efficiency:
Efficiency=Output_power/Input_power
Then you can then display the efficiency in the output area using the python command:
print 'Efficiency='+str(Efficiency)
The value obtained can be stored in a I/O parameter using the python command
VariationParameterFormula['EFFICIENCY'].formula=str(Efficiency)
Please note that in thise case the parameter efficicncy already exist so it will just updated its value if you want to create it with a refernce value of 0 you can use the command:
VariationParameterFormula(name='EFFICIENCY',
formula='0.0')I hope this helps.
Best regards.
Cyril Favre
1
Answers
-
Hi,
I propose you to use the following python command (in Bold) in order to compute the efficiency.
Firstly you can store in a pyhton variable the output and input power with the following command:
Output_power=CurveVariation2D['OUTPUT_POWER'].y[0].meanValues[0]
Input_power=CurveVariation2D['INPUT_POWER'].y[0].meanValues[0]
After that create a python variable to store the efficiency:
Efficiency=Output_power/Input_power
Then you can then display the efficiency in the output area using the python command:
print 'Efficiency='+str(Efficiency)
The value obtained can be stored in a I/O parameter using the python command
VariationParameterFormula['EFFICIENCY'].formula=str(Efficiency)
Please note that in thise case the parameter efficicncy already exist so it will just updated its value if you want to create it with a refernce value of 0 you can use the command:
VariationParameterFormula(name='EFFICIENCY',
formula='0.0')I hope this helps.
Best regards.
Cyril Favre
1 -
Hi,
Another way is to use a macro, Analyse2DCurve.PFM, which can be loaded in the Extensions/Macros in the Data Tree, and then run for any 2D curve to compute the integral, max, mean, min, rectified mean and RMS values. The values are saved as I/O parameters that can be used in calculations.
Best regards,
Alexandru
1 -
Cyril Favre_21925 said:
Hi,
I propose you to use the following python command (in Bold) in order to compute the efficiency.
Firstly you can store in a pyhton variable the output and input power with the following command:
Output_power=CurveVariation2D['OUTPUT_POWER'].y[0].meanValues[0]
Input_power=CurveVariation2D['INPUT_POWER'].y[0].meanValues[0]
After that create a python variable to store the efficiency:
Efficiency=Output_power/Input_power
Then you can then display the efficiency in the output area using the python command:
print 'Efficiency='+str(Efficiency)
The value obtained can be stored in a I/O parameter using the python command
VariationParameterFormula['EFFICIENCY'].formula=str(Efficiency)
Please note that in thise case the parameter efficicncy already exist so it will just updated its value if you want to create it with a refernce value of 0 you can use the command:
VariationParameterFormula(name='EFFICIENCY',
formula='0.0')I hope this helps.
Best regards.
Cyril Favre
Thank you very much. You were faster than light with your answer ;-)
0 -
Hi,
Another way is to use a macro, Analyse2DCurve.PFM, which can be loaded in the Extensions/Macros in the Data Tree, and then run for any 2D curve to compute the integral, max, mean, min, rectified mean and RMS values. The values are saved as I/O parameters that can be used in calculations.
Best regards,
Alexandru
Thank you very much. This is a great work around. If I analyze the python script I get also my solution.
0