Home > Community > Forums > PCB Design > New to Pspice

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 New to Pspice 

Last post Tue, Mar 12 2013 4:41 AM by sss123987. 4 replies.
Started by sss123987 12 Mar 2013 04:01 AM. Topic has 4 replies and 679 views
Page 1 of 1 (5 items)
Sort Posts:
  • Tue, Mar 12 2013 4:01 AM

    • sss123987
    • Not Ranked
    • Joined on Tue, Mar 12 2013
    • Posts 4
    • Points 35
    New to Pspice Reply

    Hey guys,

     Im an engineering student and i am using Spice to model a single solar cell, but i am having some problems with it, i was wondering if someone can help me make this work, my problem is that the plot at the output is just a flat line i dont know why, i cant figure out what i am doing wrong.

     

    Here is my code:

    **cell_2.cir

    .include cell_2.lib
    xcell2 0 31 32 cell_2 params:area=126.6 j0=1e-11 j02=1e-9  jsc=0.0343 rs={RS} rsh=10000
    .param RS=1
    vbias 31 0 dc 0
    virrad 32 0 dc 1000
    .plot dc i(vbias)
    .dc vbias -0.1 0.6 0.01
    .step param RS list 0.0001 0.001 0.01 0.1 1
    .probe
    .end

     

    and this is the subcircuit that i used

    ***** Cell_2.lib


    .subckt cell_2 300 303 302 params:area=1, j0=1, jsc=1, j02=0, rs=1, rsh=1

    girrad 300 301 value={(jsc/1000)*v(302)*area}
    d1 301 300 diode
    .model diode d(is={j0*area})
    **d2 301 300 diode2
    **.model diode2 d(is={j02*area},n=2)
    .ends cell_2

    Any help is appriciated.

     

    • Post Points: 20
  • Tue, Mar 12 2013 4:16 AM

    • oldmouldy
    • Top 10 Contributor
    • Joined on Tue, Jul 15 2008
    • Woking, Surrey
    • Posts 1,415
    • Points 24,170
    Re: New to Pspice Answer Reply
    Cell2 has an "rs" parameter passed to it but the subcircuit contains no actual usage of the parameter, hence changing the value has no effect and the output is constant. (That also applies to the "rsh" parameter)
    • Post Points: 50
  • Tue, Mar 12 2013 4:29 AM

    • sss123987
    • Not Ranked
    • Joined on Tue, Mar 12 2013
    • Posts 4
    • Points 35
    Re: New to Pspice Reply
    Hi thanks for the quick responce, i didnt actually write this code i am following a book this is the result that they say you get from this code, i have checked the code so many times its exacly the same as the code in the book, but for some reason i cant get this graph all i get is a straight line, do you have an idea on why this is the case

    here is the code directly from the book
    • Post Points: 5
  • Tue, Mar 12 2013 4:33 AM

    • sss123987
    • Not Ranked
    • Joined on Tue, Mar 12 2013
    • Posts 4
    • Points 35
    Re: New to Pspice Reply
    Hi thanks for the quick responce, this code actually is not mine i have been following a book that shows how to model solar cells in spice, the output that i get is just a straight line, i am not understanding why i have compared the code that they give with the one that i wrote and they are exacly the same, here is the result that i am supposed to get.
    • Post Points: 5
  • Tue, Mar 12 2013 4:41 AM

    • sss123987
    • Not Ranked
    • Joined on Tue, Mar 12 2013
    • Posts 4
    • Points 35
    Re: New to Pspice Reply
    The code up the top is not mine i have been follwing a book and in the book this code produces the graph below, i understand what you are saying about the resistances but why do i only get a flat line at the output.
    • Post Points: 5
Page 1 of 1 (5 items)
Sort Posts:
Started by sss123987 at 12 Mar 2013 04:01 AM. Topic has 4 replies.