Skip to content
Permalink
Browse files

Merge pull request #1 from rcc02007/master

Bringing fork up to date
  • Loading branch information
tgr12001 committed Jan 25, 2017
2 parents 1ac9158 + afbd43c commit ae400d0a234680a80af46f93d231cdc3a3500cbc
@@ -55,3 +55,7 @@
vii. Paste this into the Homework #1 Google form reponse.
(https://goo.gl/forms/jINjsioRLwQOiYtl2)[https://goo.gl/forms/jINjsioRLwQOiYtl2]

![Step 9](g9.png)

viii. Click on the gear for "Settings" then "Collaborators" on the left menu. Add
`rcc02007` (Ryan C. Cooper) as a collaborator.
BIN +76.7 KB HW1/g9.png
Binary file not shown.
@@ -19,11 +19,11 @@ matlab/octave functions and programming best practices.

**Instructor**: Prof. Ryan C. Cooper (ryan.c.cooper@uconn.edu)

**Office hours**: Fridays 10am-12pm in Engineering II room 315
**Office hours**: Mon 2:30-4:30pm and Thur 11am-1pm in Engineering II room 315

## Teaching Assistants:
- Graduate: **TBD**
- Office hours: 2 hours / week in office **TBD**
- Graduate: Peiyu Zhang <peiyu.zhang@uconn.edu>
- Office hours: 2 hours / week

**Prerequisite:** CE 3110, MATH 2410Q

@@ -0,0 +1,111 @@

# Freefall Model
## Octave solution (will run same on Matlab)


```octave
%plot --format svg
```


```octave
set (0, "defaultaxesfontname", "Helvetica")
set (0, "defaultaxesfontsize", 18)
set (0, "defaulttextfontname", "Helvetica")
set (0, "defaulttextfontsize", 18)
set (0, "defaultlinelinewidth", 4)
```

Define time from 0 to 12 seconds


```octave
t=[0,2,4,6,8,10,12]'
```

t =

0
2
4
6
8
10
12



Define constants and analytical solution (meters-kilogram-sec)


```octave
c=0.25; m=60; g=9.81; v_terminal=sqrt(m*g/c);
v_analytical = v_terminal*tanh(g*t/v_terminal)
```

v_analytical =

0.00000
18.61630
32.45521
40.64183
44.84646
46.84974
47.77002




```octave
v_numerical=zeros(length(t),1);
for i=1:length(t)-1
v_numerical(i+1)=v_numerical(i)+(g-c/m*v_numerical(i)^2)*2;
end
v_numerical
```

v_numerical =

0.00000
19.62000
36.03213
44.83284
47.70298
48.35986
48.49089



Display time, velocity (analytical) and velocity (numerical)


```octave
fprintf('time (s)|vel analytical (m/s)|vel numerical (m/s)\n')
fprintf('-----------------------------------------------')
M=[t,v_analytical,v_numerical];
fprintf('%7.1f | %18.2f | %15.2f\n',M(:,1:3)');
```

time (s)|vel analytical (m/s)|vel numerical (m/s)
-----------------------------------------------
0.0 | 0.00 | 0.00
2.0 | 18.62 | 19.62
4.0 | 32.46 | 36.03
6.0 | 40.64 | 44.83
8.0 | 44.85 | 47.70
10.0 | 46.85 | 48.36
12.0 | 47.77 | 48.49



```octave
plot(t,v_analytical,'-',t,v_numerical,'o-')
```


![plot of
velocities](https://github.uconn.edu/rcc02007/ME3255S2017/blob/master/lecture_01/output_10_0.svg)
<img
src="https://github.uconn.edu/rcc02007/ME3255S2017/blob/master/lecture_01/output_10_0.svg">

Binary file not shown.
Binary file not shown.
@@ -0,0 +1,143 @@
<svg height="420px" viewBox="0 0 560 420" width="560px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

<title>Gnuplot</title>
<desc>Produced by GNUPLOT 5.0 patchlevel 3 </desc>

<g id="gnuplot_canvas">

<rect fill="none" height="420" width="560" x="0" y="0"/>
<defs>

<circle id="gpDot" r="0.5" stroke-width="0.5"/>
<path d="M-1,0 h2 M0,-1 v2" id="gpPt0" stroke="currentColor" stroke-width="0.190"/>
<path d="M-1,-1 L1,1 M1,-1 L-1,1" id="gpPt1" stroke="currentColor" stroke-width="0.190"/>
<path d="M-1,0 L1,0 M0,-1 L0,1 M-1,-1 L1,1 M-1,1 L1,-1" id="gpPt2" stroke="currentColor" stroke-width="0.190"/>
<rect height="2" id="gpPt3" stroke="currentColor" stroke-width="0.190" width="2" x="-1" y="-1"/>
<rect fill="currentColor" height="2" id="gpPt4" stroke="currentColor" stroke-width="0.190" width="2" x="-1" y="-1"/>
<circle cx="0" cy="0" id="gpPt5" r="1" stroke="currentColor" stroke-width="0.190"/>
<use fill="currentColor" id="gpPt6" stroke="none" xlink:href="#gpPt5"/>
<path d="M0,-1.33 L-1.33,0.67 L1.33,0.67 z" id="gpPt7" stroke="currentColor" stroke-width="0.190"/>
<use fill="currentColor" id="gpPt8" stroke="none" xlink:href="#gpPt7"/>
<use id="gpPt9" stroke="currentColor" transform="rotate(180)" xlink:href="#gpPt7"/>
<use fill="currentColor" id="gpPt10" stroke="none" xlink:href="#gpPt9"/>
<use id="gpPt11" stroke="currentColor" transform="rotate(45)" xlink:href="#gpPt3"/>
<use fill="currentColor" id="gpPt12" stroke="none" xlink:href="#gpPt11"/>
<path d="M0,1.330 L1.265,0.411 L0.782,-1.067 L-0.782,-1.076 L-1.265,0.411 z" id="gpPt13" stroke="currentColor" stroke-width="0.190"/>
<use fill="currentColor" id="gpPt14" stroke="none" xlink:href="#gpPt13"/>
<filter filterUnits="objectBoundingBox" height="1" id="textbox" width="1" x="0" y="0">
<feFlood flood-color="white" flood-opacity="1" result="bgnd"/>
<feComposite in="SourceGraphic" in2="bgnd" operator="atop"/>
</filter>
<filter filterUnits="objectBoundingBox" height="1" id="greybox" width="1" x="0" y="0">
<feFlood flood-color="lightgrey" flood-opacity="1" result="grey"/>
<feComposite in="SourceGraphic" in2="grey" operator="atop"/>
</filter>
</defs>
<g color="white" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="1.00">
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="1.00">
<g shape-rendering="crispEdges" stroke="none">
<polygon fill="rgb(255, 255, 255)" points="43.6,378.0 530.7,378.0 530.7,19.6 43.6,19.6 "/>
</g>
</g>
<g color="black" fill="none" stroke="rgb(255, 255, 255)" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M43.6,378.0 L58.3,378.0 M530.8,378.0 L516.1,378.0 " stroke="black"/> <g fill="rgb(0,0,0)" font-family="Helvetica" font-size="18.00" stroke="none" text-anchor="end" transform="translate(33.9,384.7)">
<text><tspan font-family="Helvetica">0</tspan></text>
</g>
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M43.6,306.3 L58.3,306.3 M530.8,306.3 L516.1,306.3 " stroke="black"/> <g fill="rgb(0,0,0)" font-family="Helvetica" font-size="18.00" stroke="none" text-anchor="end" transform="translate(33.9,313.0)">
<text><tspan font-family="Helvetica">10</tspan></text>
</g>
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M43.6,234.6 L58.3,234.6 M530.8,234.6 L516.1,234.6 " stroke="black"/> <g fill="rgb(0,0,0)" font-family="Helvetica" font-size="18.00" stroke="none" text-anchor="end" transform="translate(33.9,241.3)">
<text><tspan font-family="Helvetica">20</tspan></text>
</g>
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M43.6,162.9 L58.3,162.9 M530.8,162.9 L516.1,162.9 " stroke="black"/> <g fill="rgb(0,0,0)" font-family="Helvetica" font-size="18.00" stroke="none" text-anchor="end" transform="translate(33.9,169.6)">
<text><tspan font-family="Helvetica">30</tspan></text>
</g>
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M43.6,91.2 L58.3,91.2 M530.8,91.2 L516.1,91.2 " stroke="black"/> <g fill="rgb(0,0,0)" font-family="Helvetica" font-size="18.00" stroke="none" text-anchor="end" transform="translate(33.9,97.9)">
<text><tspan font-family="Helvetica">40</tspan></text>
</g>
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M43.6,19.5 L58.3,19.5 M530.8,19.5 L516.1,19.5 " stroke="black"/> <g fill="rgb(0,0,0)" font-family="Helvetica" font-size="18.00" stroke="none" text-anchor="end" transform="translate(33.9,26.2)">
<text><tspan font-family="Helvetica">50</tspan></text>
</g>
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M43.6,378.0 L43.6,363.3 M43.6,19.5 L43.6,34.2 " stroke="black"/> <g fill="rgb(0,0,0)" font-family="Helvetica" font-size="18.00" stroke="none" text-anchor="middle" transform="translate(43.6,405.7)">
<text><tspan font-family="Helvetica">0</tspan></text>
</g>
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M124.8,378.0 L124.8,363.3 M124.8,19.5 L124.8,34.2 " stroke="black"/> <g fill="rgb(0,0,0)" font-family="Helvetica" font-size="18.00" stroke="none" text-anchor="middle" transform="translate(124.8,405.7)">
<text><tspan font-family="Helvetica">2</tspan></text>
</g>
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M206.0,378.0 L206.0,363.3 M206.0,19.5 L206.0,34.2 " stroke="black"/> <g fill="rgb(0,0,0)" font-family="Helvetica" font-size="18.00" stroke="none" text-anchor="middle" transform="translate(206.0,405.7)">
<text><tspan font-family="Helvetica">4</tspan></text>
</g>
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M287.2,378.0 L287.2,363.3 M287.2,19.5 L287.2,34.2 " stroke="black"/> <g fill="rgb(0,0,0)" font-family="Helvetica" font-size="18.00" stroke="none" text-anchor="middle" transform="translate(287.2,405.7)">
<text><tspan font-family="Helvetica">6</tspan></text>
</g>
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M368.4,378.0 L368.4,363.3 M368.4,19.5 L368.4,34.2 " stroke="black"/> <g fill="rgb(0,0,0)" font-family="Helvetica" font-size="18.00" stroke="none" text-anchor="middle" transform="translate(368.4,405.7)">
<text><tspan font-family="Helvetica">8</tspan></text>
</g>
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M449.6,378.0 L449.6,363.3 M449.6,19.5 L449.6,34.2 " stroke="black"/> <g fill="rgb(0,0,0)" font-family="Helvetica" font-size="18.00" stroke="none" text-anchor="middle" transform="translate(449.6,405.7)">
<text><tspan font-family="Helvetica">10</tspan></text>
</g>
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M530.8,378.0 L530.8,363.3 M530.8,19.5 L530.8,34.2 " stroke="black"/> <g fill="rgb(0,0,0)" font-family="Helvetica" font-size="18.00" stroke="none" text-anchor="middle" transform="translate(530.8,405.7)">
<text><tspan font-family="Helvetica">12</tspan></text>
</g>
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
<path d="M43.6,19.5 L43.6,378.0 L530.8,378.0 L530.8,19.5 L43.6,19.5 Z " stroke="black"/></g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
</g>
<g id="gnuplot_plot_1a"><title>gnuplot_plot_1a</title>
<g color="white" fill="none" stroke="black" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="4.00">
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="4.00">
<path d="M43.6,378.0 L124.8,244.5 L206.0,145.3 L287.2,86.6 L368.4,56.5 L449.6,42.1 L530.8,35.5 " stroke="rgb( 0, 0, 255)"/></g>
</g>
<g id="gnuplot_plot_2a"><title>gnuplot_plot_2a</title>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="4.00">
<path d="M43.6,378.0 L124.8,237.3 L206.0,119.6 L287.2,56.5 L368.4,36.0 L449.6,31.3 L530.8,30.3 " stroke="rgb( 0, 128, 0)"/> <g onmousemove="gnuplot_svg.showHypertext(evt,'')" onmouseout="gnuplot_svg.hideHypertext()"><title> </title>
<use color="rgb( 0, 128, 0)" transform="translate(43.6,378.0) scale(10.50)" xlink:href="#gpPt5"/></g>
<use color="rgb( 0, 128, 0)" transform="translate(124.8,237.3) scale(10.50)" xlink:href="#gpPt5"/>
<use color="rgb( 0, 128, 0)" transform="translate(206.0,119.6) scale(10.50)" xlink:href="#gpPt5"/>
<use color="rgb( 0, 128, 0)" transform="translate(287.2,56.5) scale(10.50)" xlink:href="#gpPt5"/>
<use color="rgb( 0, 128, 0)" transform="translate(368.4,36.0) scale(10.50)" xlink:href="#gpPt5"/>
<use color="rgb( 0, 128, 0)" transform="translate(449.6,31.3) scale(10.50)" xlink:href="#gpPt5"/>
<use color="rgb( 0, 128, 0)" transform="translate(530.8,30.3) scale(10.50)" xlink:href="#gpPt5"/>
</g>
</g>
<g color="white" fill="none" stroke="rgb( 0, 128, 0)" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="2.00">
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="2.00">
</g>
<g color="black" fill="none" stroke="black" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
</g>
<g color="black" fill="none" stroke="currentColor" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="0.50">
</g>
</g>
</svg>

0 comments on commit ae400d0

Please sign in to comment.
You can’t perform that action at this time.