From 1ce9ae71f2748c00e451531125c717dec463ddb0 Mon Sep 17 00:00:00 2001 From: Dimitri Alston Date: Thu, 13 Jul 2023 12:12:48 -0400 Subject: [PATCH 1/3] Update README.md Updated equation for mobile. --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 24ec2cb..f5c6773 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,11 @@ Differentiable relaxations (`Diff <: RelaxTag`) are supported for the functions In order to bound a function using a McCormick relaxation, you first construct a McCormick object (`x::MC`) that bounds the input variables, and then you pass these variables to the desired function. -In the example below, convex/concave relaxations of the function $f(x) = x (x - 5) \sin(x)$ are calculated at $x = 2$ on the interval $[1, 4]$. +In the example below, convex/concave relaxations of the function + +$$f(x) = x (x - 5) \sin(x)$$ + +are calculated at $x = 2$ on the interval $X = [1, 4]$. ```julia using McCormick @@ -78,7 +82,14 @@ Plotting the results, we can easily visualize the convex and concave relaxations This can readily be extended to multivariate functions, for example: -$$f(x, y) = \big(4 - 2.1 x^{2} + \frac{x^{4}}{6} \big) x^{2} + x y + (-4 + 4 y^{2}) y^{2}$$ +$$ +\begin{aligned} +& f(x, y) = \big(4 - 2.1 x^{2} + \frac{x^{4}}{6} \big) x^{2}\\ +& \qquad \qquad + \\; x y + (-4 + 4 y^{2}) y^{2}\\ +& X = [-2, 0]\\ +& Y = [-0.5, 0.5] +\end{aligned} +$$ ```julia using McCormick @@ -88,7 +99,7 @@ f(x, y) = (4.0 - 2.1*x^2 + (x^4)/6.0)*x^2 + x*y + (-4.0 + 4.0*y^2)*y^2 # Define intervals for independent variables n = 30 -X = Interval{Float64}(-2,0) +X = Interval{Float64}(-2, 0) Y = Interval{Float64}(-0.5, 0.5) xrange = range(X.lo, stop=X.hi, length=n) yrange = range(Y.lo, stop=Y.hi, length=n) From dac6c59b01b5d5593854baecb4c22c6ecb627ac6 Mon Sep 17 00:00:00 2001 From: Dimitri Alston Date: Thu, 13 Jul 2023 13:00:40 -0400 Subject: [PATCH 2/3] Update README.md Added badge/link to documentation and aligned images to the center of the page. --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f5c6773..d0a9bdd 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,13 @@ A Forward McCormick Operator Library -| **PSOR Lab** | **Build Status** | **Persistent DOI** | -|:------------:|:-----------------------------------------------------------------------:|:----------------------------------------:| -| [![](https://img.shields.io/badge/Developed_by-PSOR_Lab-342674)](https://psor.uconn.edu/) | [![Build Status](https://github.com/PSORLab/McCormick.jl/workflows/CI/badge.svg?branch=master)](https://github.com/PSORLab/McCormick.jl/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/PSORLab/McCormick.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/PSORLab/McCormick.jl) | [![DOI](https://zenodo.org/badge/245830962.svg)](https://zenodo.org/badge/latestdoi/245830962) | +| **PSOR Lab** | **Build Status** | +|:--------------:|:-----------------------------------------------------------------------:| +| [![](https://img.shields.io/badge/Developed_by-PSOR_Lab-342674)](https://psor.uconn.edu/) | [![Build Status](https://github.com/PSORLab/McCormick.jl/workflows/CI/badge.svg?branch=master)](https://github.com/PSORLab/McCormick.jl/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/PSORLab/McCormick.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/PSORLab/McCormick.jl) | + +| **Documentation** | **Persistent DOI** | +|:------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------:| +| [![](https://img.shields.io/badge/docs-stable-blue.svg)](https://PSORLab.github.io/EAGO.jl/stable/mccormick/overview/) [![](https://img.shields.io/badge/docs-latest-blue.svg)](https://psorlab.github.io/EAGO.jl/dev/mccormick/overview/) | [![DOI](https://zenodo.org/badge/245830962.svg)](https://zenodo.org/badge/latestdoi/245830962) | McCormick.jl is a component package in the EAGO ecosystem and is reexported by [EAGO.jl](https://github.com/PSORLab/EAGO.jl). It contains a library of forward McCormick operators (both nonsmooth and differentiable). Documentation for this is included in the [EAGO.jl](https://github.com/PSORLab/EAGO.jl) package and additional usage examples are included in [EAGO-notebooks](https://github.com/PSORLab/EAGO-notebooks) as Jupyter Notebooks. @@ -76,7 +80,9 @@ Iv = fMC.Intv # Retrieve interval bounds of f(x) on Intv Plotting the results, we can easily visualize the convex and concave relaxations, interval bounds, and affine bounds constructed using the subgradient at the middle of $X$. -![Figure_1](Figure_1.png) +

+ +

## Bounding a Multivariate Function @@ -84,8 +90,7 @@ This can readily be extended to multivariate functions, for example: $$ \begin{aligned} -& f(x, y) = \big(4 - 2.1 x^{2} + \frac{x^{4}}{6} \big) x^{2}\\ -& \qquad \qquad + \\; x y + (-4 + 4 y^{2}) y^{2}\\ +& f(x, y) = \big(4 - 2.1 x^{2} + \frac{x^{4}}{6} \big) x^{2} + x y + (-4 + 4 y^{2}) y^{2}\\ & X = [-2, 0]\\ & Y = [-0.5, 0.5] \end{aligned} @@ -117,7 +122,9 @@ for (i,x) in enumerate(xrange) end ``` -![Figure_3](Figure_3.png) +

+ +

## Citing McCormick.jl From 6f25d4a4c9b0d23fd8c4f6a6b4aae9d646f763dc Mon Sep 17 00:00:00 2001 From: Dimitri Alston Date: Fri, 14 Jul 2023 17:38:35 -0400 Subject: [PATCH 3/3] Update Project.toml Updated McCormick to v0.13.5. --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index f1336f3..ca9fffa 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "McCormick" uuid = "53c679d3-6890-5091-8386-c291e8c8aaa1" authors = ["Matthew Wilhelm "] -version = "0.13.4" +version = "0.13.5" [deps] DiffRules = "b552c78f-8df3-52c6-915a-8e097449b14b" @@ -24,7 +24,7 @@ ForwardDiff = "~0.10" IntervalArithmetic = "~0.20" IntervalRootFinding = "~0.5" NaNMath = "0.3.5, 1.0" -NNlib = "~0.7" +NNlib = "~0.8" Reexport = "~0.2, ~1" StaticArrays = "~1.2" SpecialFunctions = "~1, ~2"