Comments (4)
hmm. Do you have a minimal working example? We wouldn't be able to investigate without more information.
from snopt.jl.
Please see below. Thanks.
# workspace()
using Snopt
xl = [1; 1; 0; 1; 0; 85; 90; 3; 1.2; 145; 3; 85]
xu = [2000; 16000; 120; 5000; 2000; 93; 95; 12; 4.0; 162; 24000; 465000]
x0 = [1700; 16000; 100; 3000; 2000; 90; 94; 10; 2; 150; 18000; 200000]
function prob(x)
# --- objective ---
f = 5.04*x[1] + 0.035*x[2] + 10*x[3] + 3.36*x[5] - 0.063*x[4]*x[7]
# --- gradient of obj ---
dfdx = zeros(12)
dfdx[1] = 5.04
dfdx[2] = 0.035
dfdx[3] = 10
dfdx[4] = -0.063*x[7]
dfdx[5] = 3.36
dfdx[7] = -0.063*x[4]
c = []
dcdx = []
fail = false
return f, c, dfdx, dcdx, fail
end
options = Dict{String, Any}()
options["Derivative option"] = 1
options["Verify level"] = 1
xopt, fopt, info = snopt(prob, x0, xl, xu, options)
println(xopt)
println(info)
from snopt.jl.
The problem is x0. As you've defined it, it is an integer array. If you just change one of the values to a float (say 1700.0) then everything works. I didn't dig into exactly what the problem is, but my guess is that it is in passing data between fortran and julia and it's looking for a certain length field which is not what it expects (integer vs float).
from snopt.jl.
That works perfectly. Thanks a lot for you help!
from snopt.jl.
Related Issues (12)
- Not enough memory HOT 1
- Snopt version HOT 5
- Compiled library location HOT 3
- Integer upper bounds, lower bounds, and starting point
- Issues Building Package HOT 1
- Does the package support trial libraries? HOT 2
- Printing Summary at Major and Minor Iterations During Optimization
- Are infeasible constraints sometimes ignored? HOT 1
- Print SNOPT iteration history to terminal?
- Set SPEC File Options
- Snopt segmentation fault with Julia 1.10 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snopt.jl.