public override void SetCalculatedInfo() { int _posNet = SystemGrid.MainGrid[PinPos].Net; int _NegNet = SystemGrid.MainGrid[PinNeg].Net; double vP = _posNet > 0 ? SystemGrid.solutionMatrix[_posNet - 1] : 0; double vN = _NegNet > 0 ? SystemGrid.solutionMatrix[_NegNet - 1] : 0; VoltageAccross = vP - vN; Console.WriteLine("Voltage: " + VoltageAccross.ToString()); }
public override void UpdateValues() { VoltageAccross += (CurrentThrough / PrimaryValue) * SystemGrid.TimeSpace; Console.WriteLine("Voltage: " + VoltageAccross.ToString()); Console.WriteLine("Current " + CurrentThrough.ToString()); }
/// <summary> /// Each component provides additional information /// </summary> /// <returns>a string of their calculated vales</returns> public virtual string GetCalculatedInfo() { return(VoltageAccross.ToString() + " " + CurrentThrough.ToString()); }