예제 #1
0
]
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)

# q_cov = {}
# for i in range(1, nfet):
#     for j in range(1, ntrays + 1):
#         q_cov[("x", (j,)), ("x", (j,)), i] = 1e-05
#         q_cov[("M", (j,)), ("M", (j,)), i] = 0.5
#
# m_cov = {}
예제 #2
0
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.50}
ref_state = {("c_capture", ((),)): 0.40}
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()
# 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)
c.d1.create_bounds()
c.solve_d(c.d1, halt_on_ampl_error=True)
c.update_state_real()  # update the current state

c.find_target_ss()
with open("mult_boundsss2.txt", "w") as f:
    c.ss2.ipopt_zL_out.pprint(ostream=f)
    f.close()
c.create_nmpc()
c.update_targets_nmpc()
c.compute_QR_nmpc(n=-1)
c.new_weights_olnmpc(10, 1e+06)
예제 #3
0
u_bounds = {
    "u1": (0.0001, 9286.03346463 * 100),
    "u2": (0.0001, 9286.03346463 * 100)
}
ref_state = {("c_capture", ((), )): 0.50}
# weights = {("c_capture", ((),)): 1E+05}
c = NmpcGen(d_mod=bfb_dae,
            u=u,
            states=states,
            ref_state=ref_state,
            u_bounds=u_bounds)
c.load_iguess_ss()
c.ss.create_bounds()
c.solve_ss()
c.load_d_s(c.d1)
c.solve_d(c.d1, iter_max=100)

c.find_target_ss()
c.ss2.write_nl()
sys.exit(-1)
# c.plant_input_gen(c.ss2, 1)

c.create_nmpc()
c.update_targets_nmpc()
# sys.exit()
c.compute_QR_nmpc(n=-1)
c.initialize_olnmpc(c.d1)
c.olnmpc.display(filename="somefile0.txt")
c.create_suffixes()
# c.solve_k_aug_nmpc()
# c.olnmpc.write_nl()
예제 #4
0
    "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)
c.d1.create_bounds()

c.create_predictor()
c.predictor_step(c.d1, "real")

q_cov = {}
for j in range(1, ntrays + 1):
예제 #5
0
from numpy.random import normal as npm
from pyutilib.common._exceptions import ApplicationError

import sys
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)


# q_cov = {}
# for i in range(1, nfet):
#     for j in range(1, ntrays + 1):
#         q_cov[("x", (j,)), ("x", (j,)), i] = 1e-05
#         q_cov[("M", (j,)), ("M", (j,)), i] = 0.5
#