Skip to content

Variable constraints #252

Answered by pulsipher
FedeClaudi asked this question in Q&A
Mar 10, 2022 · 2 comments · 9 replies
Discussion options

You must be logged in to vote

These results look awesome!

Yes, you can let the track width vary as a function of s. The easiest way to do this would be using the @parameter_function macro which enables us to embed arbitrary Julia functions (that only depend on infinite parameters) in InfiniteOpt expressions. The syntax details are given here. Note however, that the bounds syntax in @variable currently supports only constants (though perhaps we could generalize this). So, you'll need to enforce the limits via @constraint.

In this case, a simple example would be:

using InfiniteOpt

model = InfiniteModel()
@infinite_parameter(model, s in [0, 1])

my_func(s) = sin(s) # TODO replace with desired function
@parameter_function(…

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
5 replies
@FedeClaudi
Comment options

@pulsipher
Comment options

@FedeClaudi
Comment options

@pulsipher
Comment options

@pulsipher
Comment options

Answer selected by FedeClaudi
Comment options

You must be logged in to vote
4 replies
@pulsipher
Comment options

@FedeClaudi
Comment options

@FedeClaudi
Comment options

@pulsipher
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants