You are on page 1of 22

ADVANCED DESIGN AND PROJECT

PATH OPTIMIZATION

Achintya Mondal, Dhaibat Srimani, Souravik Dutta


Final Year
Department of Mechanical Engineering
Jadavpur University
2013-2014

1 | Page
OPTIMIZATION PROBLEM:

Given (i) Initial Point (Coordinates of A)


(ii) Initial Direction (Angle a)
(iii) Center/Radius of 1st circle (Coordinates of O1/ Radius r)
(iv) Final Direction (Distance s & Angle b)

Find g and R to Minimize Path Travelled (AB+BC), P=(π/2+a-g)r+(π/2+b-g)R


Subjected to (i) s=O1O2sin(b-g)+R=(r+R)sin(b-g)+R
(ii) –π≤g≤π

(iii) R≥0

2 | Page
ANALYSIS:
Different paths available to satisfy the given conditions and achieve the required final
direction:

The minimum path to be travelled is the optimum path found by solving for the
appropriate point of contact between the two circles and the radius of the second circle.

SOLUTION:
3 | Page
Step 1: M-file objfun.m for the objective function
function f=objfun(x)
f=((90+a-g)*3+(90+b-g)*R)*(pi/180);

Step 2: M-file constrainsts.m for the constraints


function [c,ceq]=constraints(x)
c=[-g-180;g-180;-R]; %inequality
ceq=(r+R)*sind(b-g)+R-s; %equality

Step 3: M-file con_opt.m for constrained optimization


clc
clear all
warning off
x0=[0,2]; %initial guess solution
f=objfun(x0) %value of function at initial point
[c,ceq]=constraints(x0) %value of constraints at initial
point
options =optimset('LargeScale','off');
[x,fval]=fmincon(@objfun,x0,[],[],[],[],[],[],@constraints)
%value of function at optimum solution
[c,ceq] =constraints(x) %value of constraints at optimum
solution

Step 4: Lsp-file path_gen.lsp for generated path


(defun c:pathgen()
(setq p1 (getpoint "\npick the center of the first circle:"))
(setq r1 (getdist "\nenter first circle radius:"))
(setq r2 (getdist "\nenter second circle radius:"))
(setq a1 (getangle "\nenter the direction of vehicle:"))
(setq a2 (getangle "\nenter the path direction:"))
(setq a3 (getangle "\nenter the value of g:"))
(setq p2 (polar p1 (+ (/ pi 2) a1) r1))
(command "circle" p1 r1)
(command "line" p1 p2 "")
(setq p3 (polar p2 a1 50))
4 | Page
(command "line" p2 p3 "")
(setq p4 (polar p1 (- (* 2 pi) a3) (+ r1 r2)))
(command "circle" p4 r2)
(command "line" p1 p4 "")
(setq p5 (polar p4 (+ (* 3 (/ pi 2)) a2) r2))
(command "line" p4 p5 "")
(setq p6 (polar p5 a2 100))
(setq p7 (polar p5 (+ pi a2) 100))
(command "line" p6 p7 "")
)

EXAMPLES:
1. a=20o; b=45o; r=60cm; s=60cm; g=(-)01.44o; R=11cm

5 | Page
6 | Page
2. a=20o; b=45o; r=60cm; s=50cm; g=(-)01.44o; R=5.1cm

7 | Page
8 | Page
3. a=20o; b=45o; r=30cm; s=90cm; g=(-)01.44o; R=41cm

9 | Page
10 | Page
4. a=20o; b=20o; r=60cm; s=60cm; g=23.56o; R=11cm

11 | Page
12 | Page
5. a=20o; b=20o; r=60cm; s=50cm; g=23.56o; R=5.1cm

13 | Page
14 | Page
6. a=20o; b=20o; r=30cm; s=90cm; g=23.56o; R=41cm

15 | Page
16 | Page
7. a=20o; b=(-)20o; r=60cm; s=60cm; g=63.56o; R=11cm

17 | Page
18 | Page
8. a=20o; b=(-)20o; r=60cm; s=50cm; g=63.56o; R=5.1cm

19 | Page
20 | Page
9. a=20o; b=(-)20o; r=30cm; s=90cm; g=63.56o; R=41cm

21 | Page
22 | Page

You might also like