Thread Subject: Block parameters-help

Subject: Block parameters-help

From: Tine Andrejasic

Date: 11 Jun, 2009 12:52:01

Message: 1 of 9

I am simulating a solar cell in simulink, using Simscape library. I have a time dependant measurement data for solar radiation that I feed in to solar Cell input via block 'From Workspace'.
There is a paramerter TOFFSET in SolarCell too. This one represents the ambient temperature. I also have a time dependant measurment for this variable. [time Tvalues]. I would like to change this TOFFSET parameter through the simulation with my ambient temperature measurement time dependant data. How can I do this. Must I make a new block with TOFFSET as input or is there any other way.

Thank you

Subject: Block parameters-help

From: Arnaud Miege

Date: 15 Jun, 2009 12:05:03

Message: 2 of 9

"Tine Andrejasic" <tineandrejasic@gmail.com> wrote in message <h0qulh$6pt$1@fred.mathworks.com>...
> I am simulating a solar cell in simulink, using Simscape library. I have a time dependant measurement data for solar radiation that I feed in to solar Cell input via block 'From Workspace'.
> There is a paramerter TOFFSET in SolarCell too. This one represents the ambient temperature. I also have a time dependant measurment for this variable. [time Tvalues]. I would like to change this TOFFSET parameter through the simulation with my ambient temperature measurement time dependant data. How can I do this. Must I make a new block with TOFFSET as input or is there any other way.
>
> Thank you

Hi,

