How to minimise a value which is found by solving transcedental equations (using fsolve)?
2 views (last 30 days)
I want to minimise the coefficient of variation of the y coordinate of the rocker chassis joint of the rocker bogie suspension system.
That is, the y coordinate of P5 in the figure.
The ground function is f(x,phi)=1+sin(x-phi)
P1 is at (0,f(0,phi))
phi is incremented to depict the motion of the rover as it moves along the ground. (initially it is 0)
Each of the points P2,P3,P4 and P5 are found sequentially using fsolve. (I am not able to express P5 as a function of P1 analytically. This is why I don't know how to minimise it.)
The equations are obtained from coordinate geometry as the triangles made by P1,P3,P2 and P3,P5,P4 are fully determined. It is important to note that the angle between P2,P3,P5 is not constant.
Once the y coordinate of P5 is found, I will store it in an array and loop it over phi. Then the coefficient of variation of all the y values that have been collected is computed.
After this comes the minimisation part that I'm stuck at.
The code for phi=0 is attached below. The steps after this (looping phi and storing values) are elementary until the minimisation.
Note that the code uses the name X instead of P.
%% Function to find points of a rocker bogie traversing a function given the link lengths and angles
%% Defining initial stuff
%% Phase = 0, Solving for X(2,:)
%% Solving for X(3,:)
%% Solving for X(4,:)
%% Solving for X(5,:)
%% Display for testing
% axis([-1 100 -1 100]);
% hold on
% hold off
Thanks for your time and effort.