Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use MATLAB to solve the problem. Please fill in the following code to solve problem 1 (given below codes). Part I and part II should

Use MATLAB to solve the problem.

Please fill in the following code to solve problem 1 (given below codes). Part I and part II should be saved in different files and part II depends on the function (part I). Post the solution by pasting the completed codes that work out correctly.

(This problem's solution can be found also on the textbook solutions of numerical analysis 2ed, Timothy Sauer in Chegg, but another code building of the solution is requested as below).

  1. Your function

% Here will be the function code:

function [out, N1, N2, D] = f(theta, L1, L2, L3, gamma, x1, y1, x2, y2, p1, p2, p3)

%+++++++++++++++++++++++++++++++++++++++++++++++++

% Add your code here to the function

% Equation 1.39 in the description of the book can be used

out = N1.^2 + N2.^2 - p1^2*D.^2; % The function returns equation 1.40

end

  1. Code to call your function

% Here you can apply values to test your function.

% The function should give 0 for the values given in the description.

% The values of L and gamma are given in the description

L1 = 0;

L2 = 0;

L3 = 0;

gamma = 0;

% See Figure 1.14 and 1.15 for the values of (x1, y1) and (x1, y2)

x1 = 0;

y1 = 0;

x2 = 0;

y2 = 0;

% The values of p are given in the description.

p1 = 0;

p2 = 0;

p3 = 0;

theta = 0;

f(theta, L1, L2, L3, gamma, x1, y1, x2, y2, p1, p2, p3)

-----------------END------------------

Here is given the problem:

image text in transcribed

And here are some references for the problem:

image text in transcribed

image text in transcribed

image text in transcribed

1. Write a MATLAB function file for f(e). The parameter L1, 2L3 constants, and the strut lengths pi, p2. ps will be knowh B.5 if you are new to MATLAB function files. Here. for Y, ven pose re the function out-f (theta) To test your code, set the parameters ituting =-/4 or = /4, corres Figures 1.15(a, b), respectively, should make f(e)-0. 1.5 Root-Finding without Derivatives 67 Reality Check 1 Kinematics of the Stewart platform A Stewart platform consists of six variable length struts, or prismatic joints, supporting a payload. Prismatic joints operate by changing the length of the strut, usually pneumatically or hydraulically. As a six-degree-of-freedom robot, the Stewart platform can be placed at any point and inclination in three-dimensional space that is within its reach To simplify matters, the project concerns a two-dimensional version of the Stewart platform. It will model a manipulator composed of a triangular platform in a fixed plane controlled by three struts, as shown in Figure 1.14. The inner triangle represents the planar Stewart platform whose dimensions are defined by the three lengths Li, L2, and L3. Let denote the angle across from side L1. The position of the platform is controlled by the three numbers pi, p2, and ps, the variable lengths of the three struts. x2.2) P3 (x+L2 cos( + ), y + L2 sin( + )) L2 x + L3 cos 0,yL sin 6) P2 PI (xi. 0) Figure 1.14 Schematic of planar Stewart platform. The forward kinematics problem s pl, p2, p3 to determine the unknowns x, y, is to use the lengths P1.P2 P Finding the position of the platform, given the three strut lengths, is called the forward, or direct, kinematics problem for this manipulator. Namely, the problem is to compute (x, y) and for each given pl , P2, ps. Since there are three degrees of freedom, it is natural to expect three numbers to specify the position. For motion planning, it is important to solve this problem as fast as possible, often in real time. Unfortunately, no closed-form solution of the planar Stewart platform forward kinematics problem is known. The best current methods involve reducing the geometry of Figure 1.14 to a single equation and solving it by using one of the solvers explained in this chapter. Your job is to complete the derivation of this equation and write code to carry out its solution. Simple trigonometry applied to Figure 1.14 implies the following three equations: In these equations, Note that (1.38) solves the inverse kinematics problem of the planar Stewart platform, which is to find PI, P2. p3, given x, y,9. our goal is to solve the forward problem, namely, to find x, y,9, given PI, P2, P3 68 I CHAPTER 1 Solving Equations Multiplying out the last two equations of (1.38) and using the first yields which can be solved for x and y as 2(A2B3 - B2 A3) 2(A2B3 - B2 A3) Substituting these expressions for x and y into the first equation of (1.38), and multi 1.39) as long as D = 2( A2B5-B2A3-0 plying through by D2, yields one equation, namely, in the single unknown . (Recall that pi , P2, P3, L i , L2, Ly, xi , x2, y2 are known.) If the roots of f (0) can be found, the corresponding x- and y- values follow immediately from Note that f() is a polynomial in sin and cos , so, given any root , there are other roots + 2 k that are equivalent for the platform. For that reason, we can restrict attention to in [-, ]. It can be shown that fe) has at most six roots in that interval. 1. Write a MATLAB function file for f(e). The parameter L1, 2L3 constants, and the strut lengths pi, p2. ps will be knowh B.5 if you are new to MATLAB function files. Here. for Y, ven pose re the function out-f (theta) To test your code, set the parameters ituting =-/4 or = /4, corres Figures 1.15(a, b), respectively, should make f(e)-0. 1.5 Root-Finding without Derivatives 67 Reality Check 1 Kinematics of the Stewart platform A Stewart platform consists of six variable length struts, or prismatic joints, supporting a payload. Prismatic joints operate by changing the length of the strut, usually pneumatically or hydraulically. As a six-degree-of-freedom robot, the Stewart platform can be placed at any point and inclination in three-dimensional space that is within its reach To simplify matters, the project concerns a two-dimensional version of the Stewart platform. It will model a manipulator composed of a triangular platform in a fixed plane controlled by three struts, as shown in Figure 1.14. The inner triangle represents the planar Stewart platform whose dimensions are defined by the three lengths Li, L2, and L3. Let denote the angle across from side L1. The position of the platform is controlled by the three numbers pi, p2, and ps, the variable lengths of the three struts. x2.2) P3 (x+L2 cos( + ), y + L2 sin( + )) L2 x + L3 cos 0,yL sin 6) P2 PI (xi. 0) Figure 1.14 Schematic of planar Stewart platform. The forward kinematics problem s pl, p2, p3 to determine the unknowns x, y, is to use the lengths P1.P2 P Finding the position of the platform, given the three strut lengths, is called the forward, or direct, kinematics problem for this manipulator. Namely, the problem is to compute (x, y) and for each given pl , P2, ps. Since there are three degrees of freedom, it is natural to expect three numbers to specify the position. For motion planning, it is important to solve this problem as fast as possible, often in real time. Unfortunately, no closed-form solution of the planar Stewart platform forward kinematics problem is known. The best current methods involve reducing the geometry of Figure 1.14 to a single equation and solving it by using one of the solvers explained in this chapter. Your job is to complete the derivation of this equation and write code to carry out its solution. Simple trigonometry applied to Figure 1.14 implies the following three equations: In these equations, Note that (1.38) solves the inverse kinematics problem of the planar Stewart platform, which is to find PI, P2. p3, given x, y,9. our goal is to solve the forward problem, namely, to find x, y,9, given PI, P2, P3 68 I CHAPTER 1 Solving Equations Multiplying out the last two equations of (1.38) and using the first yields which can be solved for x and y as 2(A2B3 - B2 A3) 2(A2B3 - B2 A3) Substituting these expressions for x and y into the first equation of (1.38), and multi 1.39) as long as D = 2( A2B5-B2A3-0 plying through by D2, yields one equation, namely, in the single unknown . (Recall that pi , P2, P3, L i , L2, Ly, xi , x2, y2 are known.) If the roots of f (0) can be found, the corresponding x- and y- values follow immediately from Note that f() is a polynomial in sin and cos , so, given any root , there are other roots + 2 k that are equivalent for the platform. For that reason, we can restrict attention to in [-, ]. It can be shown that fe) has at most six roots in that interval

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions