% % Written by: % -- % John L. Weatherwax 2006-08-28 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- close all; clc; clear; % set the constants of this problem: t_0 = 0.; t_f = 10.; v_0 = 100.; % the initial conditions gamma_0 = pi/2.; gamma_d = pi/3.; % the target goals d_gamma = 10; % the error weighting factor for gamma(t_f) missing gamma_d r = 1; % the error coefficient for the integral of alpha(t) omega = 2*pi/t_f; % find the optimal value for [alpha_0,alpha_1]: % alphas = fminsearch( @(x) sect_3_prob_3_J_min_fn(x(1), x(2), x(3), omega, t_0, t_f, v_0, gamma_0, gamma_d, d_gamma, r), [ 0., 0., 0. ] ); alphas % evaluate J at this value of alpha sect_3_prob_3_J_min_fn(alphas(1), alphas(2), alphas(3), omega, t_0, t_f, v_0, gamma_0, gamma_d, d_gamma, r)