Comments (1)
@abe-mart This was added today as part of release 0.0.3b1. The functionality will not listed on the online documentation until new binaries are available for pip distribution. For now, it works on a remote solve to the default server.
Here's an example script using cspline:
from gekko import gekko
import numpy as np
import matplotlib.pyplot as plt
"""
minimize y
s.t. y = f(x)
using cubic spline with random sampling of data
"""
# function to generate data for cspline
def f(x):
return 3*np.sin(x) - (x-3)
x_data = np.random.rand(50)*10+10 #generate random data points
y_data = f(x_data)
c = gekko()
x = c.Var(value=np.random.rand(1)*10+10) #initialize at random point
y = c.Var()
c.cspline(x,y,x_data,y_data,True)
c.Obj(y)
c.options.IMODE = 3
c.options.CSV_READ = 0
c.solve()
plt.figure()
plt.scatter(x_data,y_data,5,'b')
plt.scatter(x.value,y.value,200,'r','x')
from gekko.
Related Issues (20)
- Parallel multiprocess on multiple cores HOT 1
- MINL yielding solution that does not obey strict inequalities HOT 2
- Increasing the number of independent variables for bspline and cspline HOT 2
- Data Privacy HOT 2
- Gekko_GPR error HOT 3
- Error in the docs HOT 1
- FileNotFoundError and strange behavior depending on the rundir HOT 1
- Implementation of atan2 HOT 4
- Increase in RAM usage while optimisations are running HOT 1
- Spontaneous Access Violation errors when remote is set to false HOT 1
- Is the BYU APMonitor server down? HOT 1
- Bug with multiple bsplines
- Default to remote = False HOT 11
- Feature request: web app integration HOT 4
- Getting OSError: [Errno 8] Exec format error HOT 3
- AI Support - User Data HOT 3
- Hey HOT 1
- Gekko_GPR error with multi features problem HOT 4
- Warning: there is insufficient data in CSV file 103.238.130.134_gk_model0.csv HOT 2
- Unable to specify multiple solver options HOT 2
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 gekko.