-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The InfiniteOpt does't work when deriv(x[i], t) .== -gradf(x[i]) in R^d (d>=2) which is vector defined by user's function gradf. #342
Comments
And if i delete -grad(x[i]) in ODExt[i=1:3], there still exits errors Exception of type: TOO_FEW_DOF in file "Interfaces/IpIpoptApplication.cpp" at line 655:
Exception message: status != TOO_FEW_DEGREES_OF_FREEDOM evaluated false: Too few degrees of freedom (rethrown)!
EXIT: Problem has too few degrees of freedom. about the following code. ### Pacages
# Import packages
using JuMP, InfiniteOpt, LinearAlgebra, AmplNLWriter
# Import open-source solvers
using Ipopt
## Solver.Optimizer
wjm = InfiniteModel(Ipopt.Optimizer)
## The time domain t in [0,T]
@infinite_parameter(wjm, t in [0, 10], num_supports = 101)
## Now let's specify the decision variables:
@variables(wjm, begin
## unknown variables
x[1:3], Infinite(t) # x[i](t) in R^d
end)
## Set the initial conditions of variable x at time t = 0 :
@constraint(wjm, X0[i=1:3], x[i](0) .== rand(3))
# ODEs
@constraint(wjm, ODExt[i=1:3], deriv(x[i], t) .== sum( 10/sqrt(1+sum((x[j]-x[i]).^2)).*(x[j]-x[i]) for j in 1:3 ));
# solving model
optimize!(wjm) i really dont' know that which part of CODE is wrongs. So i need your help. Thanks very much! Sincerely |
Hi @askuyue Welcome! This behavior is expected since your code has a few mistakes. For future reference, it is preferred that usage questions be discussed in the Discussions forum: https://github.com/infiniteopt/InfiniteOpt.jl/discussions since this does not denote a bug with InfiniteOpt itself. Regarding the
|
Sorry, it is my faults of they are not bugs. Thanks very much your nice. |
If there are no further issues, I will close this issue. Please feel welcome to post in the discussions forum with any additional questions. |
Dear
Thanks very much for your great work of InfiniteOpt.jl.
Describe the bug
In @constrait, it can't work if variables xi \in R^d (d >=2). Here is errors:
all code for ERROR 1
all code for ERROR 2
Desktop (please complete the following information):
Thanks for replying.
The text was updated successfully, but these errors were encountered: