Dynopt dynamic optimisation in MATLAB

1 visualizzazione (ultimi 30 giorni)
Connie Arancibia
Connie Arancibia il 19 Nov 2018
Querido:
Junto con saludar, quise consultar el error que se produjo en matlab a continuación e instalar la caja de herramientas DYNOPT. Intento ingresar el código y me muestra que la función dynopt no está definida.
A continuación detallaré el código:
proceso.m
función sys = proceso (t, x, bandera, u)
bandera del interruptor ,
caso 0
sys = [x (2);
-x (2) + u;
x (1) ^ 2 + x (2) ^ 2 + 0.005 * u ^ 2];
caso 1
sys = [0 0 2 * x (1);
1 -1 2 * x (2);
0 0 0];
caso 2
sys = [0 1 0.01 * u];
caso 3
sys = [0 0 0];
caso 4
sys = [0; -1; 0];
de otra manera
error ([ 'unsandled flag =' , num2str (flag)]);
fin
objfun.m
función [f, Dft, Dfx, Dfu] = objfun (t, x, u)
f = x (3);
Dft = [];
Dfx = [0; 0; 1];
Dfu = [];
confun.m
función [c, ceq, Dct, Dcx, Dcu, Dceqt, Dceqx, Dcequ] = confun (t, x, u)
c = x (2) -8 * (t-0.5) ^ 2 + 0.5;
ceq = [];
Dct = [- 16 * t + 8];
Dcx = [0; 1; 0];
Dcu = [];
Dceqt = [];
Dceqx = [];
Dcequ = [];
gráfico.m
[tiempo, estado, control] = tuxprint (x, 4,2,10,1,3,1000);
[tp, cp, ceqp] = tcceqprint (2, x, 4,2,10,1,3, 'confun' , 1000);
y lo que escribo en las ventanas de comando es:
opt = optimset ( 'LargeScale' , 'off' , 'Display' , 'iter' );
opt = optimset (opt, 'GradObj' , 'on' , 'GradConstr' , 'on' );
opt = optimset (opt, 'TolFun' , 1e-5);
opt = optimset (opt, 'TolCon' , 1e-5);
opt = optimset (opt, 'TolX' , 1e-5);
u = [13 4 -0.5 -2 -1.8 0 0.5 2 0 0];
tiempo = 0.1 * unidades (10,1);
[x, fval, exitflag, salida] = dynopt (1,2,4,2, time, 1, u, [], [], 'objfun' , 'confun' , 'process' , opt);
La última línea donde sale dynopt me da el siguiente mensaje: Función no definida o variable 'dynopt'.
Gracias y saludos,

Risposte (0)

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by