Tabacof
unread,Feb 21, 2012, 6:31:24 PM2/21/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pycircuit
Greetings
I'm trying to simulate two solar cells in series (each solar cell can
be modelled as a current source in series with a resistance and in
parallel with a diode) that receive different irradiation (meaning
their current sources will have different values). My circuit is as
follows:
n1 = cir.add_node('net1')
#First solar cell
cir['is1'] = IS(gnd, 1, i = 3)
cir['diode1'] = Diode(1, gnd)
cir['r1'] = R(1, 2, r=0.012)
#Second solar cell
cir['is2'] = IS(2, 3, i = 3.8)
cir['diode2'] = Diode(3, 2)
cir['r2'] = R(3, n1, r=0.012)
#Load
cir['volt2'] = VS(n1, gnd, v = 1)
dc = DC(cir)
res = dc.solve()
When I run the code above, I get this:
WARNING:root:Problems encoutered: Singular matrix
WARNING:root:Problems encoutered: No convergence. xerror = [ 0.0000e
+00 2.5843e-02 2.5843e-02
4.2633e-17 0.0000e+00]
WARNING:root:Problems encoutered: Singular matrix
Traceback (most recent call last):
File "rc.py", line 25, in <module>
res = dc.solve()
File "c:\Python25\project\pycircuit\circuit\dcanalysis.py", line 76,
in solve
raise last_e
pycircuit.circuit.analysis.SingularMatrix: Singular matrix
Just to make it clear, if I simulate using the same current it will
work just fine, so I don't think the circuit itself is wrong. I
understand it is unusual to put two current sources with different
currents in series, but that's how it's done in solar cell modelling.
PSpice doesn't have a problem with that, for example.
Any help would be much appreciated!
Pedro Tabacof.