Skip to content

Commit

Permalink
Fix Pac to match result from Ngspice and Qucsator
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3xdh committed Jun 23, 2024
1 parent 4929b41 commit 0045892
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qucs/components/source_ac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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") {
Expand Down

0 comments on commit 0045892

Please sign in to comment.