Qucs / qucsator

Circuit simulator of the Qucs project
http://qucs.sourceforge.net
GNU General Public License v2.0
24 stars 12 forks source link

S-parameter file causes simulation error #42

Open zodoczi opened 8 months ago

zodoczi commented 8 months ago

Hi,

I'm playing with this RF switch, where quite hopeless what should be wrong with my simulation as many different switches was working before. I copy the simulation error log also attach the S parameter file here. In a text editor I was not finding any strange things however sure there is something not usual here. Thats sure that the S parameter file was made with a real desktop VNA.

`Errors and Warnings:

line 23: no trailing end-of-line found, continuing... line 23: syntax error, unexpected Float, expecting $end checker error, found 6 options checker error, option hz' occurred 2x checker error, options' occurred 2x checker error, option ri' occurred 2x checker error, optionhz' occurred 2x checker error, option s' occurred 2x checker error, optionri' occurred 2x D_PE42540_SOLDERED_25C_3.300V_3.300V_0.000V_RF1_S5P_SN22_A.s5p.zip `

Thank you very much!

zodoczi commented 8 months ago

Okay, looks like AWR S data repair tool magically solved this :) Now my simluation runs smoothly with the repaired S-parameter! https://awrcorp.com/download/kb.aspx?file=/Questions/SdataConversion.zip

D_PE42540_SOLDERED_25C_3.300V_3.300V_0.000V_RF1_S5P_SN22_A_mwo.s5p.zip

zodoczi commented 8 months ago

BTW any idea while de original S parameter file was failing?

Here is the repair process, some issues shown about negative character used as delimiter

image

Thanks

felix-salfelder commented 8 months ago

On Fri, Mar 01, 2024 at 05:31:56AM -0800, Zoltan Doczi wrote:

BTW any idea while de original S parameter file was failing?

Could you provide a netlist.txt please?

thanks

zodoczi commented 8 months ago

On Fri, Mar 01, 2024 at 05:31:56AM -0800, Zoltan Doczi wrote: BTW any idea while de original S parameter file was failing? Could you provide a netlist.txt please? thanks

Attaching the whole simulation, and the working (D_PE42540_SOLDERED_25C_3.300V_3.300V_0.000V_RF1_S5P_SN22_A_mwo.s5p) and the problematic (D_PE42540_SOLDERED_25C_3.300V_3.300V_0.000V_RF1_S5P_SN22_A.s5p) parameters.

Now the upper s parameter box (with the ports attached) is the corrected s parameter file (_mwo ending) the lower box contains the original but bogus s parameter file. Once you disable the lower box the simulation will run without any problem.

Thank you sparameter_freeze.zip

felix-salfelder commented 8 months ago

On Sat, Mar 02, 2024 at 12:59:56AM -0800, Zoltan Doczi wrote:

On Fri, Mar 01, 2024 at 05:31:56AM -0800, Zoltan Doczi wrote: BTW any idea while de original S parameter file was failing? Could you provide a netlist.txt please? thanks

sparameter_freeze.zip

There is no netlist.txt in the archive (?).

zodoczi commented 8 months ago

Sorry, new to Qucs have no idea how to export the netlist. I've just built up the simulation in the GUI interface, thanks

felix-salfelder commented 8 months ago

On Sat, Mar 02, 2024 at 01:56:39AM -0800, Zoltan Doczi wrote:

Sorry, new to Qucs have no idea how to export the netlist. I've just built up the simulation in the GUI interface, thanks

Its in ~/.qucs/netlist.txt, after the simulation attempt.

thanks

zodoczi commented 8 months ago

Ouch, sorry for the confusion but I see nothing like that in my folder :( I'm using it in Windows 10, should I try it under my Ubuntu pc?

zodoczi commented 8 months ago

okay found it, on windows its stored in a completely different folder, under users, find attached netlist.zip Thanks

felix-salfelder commented 8 months ago

On Sat, Mar 02, 2024 at 03:37:28AM -0800, Zoltan Doczi wrote:

okay found it, on windows its stored in a completely different folder, under users, find attached netlist.zip

Okay, I can reproduce this.

Qucsator SPFile has a limit on the number of characters or numbers in each line. the _mwo version has more line breaks...

I'm working on successor/substitute for qucsator once in a while. May I use your netlist as a test case?

(will move this issue to qucsator.)

Best wishes felix

zodoczi commented 8 months ago

Sure please go ahead and use this to solve the case! Thanks

What I see in the MWO fixer tool is only this bug: "Negative character used as a delimiter in file; fixed"

felix-salfelder commented 8 months ago

On Sat, Mar 02, 2024 at 06:31:58AM -0800, Zoltan Doczi wrote:

Sure please go ahead and use this to solve the case! Thanks

What I see in the MWO fixer tool is only this bug: "Negative character used as a delimiter in file; fixed"

Perhaps MWO does not consider long lines a problem, but only dumps short lines as a measure of precaution. Or to be compliant with some touchstone spec...

The qucs touchstone reader uses lex/yacc, and the grammar seems to limit the number of Float tokens per line. Rookie mistake, either in the spec, or in the implementation.

Anyway, I won't use lex or yacc, and this is going to be a non-issue.

felix-salfelder commented 8 months ago

gnucsator now has an SPFile component that works with your original s5p (same numerical result as qucsator, but following a different approach).

Thanks for your example and test case. That's the kind of stuff I need...

(Curiously qucsator/SPfile transposes the S param matrix if there are only two ports. I wonder if this is intentional.)