Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
ayr13001 committed Nov 18, 2017
1 parent 482822a commit 02ff4e3
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions README.md
Expand Up @@ -2,7 +2,7 @@
ME 3255
Homework 5

##Problem 2
## Problem 2

Least Squares function
```matlab
Expand Down Expand Up @@ -52,24 +52,24 @@ plot(xd,fx,xd,yd,'o','Linewidth',2)
```

Output:
###Part A: 0.9801
### Part A: 0.9801

![Part A](./figure1.png)

###Part B: 0.9112
### Part B: 0.9112

![Part B](./figure2.png)

###Part C: 0.9462
### Part C: 0.9462

![Part C](./figure3.png)

###Part D: 0.9219
### Part D: 0.9219

![Part D](./figure4.png)

##Problem 3
###Part A
## Problem 3
### Part A
```matlab
darts = dlmread('compiled_data.csv',',',1,0);
x_darts =darts(:,2).*cosd(darts(:,3));
Expand All @@ -91,7 +91,7 @@ end
Most accurate dart thrower: User 31
- combined mean of x & y of 0.0044cm from zero

###Part B
### Part B
```matlab
darts = dlmread('compiled_data.csv',',',1,0);
x_darts =darts(:,2).*cosd(darts(:,3));
Expand All @@ -113,8 +113,8 @@ end
Most precise dart thrower: User 32
- combined x & y STD of 3.4073

#Problem 4
###Part A
# Problem 4
### Part A
```matlab
function [mean_buckle_load,std_buckle_load]=buckle_monte_carlo(E,r_mean,r_std,L_mean,L_std);
Expand All @@ -124,7 +124,6 @@ r_std=.001;
L_mean=5;
L_std=L_mean*0.01;
rrand=normrnd(r_mean,r_std,[N,1]);
Lrand=normrnd(L_mean,L_std,[N,1]);
E = 200*10^9;
Expand All @@ -140,7 +139,7 @@ Output:
- Mean_buckle_load = 164.4154 N
- STD = 63.6238 N

###Part B
### Part B
```matlab
function [mean_buckle_load,std_buckle_load]=buckle_monte_carlo_2(E,r_mean,r_std,P_cr);
Expand All @@ -158,8 +157,9 @@ end
```
Output:
- L = 5.0108 m
#Problem 5
###Part A

# Problem 5
### Part A
```matlab
cd_out_linear = sphere_drag(300,'linear') = 0.1750
cd_out_spline = sphere_drag(300,'spline') = 0.1809
Expand All @@ -169,15 +169,15 @@ cd_out_pchip = sphere_drag(300,'pchip') = 0.1807
### Part B
![Drag Force vs. Velocity (3 Interpolation Methods)](./figure5.png)

#Problem 6
###Analytical
# Problem 6
### Analytical
```matlab
fun = @(x) (1/6).*(x).^3+(1/2).*(x).^2+(x);
q = integral(fun,2,3)
```

###Gauss Quadrature
###1-point
### Gauss Quadrature
### 1-point
```matlab
x = [0];
c = [2];
Expand All @@ -188,7 +188,7 @@ tildex = (b-a)/2*x + (b+a)/2;
f = (1/6).*(tildex).^3+(1/2).*(tildex).^2+(tildex);
value1 = sum(tildec.*f)
```
###2-point
### 2-point
```matlab
x = [-0.57735,0.57735];
c = [1,1];
Expand All @@ -199,7 +199,7 @@ tildex = (b-a)/2*x + (b+a)/2;
f = (1/6).*(tildex).^3+(1/2).*(tildex).^2+(tildex);
value2 = sum(tildec.*f)
```
##3-point
### 3-point
```matlab
%Three Point
x = [-0.77459666,0,0.77459666];
Expand Down

0 comments on commit 02ff4e3

Please sign in to comment.