using System; namespace Science.Physics.GeneralPhysics { /// /// CircuitRLC /// public class CircuitRLC { private Resistance r; private Inductance l; private Capacitance c; public CircuitRLC() { } public CircuitRLC(Resistance R, Inductance L, Capacitance C) { r = R; l = L; c = C; } public double Impedance(Frequency f) { return Math.Sqrt(r.Ohm*r.Ohm +(l.Reactance(f)-c.Reactance(f)) *(l.Reactance(f)-c.Reactance(f))); } public double PhaseAngle(Frequency f) { return Math.Atan((l.Reactance(f)-c.Reactance(f))/r.Ohm); } public double PowerFactor(Frequency f) { return Math.Cos(PhaseAngle(f)); } public double Charge(ElectricCharge Qmax, Time t) { double od = Math.Sqrt(1.0/l.H/c.F - r.Ohm*r.Ohm/4.0/l.H/l.H); return Qmax.C*Math.Exp(-r.Ohm*t.s/2.0/l.H)*Math.Cos(od*t.s); } } }