80 likes | 172 Views
Examples:. How do you calculate a and b, which satisfy given equations by computer?. With Visual Basic 40 n = 2 … 41 xb(1) = 1: xb(2) = 0: xh(1) = .001: xh(2) = .001 … 45 '---- Error equations ----------- a(1, 1) = 6 * xb(1): a(1, 2) = 4 * xb(2)
E N D
Examples: How do you calculate a and b, which satisfy given equations by computer? With Visual Basic 40 n = 2 … 41 xb(1) = 1: xb(2) = 0: xh(1) = .001: xh(2) = .001 … 45 '---- Error equations ----------- a(1, 1) = 6 * xb(1): a(1, 2) = 4 * xb(2) a(2, 1) = 6 * xb(1) ^ 2: a(2, 2) = 2 *( xb(2) – 1) b(1) = -(3 * (xb(1) ^ 2 - 1) + 2 * xb(2) ^ 2 - 11) b(2) = -(2 * xb(1) ^ 3 + (xb(2) - 1) ^ 2 - 16) 46 '-------------------- … End Sub With Matlab >>[a,b]=solve('3*(a^2-1)+2*b^2=11','2*a^3+(b-1)^2=16') Matlab gives all possible solutions
Examples: Number of points Noktalar Hangi değer için hesaplama yapılacak The x and y coordinates of three points on the screen, which were clicked by a CAD user are given in the figure. Find the y value of the curve obtained from these points at x=50. • How do you find the answer with computer? • The file li.txt is arranged as given below and the code Lagr.I is run. • li.txt • 3 • 25,-10 • 40,20 • 70,5 • 50 Sonuç: 26.111 b) How do you find the answer manually?
Examples: A stationary car starts to move with the acceleration given below • Find the speed of the car at the end of 10 seconds • Manually • With computer a) Sub simpson_Click( ) 80 a=0: b=10:m=2 … 85 f=(1+sin(x^3))/Sqr(x^2+1) … End Sub b) With computer m=2 (n=4) için v=3.236 m=100 (n=200) için v=3.318
Examples: Roots Find the intersection area of the curves y=x2+2 ile y=3x . >> roots([1 -3 2]) With Computer: Sub simpson_Click ( ) 80 a=1:b=2:m=2 … 85 f=3*x-x^2-2 … End Sub
Examples: For a steel plate weighing 10 N and has a thickness 3 mm, the the coordinates of some points shown in the figure were measured (in cm) by a Coordinate Measuring Machine (CMM). How do you calculate the intensity of the steel by fitting a curve, which passes through these points. ? a) Manual calculation: The volume of the part is calculated by using its surface area and 0.3 cm thickness value. The simpson’s rule is used for area calculation. The x axis must be divided in equal segments in this method. Since the points are not equally spaced on the x axis, the necessary y values should be calculated at suitable x values. If we divide the interval 0-4 into four equal sections using the increment ∆x=1 , we can obtain the y values for x=1, x=2 and x=3.
Examples: b) With computer: For calculation with computer, the li.txt file is arranged to find the y values for x=1, x=2 and x=3 and the code Lagr.I is run. li.txt 4 0,5 2.5,7.8 3.7,9.3 4,10 1 li.txt 4 0,5 2.5,7.8 3.7,9.3 4,10 2 li.txt 4 0,5 2.5,7.8 3.7,9.3 4,10 3 The area of the plate can be calculated by using Simpson’s rule. Then, the density of the steel can be calculated as mentioned before.
Examples: How do you calculate u,w and z with computer? With Matlab clc;clear a=[-1 1 -3;0 3 -6;1 1 1]; b=[9;12;5]; c=inv(a)*b