adding tordoidal simulator and drawing
This commit is contained in:
@@ -57,6 +57,7 @@ class TransformerOptimizer:
|
||||
Vp_step: float = 0.5,
|
||||
B_max_T: float = 0.3,
|
||||
Vs_max: float = float('inf'),
|
||||
Is_max: float = float('inf'),
|
||||
core_loss_W: float = 0.0,
|
||||
power_tolerance_percent: float = 2.0,
|
||||
fallback_max_power: bool = True,
|
||||
@@ -71,6 +72,7 @@ class TransformerOptimizer:
|
||||
- Vp_min, Vp_max, Vp_step: Input voltage search range
|
||||
- B_max_T: Maximum allowed flux density (Tesla)
|
||||
- Vs_max: Maximum allowed secondary voltage (V)
|
||||
- Is_max: Maximum allowed secondary current (A)
|
||||
- core_loss_W: Core loss at this operating point
|
||||
- power_tolerance_percent: Acceptable power delivery error (%)
|
||||
- fallback_max_power: If True and target cannot be met, find max power with best efficiency
|
||||
@@ -115,6 +117,7 @@ class TransformerOptimizer:
|
||||
Vp_step=Vp_step,
|
||||
B_max_T=B_max_T,
|
||||
Vs_max=Vs_max,
|
||||
Is_max=Is_max,
|
||||
core_loss_W=core_loss_W,
|
||||
power_tolerance_percent=power_tolerance_percent,
|
||||
fallback_max_power=fallback_max_power,
|
||||
@@ -151,6 +154,7 @@ class TransformerOptimizer:
|
||||
Vp_step: float,
|
||||
B_max_T: float,
|
||||
Vs_max: float,
|
||||
Is_max: float,
|
||||
core_loss_W: float,
|
||||
power_tolerance_percent: float,
|
||||
fallback_max_power: bool,
|
||||
@@ -195,6 +199,9 @@ class TransformerOptimizer:
|
||||
if sim["Vs_rms"] > Vs_max:
|
||||
continue
|
||||
|
||||
if sim["Is_rms"] > Is_max:
|
||||
continue
|
||||
|
||||
power_error = abs(sim["P_out_W"] - target_power_W) / target_power_W * 100
|
||||
|
||||
result = OptimizationResult(
|
||||
|
||||
Reference in New Issue
Block a user