Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math equation/functions syntax used for making Libraries #345

Closed
tomhajjar opened this issue Oct 30, 2023 · 3 comments
Closed

Math equation/functions syntax used for making Libraries #345

tomhajjar opened this issue Oct 30, 2023 · 3 comments
Labels

Comments

@tomhajjar
Copy link

I'm having "syntax" issues making library models containing Equations and mathematical functions used to generate circuit parameters based on User inputs.

It seems Qucs-S wants "Qucs syntax" for making the Library models yet ngspice requires Nutmeg syntax for analysis. In the past we discussed that Qucs and ngspice coincidently share some of the same function names allowing some legacy Qucs Equations in older Qucs schematics to work in Qucs-S instead of converting to Nutmeg Equations. I need to know what syntax to use for Library versus Analysis.

For example, Ideal_LPF1_model.sch has a Qucs equation that works when the model is used in Ideal_LPF1_lib_test.sch. When I try to test the schematic of the library device in Ideal_LPF1_model_test.sch, the equation fails.

In the case of library device Ideal_LPF2_model.sch used in Ideal_LPF2_lib_test.sch, none of the formulas I tried worked. The schematic Ideal_LPF2_model_test.sch doesn't work as well.

Ideal_Library_ngspice_prj.zip

@ra3xdh
Copy link
Owner

ra3xdh commented Oct 30, 2023

Nutmeg equations are evaluated only after the simulation. SPICE has such division. Nutmeg equation has no effect inside subcircuits and libraries, because libraries and subcircuits evaluated before the simulation. You have to use .PARAM section instead if you need access to full set of SPICE syntax. This device is located in SPICE specific section group.

@tomhajjar
Copy link
Author

This is resolved.

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 1, 2023

Closing as resolved.

@ra3xdh ra3xdh closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants