示例#1
0
    "T": [(i, ) for i in range(1, ntrays + 1)],
    "Mv": [(i, ) for i in range(2, ntrays)],
    "Mv1": [((), )],
    "Mvn": [((), )]
}

x_vars = {
    "x": [(i, ) for i in range(1, ntrays + 1)],
    "M": [(i, ) for i in range(1, ntrays + 1)]
}
nfet = 10
tfe = [i for i in range(1, nfet + 1)]

c = NmpcGen(d_mod=DistDiehlNegrete,
            u=u,
            states=states,
            ref_state=ref_state,
            u_bounds=u_bounds)

c.load_iguess_ss()
c.solve_ss()
c.load_d_s(c.d1)
c.solve_d(c.d1)

c.update_state_real()  # update the current state

c.find_target_ss()
c.create_nmpc()
c.update_targets_nmpc()
c.compute_QR_nmpc(n=-1)
c.new_weights_olnmpc(10000, 1e+06)
示例#2
0
from pyomo.environ import *
from nmpc_mhe.dync.NMPCGen import NmpcGen
from nmpc_mhe.mods.bfb.bfb_abs7momdt_nmpc import bfb_dae
from snap_shot import snap
from pyomo.core.base import value

states = [
    "Ngb", "Hgb", "Ngc", "Hgc", "Nsc", "Hsc", "Nge", "Hge", "Nse", "Hse", "mom"
]
u = ["u1"]
u_bounds = {"u1": (162.183495794 * 0.5, 162.183495794 * 1.6)}
ref_state = {("c_capture", ((), )): 0.52}
c = NmpcGen(d_mod=bfb_dae,
            u=u,
            states=states,
            ref_state=ref_state,
            u_bounds=u_bounds)

c.ss.dref = snap

c.load_iguess_ss()
c.solve_ss()
c.load_d_s(c.d1)
c.solve_d(c.d1)
c.update_state_real()  # update the current state

c.find_target_ss()
c.create_nmpc()
c.update_targets_nmpc()
c.compute_QR_nmpc(n=-1)
c.new_weights_olnmpc(1000, 1e+06)
示例#3
0
from nmpc_mhe.dync.NMPCGen import NmpcGen
from nmpc_mhe.mods.bfb.bfb_abs7momdt_ht2 import bfb_dae
from snap_shot import snap
import sys
from numpy.random import normal as npm
from pyutilib.common._exceptions import ApplicationError
states = [
    "Ngb", "Hgb", "Ngc", "Hgc", "Nsc", "Hsc", "Nge", "Hge", "Nse", "Hse", "mom"
]
u = ["u1"]
u_bounds = {"u1": (162.183495794 * 0.0005, 162.183495794 * 10000)}
ref_state = {("c_capture", ((), )): 0.63}
c = NmpcGen(d_mod=bfb_dae,
            u=u,
            states=states,
            ref_state=ref_state,
            u_bounds=u_bounds,
            nfe_t=5,
            _t=100)

c.ss.dref = snap

c.load_iguess_ss()
# sys.exit()
# c.ss.lydot.display()
# sys.exit()
c.solve_ss()
c.solve_d(c.ss)
c.ss.write_nl()
# sys.exit()
c.load_d_s(c.d1)