참조
카테고리 : 슬롯 무료체험 NOA 라이브러리
메인파일 : robot.gms
$onText
로봇 팔이 두 지점 사이를 이동하는 데 걸리는 시간을 최소화합니다.
이 모델은 COPS 벤치마킹 제품군에서 나온 것입니다.
http://www-unix.mcs.anl.gov/~more/cops/를 참조하세요.
참고자료:
* Dolan, E D 등, J J, COPS를 사용한 벤치마킹 최적화 소프트웨어.
기술. 대표, 수학 및 컴퓨터 과학부, 2000.
* Vanderbei, R, 비선형 최적화 모델.
$offText
$if 세트 n $set nh %n%
$설정되지 않은 경우 nh $set nh 800
h 간격을 설정합니다 / h0 * h%nh%/
스칼라
파이
nh 간격 수 / %nh% /
L 팔 전체 길이 / 5 /
max_u_rho / 1 /
max_u_the / 1 /
max_u_phi / 1 /;
파이 = 2*arctan(inf);
변수
rho(h) 원점으로부터의 거리
(h) 수평각
phi(h) 수직각
rho_dot(h)
the_dot(h)
phi_dot(h)
u_rho(h) 제어
u_the(h)
u_phi(h)
단계
tf 마지막 시간
i_the(h) 관성 모멘트
i_phi(h) ;
* 경계
rho.lo(h) = 0; rho.up(h) = L;
the.lo(h) = -pi; the.up(h) = 파이;
phi.lo(h) = 0; phi.up(h) = 파이;
u_rho.lo(h) = -max_u_rho; u_rho.up(h) = max_u_rho;
u_the.lo(h) = -max_u_the; u_the.up(h) = max_u_the;
u_phi.lo(h) = -max_u_phi; u_phi.up(h) = max_u_phi;
i_the.lo(h) = 0.0001;
i_phi.lo(h) = 0.0001;
set firstlast(h) / h0, h%nh% /;
* 고정 변수
the.fx('h0') = 0;
the.fx('h%nh%') = 2*pi/3;
rho.fx(firstlast) = 4.5;
phi.fx(firstlast) = pi/4;
rho_dot.fx(firstlast) = 0;
the_dot.fx(firstlast) = 0;
phi_dot.fx(firstlast) = 0;
i_phi.fx(firstlast(h)) = (power(L-rho.l(h),3)+power(rho.l(h),3))/3.0;
i_the.fx(firstlast(h)) = i_phi.l(h)*sqr(sin(phi.l(h)));
*초기화
rho.l(h) = 4.5;
the.l(h) = (2*pi/3)*sqr(ord(h)/nh);
phi.l(h) = pi/4;
rho_dot.l(h) = 0.0;
the_dot.l(h) = (4*pi/3)*(ord(h)/nh);
phi_dot.l(h) = 0.0;
단계 1 = 1/nh;
i_phi.l(h) = (전력(L-rho.l(h),3)+전력(rho.l(h),3))/3.0;
i_the.l(h) = i_phi.l(h)*sqr(sin(phi.l(h)));
방정식
tf_eqn
rho_eqn(h)
the_eqn(h)
phi_eqn(h)
u_rho_eqn(h)
u_the_eqn(h)
u_phi_eqn(h)
i_the_eqn(h)
i_phi_eqn(h);
tf_eqn.. tf =e= 단계*nh;
i_phi_eqn(h).. i_phi(h) =e= (power(L-rho(h),3)+power(rho(h),3))/3.0;
i_the_eqn(h).. i_the(h) =e= i_phi(h)*sqr(sin(phi(h)));
rho_eqn(h-1).. rho(h) =e= rho(h-1) + 0.5*단계*(rho_dot(h) + rho_dot(h-1));
the_eqn(h-1).. the(h) =e= the(h-1) + 0.5*단계*(the_dot(h) + the_dot(h-1));
phi_eqn(h-1).. phi(h) =e= phi(h-1) + 0.5*단계*(phi_dot(h) + phi_dot(h-1));
u_rho_eqn(h-1).. rho_dot(h) =e=
rho_dot(h-1) + 0.5*단계*(u_rho(h) + u_rho(h-1))/L;
u_the_eqn(h-1)..the_dot(h) =e=
the_dot(h-1) + 0.5*단계*(u_the(h)/i_the(h) + u_the(h-1)/i_the(h-1));
u_phi_eqn(h-1)..phi_dot(h) =e=
phi_dot(h-1) + 0.5*단계*(u_phi(h)/i_phi(h) + u_phi(h-1)/i_phi(h-1));
모델 로봇 /all/;
$ifThenI x%mode%==xbook
로봇.iterlim=50000;
로봇.작업공간=120;
$endIf
nlp를 사용하여 로봇 최소화 tf를 해결합니다.
$ifThenI x%mode%==xbook
파일 res /robot.dat/;
입술을 넣어
루프(h, u_phi.l(h):10:5, put/)
$endIf
*--------------- 수치실험---------
* 2011년 1월 15일
*
*변형 1:
* 8002개의 제약조건, 11012개의 변수
* CONOPT3:
* 953회 반복, 27.720초
* vfo=9.1409312779
* 니트로:
* 제한 시간 도달
*--------------------------------------------
* 로봇 종료