This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> | |
<html xmlns='http://www.w3.org/1999/xhtml'> | |
<head><script src='http://d3js.org/d3.v3.min.js'></script><script src='http://cpettitt.github.io/project/dagre-d3/v0.1.5/dagre-d3.min.js'></script><style>svg { overflow: hidden;}.node rect { stroke: #333; stroke-width: 1.5px; fill: #fff;}.edgeLabel rect { fill: #fff;}.edgePath { stroke: #333; stroke-width: 1.5px; fill: none;}.outer { width: 1024px; height: 960px; overflow: auto;}.inner { width: 8000px; height: 6000px;}svg { display: block; width: 100%; height: 100%;} | |
.link { | |
stroke: #999; | |
stroke-width: 2px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
simple example script for running and testing notebooks. | |
Usage: `ipnbdoctest.py foo.ipynb [bar.ipynb [...]]` | |
Each cell is submitted to the kernel, and the outputs are compared with those stored in the notebook. | |
""" | |
import os,sys,time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import io | |
import shutil | |
dir = '/home/frs/project/casadi/CasADi/' | |
shutil.rmtree(os.path.join(dir,'branches')) | |
os.mkdir(os.path.join(dir,'branches')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import casadi.* | |
load SilverboxSimulated | |
u_data = u; | |
y_data = y; | |
% simulation horizon | |
N = size(u_data, 1); | |
% declare symbols for states and controls | |
y = MX.sym('y'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import casadi.* | |
load SilverboxSimulated | |
u_data = u; | |
y_data = y; | |
%% | |
% simulation horizon | |
N = size(u_data, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import casadi.* | |
% In this example, we fit a nonlinear model to measurements | |
% | |
% This example uses more advanced constructs than the vdp* examples: | |
% Since the number of control intervals is potentially very large here, | |
% we use memory-efficient Map and MapAccum, in combination with | |
% codegeneration. | |
% | |
% We will be working with a 2-norm objective: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import hashlib | |
import subprocess | |
import shutil | |
import os | |
args = sys.argv[1:] | |
cachedir = ".cache" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import casadi | |
import re | |
class MFunctionParser: | |
def parse(self,filename): | |
f = open(filename,"r") | |
signature = f.readline() | |
m = re.search("function \[?([\w,]+)\]? = \w+\((.*)\)",signature) | |
if not m: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from casadi import * | |
x = msym("x",2) | |
y = msym("y",2,2) | |
f = MXFunction([x,y],[mul(y,x),y]) | |
f.setOption("number_of_fwd_dir",2) | |
f.init() | |
f.input(0).set(DMatrix([1.1,1.3])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_subclasses(myclass, depth=0): | |
print (" " * depth) + " - " + myclass.__name__ | |
for s in myclass.__subclasses__(): | |
print_subclasses(s,depth=depth+1) |
OlderNewer