Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

problem: Spice Simulation Model

Status
Not open for further replies.

jonnycristhian

Newbie level 3
Joined
Apr 30, 2013
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,326
I want to simulate the following model in proteus.
But this model is made in Pspice, and Proteus only supports spice 3f5


*****************************************************
* GENERATOR_BEH.LIB *
* *
****************************************************
*BEHAVIOURAL MODEL OF A PV GENERATOR
* INPUT PARAMETERS:,AM1.5 JSCMR,AM1.5 VOCMR,AM1.5 PMAXMR
* AM1.5 VMMR,AM1.5 IMMR, CURRENT TEMP COEFF.,VOLTAGE TEMP.COEFF,
* NOCT, REFERENCE TEMPERATURE


* NODES
* (400) REFERENCE
* (401) INTERNAL NODE
* (402) INPUT, IRRADIANCE
* (403) INPUT, AMBIENT TEMPERATURE
* (404) OUTPUT
* (405) OUTPUT, (VOLTAGE) VALUE=SHORT CIRCUIT CURRENT(A) AT
* IRRADIANCE AND TEMPERATURE
* (406) OUTPUT, OPEN CIRCUIT VOLTAGE AT IRRADIANCE ANDTEMPERATURE
* (407) OUTPUT, (VOLTAGE) VALUE=CELL OPERATING TEMPERATURE(ºC)
* (408) OUTPUT, MPP CURRENT
* (409) OUTPUT, MPP VOLTAGE

.subckt generator_beh 400 402 403 404 405 406 407 408 409 params:
+ iscmr=1, coef_iscm=1, vocmr=1, coef_vocm=1,pmaxmr=1,
+ noct=1,immr=1 , vmmr=1, tr=1, ns=1, nsg=1 npg=1

girrad 400 401 value={v(402)/1000*(npg*iscmr+npg*coef_iscm*(v(407)-25))}

eiscm 405 400 value={v(402)/1000*(iscmr+coef_iscm*(v(407)-25))}
evocm 406 400 value={if (v(405)>1e-11, (vocmr+coef_vocm*(v(407)-25)+8.66e-5*
+ (v(407)+273)*log(v(405)/(iscmr))),0)}

etcell 407 400 value={v(403)+(noct-20)/800*v(402)}

gidiode 401 400 value={npg*v(405)/(exp(v(406)/(ns*8.66e-5*(v(407)+273)))-1)*
+ (exp(v(401)/ (ns*nsg*8.66e-5*(v(407)+273)))-1)}
rsg 401 404 {nsg/npg*((vocmr/(iscmr)-pmaxmr/(iscmr**2*(vocmr/(ns*0.0258)-log
+ ((vocmr/(ns*0.0258))+0.72))/(1+vocmr/(ns*0.0258)))))}
.func frsg() {nsg/npg*((vocmr/(iscmr)-pmaxmr/(iscmr**2*(vocmr/(ns*0.0258)-log
+ ((vocmr/(ns*0.0258))+0.72))/(1+vocmr/(ns*0.0258)))))}

gimg 400 408 value={npg*(immr*v(402)/1000+coef_iscm*(v(403)-25))}
rimg 408 400 1
evmg 409 400 value={if (v(402)>0.001, nsg*(ns*8.66e-5*(v(407)+273)*log(1+(v(405)-v(408)/npg)/v(405)*(exp(v(406)/
+ (ns*8.66e-5*(v(407)+273)))-1))-v(408)*frsg/nsg),0)}
.ends generator_beh
*_____________________________________________________

As I make the model compatible with proteus

please help
 

jonnycristhian

Newbie level 3
Joined
Apr 30, 2013
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,326
*****************************************************
* GENERATOR_BEH.LIB
****************************************************
.subckt generator_beh 400 401 402 403 404 405 406 407

girrad 400 401 value={v(402)/1000*(5*0.37+5*0.13e-3*(v(407)-25))}

eiscm 405 400 value={v(402)/1000*(0.37+0.13e-3*(v(407)-25))}
evocm 406 400 value={(21-0.1*(v(407)-25)+8.66e-5*(v(407)+273)*ln(v(405)/(0.37)))}

etcell 407 400 value={v(403)+(47-20)/800*v(402)}

gidiode 401 400 value={5*v(405)/(exp(v(406)/(2.86e-3*(v(407)+273)))-1)*(exp(v(401)/(8e-3*(v(407)+273)))-1)}

rsg 401 404 {2/5*((21/(0.37)-5/(pwr(0.37,2)*(21/(33*0.0258)-log((21/(33*0.0258))+0.72))/(1+21/(33*0.0258)))))}

.ends generator_beh


I have made ​​some changes, and the simulation seems to already be compatible, however when measuring voltage on the output pins 401 and 404, the result is NaN.

please help to fix this
 

jonnycristhian

Newbie level 3
Joined
Apr 30, 2013
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,326
I added a resitencia of 1000ohm to node 401, and I have placed inicial condition = 0 on the same node, now allows me to run the simulation, but does the dc sweep correctly



- - - Updated - - -
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top