Mathematical Modeling with LPL : Explain and run a Model
Problem Statement
Modeling Description
||
Back to MatMod
model aGraph1 "Draw Graph II"; set i,j "A set of nodes"; e{i,j} "A set of edges"; parameter X{i} "X-position of node"; Y{i} "Y-position of node";; i :=[ AAA AAB ABA ABB BAA BAB BBA BBB ]; X{i} := [0 0 3 9 0 6 9 9]; Y{i} := [3 0 3 0 6 3 6 3]; e{i,j} := [ (AAA,*), AAB, ABA, BAA, (AAB,*), ABB, BAB, (BAA,*), BAB, BBA, (ABA,*), ABB, BBA, (ABB,*), BBB, (BAB,*), BBB, (BBA,*), BBB ]; drawgraph; model drawgraph; Draw.Scale(60,60); Draw.DefFont('Verdana',16); {e[i,j]} Draw.Arrow(X[i],Y[i],X[j],Y[j],.4); {i} Draw.Circle(i&'', X,Y,.4,1,0); end end
Problem Statement
Modeling Description
Back to model
The solution is as follows:
The LOG-File output of LPL is as follows: