Suscripts

Use this forum to post Vensim related questions.
Post Reply
viladent
Junior Member
Posts: 11
Joined: Sun Sep 18, 2005 2:53 pm

Suscripts

Post by viladent »

Hello,
I am back with my HIV transmission model. This time i am trying to capture the two-<b>***</b> mixing pattern and tried to use the subscript fonction.
I have got questions
(I also have attached a word document to explain what i am trying to do and will post a simplified model which (I hope) will illustrate what I am trying to do
Questions :

1.I think I need to create 2 subscripts (one for male to female matrix and one for female to male matrix) so I have created one subscript (WAIFW male to female) on the simplified model attached (this one only shows the Urban Setting) but I was not able to create more than one subscript e.g WAIFW female to male , even when using the New button in the Subscript Control button. What did I do wrong?
Also when I tried to add the subscript to the variable infectivity (in red color) I got the message : unable to understand the right hand side of the equation and I could get what was expected

2.Shall I add every subscript to each of the variables in red and purple color ?(see sketch)
Or shall I create vector functions with comprehensive variables such as Total Rate of Infection for Female Urban 16-20, Total Rate of Infection For Male 16-20 Urban, (see sketch variables in orange color) etc..and finally do a SUM of all related subscripts in those Total Rate variables?
Attachments
explanation about two-sex matrix.doc
(23.5 KiB) Downloaded 831 times
viladent
Junior Member
Posts: 11
Joined: Sun Sep 18, 2005 2:53 pm

Post by viladent »

Here is the model where I need to use subscript.
Thank you in advance for your help
Attachments
Two sex model simplified.mdl
(20.41 KiB) Downloaded 707 times
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

You need a model that is subscripted by gender and age cohort. I am afraid I can't understand all of your questions. Have you worked through Chapter 17 of the user's Guide?
viladent
Junior Member
Posts: 11
Joined: Sun Sep 18, 2005 2:53 pm

Post by viladent »

Hi Bob,

Indeed, after your last e.mail, I deeply went through chapt 17. Chapter 17 is great to start with subscript but does not help much to create multiple subscripts
My first question was concerning the fact that I was not able to create more than one subscript: after I had created the first one, I used the New button and entered a new name, then I clicked OK so I was put to equation editor and filled the items (as you had suggested age, behavior, etc..) but whan I cliced the OK button, I dould not see more than one subscript on the Subscript Control window. I am sure that I did something wrong but I could not find where.
Hoping this clarfies
Thank you in advance
Christian
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Hiv infectivity

Post by LAUJJL »

Hi

In your model you use a subscript WAIFW male to female that has age,behaviour and settings as value.
But logically the age, behaviour and settings are themselves subscripts which is impossible.
You should normally use values subscripted by age, behavious and settings, defining age with the age periods, the behaviour the different possible behaviours, same for the settings.
You had better restart building a model, with the three subscripts, and consider what will be the value WAIFW, a matrix? or something else. It will give a much more compact sketch and much more readable too.

Better start with a small model, and find help with the small one and get to the bigger one progressively.

Regards.
J.J. Laublé
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

HIV infectivity

Post by LAUJJL »

Hi

One more remark.
The model has errors and no units.
If you restart a model, check out the model at every time step included with unit checking. You cannot expect to have a model a little more then simplistic, right with errors in the equations or in the units.

Regards.
J.J. Laublé
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

At a guess the reason that the addition of a subscript failed is because you have overlapping elements. Do as JJ suggests and start a new model - put in the subscripts

Gender : Female,Male
Age: AgeUnder16,Age16to25,Age26-35,AgeOver34
IGender <->Gender
IAge <-> Age


or something similar. The equation for infections from to would look simething like

infection rate[age,gender] = SUM(WAIFW[age,gender,iage!,igender!])
WAIFW[age,gender,iage,igender] = pop[age,gender]*prob contact[age,gender,iage,igender] *prob infection[age,gender,iage,igender]

where prob contact and prob infection could be big constant arrays or computed -

As you can see this way of attacking the problem gets very complicated very quickly. so you need to be sure the added complexity is really getting you something useful.
viladent
Junior Member
Posts: 11
Joined: Sun Sep 18, 2005 2:53 pm

Post by viladent »

Thank you both of you for you valuable information. Actually, you're right, the model will become very complicated but infection transmission works with matrix(es) as I indicated in the word document attached earlier. I understand that the simpler the model the better it is to comprehend but w/o matrixes, infection model lost some realistic power. I will work under your recomendation and see how far i can go.
regards
Christian
By the way, I can see that JJ Lauble is from Strasbourg, I am working at the university of Lausanne, dept of management, is there a way that we can talk direct by phone?
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Hiv transmission

Post by LAUJJL »

Hi,
you can join me at the 0033388408060, or at the 0033677088097 from Switzerland.
But you can use too the U2U feature of the forum that permits to discuss in a more private manner very easily.
Regards.
My e-mail can be found too on the forum.
jean-jacques.lauble@wanadoo.fr
J.J. Laublé
Post Reply