Hallo, I need to make a solar module with NGSPICE and Python. First I made a solarcell model in NGSPICE, and with netlisting it must be possible now to put solarcells in series or parallel.

But the problem is the nodes...I need to make the nodes variable, and to connect them to each other.

The nodes I used in my example are: (in, p1 and out)

Rshunt in p1 10
Icurrent p1 in 3
D in p1 dmod
Rseries p1 out 1.e-3

But I can't use it like that when I need more solar cells in series. I was thinking of making a global variable: global node = n000;

The first '0' will be for solar cell string number, second '0' will be for solar cell number inside a string, and the last '0' will be for numbering the nodes.
With this it would be possible to make a module as large as I want.

But I really don't have a clue how to let it work.

Can someone give me a clue how to solve this? I am new to NGSPICE and Python, and struggling alot.

Kind regards,

Willem