Skip to content

Commit

Permalink
Merge pull request #6 from chkwon/new-mapping
Browse files Browse the repository at this point in the history
doc update
  • Loading branch information
chkwon committed Mar 14, 2017
2 parents f08316a + 2852320 commit 3ef61e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion doc/index.rst
Expand Up @@ -13,7 +13,7 @@ To find :math:`x^* \in X` such that
where the set :math:`X` is defined by equalities and inequalities. The problem may be called :math:`VI(F,X)`.

This package requires ``JuMP`` and ``Ipopt``. Use ``@variable`` and ``@mapping`` to define `x` and `F(x)`, respectively. Use ``@innerproduct`` to match each variable and mapping and add to the problem.
This package requires ``JuMP`` and ``Ipopt``. Use ``@variable`` and ``@mapping`` to define :math:`x` and :math:`F(x)`, respectively. Use ``@innerproduct`` to match each variable and mapping and add to the problem. You can use ``@innerproduct`` multiple times.

For variational inequality problems for traffic user equilibrium, see `TrafficAssignment.jl <https://github.com/chkwon/TrafficAssignment.jl>`_.

Expand Down Expand Up @@ -68,6 +68,12 @@ Example 1 from `Fukushima (1986) <http://link.springer.com/article/10.1007%2FBF0
@innerproduct(m, [F1, F2, F3], [x1, x2, x3])
// or
// @innerproduct(m, F1, x1)
// @innerproduct(m, F2, x2)
// @innerproduct(m, F3, x3)
sol1, Fval1, gap1 = solveVIP(m, algorithm=:fixed_point, max_iter=1000, step_size=0.1)
@assert 0<= gap1 < 1e-6
Expand Down
2 changes: 1 addition & 1 deletion example/traffic.jl
Expand Up @@ -15,11 +15,11 @@ p = 3
@mapping(m, F2, A[2]+B[2]*(h[2]+h[3])^2 + A[3]+B[3]*h[2]^2 + A[4]+B[4]*(h[1]+h[2])^2 )
@mapping(m, F3, A[2]+B[2]*(h[2]+h[3])^2 + A[5]+B[5]*(h[3])^2 )


@constraint(m, sum(h[i] for i=1:p) == T14)

F = [F1, F2, F3]
@innerproduct(m, F, h)

sol, Fval, gap = solveVIP(m, algorithm=:extra_gradient, max_iter=1000, step_size=0.01)

@assert 0<= gap < 1e-4
Expand Down

0 comments on commit 3ef61e2

Please sign in to comment.