Skip to content

Commit

Permalink
update graph_q_oss graph in WP
Browse files Browse the repository at this point in the history
  • Loading branch information
gituser789 committed Jun 3, 2024
1 parent 8cc69fd commit dbf68c7
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions transistordatabase/transistor.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,15 @@ def update_wp(self, t_j: float, v_g: float, i_channel: float, switch_or_diode: s
self.wp.switch_v_channel, self.wp.switch_r_channel = \
self.calc_lin_channel(self.wp.switch_channel.t_j, self.wp.switch_channel.v_g, i_channel, switch_or_diode="switch")

# working point, fill e_oss
if self.graph_v_ecoss is None:
self.wp.graph_v_eoss = self.calc_v_eoss
else:
self.wp.graph_v_eoss = self.calc_v_eoss()

# working pint, calculate q_oss
self.wp.graph_v_qoss = self.calc_v_qoss()

def init_loss_matrices(self):
"""Experimental."""
self.init_switch_channel_matrix()
Expand Down Expand Up @@ -437,11 +446,11 @@ def init_switch_channel_matrix(self):
v_channel_interpolated = np.interp(i_channel_linspace, channel_object.graph_v_i[1],
channel_object.graph_v_i[0])

print(f"{channel_object.t_j = }")
print(f"{t_j_max = }")
print(f"{t_j_min = }")
print(f"{v_channel_max = }")
print(f"{i_channel_max = }")
print(f"{channel_object.t_j=}")
print(f"{t_j_max=}")
print(f"{t_j_min=}")
print(f"{v_channel_max=}")
print(f"{i_channel_max=}")

def quickstart_wp(self) -> None:
"""
Expand Down Expand Up @@ -688,7 +697,7 @@ def calc_real_on_off_loss(self, e_on: SwitchEnergyData, e_off: SwitchEnergyData,

eoss_v, eoss_e = self.calc_v_eoss()
e_oss_v_op = np.interp(v_op, eoss_v, eoss_e)
print(f"{e_oss_v_op = }")
print(f"{e_oss_v_op=}")

e_on_corrected.graph_i_e[1] = e_on_corrected.graph_i_e[1] + e_oss_v_op
e_off_corrected.graph_i_e[1] = e_off_corrected.graph_i_e[1] - e_oss_v_op
Expand Down Expand Up @@ -2093,8 +2102,8 @@ class WP:
e_off: npt.NDArray[np.float64] | None #: Units: Row 1: A; Row 2: J
e_rr: npt.NDArray[np.float64] | None #: Units: Row 1: A; Row 2: J
v_switching_ref: float | None #: Unit: V
e_oss: npt.NDArray[np.float64] | None #: Units: Row 1: V; Row 2: J
q_oss: npt.NDArray[np.float64] | None #: Units: Row 1: V; Row 2: C
graph_v_eoss: npt.NDArray[np.float64] | None #: Units: Row 1: V; Row 2: J
graph_v_qoss: npt.NDArray[np.float64] | None #: Units: Row 1: V; Row 2: C
parallel_transistors: float | None #: Unit: Number

def __init__(self):
Expand All @@ -2108,8 +2117,8 @@ def __init__(self):
self.e_off = None
self.e_rr = None
self.v_switching_ref = None
self.e_oss = None
self.q_oss = None
self.graph_v_eoss = None
self.graph_v_qoss = None
self.parallel_transistors = None

def validate_transistor(self) -> Dict:
Expand Down

0 comments on commit dbf68c7

Please sign in to comment.