# Some modeling help

Hello CSG,

I have recently started to attempt modeling using
Simulink on MatLab. I am hoping to firstly construct a “basic” situation
where two loops are in conflict with each other, and later on extend on it to
test a hypothesis.

What happens when I run the model in the picture I have
attached (without the “transport delay blocks”) is that the input
is at 1,75 for both loops (seem right?).

-The comparator functions: o=r-p

-Environmental function is: i=o1+o2

I obviously want there to be a time delay in order for the
model to be dynamic. With the transport delay blocks, the inputs stay at 0 and
then start to fluctuate at the very end of the simulation. This is probably because
I can’t work them properly yet.

As most of you probably figured out I am a complete
novice (although a keen one).

So I was wondering:

Is this construct about correct? Anything vital missing?

Any good books on the type of modelling that is relevant to
PCT?

Anyone know how to work the delay blocks?

So, what say the pros?

Best wishes,

Oliver Schauman

Institute of Psychiatry London

[From Bill Powers (2010.10.04.1615 MDT)]

Hello, Oliver. I've wanted to try simulations on Matlab (I have it installed), but haven't had time to learn how. I will be very interested in how you do it. Is it possible to write a program that you could send me and that I could run using Matlab? I would need kindergarten instructions for how to do it. I might be able to say more useful things if I could do that.

Best,

Bill P.

[From Richard Kennaway (2010.10.05.1046 BST)]

···

At 21:16 +0100 4/10/10, Oliver Schauman wrote:

I have recently �started to attempt modeling using Simulink on MatLab. I am hoping to firstly construct a �basic� situation where two loops are in conflict with each other, and later on extend on it to test a hypothesis.

What happens when I run the model in the picture I have attached (without the �transport delay blocks�) is that the input is at 1,75 for both loops (seem right?).

-The comparator functions: o=r-p
-Environmental function is: �i=o1+o2

I obviously want there to be a time delay in order for the model to be dynamic. With the transport delay blocks, the inputs stay at 0 and then start to fluctuate at the very end of the simulation. This is probably because I can�t work them properly yet.

