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

Add file I/V sources #254

Closed
ra3xdh opened this issue Apr 3, 2023 · 6 comments
Closed

Add file I/V sources #254

ra3xdh opened this issue Apr 3, 2023 · 6 comments
Assignees
Milestone

Comments

@ra3xdh
Copy link
Owner

ra3xdh commented Apr 3, 2023

Ngspice supports file-based current and voltage sources via XSPICE device type "filesource". It's need to add a GUI entry for this device. The ifile.cpp and vfile.cpp should be modified to generate SPICE netlist.

@cmat21
Copy link

cmat21 commented Apr 5, 2023

Hello, I am waiting for the availability of the sources of V&I based on files. Is there another way to simulate the file-based V&I source? Will this new feature be inside V1.0.2?

@ra3xdh
Copy link
Owner Author

ra3xdh commented Apr 6, 2023

The file-based sources are not SPICE core devices, but XSPICE devices. These sources require ports definition and modelcard. You cannot define such type using the red voltage source. Please wait an update. I am planning to prepare v.1.0.2 release in 1-2 months and the next release will include file-based sources.

@ra3xdh ra3xdh added this to the 1.0.2 milestone Apr 6, 2023
ra3xdh added a commit that referenced this issue Apr 18, 2023
@ra3xdh
Copy link
Owner Author

ra3xdh commented Apr 18, 2023

I have just added the file voltage and current sources. The difference from the old implementation is that Ngspice doesn't support the cubic interpolation and waveform repeat. Here is an example schematic using these sources.
image

@ra3xdh
Copy link
Owner Author

ra3xdh commented Apr 18, 2023

The data file should contain the space separated values. The first column is time and the second column is current/voltage. Here is an example of the DAT file contents.

1e-3 1.0
2e-3 1.3
3e-3 1.8
4e-3 1.5
5e-3 1.6
6e-3 1.4
7e-3 1.2
8e-3 1.15
9e-3 1.0
10e-3 1.05

@ra3xdh ra3xdh self-assigned this Apr 18, 2023
@cmat21
Copy link

cmat21 commented Apr 18, 2023

Great work @ra3xdh, thank you for taking the project forward!

@ra3xdh
Copy link
Owner Author

ra3xdh commented Apr 18, 2023

Closing this ticket as completed. The file sources will be available since v1.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants