Exemplo n.º 1
0
        /// <summary>
        /// 根据给定的条件进行优化设计
        /// </summary>
        public override void Optimize(MainForm form, double progressMin, double progressMax)
        {
            double progress = progressMin;
            double dp       = (progressMax - progressMin) / Math_VbusRange.Length;

            foreach (double Vbus in Math_VbusRange) //母线电压变化
            {
                form.PrintDetails(3, "Now DC bus voltage = " + Vbus + ":");
                //前级DC/DC变换器设计
                form.PrintDetails(3, "-------------------------");
                form.PrintDetails(3, "Front-stage DC/DC converters design...");
                DCDC = new DCDCConverter()
                {
                    PhaseNum                = 1,
                    Math_Psys               = Math_Psys,
                    Math_Vin_min            = Math_Vpv_min,
                    Math_Vin_max            = Math_Vpv_max,
                    IsInputVoltageVariation = true,
                    Math_Vo        = Vbus,
                    NumberRange    = DCDC_numberRange,
                    TopologyRange  = DCDC_topologyRange,
                    FrequencyRange = DCDC_frequencyRange
                };
                DCDC.Optimize(form, progress, progress + dp * 0.2);
                progress += dp * 0.2;
                if (DCDC.AllDesignList.Size <= 0)
                {
                    progress += dp * 0.8;
                    form.Estimate_Result_ProgressBar_Set(progress);
                    continue;
                }
                double dp2 = (dp * 0.8) / Math_VinvRange.Length / IsolatedDCDC_secondaryRange.Length / IsolatedDCDC_numberRange.Length;
                foreach (double Vinv in Math_VinvRange) //逆变直流侧电压变化
                {
                    form.PrintDetails(3, "Now Inv DC voltage = " + Vinv + ":");
                    form.PrintDetails(3, "-------------------------");
                    foreach (int No in IsolatedDCDC_secondaryRange) //一拖N
                    {
                        foreach (int n in IsolatedDCDC_numberRange)
                        {
                            //逆变器设计
                            form.PrintDetails(3, "-------------------------");
                            form.PrintDetails(3, "Inverters design...");
                            DCAC = new DCACConverter()
                            {
                                PhaseNum        = 3,
                                Math_Psys       = Math_Psys,
                                Math_Vin        = Vinv,
                                Math_Vg         = Math_Vg,
                                Math_Vo         = Math_Vg / Math.Sqrt(3),
                                Math_fg         = Math_fg,
                                Math_Ma_min     = DCAC_Ma_min,
                                Math_Ma_max     = DCAC_Ma_max,
                                Math_φ          = DCAC_φ,
                                NumberRange     = new int[] { n *No },
                                TopologyRange   = DCAC_topologyRange,
                                ModulationRange = DCAC_modulationRange,
                                FrequencyRange  = DCAC_frequencyRange
                            };
                            DCAC.Optimize(form, progress, progress + dp2 * 0.3);
                            progress += dp2 * 0.3;
                            if (DCAC.AllDesignList.Size <= 0)
                            {
                                progress += dp2 * 0.7;
                                continue;
                            }

                            //隔离DC/DC变换器设计
                            form.PrintDetails(3, "-------------------------");
                            form.PrintDetails(3, "Isolated DC/DC converters design...");
                            IsolatedDCDC = new IsolatedDCDCConverter()
                            {
                                PhaseNum  = 3,
                                Math_Psys = Math_Psys,
                                Math_Vin  = Vbus,
                                IsInputVoltageVariation = false,
                                Math_Vo        = Vinv,
                                Math_No_Range  = new int[] { No },
                                NumberRange    = new int[] { n },
                                TopologyRange  = IsolatedDCDC_topologyRange,
                                FrequencyRange = IsolatedDCDC_frequencyRange,
                                Math_Q_Range   = IsolatedDCDC_Math_Q_Range,
                                Math_k_Range   = IsolatedDCDC_Math_k_Range
                            };
                            IsolatedDCDC.Optimize(form, progress, progress + dp2 * 0.3);
                            progress += dp2 * 0.3;
                            if (IsolatedDCDC.AllDesignList.Size <= 0)
                            {
                                progress += dp2 * 0.4;
                                continue;
                            }

                            //整合得到最终结果
                            form.PrintDetails(3, "-------------------------");
                            form.PrintDetails(3, "Iso num=" + n + ", Iso sec=" + No + ", DC bus voltage=" + Vbus + ", Combining...");
                            ConverterDesignList newDesignList = new ConverterDesignList();
                            newDesignList.Combine(DCDC.ParetoDesignList);
                            newDesignList.Combine(IsolatedDCDC.ParetoDesignList);
                            newDesignList.Combine(DCAC.ParetoDesignList);
                            newDesignList.Transfer(new string[] { Vbus.ToString(), DCAC.Math_Vin.ToString() });
                            ParetoDesignList.Merge(newDesignList); //记录Pareto最优设计
                            AllDesignList.Merge(newDesignList);    //记录所有设计
                            progress += dp2 * 0.4;
                            form.Estimate_Result_ProgressBar_Set(progress);
                        }
                        form.PrintDetails(3, "=========================");
                    }
                }
            }
        }