## Transcribed Text

MATLAB Report
Write about Numerical Approximation in
Matlab and also answer questions
Part Part 1a
The forces in the nine members of the truss below can be determined by solving the following
systemo nine equations (in degrees),
1800lbs
4
- 1200 lbs
F2+cos(48 81)Fr=0
cos(48.81)F>-F4+ cos(45)F=1200
Fatcos(48 81)Fs-F>=0
-sin(48.81)Fs-Fz-sin(45)F==0
sin(48.81)Fst F.=0
sin(45)F==1500
5
1
7
-cos(48 81)Fi+Fe=
sin(48.81)F1 F>=1800
6
8
1500 lbs
Writea MATLAB script that takes in the equations asa matrix and thendetermines the forces in
the members Display the results in table where the first column displays the member number
and the second column displays the corresponding force.
Part 1b
The stress intensity factor at crack for the plate shown at righti K Covna where is the
far -field stress, ai the crack length, and Cis parameter that depends of the geometry of the
specimen and crack Forthe case of the edge crack show below, Cis given by,
0.857 0.265
C
0.265(
a)
o
Write a script filethat will print out table of values with the ratio a/b inthe first column and the
corresponding parameter c in the second column Let a/b range between o and 0.95 with
increments of 0.05
Part
Part 2a
Write MATLAB Script file that calcul ates f(x)=5sin(3x) using the Taylor series with the number of
terms n=2 5, 50, without using the built in sum function.
Plot the three approximations along with the exact function for x=| 2ro 2rt].
Plot the relativetrue error for each of the approximations
Calculatet the value of sin(x) and the error for x=rt and x=3rt/2 for each of the approximations
How many terms are necessary for an error E<.000001?
Part 2b
Use the centered difference approximation of o(h2 to estimate the first derivative at x=0.7 of
f(x) -0,25x5 0.15x4 1,25x³ 0,35x² 2.1x -1.4
Write script to perform the computation repeatedly, beginning with step size h=1 and then
progressively divide the step size by factor of 10to demonstrate how round off error becomes
dominant as the step size is reduced.
Part 3
Write script that takes in either binary or decimal and converts it to either decimal or binary
respectively. The programshould first ask whether to convertito binary or decimal.

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

NUMERICAL APPROXIMATION IN MATLAB

1. Theory and Background

The main theory is numerical calculations in Matlab. Unlike formal Mathematics, which is exact, Matlab does not know how to store real numbers. Thus all the calculations have rounding errors and this is what will be examined in this report.

In the first part we examine how to solve a system of linear equations that represent the forces applied to a certain system. We can solve this by inverting a matrix and we also examine how Matlab stores variables in vector or matrix form.

In the second part, the issue of computing complex functions like sine is examined. One of the ways to compute an approximation of the sine function numerically is by using its Taylor Series. The more we increase the number of terms, the more accurate the approximating function becomes. We then examine the error that results from using the approximation instead of using the exact function. We then go onto study how to compute the derivative of a function numerically by decreasing the step size. As the step size diminishes, we will see that the error decreases. However, when the step size becomes really small, of the order of 10-9, the rounding error kicks in and we lose accuracy....