I assume you refer to the Solar Cell block from the SimElectronics library (http://www.mathworks.com/access/helpdesk/help/toolbox/physmod/elec/ref/solarcell.html). TOFFSET is a constant parameter as you have noted. If you want to have a time-dependent offset parameter, you would need to create your own Solar Cell block using the Simscape language:
http://www.mathworks.com/access/helpdesk/help/toolbox/physmod/simscape/lang/brmrvd8.html

HTH,

Arnaud

Subject: Block parameters-help

From: Tine Andrejasic

Date: 16 Jun, 2009 12:54:03

Message: 3 of 9

Thanks

I menaged to convert ideal transformer to variable with input instead of parameter.
I need it for DC-DC converter static losses model. I rewrite simscape file and updated mask and submask.

What about solar cell. It does't have a simscape source that I can work on. Do I have to write it from scratch?

Tine

Subject: Block parameters-help

From: Arnaud Miege

Date: 16 Jun, 2009 14:51:29

Message: 4 of 9


"Tine Andrejasic" <tineandrejasic@gmail.com> wrote in message
news:h184lb$s39$1@fred.mathworks.com...
> Thanks
>
> I menaged to convert ideal transformer to variable with input instead of
> parameter.
> I need it for DC-DC converter static losses model. I rewrite simscape file
> and updated mask and submask.
>
> What about solar cell. It does't have a simscape source that I can work
> on. Do I have to write it from scratch?
>
> Tine

Yes, you would need to recreate the solar cell from scratch using the
equations provided in the block documentation.

Arnaud

Subject: Block parameters-help

From: Tine Andrejasic

Date: 17 Jun, 2009 08:16:01

Message: 5 of 9

"Arnaud Miege" <arnaud.miege@nospam.mathworks.co.uk> wrote in message <h18bhh$h1m$1@fred.mathworks.com>...
>
> "Tine Andrejasic" <tineandrejasic@gmail.com> wrote in message
> news:h184lb$s39$1@fred.mathworks.com...
> > Thanks
> >
> > I menaged to convert ideal transformer to variable with input instead of
> > parameter.
> > I need it for DC-DC converter static losses model. I rewrite simscape file
> > and updated mask and submask.
> >
> > What about solar cell. It does't have a simscape source that I can work
> > on. Do I have to write it from scratch?
> >
> > Tine
>
> Yes, you would need to recreate the solar cell from scratch using the
> equations provided in the block documentation.
>
> Arnaud
>


Do you know is it compulsury to write an explicit form of equation in Simscape equation object equation?
Because the equation for solar cell is written in the implicit form:

I = Iph - Is*(e^((V+I*Rs)/(N*Vt))-1) - Is2*(e^((V+I*Rs)/(N2*Vt))-1) - (V+I*Rs)/Rp

Subject: Block parameters-help

From: Arnaud Miege

Date: 17 Jun, 2009 09:03:01

Message: 6 of 9


"Tine Andrejasic" <tineandrejasic@gmail.com> wrote in message
news:h1a8o1$prf$1@fred.mathworks.com...
> "Arnaud Miege" <arnaud.miege@nospam.mathworks.co.uk> wrote in message
> <h18bhh$h1m$1@fred.mathworks.com>...
>>
>> "Tine Andrejasic" <tineandrejasic@gmail.com> wrote in message
>> news:h184lb$s39$1@fred.mathworks.com...
>> > Thanks
>> >
>> > I menaged to convert ideal transformer to variable with input instead
>> > of
>> > parameter.
>> > I need it for DC-DC converter static losses model. I rewrite simscape
>> > file
>> > and updated mask and submask.
>> >
>> > What about solar cell. It does't have a simscape source that I can work
>> > on. Do I have to write it from scratch?
>> >
>> > Tine
>>
>> Yes, you would need to recreate the solar cell from scratch using the
>> equations provided in the block documentation.
>>
>> Arnaud
>>
>
>
> Do you know is it compulsury to write an explicit form of equation in
> Simscape equation object equation?
> Because the equation for solar cell is written in the implicit form:
>
> I = Iph - Is*(e^((V+I*Rs)/(N*Vt))-1) - Is2*(e^((V+I*Rs)/(N2*Vt))-1) -
> (V+I*Rs)/Rp

No, you can write it in the implicit form as is. Simscape uses symbolic
techniques to compute analytical derivatives of functions like exp, sin,
etc... Those functions are evaluated numerically. As long as you have the
correct number of equations for the number of variables, you don't have to
worry about how the equations are written.

Arnaud

Subject: Block parameters-help

From: Tine Andrejasic

Date: 17 Jun, 2009 09:40:17

Message: 7 of 9

 variables
    i = { 0, 'A' }; % Current through variable
    v = { 0, 'V' }; % Voltage across variable
  end
  
  function setup
    
    through( i, p.i, n.i ); % Through variable i from node p to node n
    across( v, p.v, n.v ); % Across variable v from p to n
 end

I only have one eqation:
 
I = Iph - Is*(e^((V+I*Rs)/(N*Vt))-1) - Is2*(e^((V+I*Rs)/(N2*Vt))-1) - (V+I*Rs)/Rp

normali both i and v have to be expresed with eqation like this:

equations
    i == *******; % Equation 1
    v == ******; % Equation 2
end




"Arnaud Miege" <arnaud.miege@nospam.mathworks.co.uk> wrote in message <h1abg6$t50$1@fred.mathworks.com>...
>
> "Tine Andrejasic" <tineandrejasic@gmail.com> wrote in message
> news:h1a8o1$prf$1@fred.mathworks.com...
> > "Arnaud Miege" <arnaud.miege@nospam.mathworks.co.uk> wrote in message
> > <h18bhh$h1m$1@fred.mathworks.com>...
> >>
> >> "Tine Andrejasic" <tineandrejasic@gmail.com> wrote in message
> >> news:h184lb$s39$1@fred.mathworks.com...
> >> > Thanks
> >> >
> >> > I menaged to convert ideal transformer to variable with input instead
> >> > of
> >> > parameter.
> >> > I need it for DC-DC converter static losses model. I rewrite simscape
> >> > file
> >> > and updated mask and submask.
> >> >
> >> > What about solar cell. It does't have a simscape source that I can work
> >> > on. Do I have to write it from scratch?
> >> >
> >> > Tine
> >>
> >> Yes, you would need to recreate the solar cell from scratch using the
> >> equations provided in the block documentation.
> >>
> >> Arnaud
> >>
> >
> >
> > Do you know is it compulsury to write an explicit form of equation in
> > Simscape equation object equation?
> > Because the equation for solar cell is written in the implicit form:
> >
> > I = Iph - Is*(e^((V+I*Rs)/(N*Vt))-1) - Is2*(e^((V+I*Rs)/(N2*Vt))-1) -
> > (V+I*Rs)/Rp
>
> No, you can write it in the implicit form as is. Simscape uses symbolic
> techniques to compute analytical derivatives of functions like exp, sin,
> etc... Those functions are evaluated numerically. As long as you have the
> correct number of equations for the number of variables, you don't have to
> worry about how the equations are written.
>
> Arnaud
>

Subject: Block parameters-help

From: Arnaud Miege

Date: 17 Jun, 2009 10:17:24

Message: 8 of 9


"Tine Andrejasic" <tineandrejasic@gmail.com> wrote in message
news:h1adm1$ef7$1@fred.mathworks.com...
> variables
> i = { 0, 'A' }; % Current through variable
> v = { 0, 'V' }; % Voltage across variable
> end
>
> function setup
>
> through( i, p.i, n.i ); % Through variable i from node p to node n
> across( v, p.v, n.v ); % Across variable v from p to n
> end
>
> I only have one eqation:
>
> I = Iph - Is*(e^((V+I*Rs)/(N*Vt))-1) - Is2*(e^((V+I*Rs)/(N2*Vt))-1) -
> (V+I*Rs)/Rp
>
> normali both i and v have to be expresed with eqation like this:
>
> equations
> i == *******; % Equation 1
> v == ******; % Equation 2
> end
>
>
That's probably OK. Have a look at the lossy ultracapacitor example:
http://www.mathworks.com/access/helpdesk/help/toolbox/physmod/simscape/lang/brnqhlk-1_1.html

In particular, it says:
"As a check, the number of equations required for a component used in a
single connected network is given by the sum of the number of ports plus the
number of internal variables minus one. This is not necessarily true for all
components (for example, one exception is mass), but in general it is a good
rule of thumb. Here this gives 2 + 1 - 1 = 2."

Where this rule falls down is if the component has an internal reference to
ground e.g. as is the case for mass and inertia. This reference to ground
can be considered a hidden port that nees to be taken account of in the rule
above. Here, you have 2 ports and no internal variables (?not sure, please
check), therefore one equation is OK. If you had an internal variable, then
you would need an extra equation, two internal variables, two extra
equations, etc...

BTW, the Simscape language is case sensitive, I is not the same as i, and V
is not the same as V.

HTH,

Arnaud

Subject: Block parameters-help

From: Tine Andrejasic

Date: 17 Jun, 2009 13:46:01

Message: 9 of 9

I managed to build the model. It took me almost one working day.
Thank you very much for the provided help.
Have a nice day.

Regards,
Tine

"Arnaud Miege" <arnaud.miege@nospam.mathworks.co.uk> wrote in message <h1afrk$iav$1@fred.mathworks.com>...
>
> "Tine Andrejasic" <tineandrejasic@gmail.com> wrote in message
> news:h1adm1$ef7$1@fred.mathworks.com...
> > variables
> > i = { 0, 'A' }; % Current through variable
> > v = { 0, 'V' }; % Voltage across variable
> > end
> >
> > function setup
> >
> > through( i, p.i, n.i ); % Through variable i from node p to node n
> > across( v, p.v, n.v ); % Across variable v from p to n
> > end
> >
> > I only have one eqation:
> >
> > I = Iph - Is*(e^((V+I*Rs)/(N*Vt))-1) - Is2*(e^((V+I*Rs)/(N2*Vt))-1) -
> > (V+I*Rs)/Rp
> >
> > normali both i and v have to be expresed with eqation like this:
> >
> > equations
> > i == *******; % Equation 1
> > v == ******; % Equation 2
> > end
> >
> >
> That's probably OK. Have a look at the lossy ultracapacitor example:
> http://www.mathworks.com/access/helpdesk/help/toolbox/physmod/simscape/lang/brnqhlk-1_1.html
>
> In particular, it says:
> "As a check, the number of equations required for a component used in a
> single connected network is given by the sum of the number of ports plus the
> number of internal variables minus one. This is not necessarily true for all
> components (for example, one exception is mass), but in general it is a good
> rule of thumb. Here this gives 2 + 1 - 1 = 2."
>
> Where this rule falls down is if the component has an internal reference to
> ground e.g. as is the case for mass and inertia. This reference to ground
> can be considered a hidden port that nees to be taken account of in the rule
> above. Here, you have 2 ports and no internal variables (?not sure, please
> check), therefore one equation is OK. If you had an internal variable, then
> you would need an extra equation, two internal variables, two extra
> equations, etc...
>
> BTW, the Simscape language is case sensitive, I is not the same as i, and V
> is not the same as V.
>
> HTH,
>
> Arnaud
>

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
simelectronics Arnaud Miege 15 Jun, 2009 08:09:05
simscape language Arnaud Miege 15 Jun, 2009 08:09:05
rssFeed for this Thread

Contact us at files@mathworks.com