From 0045892d1255a48a722785686a67fbc2c5a27bc8 Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Sun, 23 Jun 2024 09:31:53 +0300 Subject: [PATCH] Fix Pac to match result from Ngspice and Qucsator --- qucs/components/source_ac.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qucs/components/source_ac.cpp b/qucs/components/source_ac.cpp index 995f7eeae..bdfbc2563 100644 --- a/qucs/components/source_ac.cpp +++ b/qucs/components/source_ac.cpp @@ -106,7 +106,7 @@ QString Source_ac::ngspice_netlist() double z0 = spicecompat::normalize_value(getProperty("Z")->Value).toDouble(); double p = spicecompat::normalize_value(getProperty("P")->Value).toDouble(); double vrms = sqrt(z0/1000.0)*pow(10, p/20.0); - double vamp = vrms*sqrt(2.0); + double vamp = 2.0*vrms*sqrt(2.0); QString f = spicecompat::normalize_value(getProperty("f")->Value); bool en_tran = true; @@ -140,7 +140,7 @@ QString Source_ac::xyce_netlist() QString s_p = spicecompat::normalize_value(getProperty("P")->Value); double p = s_p.toDouble(); double vrms = sqrt(z0/1000.0)*pow(10, p/20.0); - double vamp = vrms*sqrt(2.0); + double vamp = 2.0*vrms*sqrt(2.0); bool en_tran = true; if (getProperty("EnableTran")->Value == "true") {