I use Matlab a lot (though I've only dabbled with Simulink), and I'd be interested in your models. There wasn't any picture with your post though.

--
Richard Kennaway, jrk@cmp.uea.ac.uk, Richard Kennaway
Tel. 01603 593212
School of Computing Sciences,
University of East Anglia, Norwich NR4 7TJ, U.K.

OK, but I think I'll have to do this after we finish the offline project some of us are involved in.

Bill

···

At 01:39 AM 10/5/2010 +0100, you wrote:

Hi Bill,

I have not gotten very far with MatLab myself and I am pretty much
progressing by just trying things out at the moment.

[From Rick Marken (2010.10.05.0930)]

···

On Mon, Oct 4, 2010 at 1:16 PM, Oliver Schauman <oliver.s@telia.com> wrote:

What happens when I run the model in the picture I have attached (without
the ï¿½transport delay blocksï¿½) is that the input is at 1,75 for both loops
(seem right?).

-The comparator functions: o=r-p

-Environmental function is: ï¿½i=o1+o2
...

Is this construct about correct? Anything vital missing?

Any good books on the type of modelling that is relevant to PCT?

Anyone know how to work the delay blocks?

I can't tell because I haven't seen a diagram of the model. If I could
see the model then maybe I could help, even if I don't speak Simulink
on MatLab.

Best

Rick
--
Richard S. Marken PhD
rsmarken@gmail.com

It should be attached now.

···

-----Original Message-----
From: Control Systems Group Network (CSGnet)
[mailto:CSGNET@LISTSERV.ILLINOIS.EDU] On Behalf Of Richard Marken
Sent: den 5 oktober 2010 17:26
To: CSGNET@LISTSERV.ILLINOIS.EDU
Subject: Re: Some modeling help

[From Rick Marken (2010.10.05.0930)]

On Mon, Oct 4, 2010 at 1:16 PM, Oliver Schauman <oliver.s@telia.com> wrote:

What happens when I run the model in the picture I have attached (without
the transport delay blocks) is that the input is at 1,75 for both loops
(seem right?).

-The comparator functions: o=r-p

-Environmental function is: i=o1+o2
...

Is this construct about correct? Anything vital missing?

Any good books on the type of modelling that is relevant to PCT?

Anyone know how to work the delay blocks?

I can't tell because I haven't seen a diagram of the model. If I could
see the model then maybe I could help, even if I don't speak Simulink
on MatLab.

Best

Rick
--
Richard S. Marken PhD
rsmarken@gmail.com

Sure sure! This is by no means urgent. It is a side project for me as well.
Regards,
Oliver

···

-----Original Message-----
From: Control Systems Group Network (CSGnet)
[mailto:CSGNET@LISTSERV.ILLINOIS.EDU] On Behalf Of Bill Powers
Sent: den 5 oktober 2010 16:41
To: CSGNET@LISTSERV.ILLINOIS.EDU
Subject: Re: Some modeling help

At 01:39 AM 10/5/2010 +0100, you wrote:

Hi Bill,

I have not gotten very far with MatLab myself and I am pretty much
progressing by just trying things out at the moment.

OK, but I think I'll have to do this after we finish the offline
project some of us are involved in.

Bill

[From Bill Powers (2010.10.05.1325 MDT)]

Oliver Schauman --

Well, I thought I had Matlab, provided by a colleague, but I don't; I have to have the same email address as the providing institution. The authorization doesn't work.

Octave (free) is supposed to be a good clone, but there's no counterpart of simulink that I know of.

I have used Vensim (Ventana Systems, Inc.) and it's a good simulator with a graphics interface -- basically you draw a block diagram and fill in the functions, and Vensim runs the simulator and plots results as desired. It's like Stella if you know what that is. The introductory form is free for personal and academic use.

http://www.vensim.com/venple.html

One great advantage of Vensim is that there are versions for Windows and Macs.

I'll try to write your conflict simulation in VenPLE after I remind myself how to do it. You might download and install it to try it out. Good documentation comes with it. It's possible to transmit Vensim simulation programs to other users so they can run them, too. A reader is available for those who don't do programming; it will run simulation files.

Bill

[From Rick Marken (2010.10.05.1750)]

It should be attached now.

Yes, thanks. It looks like you have two control systems, both
controlling an environmental variable that is the sum of outputs of
the two systems, o + o1. It appears that the perceptual functions of
both systems are simply multipliers of the inputs by 1.0. So p = 1* (o
+ o1) and p2 = 1* (o + o1). I don't know what the output functions
are. I'll presume that they are just proportional outputs so that o =
k * (r - p) and o2 = k2 * (r2-p2).

So we have two control systems controlling the same perception: o+o1.
There will be conflict is each system has a different reference for
this perception. So in order to know what this model does I have to
know what the values of r and r2 are. You say that p and p2 both equal
1.75. That suggests that r = r2 = 1.75. If r<>r2 then the output of
both systems should continuously increase or decrease. Actually, if o
continuously increases (because p<r) and o1 continuously decreases
(because p2>r2) then p and p2 could end up being the same and
constant.

So I think your model of conflict is fine, though I would have have
made o and o2 separate variables in the environment; and then I would
have the input functions (which you call the input gains) define the
function of o and o2 that is controlled by each system. If both
systems control the same (or nearly the same) function of o and o2 you
will get conflict (when the references for the two systems are
different).

Hope that helps.

Best

Rick

···

On Tue, Oct 5, 2010 at 10:09 AM, Oliver Schauman <oliver.s@telia.com> wrote:
--
Richard S. Marken PhD
rsmarken@gmail.com

Thanks! That helps! In theory everything should be as it is, I'll give it a
second go and make the changes you suggested. I think the model might behave
more like expected then.

Regards,
Oliver

···

-----Original Message-----
From: Control Systems Group Network (CSGnet)
[mailto:CSGNET@LISTSERV.ILLINOIS.EDU] On Behalf Of Richard Marken
Sent: den 6 oktober 2010 01:50
To: CSGNET@LISTSERV.ILLINOIS.EDU
Subject: Re: Some modeling help

[From Rick Marken (2010.10.05.1750)]

On Tue, Oct 5, 2010 at 10:09 AM, Oliver Schauman <oliver.s@telia.com> wrote:

It should be attached now.

Yes, thanks. It looks like you have two control systems, both
controlling an environmental variable that is the sum of outputs of
the two systems, o + o1. It appears that the perceptual functions of
both systems are simply multipliers of the inputs by 1.0. So p = 1* (o
+ o1) and p2 = 1* (o + o1). I don't know what the output functions
are. I'll presume that they are just proportional outputs so that o =
k * (r - p) and o2 = k2 * (r2-p2).

So we have two control systems controlling the same perception: o+o1.
There will be conflict is each system has a different reference for
this perception. So in order to know what this model does I have to
know what the values of r and r2 are. You say that p and p2 both equal
1.75. That suggests that r = r2 = 1.75. If r<>r2 then the output of
both systems should continuously increase or decrease. Actually, if o
continuously increases (because p<r) and o1 continuously decreases
(because p2>r2) then p and p2 could end up being the same and
constant.

So I think your model of conflict is fine, though I would have have
made o and o2 separate variables in the environment; and then I would
have the input functions (which you call the input gains) define the
function of o and o2 that is controlled by each system. If both
systems control the same (or nearly the same) function of o and o2 you
will get conflict (when the references for the two systems are
different).

Hope that helps.

Best

Rick
--
Richard S. Marken PhD
rsmarken@gmail.com

[From Rick Marken (2010.10.06.1615)]

Thanks! That helps! In theory everything should be as it is, I'll give it a
second go and make the changes you suggested. I think the model might behave
more like expected then.

Keep us posted ion how it goes. You might want to make the output
functions leaky integrators, by the way. It's easier to stabilize the
system that way.

Best

Rick

···

On Wed, Oct 6, 2010 at 3:37 PM, Oliver Schauman <oliver.s@telia.com> wrote:

Regards,
Oliver

-----Original Message-----
From: Control Systems Group Network (CSGnet)
[mailto:CSGNET@LISTSERV.ILLINOIS.EDU] On Behalf Of Richard Marken
Sent: den 6 oktober 2010 01:50
To: CSGNET@LISTSERV.ILLINOIS.EDU
Subject: Re: Some modeling help

[From Rick Marken (2010.10.05.1750)]

On Tue, Oct 5, 2010 at 10:09 AM, Oliver Schauman <oliver.s@telia.com> wrote:

It should be attached now.

Yes, thanks. It looks like you have two control systems, both
controlling an environmental variable that is the sum of outputs of
the two systems, o + o1. It appears that the perceptual functions of
both systems are simply multipliers of the inputs by 1.0. So p = 1* (o
+ o1) and ï¿½p2 = 1* (o + o1). I don't know what the output functions
are. I'll presume that they are just proportional outputs so that o =
k * (r - p) and o2 = k2 * (r2-p2).

So we have two control systems controlling the same perception: o+o1.
There will be conflict is each system has a different reference for
this perception. So in order to know what this model does I have to
know what the values of r and r2 are. You say that p and p2 both equal
1.75. That suggests that r = r2 = 1.75. If r<>r2 then the output of
both systems should continuously increase or decrease. Actually, if o
continuously increases (because p<r) and o1 continuously decreases
(because p2>r2) then p and p2 could end up being the same and
constant.

So I think your model of conflict is fine, though I would have have
made o and o2 separate variables in the environment; and then I would
have the input functions (which you call the input gains) define the
function of o and o2 that is controlled by each system. If both
systems control the same (or nearly the same) function of o and o2 you
will get conflict (when the references for the two systems are
different).

Hope that helps.

Best

Rick
--
Richard S. Marken PhD
rsmarken@gmail.com