JoeyDelp / JoSIM

Superconductor Circuit Simulator
MIT License
73 stars 33 forks source link

Usage of custom wave source #66

Closed ToM-ynu closed 2 years ago

ToM-ynu commented 2 years ago

I am having trouble using custom waveforms in v2.6 josim, please let me check if I am using it correctly.

Net list

R0    1    2   100
C0    2    0   100p
V0    1    0   cus(CUS.TXT 10p 1V 0)

.tran 0.1p 1000ps

.file out.csv
.print v(V0)
.print v(C0)
.print v(R0)

CUS.TXT

3 0 1 2 3 4 5 4 3 2 1 0 0 -1 -2 -3

I confirmed that it was working in v2.4. Was there a change in syntax?

Using josim has made my simulations 10x faster than jsim. thanks for making josim.

JoeyDelp commented 2 years ago

Hi,

I found some issues with the custom waveform function. There was some changes to the functions going from 2.4 to 2.5 and now 2.6 which seem to have affected the custom waveform but I did not pick up on.

I fixed the issues and it should work now for all interpolation methods. Attached is the output of the custom waveform in your example. Please have a look and see if the version under testing branch solves the issues you have. If they do I will pull this as a fix into the master branch.

Best regards, Joey cus_test

ToM-ynu commented 2 years ago

We built the source code in the testing branch and verified that the cus power supply is working properly. Thank you so much for your quick response.

In our environment, due to the effect of capillarizing the netlist, we are not able to specify the file correctly. By Placing the CUS.TXT in the path written in all capitals solved the problem. Since this is not a functional problem, could you please change it to prevent capillarization of file names when you have time?

JoeyDelp commented 2 years ago

Good morning,

I have pushed another fix to the testing branch that should check both CUS.TXT (as created by JoSIM internally due to the toupper function) and if it does not find this will look for the lowercase cus.txt.

Please note that this prevents any form of CaMeL cAsE file names. The txt file needs to be either fully lower case or fully upper case.

Let me know if this works.

Best regards, Joey

ToM-ynu commented 2 years ago

Hello.

I confirmed it is works! Thank you very much for your help.