Main

Programming Assignments

Main.CourseHomework History

Hide minor edits - Show changes to output

May 25, 2018, at 06:01 AM by 45.56.3.173 -
Changed lines 765-766 from:
** [[ https://youtu.be/ezuRn1ViIJE|Solutions (1-5)]], [[https://youtu.be/8SNaW1nt6j0|Solution 6]]
to:
** [[ https://youtu.be/ezuRn1ViIJE|Solutions 1-5]], [[https://youtu.be/8SNaW1nt6j0|Solution 6]]
Changed line 769 from:
** [[https://youtu.be/oCr2eUIYznc|Solutions]]
to:
** [[https://youtu.be/oCr2eUIYznc|Solutions 1-2]], [[https://youtu.be/vjCctma5dYg|Solution 3]]
May 21, 2018, at 05:15 PM by 184.254.134.139 -
Changed line 761 from:
** [[https://youtu.be/ygoohjN_Lww|Solution 2]]
to:
** [[https://youtu.be/vY9Sv605E8c|Solution 1]], [[https://youtu.be/ygoohjN_Lww|Solution 2]]
May 17, 2018, at 02:15 PM by 45.56.3.173 -
Changed lines 760-761 from:
** [[Main/PythonWidgets|User Interaction]]
** [[https://youtu.be/ouyg_TQGI2Q|Solution 2 (Video)]] - [[Attach:hw10.zip|Solution 2 (.py)]] - [[https://youtu.be/ygoohjN_Lww|Solution 3]]
to:
** [[http://apmonitor.com/heat.htm|Temperature Control Lab]]
** [[https://youtu.be/ygoohjN_Lww|Solution 2]]
May 08, 2018, at 02:44 PM by 45.56.3.173 -
Added line 336:
** Python [[https://youtu.be/sGZbQgDOfi4|Solution 1]]
May 08, 2018, at 02:42 PM by 45.56.3.173 -
Changed line 376 from:
# plot data and prediciton
to:
# plot data and prediction
Changed line 446 from:
# plot data and prediciton
to:
# plot data and prediction
May 07, 2018, at 02:53 PM by 45.56.3.173 -
Changed line 7 from:
Complete the following assignments with Microsoft Excel, Google Sheets, or another similar spreadsheet program. Microsoft Excel solutions are shown for each problem but should only be used as a learning resource, not to merely complete the assignment. Python solutions are shown as a reference and introduction to programming but are not required.
to:
Complete the following assignments with Microsoft Excel, Google Sheets, or another similar spreadsheet program. Microsoft Excel solutions are shown for each problem but should only be used as a learning resource, not to merely complete the assignment. Python solutions are shown as examples of programming but are not required.
May 07, 2018, at 02:51 PM by 45.56.3.173 -
Deleted lines 720-725:
** (:toggle hide hw6_1 button show="Solution 1 (Python)":)
(:div id=hw6_1:)
(:source lang=python:)

(:sourceend:)
(:divend:)
May 07, 2018, at 02:50 PM by 45.56.3.173 -
Changed lines 300-329 from:
to:
from gekko import GEKKO

# constants
y1 = 0.33
y2 = 1.0-y1
P = 120.0 # kPa

# Antoine constants
# Benzene
ac1 = [13.7819, 2726.81, 217.572]
# Toluene
ac2 = [13.9320, 3056.96, 217.625]

# gekko model
m = GEKKO()
T = m.Var(value=100)
x1,x2 = [m.Var(value=0.5,lb=0,ub=1) for i in range(2)]
# vapor pressure
Psat1 = m.Intermediate(m.exp(ac1[0]-ac1[1]/(T+ac1[2])))
Psat2 = m.Intermediate(m.exp(ac2[0]-ac2[1]/(T+ac2[2])))
# Raoult's law
m.Equation(y1*P==x1*Psat1)
m.Equation(y2*P==x2*Psat2)
m.Equation(x1+x2==1)
m.options.IMODE=1
m.solve(disp=False)
print('Gekko Solution')
print('x1: ' + str(x1.value))
print('x2: ' + str(x2.value))
print('T:  ' + str(T.value))
Changed lines 336-337 from:
** (:toggle hide hw4_1 button show="Solution 1 (Python)":)
(:div id=hw4_1:)
to:
** (:toggle hide hw4_1a button show="Solution 1 (Python curve_fit)":)
(:div id=hw4_1a:)
Changed lines 339-384 from:
to:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from sklearn.metrics import r2_score

# import data
# Time (sec),Heart Rate (BPM)
url = 'http://apmonitor.com/che263/uploads/Main/heart_rate.txt'
x = pd.read_csv(url)

# print first rows
print('Data')
print(x.head())

# extract vectors
t = x['Time (sec)'].values
ym = x['Heart Rate (BPM)'].values

# define function for fitting
def bpm(t,c0,c1,c2,c3):
    return c0+c1*t-c2*np.exp(-c3*t)

# find optimal parameters
p0 = [100,0.01,100,0.01]        # initial guesses
c,cov = curve_fit(bpm,t,ym,p0)  # fit model

# print parameters
print('Optimal parameters')
print(c)

# calculate prediction
yp = bpm(t,c[0],c[1],c[2],c[3])

# calculate r^2
print('R^2: ' + str(r2_score(ym,yp)))

# plot data and prediciton
plt.figure()
plt.title('Heart Rate Regression')
plt.plot(t/60.0,ym,'r--',label='Measured')
plt.plot(t/60.0,yp,'b-',label='Predicted')
plt.ylabel('Rate (BPM)')
plt.xlabel('Time (min)')
plt.legend(loc='best')
plt.show()
Changed lines 387-388 from:
** (:toggle hide hw4_2 button show="Solution 2 (Python)":)
(:div id=hw4_2:)
to:
** (:toggle hide hw4_1b button show="Solution 1 (Python GEKKO)":)
(:div id=hw4_1b:)
Changed lines 390-454 from:
to:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from gekko import GEKKO
from sklearn.metrics import r2_score

# import data
# Time (sec),Heart Rate (BPM)
url = 'http://apmonitor.com/che263/uploads/Main/heart_rate.txt'
x = pd.read_csv(url)

# print first rows
print('Data')
print(x.head())

# extract vectors
t = np.array(x['Time (sec)'])
ym = np.array(x['Heart Rate (BPM)'])

# GEKKO model
m = GEKKO()

# parameters
tm = m.Param(value=t)
c0 = m.FV(value=100)
c1 = m.FV(value=0.01)
c2 = m.FV(value=100)
c3 = m.FV(value=0.01)
c0.STATUS=1
c1.STATUS=1
c2.STATUS=1
c3.STATUS=1

# variables
bpm = m.CV(value=ym)
bpm.FSTATUS=1

# regression equation
m.Equation(bpm==c0+c1*tm-c2*m.exp(-c3*tm))

# regression mode
m.options.IMODE = 2 

# optimize
m.solve()

# print parameters
print('Optimal parameters')
print(c0.value[0])
print(c1.value[0])
print(c2.value[0])
print(c3.value[0])

# calculate r^2
print('R^2: ' + str(r2_score(ym,bpm)))

# plot data and prediciton
plt.figure()
plt.title('Heart Rate Regression')
plt.plot(t/60.0,ym,'r--',label='Measured')
plt.plot(t/60.0,bpm,'b-',label='Predicted')
plt.ylabel('Rate (BPM)')
plt.xlabel('Time (min)')
plt.legend(loc='best')
plt.show()
Changed lines 457-458 from:
** (:toggle hide hw4_3 button show="Solution 3 (Python)":)
(:div id=hw4_3:)
to:
** (:toggle hide hw4_2 button show="Solution 2 (Python)":)
(:div id=hw4_2:)
Changed lines 460-511 from:
to:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from sklearn.metrics import r2_score

# import data
# time (min),y
url = 'http://apmonitor.com/che263/uploads/Main/dynamics.txt'
x = pd.read_csv(url)

# print first rows
print('Data')
print(x.head())

# extract vectors
t = x['time (min)'].values
ym = x['y'].values

# define function for fitting
def yfcn(t,tau,theta):
    n = len(t)
    res = np.zeros(n)
    for i in range(n):
        if i>=theta:
            res[i] = 5.0*(1.0-np.exp(-(t[i]-theta)/tau))
    return res

# find optimal parameters
c,cov = curve_fit(yfcn,t,ym)

# print parameters
print('Optimal parameters')
tau = c[0]
theta = c[1]
print(c)

# calculate prediction
yp = yfcn(t,tau,theta)

# calculate r^2
print('R^2: ', r2_score(yp,ym))

# plot data and prediciton
plt.figure()
plt.title('Step Test Regression')
plt.plot(t,ym,'ro',label='Measured')
plt.plot(t,yp,'b-',label='Predicted')
plt.ylabel('Response')
plt.xlabel('Time (min)')
plt.legend(loc='best')
plt.show()
Changed lines 514-519 from:

*[[Attach:hw5.pdf|Assignment #5]]
** [[Main/ExcelEulers|Differential Equation
Solution]]
** Excel [[https
://youtu.be/cc8CuFTX5CI|Solution 1]], [[https://youtu.be/ySrMlC-bnGM|Solution 2]]
** (:toggle hide hw5_1 button show="Solution 1 (Python)":)
(:div id=hw5_1
:)
to:
** (:toggle hide hw4_3 button show="Solution 3 (Python)":)
(:div id=hw4_3
:)
Changed lines 517-536 from:
to:
import numpy as np
import matplotlib.pyplot as plt

# generate 1000 random numbers
#  with Poisson distribution and lambda=1
n = 1000
lam = 1
x = np.random.poisson(lam,n)

# count number in each bin
bins=[0,1,2,3,4,5,6]
hist, _ = np.histogram(x, bins)

# plot histogram data
plt.bar(bins[0:-1],hist,label='1000 samples')
plt.xlabel('bin')
plt.ylabel('count')
plt.title('Poisson Distribution (lambda=1)')
plt.legend(loc='best')
plt.show()
Changed lines 539-540 from:
** (:toggle hide hw5_2 button show="Solution 2 (Python)":)
(:div id=hw5_2
:)
to:

*[[Attach:hw5.pdf|Assignment #5]]
** [[Main/ExcelEulers|Differential Equation Solution]]
** Excel [[https
://youtu.be/cc8CuFTX5CI|Solution 1]], [[https://youtu.be/ySrMlC-bnGM|Solution 2]]
** (:toggle hide hw5_1ab button show="Solution 1ab (Python)":)
(:div id=hw5_1ab
:)
Changed lines 546-601 from:
to:
import numpy as np
import matplotlib.pyplot as plt
from gekko import GEKKO
from scipy.integrate import odeint

# number of time points
n = 15
# final time
tf = 7.0
# initial concentration
Ca0 = 5.0
# constants
k = 1 # 1/s

# method #1 Analytical solution
# Ca(t) = Ca(0) * exp(-k*t)
t = np.linspace(0,tf,n)
Ca_m1 = Ca0 * np.exp(-k*t)

# method #2 Euler's method
Ca_m2 = np.empty(n)
Ca_m2[0] = Ca0 # kmol/m^3
for i in range(1,n):
    dt = t[i] - t[i-1]
    Ca_m2[i] = Ca_m2[i-1] - k * Ca_m2[i-1] * dt

# method #3: GEKKO solution
# create new gekko model
m = GEKKO()
# integration time points
m.time = t
# variables
Ca = m.Var(value=Ca0)
# differential equation
m.Equation(Ca.dt()==-k*Ca)
# set options
m.options.IMODE = 4 # dynamic simulation
m.options.NODES = 3 # collocation nodes
# simulate ODE
m.solve()

# method #4: ODEINT from SciPy
def dCadt(t,Ca):
    return -k * Ca
Ca_m4 = odeint(dCadt,t,Ca0)

# plot results
plt.figure(1)
plt.plot(t,Ca_m1,'r-',label='Ca (Analytical)')
plt.plot(t,Ca_m2,'ko',label='Ca (Euler)')
plt.plot(t,Ca,'b--',label='Ca (GEKKO)')
plt.plot(t,Ca,'ys',label='Ca (ODEINT)')
plt.xlabel('Time (sec)')
plt.ylabel(r'$C_a (kmol/m^3)$')
plt.legend(loc='best')
plt.show()
Changed lines 604-609 from:

*[[Attach:hw6.pdf|Assignment #6]]
** [[Main/VbaMacro|VBA Macros]]
** Excel [[https
://youtu.be/bHwFTDp5g6A|Solution 1]], [[https://youtu.be/0C6QMin5OZc|Solution 2]]
** (:toggle hide hw6_1 button show="Solution 1 (Python)":)
(:div id=hw6_1
:)
to:
** (:toggle hide hw5_1c button show="Solution 1c (Python)":)
(:div id=hw5_1c
:)
Changed lines 607-660 from:
to:
import numpy as np
import matplotlib.pyplot as plt
from gekko import GEKKO
from scipy.integrate import odeint

# number of time points
n = 15
# final time
tf = 7.0
# initial concentration
Ca0 = 5.0
# constants
k = 1 # 1/s

# method #1 Analytical solution
# Ca(t) = Ca(0) * exp(-k*t)
t = np.linspace(0,tf,n)
Ca_m1 = Ca0 * np.exp(-k*t)

# method #2 Euler's method
t2 = np.arange(0,tf,0.5)
n = len(t2)
Ca_m2 = np.empty_like(t2)
Ca_m2[0] = Ca0 # kmol/m^3
for i in range(1,n):
    dt = t2[i] - t2[i-1]
    Ca_m2[i] = Ca_m2[i-1] - k * Ca_m2[i-1] * dt

t3 = np.arange(0,tf,1.5)
n = len(t3)
Ca_m3 = np.empty_like(t3)
Ca_m3[0] = Ca0 # kmol/m^3
for i in range(1,n):
    dt = t3[i] - t3[i-1]
    Ca_m3[i] = Ca_m3[i-1] - k * Ca_m3[i-1] * dt

t4 = np.arange(0,tf,2.1)
n = len(t4)
Ca_m4 = np.empty_like(t4)
Ca_m4[0] = Ca0 # kmol/m^3
for i in range(1,n):
    dt = t4[i] - t4[i-1]
    Ca_m4[i] = Ca_m4[i-1] - k * Ca_m4[i-1] * dt

# plot results
plt.figure(1)
plt.plot(t,Ca_m1,'r-',label='Ca (Analytical)')
plt.plot(t2,Ca_m2,'k.-',label='Ca (Euler 0.5)')
plt.plot(t3,Ca_m3,'bo-',label='Ca (Euler 1.5)')
plt.plot(t4,Ca_m4,'y--',label='Ca (Euler 2.1)')
plt.xlabel('Time (sec)')
plt.ylabel(r'$C_a (kmol/m^3)$')
plt.legend(loc='best')
plt.show()
Changed lines 663-664 from:
** (:toggle hide hw6_2 button show="Solution 2 (Python)":)
(:div id=hw6_2:)
to:
** (:toggle hide hw5_2 button show="Solution 2 (Python)":)
(:div id=hw5_2:)
Changed lines 666-744 from:
to:
import numpy as np
import matplotlib.pyplot as plt
from gekko import GEKKO

# final time
tf = 3.0

# constants
k1 = 1.0 # L/mol-s
k2 = 1.5 # L/mol-s

# GEKKO solution
# create new gekko model
m = GEKKO()
# integration time points
m.time = np.arange(0,tf+0.01,0.2)
# variables
Ca = m.Var(value=1.0)
Cb = m.Var(value=1.0)
Cc = m.Var(value=0.0)
Cd = m.Var(value=0.0)
S = m.Var(value=1.0)
# differential equations
m.Equation(Ca.dt()==-k1*Ca*Cb)
m.Equation(Cb.dt()==-k1*Ca*Cb-k2*Cb*Cc)
m.Equation(Cc.dt()== k1*Ca*Cb-k2*Cb*Cc)
m.Equation(Cd.dt()== k2*Cb*Cc)
m.Equation(S==Cc/(Cc+Cd))
# set options
m.options.IMODE = 4 # dynamic simulation
m.options.NODES = 3 # collocation nodes
# simulate ODE
m.solve()

# plot results
plt.figure(1)
plt.subplot(2,1,1)
plt.plot(m.time,Ca,'r-',label='Ca',linewidth=2.0)
plt.plot(m.time,Cb,'k.-',label='Cb',linewidth=2.0)
plt.plot(m.time,Cc,'b--',label='Cc',linewidth=2.0)
plt.plot(m.time,Cd,'y:',label='Cd',linewidth=3.0)
plt.ylabel('Conc (mol/L)')
plt.legend(loc='best')

plt.subplot(2,1,2)
plt.plot(m.time,S,'k-',label='Selectivity',linewidth=2.0)
plt.xlabel('Time (sec)')
plt.legend(loc='best')
plt.show()
(:sourceend:)
(:divend:)

*[[Attach:hw6.pdf|Assignment #6]]
** [[Main/VbaMacro|VBA Macros]]
** Excel [[https://youtu.be/bHwFTDp5g6A|Solution 1]], [[https://youtu.be/0C6QMin5OZc|Solution 2]]
** (:toggle hide hw6_1 button show="Solution 1 (Python)":)
(:div id=hw6_1:)
(:source lang=python:)

(:sourceend:)
(:divend:)
** (:toggle hide hw6_2 button show="Solution 2 (Python)":)
(:div id=hw6_2:)
(:source lang=python:)
import numpy as np

r = 5    # m
h = 10    # m
F = 15    # m^3/min
t = 180  # min

V_tank = np.pi * r**2 * h  # m^3
V_crude_oil = F * t # m^3

if V_crude_oil > V_tank:
    print('Tank Overfilled by ' \
          + str(V_crude_oil-V_tank) + ' m^3')
else:
    print('Not Overfilled')
May 07, 2018, at 02:45 PM by 45.56.3.173 -
Changed lines 266-294 from:
to:
import numpy as np
from scipy.optimize import fsolve

# constants
TC = 77 # degC
P = 1.0 # bar
a = 2.877e8 # cm^6 bar K^0.5 / mol^2
b = 60.211  # cm^3 / mol
Rg = 83.144598 # cm^3 bar / K-mol
# derived quantities
TK = TC+273.15 # K

# method #1: NumPy
def f(V):
    return P - Rg*TK/(V-b)+a/(np.sqrt(TK)*V*(V+b))
V_liq = fsolve(f,82)    # Liquid root
V_vap = fsolve(f,28600) # Vapor root
print('NumPy Solution')
print(V_liq,V_vap)

# method #2: Gekko
from gekko import GEKKO
m = GEKKO()
V = m.Var(value=[82,28600])
m.Equation(P==Rg*TK/(V-b)-a/(m.sqrt(TK)*V*(V+b)))
m.options.IMODE=2
m.solve(disp=False)
print('Gekko Solution')
print(V.value)
May 07, 2018, at 02:44 PM by 45.56.3.173 -
Changed lines 7-8 from:
Complete the following assignments with Microsoft Excel, Google Sheets, or another equivalent spreadsheet program. Python solutions are also shown as a reference and introduction but not required.
to:
Complete the following assignments with Microsoft Excel, Google Sheets, or another similar spreadsheet program. Microsoft Excel solutions are shown for each problem but should only be used as a learning resource, not to merely complete the assignment. Python solutions are shown as a reference and introduction to programming but are not required.
Changed line 12 from:
** [[https://youtu.be/VPjoNrtm8wk|Solution 2]], [[https://youtu.be/JF7Lda8_YzE|Solution 3]]
to:
** Excel [[https://youtu.be/VPjoNrtm8wk|Solution 2]], [[https://youtu.be/JF7Lda8_YzE|Solution 3]]
Changed line 63 from:
plt.contourf(Tm,Vm,Pm,cmap='RdBu_r')
to:
plt.contourf(Vm,Tm,Pm,cmap='RdBu_r')
Changed line 65 from:
CS2 = plt.contour(Tm,Vm,Pm,[1.0,2.5],colors='k')
to:
CS2 = plt.contour(Vm,Tm,Pm,[1.0,2.5],colors='k')
Changed lines 67-68 from:
plt.xlabel('Temperature (K)')
plt.ylabel('Volume (L)')
to:
plt.xlabel('Volume (L)')
plt.ylabel('Temperature (K)')
Changed line 76 from:
** [[https://youtu.be/CchyR-vmFbk|Solution 1]], [[https://youtu.be/6vFynd2bGoQ|Solution 2]], [[https://youtu.be/AJwxW6oMu_E|Solution 3]]
to:
** Excel [[https://youtu.be/CchyR-vmFbk|Solution 1]], [[https://youtu.be/6vFynd2bGoQ|Solution 2]], [[https://youtu.be/AJwxW6oMu_E|Solution 3]]
Added lines 80-119:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

# import April 2018 data or get new data from finance.yahoo.com
appl = pd.read_csv('http://apmonitor.com/che263/uploads/Main/AAPL.csv')
goog = pd.read_csv('http://apmonitor.com/che263/uploads/Main/GOOG.csv')
#xom = pd.read_csv('http://apmonitor.com/che263/uploads/Main/XOM.csv')
# create dictionary of stocks
s = dict([('Apple',appl),('Google',goog)]) #,('ExxonMobil',xom)])

# print column headers and starting rows (5 is default)
print('Apple Data')
print(s['Apple'].head())

# print column headers and ending close price (4 rows)
print('Google Data')
print(s['Google']['Close'].tail(4))

# basic data statistics
for i in s:
    print('Stock: ' + i)
    print(' max  : ' + str(max(s[i]['Close'])))
    print(' min  : ' + str(min(s[i]['Close'])))
    print(' stdev : ' + str(np.std(s[i]['Close'])))
    print(' avg  : ' + str(np.mean(s[i]['Close'])))
    print(' median: ' + str(np.median(s[i]['Close'])))

# plot data
plt.figure()
sty = dict([('Apple','r--'),('Google','b:'),('ExxonMobil','k-')])
ni = 0
for i in s:
    mc = max(s[i]['Close'])
    plt.plot(s[i]['Date'],s[i]['Close']/mc,sty[i],linewidth=3,label=i)
    plt.plot(s[i]['Date'],s[i]['High']/mc,sty[i],linewidth=1)
    plt.plot(s[i]['Date'],s[i]['Low']/mc,sty[i],linewidth=1)
plt.xticks(rotation=90)
plt.legend(loc='best')
plt.show()
Added lines 125-151:
import pandas as pd
import matplotlib.pyplot as plt

# import data
# Time (sec), Heater 1, Heater 2, Temperature 1, Temperature 2
x = pd.read_csv('http://apmonitor.com/che263/uploads/Main/tclab.txt')

# print column headers and starting 10 rows (5 is default)
print('Data')
print(x.head(10))

# plot data
plt.figure()
plt.subplot(2,1,1)
plt.title('Temperature Control Lab')
plt.plot(x['Time (sec)'],x['Temperature 1'],'r--')
plt.plot(x['Time (sec)'],x['Temperature 2'],'b-')
plt.ylabel('Temp (degC)')
plt.legend(loc='best')

plt.subplot(2,1,2)
plt.plot(x['Time (sec)'],x['Heater 1'],'r--')
plt.plot(x['Time (sec)'],x['Heater 2'],'b-')
plt.ylabel('Heater (%)')
plt.xlabel('Time (sec)')
plt.legend(loc='best')
plt.show()
Added lines 157-197:
import math as m

# part a
help(m.cos)
y = m.cos(0.5)
print('cos(0.5): ' + str(y))

# part b
y = m.sin(30.0*(m.pi/180.0))
print('sin(30 deg): ' + str(y))

# part c
y = m.tan(m.pi/2.0)
print('tan(pi/x): ' + str(y))

# part d
x = 5.0
y = max(2.0*m.sqrt(x),(x**2)/2.0,\
        (x**3)/3.0,(x**2+x**3)/5.0)
print('max value: ' + str(y))

# part e
x = 25
y = m.factorial(x)
print('25!: ' + str(y))

# part f
x = 0.5
# if..else statement
if x<1.0:
    y = x**2
else:
    y = m.sin(m.pi*x/2.0)
# same but one line
y = x**2 if x<1.0 else m.sin(m.pi*x/2.0)
print('if statement result: ' + str(y))

# part g
x = 4.999
y = m.floor(x)
print('floor(4.999): ' + str(y))
Changed lines 203-204 from:
** [[https://youtu.be/wbDfPIpTf4E|Solution 1]], [[https://youtu.be/td9AQZF5gIM|Solution 2]], [[https://youtu.be/GMC31hEhFMg|Solution 3]], [[https://youtu.be/7HDO0ORwjn0|Solution 4]]
to:
** Excel [[https://youtu.be/wbDfPIpTf4E|Solution 1]], [[https://youtu.be/td9AQZF5gIM|Solution 2]], [[https://youtu.be/GMC31hEhFMg|Solution 3]], [[https://youtu.be/7HDO0ORwjn0|Solution 4]]
** (:toggle hide hw3_1 button show="Solution 1 (Python)":)
(:div id=hw3_1:)
(:source lang=python:)
# method #1: NumPy
from numpy.linalg import solve
A = [[11.0, 3.0, 0.0,  1.0,  2.0],\
    [ 0.0, 4.0, 2.0,  0.0,  1.0],\
    [ 3.0, 2.0, 7.0,  1.0,  0.0],\
    [ 4.0, 0.0, 4.0, 10.0,  1.0],\
    [ 2.0, 5.0, 1.0,  3.0, 14.0]]
b = [45.0, 30.0, 15.0, 20.0, 92.0]
x = solve(A,b)
print('NumPy Solution')
print(x)

# method #2: Gekko
from gekko import GEKKO
m = GEKKO()
x1,x2,x3,x4,x5 = [m.Var() for i in range(5)]
m.Equation(11*x1+3*x2+x4+2*x5==45)
m.Equation(4*x2+2*x3+x5==30)
m.Equation(3*x1+2*x2+7*x3+x4==15)
m.Equation(4*x1+4*x3+10*x4+x5==20)
m.Equation(2*x1+5*x2+x3+3*x4+14*x5==92)
m.solve(disp=False)
print('Gekko Solution')
print(x1.value)
print(x2.value)
print(x3.value)
print(x4.value)
print(x5.value)
(:sourceend:)
(:divend:)
** (:toggle hide hw3_2 button show="Solution 2 (Python)":)
(:div id=hw3_2:)
(:source lang=python:)
# method #1: NumPy
from scipy.optimize import fsolve
def f(z):
    x,y=z
    f1 = 2*x**2+y**2-1
    f2 = (0.5*x-0.5)**2+2.0*(y-0.25)**2-1
    return [f1,f2]
x,y = fsolve(f,[1,1])
print('NumPy Solution')
print(x,y)

# method #2: Gekko
from gekko import GEKKO
m = GEKKO()
x,y = [m.Var(value=1) for i in range(2)]
m.Equation(2*x**2+y**2==1)
m.Equation((0.5*x-0.5)**2+2.0*(y-0.25)**2==1)
m.solve(disp=False)
print('Gekko Solution')
print(x.value)
print(y.value)
(:sourceend:)
(:divend:)
** (:toggle hide hw3_3 button show="Solution 3 (Python)":)
(:div id=hw3_3:)
(:source lang=python:)

(:sourceend:)
(:divend:)
** (:toggle hide hw3_4 button show="Solution 3 (Python)":)
(:div id=hw3_4:)
(:source lang=python:)

(:sourceend:)
(:divend:)

Changed lines 278-279 from:
** [[https://youtu.be/X4jneorGsls|Solution 1]], [[https://youtu.be/eXco8_3MmjI|Solution 2]], [[https://youtu.be/kehsHfFMsAE|Solution 3]]
to:
** Excel [[https://youtu.be/X4jneorGsls|Solution 1]], [[https://youtu.be/eXco8_3MmjI|Solution 2]], [[https://youtu.be/kehsHfFMsAE|Solution 3]]
** (:toggle hide hw4_1 button show="Solution 1 (Python)":)
(:div id=hw4_1:)
(:source lang=python:)

(:sourceend:)
(:divend:)
** (:toggle hide hw4_2 button show="Solution 2 (Python)":)
(:div id=hw4_2:)
(:source lang=python:)

(:sourceend:)
(:divend:)
** (:toggle hide hw4_3 button show="Solution 3 (Python)":)
(:div id=hw4_3:)
(:source lang=python:)

(:sourceend:)
(:divend:)

Changed lines 300-301 from:
** [[https://youtu.be/cc8CuFTX5CI|Solution 1]], [[https://youtu.be/ySrMlC-bnGM|Solution 2]]
to:
** Excel [[https://youtu.be/cc8CuFTX5CI|Solution 1]], [[https://youtu.be/ySrMlC-bnGM|Solution 2]]
** (:toggle hide hw5_1 button show="Solution 1 (Python)":)
(:div id=hw5_1:)
(:source lang=python:)

(:sourceend:)
(:divend:)
** (:toggle hide hw5_2 button show="Solution 2 (Python)":)
(:div id=hw5_2:)
(:source lang=python:)

(:sourceend:)
(:divend:)

Changed lines 316-328 from:
** [[https://youtu.be/bHwFTDp5g6A|Solution 1]], [[https://youtu.be/0C6QMin5OZc|Solution 2]]
to:
** Excel [[https://youtu.be/bHwFTDp5g6A|Solution 1]], [[https://youtu.be/0C6QMin5OZc|Solution 2]]
** (:toggle hide hw6_1 button show="Solution 1 (Python)":)
(:div id=hw6_1:)
(:source lang=python:)

(:sourceend:)
(:divend:)
** (:toggle hide hw6_2 button show="Solution 2 (Python)":)
(:div id=hw6_2:)
(:source lang=python:)

(:sourceend:)
(:divend:)
May 07, 2018, at 02:33 PM by 45.56.3.173 -
Added lines 6-7:

Complete the following assignments with Microsoft Excel, Google Sheets, or another equivalent spreadsheet program. Python solutions are also shown as a reference and introduction but not required.
May 07, 2018, at 02:29 PM by 45.56.3.173 -
Changed line 76 from:
(:div id=hw1_3:)
to:
(:div id=hw2_1:)
Changed line 81 from:
(:div id=hw1_3:)
to:
(:div id=hw2_2:)
Changed line 86 from:
(:div id=hw1_3:)
to:
(:div id=hw2_3:)
May 07, 2018, at 02:29 PM by 45.56.3.173 -
Changed lines 35-70 from:
to:
** (:toggle hide hw1_3 button show="Solution 3 (Python)":)
(:div id=hw1_3:)
%width=500px%Attach:pressure_contour.png
(:source lang=python:)
import numpy as np
import matplotlib.pyplot as plt

# calculate initial moles of N2
T = 298.15  # K
P = 1.25    # atm
V = 4000    # L
Rg = 0.0821 # L*atm/mol/K
n_N2 = P*V/(Rg*T) # moles of N2
n_N2 = n_N2 * 0.25  # moles with 25% remaining

# calculate N2 pressure at different V and T
n = 20 # grid points
V = np.linspace(500,1000,n)
T = np.linspace(100,600,n)
# create meshgrid
Vm,Tm = np.meshgrid(V,T)
# calculate pressure
Pm = n_N2 * Rg * Tm / Vm

# plot results
plt.figure()
plt.contourf(Tm,Vm,Pm,cmap='RdBu_r')
plt.colorbar()
CS2 = plt.contour(Tm,Vm,Pm,[1.0,2.5],colors='k')
plt.clabel(CS2, inline=1, fontsize=10)
plt.xlabel('Temperature (K)')
plt.ylabel('Volume (L)')
plt.show()
(:sourceend:)
(:divend:)

Added lines 75-89:
** (:toggle hide hw2_1 button show="Solution 1 (Python)":)
(:div id=hw1_3:)
(:source lang=python:)
(:sourceend:)
(:divend:)
** (:toggle hide hw2_2 button show="Solution 2 (Python)":)
(:div id=hw1_3:)
(:source lang=python:)
(:sourceend:)
(:divend:)
** (:toggle hide hw2_3 button show="Solution 3 (Python)":)
(:div id=hw1_3:)
(:source lang=python:)
(:sourceend:)
(:divend:)
May 07, 2018, at 02:26 PM by 45.56.3.173 -
Added lines 11-34:
** (:toggle hide hw1_2 button show="Solution 2 (Python)":)
(:div id=hw1_2:)
(:source lang=python:)
# constants
L      = 2      # m
Tplate = 343    # K
v      = 1.45    # m/s
Twater = 294    # K
mu    = 9.79e-4 # Pa*s
rho    = 998    # kg/m^3
k      = 0.601  # W/m-K
cp    = 4.18e3  # J/kg-K

# derived quantities
Re = rho*L*v/mu
Pr = mu*cp/k
Nu = 0.332 * Pr**(1.0/3.0) * Re**(1.0/2.0)
h = Nu * k / L
q = h * (Tplate-Twater)

print('Rate of Heat Transfer')
print(str(q)+' W/m^2')
(:sourceend:)
(:divend:)
May 03, 2018, at 07:28 PM by 10.37.57.234 -
Changed line 23 from:
** [[https://youtu.be/eXco8_3MmjI|Solution 2]], [[https://youtu.be/kehsHfFMsAE|Solution 3]]
to:
** [[https://youtu.be/X4jneorGsls|Solution 1]], [[https://youtu.be/eXco8_3MmjI|Solution 2]], [[https://youtu.be/kehsHfFMsAE|Solution 3]]
May 03, 2018, at 02:01 PM by 45.56.3.173 -
Changed line 21 from:
*[[Attach:hw4.pdf|Assignment #4]] - [[Attach:hw4.zip|Files]]
to:
*[[Attach:hw4.pdf|Assignment #4]] - [[Attach:hw4.zip|Excel Template]] - [[Attach:heart_rate.txt|HR Data]] - [[Attach:dynamics.txt|Dynamics Data]]
May 01, 2018, at 02:32 PM by 45.56.3.173 -
Changed line 15 from:
** [[https://youtu.be/CchyR-vmFbk|Solution 1]], Solution 2, [[https://youtu.be/AJwxW6oMu_E|Solution 3]]
to:
** [[https://youtu.be/CchyR-vmFbk|Solution 1]], [[https://youtu.be/6vFynd2bGoQ|Solution 2]], [[https://youtu.be/AJwxW6oMu_E|Solution 3]]
May 01, 2018, at 01:09 PM by 45.56.3.173 -
Changed line 12 from:
*[[Attach:hw2.pdf|Assignment #2]] - [[Attach:tclab_steps.txt|Problem 2 Data File]]
to:
*[[Attach:hw2.pdf|Assignment #2]] - [[Attach:tclab.txt|Problem 2 Data File]]
May 01, 2018, at 12:56 PM by 45.56.3.173 -
Changed line 15 from:
** [[https://youtu.be/CchyR-vmFbk|Solution 1]], [[https://youtu.be/Waz-NcSMLe4|Solution 2]], Solution 3
to:
** [[https://youtu.be/CchyR-vmFbk|Solution 1]], Solution 2, [[https://youtu.be/AJwxW6oMu_E|Solution 3]]
May 01, 2018, at 12:55 PM by 45.56.3.173 -
Changed line 12 from:
*[[Attach:hw2.pdf|Assignment #2]] - [[Attach:tclab_steps.txt|HW2, Problem 3 Data File]]
to:
*[[Attach:hw2.pdf|Assignment #2]] - [[Attach:tclab_steps.txt|Problem 2 Data File]]
Changed line 15 from:
** [[https://youtu.be/CchyR-vmFbk|Solution 1]], [[https://youtu.be/Waz-NcSMLe4|Solution 2]], [[https://youtu.be/AJwxW6oMu_E|Solution 3]]
to:
** [[https://youtu.be/CchyR-vmFbk|Solution 1]], [[https://youtu.be/Waz-NcSMLe4|Solution 2]], Solution 3
May 01, 2018, at 12:53 PM by 45.56.3.173 -
Changed line 12 from:
*[[Attach:hw2.pdf|Assignment #2]] - [[Attach:tclab_steps.txt|Problem 3 Data File]]
to:
*[[Attach:hw2.pdf|Assignment #2]] - [[Attach:tclab_steps.txt|HW2, Problem 3 Data File]]
May 01, 2018, at 12:43 PM by 45.56.3.173 -
Changed line 12 from:
*[[Attach:hw2.pdf|Assignment #2]]
to:
*[[Attach:hw2.pdf|Assignment #2]] - [[Attach:tclab_steps.txt|Problem 3 Data File]]
June 13, 2017, at 05:46 PM by 174.148.255.132 -
Changed line 85 from:
** [[https://youtu.be/QlRB2k9i4gc | Solutions 1-7]] and [[https://youtu.be/QlRB2k9i4gc | 8-10]] (Python)
to:
** [[https://youtu.be/QlRB2k9i4gc | Solutions 1-7]] and [[https://youtu.be/6gjYvgIpDo8 | 8-10 (Python)]]
June 13, 2017, at 04:13 PM by 45.56.3.173 -
Changed lines 85-86 from:
** [[https://youtu.be/QlRB2k9i4gc | Solutions 1-7 (Python)]]
**
[[https://youtu.be/QlRB2k9i4gc | Solutions 8-10 (Python)]]
to:
** [[https://youtu.be/QlRB2k9i4gc | Solutions 1-7]] and [[https://youtu.be/QlRB2k9i4gc | 8-10]] (Python)
June 13, 2017, at 04:11 PM by 45.56.3.173 -
Added lines 85-86:
** [[https://youtu.be/QlRB2k9i4gc | Solutions 1-7 (Python)]]
** [[https://youtu.be/QlRB2k9i4gc | Solutions 8-10 (Python)]]
June 13, 2017, at 02:33 PM by 45.56.3.173 -
Changed lines 83-84 from:
*[[Attach:hw_mathcad_basics.pdf|Assignment #18 - Variables and Equations]]
** [[https://youtu.be/UV7aU7HXv7E | Solutions]]
to:
*[[Attach:hw_mathcad_basics.pdf|Assignment #18 - Variables and Equations (MathCAD)]] and [[Attach:hw_python_basics.zip|(Python)]]
** [[https://youtu.be/UV7aU7HXv7E | Solutions (MathCAD)
]]
May 01, 2017, at 11:16 PM by 45.56.3.173 -
Changed line 58 from:
* [[Main/PythonDataAnalysis|File Input and Output]]
to:
** [[Main/PythonDataAnalysis|File Input and Output]]
May 01, 2017, at 11:15 PM by 45.56.3.173 -
Changed line 78 from:
** [[https://youtu.be/SFI_l96Oss4|Symbolic Derivatives]]
to:
** [[https://youtu.be/SFI_l96Oss4|Symbolic Derivatives]] and [[https://youtu.be/4grhQ5Y_MWo|Integrals]]
May 01, 2017, at 11:14 PM by 45.56.3.173 -
Changed lines 8-9 from:
** Conditions and Functions
to:
** [[Main/ExcelConditionals|Conditionals]]
** [[Main/ExcelFunctions|Functions]]
Changed lines 13-14 from:
** Generate Plots and Data Analysis
to:
** [[Main/ExcelScatterPlots|Generate Plots]]
** [[Main/ExcelDataAnalysis|Data Analysis]]
Changed line 18 from:
** Solve Equations
to:
** [[Main/ExcelSolveEquations|Solve Equations]]
Changed line 22 from:
** Regression
to:
** [[Main/ExcelDataRegression|Data Regression]]
Changed line 26 from:
** Differential Equations
to:
** [[Main/ExcelEulers|Differential Equation Solution]]
Changed line 30 from:
** VBA Macros
to:
** [[Main/VbaMacro|VBA Macros]]
Changed lines 36-37 from:
** [[Main/PythonConditionals|Conditionals]], [[Main/PythonFunctions|Functions]]
to:
** [[Main/PythonConditionals|Conditionals]]
** [[Main/PythonFunctions|Functions]]
Changed lines 41-42 from:
** Loops and Arrays
to:
** [[Main/PythonLoops|Loops]]
** [[Main/PythonArrays|Arrays]]
Changed line 46 from:
** Plot Data and Correlations
to:
** [[Main/PythonPlots|Generate Plots]]
Changed line 50 from:
** User input, loops, ODEs, and plotting
to:
** [[Main/PythonWidgets|User Interaction]]
Changed line 54 from:
** Debugging
to:
** [[Main/PythonDebug|Debugging]]
Changed line 58 from:
** File Input and Ouput
to:
* [[Main/PythonDataAnalysis|File Input and Output]]
Changed line 62 from:
** Classes (collections of values and functions)
to:
** [[https://youtu.be/LwOg0b0ZwCM|Classes (collections of values and functions)]]
Changed line 66 from:
** Solve Equations (fsolve)
to:
** [[Main/PythonSolveEquations|Solve Equations]]
Changed line 70 from:
** Integration, interpolation, and regression
to:
** [[Main/PythonDataRegression|Data Regression]]
Changed line 74 from:
** Solve differential equations (odeint)
to:
** [[Main/PythonDynamicSim|Solve Differential Equations]]
Changed line 78 from:
** Symbolic solutions (sympy)
to:
** [[https://youtu.be/SFI_l96Oss4|Symbolic Derivatives]]
May 01, 2017, at 11:01 PM by 45.56.3.173 -
Changed lines 7-17 from:
*[[Attach:hw1.pdf|Assignment #1]] - [[https://youtu.be/VPjoNrtm8wk|Solution 2]], [[https://youtu.be/JF7Lda8_YzE|Solution 3]]

*[[Attach:hw2.pdf|Assignment #2]] - [[https://youtu.be/CchyR-vmFbk|Solution 1]], [[https://youtu.be/Waz-NcSMLe4|Solution 2]], [[https://youtu.be/AJwxW6oMu_E|Solution 3]]

*[[Attach:hw3.pdf|Assignment #3]] - [[https://youtu.be/wbDfPIpTf4E|Solution 1]], [[https://youtu.be/td9AQZF5gIM|Solution 2]], [[https://youtu.be/GMC31hEhFMg|Solution 3]], [[https://youtu.be/7HDO0ORwjn0|Solution 4]]

*[[Attach:hw4.pdf|Assignment #4]] - [[Attach:hw4.zip|Files]] - [[https://youtu.be/eXco8_3MmjI|Solution 2]], [[https://youtu.be/kehsHfFMsAE|Solution 3]]

*[[Attach:hw5.pdf|Assignment #5]] - [[https://youtu.be/cc8CuFTX5CI|Solution 1]], [[https://youtu.be/ySrMlC-bnGM|Solution 2]]

*[[Attach:hw6.pdf|Assignment #6]] - [[https://youtu.be/bHwFTDp5g6A|Solution 1]], [[https://youtu.be/0C6QMin5OZc|Solution 2]]
to:
*[[Attach:hw1.pdf|Assignment #1]]
** Conditions and Functions
**
[[https://youtu.be/VPjoNrtm8wk|Solution 2]], [[https://youtu.be/JF7Lda8_YzE|Solution 3]]

*[[Attach:hw2.pdf|Assignment #2]]
** Generate Plots and Data Analysis
**
[[https://youtu.be/CchyR-vmFbk|Solution 1]], [[https://youtu.be/Waz-NcSMLe4|Solution 2]], [[https://youtu.be/AJwxW6oMu_E|Solution 3]]

*[[Attach:hw3.pdf|Assignment #3]]
** Solve Equations
**
[[https://youtu.be/wbDfPIpTf4E|Solution 1]], [[https://youtu.be/td9AQZF5gIM|Solution 2]], [[https://youtu.be/GMC31hEhFMg|Solution 3]], [[https://youtu.be/7HDO0ORwjn0|Solution 4]]

*[[Attach:hw4.pdf|Assignment #4]] - [[Attach:hw4.zip|Files]]
** Regression
**
[[https://youtu.be/eXco8_3MmjI|Solution 2]], [[https://youtu.be/kehsHfFMsAE|Solution 3]]

*[[Attach:hw5.pdf|Assignment #5]]
** Differential Equations
**
[[https://youtu.be/cc8CuFTX5CI|Solution 1]], [[https://youtu.be/ySrMlC-bnGM|Solution 2]]

*[[Attach:hw6.pdf|Assignment #6]]
** VBA Macros
**
[[https://youtu.be/bHwFTDp5g6A|Solution 1]], [[https://youtu.be/0C6QMin5OZc|Solution 2]]
May 01, 2017, at 09:21 PM by 173.117.245.75 -
Changed line 22 from:
** Conditionals, Functions
to:
** [[Main/PythonConditionals|Conditionals]], [[Main/PythonFunctions|Functions]]
May 01, 2017, at 09:18 PM by 173.117.245.75 -
Changed line 22 from:
** Conditionals, Functions, Loops
to:
** Conditionals, Functions
Changed lines 25-43 from:
*[[Attach:hw8.pdf|Assignment #8]] - [[Attach:hw8.zip|Files]] - [[https://youtu.be/2Y6aMjBYPww|Solutions]]

*[[Attach:hw9.pdf|Assignment #9]] - [[Attach:hw9.zip|Files]] - Solution [[https://youtu.be/ziRNzO1T-Mo|1]], [[https://youtu.be/Ql8QPcp8818|2]], [[https://youtu.be/6r5JZjokp-0|3]], [[https://youtu.be/G0ceVjin_cg|4]]

*[[Attach:hw10.pdf|Assignment #10]] - [[https://youtu.be/ouyg_TQGI2Q|Solution 2 (Video)]] - [[Attach:hw10.zip|Solution 2 (.py)]] - [[https://youtu.be/ygoohjN_Lww|Solution 3]]

*
[[Attach:hw11.pdf|Assignment #11]] - [[Attach:hw11.zip|Files]] - [[ https://youtu.be/ezuRn1ViIJE|Solutions (1-5)]], [[https://youtu.be/8SNaW1nt6j0|Solution 6]]

*
[[Attach:hw12.pdf|Assignment #12]] - [[Attach:hw12.zip|Files]] - [[https://youtu.be/oCr2eUIYznc|Solutions]]

*[[Attach:hw13.pdf|Assignment #13]] - [[Attach:hw13.zip|Files]] - [[https://youtu.be/ntyGGOiOD9w|Solutions 1]] - [[https://youtu.be/mV9HECu07z8|Solutions 2]]

*[[Attach:hw14.pdf|Assignment #14]] - [[Attach:hw14.zip|Files]] - [[ https://youtu.be/v4R6K4RxADE|Solutions 1-2]], [[https://youtu.be/66hOMWZec10|Solution 3]], [[https://youtu.be/Y7YBPqGKr9Y|Solution 4]]

*
[[Attach:hw15.pdf|Assignment #15]] - [[Attach:hw15.zip|Files]] - [[https://youtu.be/4grhQ5Y_MWo|Solution 1]], [[https://youtu.be/Lj_-7xIGkeI|Solutions 2-4]]

*[[Attach:hw16.pdf|Assignment #16]] - [[Attach:hw16.zip|Files]] - [[https://youtu.be/BRe7qKIAa34|Solution]]

*
[[Attach:hw17.pdf|Assignment #17]] - [[Attach:hw17.zip|Files]] - [[https://youtu.be/EaYEQ30KlWw|Solution]]
to:
*[[Attach:hw8.pdf|Assignment #8]] - [[Attach:hw8.zip|Files]]
** Loops and Arrays
**
[[https://youtu.be/2Y6aMjBYPww|Solutions]]

*[[Attach:hw9.pdf|Assignment #9]] - [[Attach:hw9.zip|Files]]
** Plot Data and Correlations
** Solution
[[https://youtu.be/ziRNzO1T-Mo|1]], [[https://youtu.be/Ql8QPcp8818|2]], [[https://youtu.be/6r5JZjokp-0|3]], [[https://youtu.be/G0ceVjin_cg|4]]

*[[Attach:hw10.pdf|Assignment #10]]
** User input, loops, ODEs, and plotting
**
[[https://youtu.be/ouyg_TQGI2Q|Solution 2 (Video)]] - [[Attach:hw10.zip|Solution 2 (.py)]] - [[https://youtu.be/ygoohjN_Lww|Solution 3]]

*
[[Attach:hw11.pdf|Assignment #11]] - [[Attach:hw11.zip|Files]]
** Debugging
**
[[ https://youtu.be/ezuRn1ViIJE|Solutions (1-5)]], [[https://youtu.be/8SNaW1nt6j0|Solution 6]]

*
[[Attach:hw12.pdf|Assignment #12]] - [[Attach:hw12.zip|Files]]
** File Input and Ouput
**
[[https://youtu.be/oCr2eUIYznc|Solutions]]

*
[[Attach:hw13.pdf|Assignment #13]] - [[Attach:hw13.zip|Files]]
** Classes (collections of values and functions)
** [[
https://youtu.be/ntyGGOiOD9w|Solutions 1]] - [[https://youtu.be/mV9HECu07z8|Solutions 2]]

*
[[Attach:hw14.pdf|Assignment #14]] - [[Attach:hw14.zip|Files]]
** Solve Equations (fsolve)
**
[[ https://youtu.be/v4R6K4RxADE|Solutions 1-2]], [[https://youtu.be/66hOMWZec10|Solution 3]], [[https://youtu.be/Y7YBPqGKr9Y|Solution 4]]

*[[Attach:hw15.pdf|Assignment #15]] - [[Attach:hw15.zip|Files]]
** Integration, interpolation, and regression
**
[[https://youtu.be/4grhQ5Y_MWo|Solution 1]], [[https://youtu.be/Lj_-7xIGkeI|Solutions 2-4]]

*
[[Attach:hw16.pdf|Assignment #16]] - [[Attach:hw16.zip|Files]]
** Solve differential equations (odeint)
** [[https://youtu.be/BRe7qKIAa34|Solution]]

*[[Attach:hw17.pdf|Assignment #17]] - [[Attach:hw17.zip|Files]]
** Symbolic solutions (sympy)
**
[[https://youtu.be/EaYEQ30KlWw|Solution]]
May 01, 2017, at 09:09 PM by 173.117.245.75 -
Changed lines 21-23 from:
*[[Attach:hw7.pdf|Assignment #7]] - [[Attach:hw7.zip|Files]] - Solution [[https://youtu.be/r7C2Hu1Qtgg|1]], [[https://youtu.be/YugOojaknDM|2]], [[https://youtu.be/L7scElJU36s|3]], [[https://youtu.be/p2Dyx9DyQWw|4]]
to:
*[[Attach:hw7.pdf|Assignment #7]] - [[Attach:hw7.zip|Files]]
** Conditionals, Functions, Loops
**
Solution [[https://youtu.be/r7C2Hu1Qtgg|1]], [[https://youtu.be/YugOojaknDM|2]], [[https://youtu.be/L7scElJU36s|3]], [[https://youtu.be/p2Dyx9DyQWw|4]]
January 24, 2017, at 04:17 PM by 10.10.148.223 -
Changed line 15 from:
*[[Attach:hw5.pdf|Assignment #5]] - [[https://youtu.be/cc8CuFTX5CI|Solution 1]]
to:
*[[Attach:hw5.pdf|Assignment #5]] - [[https://youtu.be/cc8CuFTX5CI|Solution 1]], [[https://youtu.be/ySrMlC-bnGM|Solution 2]]
Changed line 11 from:
*[[Attach:hw3.pdf|Assignment #3]] - [[https://youtu.be/wbDfPIpTf4E|Solution 1]], [[https://youtu.be/td9AQZF5gIM|Solution 2]], [[https://youtu.be/GMC31hEhFMg|Solution 3]]
to:
*[[Attach:hw3.pdf|Assignment #3]] - [[https://youtu.be/wbDfPIpTf4E|Solution 1]], [[https://youtu.be/td9AQZF5gIM|Solution 2]], [[https://youtu.be/GMC31hEhFMg|Solution 3]], [[https://youtu.be/7HDO0ORwjn0|Solution 4]]
January 05, 2017, at 01:03 AM by 10.10.144.119 -
Changed line 17 from:
*[[Attach:hw6.pdf|Assignment #6]] - [[https://youtu.be/0C6QMin5OZc|Solution 2]]
to:
*[[Attach:hw6.pdf|Assignment #6]] - [[https://youtu.be/bHwFTDp5g6A|Solution 1]], [[https://youtu.be/0C6QMin5OZc|Solution 2]]
January 05, 2017, at 12:34 AM by 10.10.144.119 -
Changed line 17 from:
*[[Attach:hw6.pdf|Assignment #6]]
to:
*[[Attach:hw6.pdf|Assignment #6]] - [[https://youtu.be/0C6QMin5OZc|Solution 2]]
January 05, 2017, at 12:23 AM by 10.10.144.119 -
Changed line 15 from:
*[[Attach:hw5.pdf|Assignment #5]]
to:
*[[Attach:hw5.pdf|Assignment #5]] - [[https://youtu.be/cc8CuFTX5CI|Solution 1]]
Changed line 15 from:
*[[Attach:hw5a.pdf|Assignment #5]]
to:
*[[Attach:hw5.pdf|Assignment #5]]
January 04, 2017, at 05:52 PM by 10.10.144.119 -
Changed line 13 from:
*[[Attach:hw4.pdf|Assignment #4]] - [[Attach:hw4.zip|Files]] - [[https://youtu.be/eXco8_3MmjI|Solution 2]],[[https://youtu.be/kehsHfFMsAE|Solution 3]]
to:
*[[Attach:hw4.pdf|Assignment #4]] - [[Attach:hw4.zip|Files]] - [[https://youtu.be/eXco8_3MmjI|Solution 2]], [[https://youtu.be/kehsHfFMsAE|Solution 3]]
January 04, 2017, at 05:52 PM by 10.10.144.119 -
Changed line 13 from:
*[[Attach:hw4.pdf|Assignment #4]] - [[Attach:hw4.zip|Files]] - [[https://youtu.be/kehsHfFMsAE|Solution 3]]
to:
*[[Attach:hw4.pdf|Assignment #4]] - [[Attach:hw4.zip|Files]] - [[https://youtu.be/eXco8_3MmjI|Solution 2]],[[https://youtu.be/kehsHfFMsAE|Solution 3]]
January 04, 2017, at 05:14 PM by 10.10.144.119 -
Changed line 13 from:
*[[Attach:hw4.pdf|Assignment #4]] - [[Attach:hw4.zip|Files]]
to:
*[[Attach:hw4.pdf|Assignment #4]] - [[Attach:hw4.zip|Files]] - [[https://youtu.be/kehsHfFMsAE|Solution 3]]
January 04, 2017, at 04:41 PM by 10.10.144.119 -
Changed line 11 from:
*[[Attach:hw3.pdf|Assignment #3]] - [[https://youtu.be/wbDfPIpTf4E|Solution 1]], [[https://youtu.be/td9AQZF5gIM|Solution 2]]
to:
*[[Attach:hw3.pdf|Assignment #3]] - [[https://youtu.be/wbDfPIpTf4E|Solution 1]], [[https://youtu.be/td9AQZF5gIM|Solution 2]], [[https://youtu.be/GMC31hEhFMg|Solution 3]]
Changed line 7 from:
*[[Attach:hw1.pdf|Assignment #1]] - [[https://youtu.be/VPjoNrtm8wk|Solution 2]] - [[https://youtu.be/JF7Lda8_YzE|Solution 3]]
to:
*[[Attach:hw1.pdf|Assignment #1]] - [[https://youtu.be/VPjoNrtm8wk|Solution 2]], [[https://youtu.be/JF7Lda8_YzE|Solution 3]]
Changed line 11 from:
*[[Attach:hw3.pdf|Assignment #3]] - [[https://youtu.be/wbDfPIpTf4E|Solution 1]]
to:
*[[Attach:hw3.pdf|Assignment #3]] - [[https://youtu.be/wbDfPIpTf4E|Solution 1]], [[https://youtu.be/td9AQZF5gIM|Solution 2]]
Changed line 11 from:
*[[Attach:hw3.pdf|Assignment #3]]
to:
*[[Attach:hw3.pdf|Assignment #3]] - [[https://youtu.be/wbDfPIpTf4E|Solution 1]]
Changed line 9 from:
*[[Attach:hw2.pdf|Assignment #2]] - [[https://youtu.be/CchyR-vmFbk|Solution 1]], [[https://youtu.be/Waz-NcSMLe4|Solution 2]], [[https://youtu.be/Waz-NcSMLe4|Solution 3]]
to:
*[[Attach:hw2.pdf|Assignment #2]] - [[https://youtu.be/CchyR-vmFbk|Solution 1]], [[https://youtu.be/Waz-NcSMLe4|Solution 2]], [[https://youtu.be/AJwxW6oMu_E|Solution 3]]
Changed line 9 from:
*[[Attach:hw2.pdf|Assignment #2]] - [[https://youtu.be/CchyR-vmFbk|Solution 1]], [[https://youtu.be/Waz-NcSMLe4|2]], [[https://youtu.be/Waz-NcSMLe4|3]]
to:
*[[Attach:hw2.pdf|Assignment #2]] - [[https://youtu.be/CchyR-vmFbk|Solution 1]], [[https://youtu.be/Waz-NcSMLe4|Solution 2]], [[https://youtu.be/Waz-NcSMLe4|Solution 3]]
Changed line 9 from:
*[[Attach:hw2.pdf|Assignment #2]] - [[https://youtu.be/CchyR-vmFbk|Solution 1]]
to:
*[[Attach:hw2.pdf|Assignment #2]] - [[https://youtu.be/CchyR-vmFbk|Solution 1]], [[https://youtu.be/Waz-NcSMLe4|2]], [[https://youtu.be/Waz-NcSMLe4|3]]
Changed line 9 from:
*[[Attach:hw2.pdf|Assignment #2]]
to:
*[[Attach:hw2.pdf|Assignment #2]] - [[https://youtu.be/CchyR-vmFbk|Solution 1]]
January 02, 2017, at 08:48 PM by 173.117.183.12 -
Changed line 7 from:
*[[Attach:hw1.pdf|Assignment #1]] - [[https://youtu.be/VPjoNrtm8wk|Solution 2]] - [[https://youtu.be/VPjoNrtm8wk|Solution 3]]
to:
*[[Attach:hw1.pdf|Assignment #1]] - [[https://youtu.be/VPjoNrtm8wk|Solution 2]] - [[https://youtu.be/JF7Lda8_YzE|Solution 3]]
January 02, 2017, at 08:10 PM by 173.117.183.12 -
Changed line 7 from:
*[[Attach:hw1.pdf|Assignment #1]]
to:
*[[Attach:hw1.pdf|Assignment #1]] - [[https://youtu.be/VPjoNrtm8wk|Solution 2]] - [[https://youtu.be/VPjoNrtm8wk|Solution 3]]
Changed lines 21-42 from:
*[[Attach:hw7.pdf|Assignment #7]] - [[Attach:hw7.zip|Files]]

*
[[Attach:hw8.pdf|Assignment #8]] - [[Attach:hw8.zip|Files]]

*
[[Attach:hw9.pdf|Assignment #9]] - [[Attach:hw9.zip|Files]]

*[[Attach:hw10.pdf|Assignment #10]]

*
[[Attach:hw11.pdf|Assignment #11]] - [[Attach:hw11.zip|Files]]

*[[Attach:hw12.pdf|Assignment #12]] - [[Attach:hw12.zip|Files]]

*
[[Attach:hw13.pdf|Assignment #13]] - [[Attach:hw13.zip|Files]]

*
[[Attach:hw14.pdf|Assignment #14]] - [[Attach:hw14.zip|Files]]

*[[Attach:hw15.pdf|Assignment #15]] - [[Attach:hw15.zip|Files]]

*
[[Attach:hw16.pdf|Assignment #16]] - [[Attach:hw16.zip|Files]]

*[[Attach:hw17.pdf|Assignment #17]] - [[Attach:hw17.zip|Files]]
to:
*[[Attach:hw7.pdf|Assignment #7]] - [[Attach:hw7.zip|Files]] - Solution [[https://youtu.be/r7C2Hu1Qtgg|1]], [[https://youtu.be/YugOojaknDM|2]], [[https://youtu.be/L7scElJU36s|3]], [[https://youtu.be/p2Dyx9DyQWw|4]]

*[[Attach:hw8.pdf|Assignment #8]] - [[Attach:hw8.zip|Files]] - [[https://youtu.be/2Y6aMjBYPww|Solutions]]

*[[Attach:hw9.pdf|Assignment #9]] - [[Attach:hw9.zip|Files]] - Solution [[https://youtu.be/ziRNzO1T-Mo|1]], [[https://youtu.be/Ql8QPcp8818|2]], [[https://youtu.be/6r5JZjokp-0|3]], [[https://youtu.be/G0ceVjin_cg|4]]

*[[Attach:hw10.pdf|Assignment #10]] - [[https://youtu.be/ouyg_TQGI2Q|Solution 2 (Video)]] - [[Attach:hw10.zip|Solution 2 (.py)]] - [[https://youtu.be/ygoohjN_Lww|Solution 3]]

*[[Attach:hw11.pdf|Assignment #11]] - [[Attach:hw11.zip|Files]] - [[ https://youtu.be/ezuRn1ViIJE|Solutions (1-5)]], [[https://youtu.be/8SNaW1nt6j0|Solution 6]]

*[[Attach:hw12.pdf|Assignment #12]] - [[Attach:hw12.zip|Files]] - [[https://youtu.be/oCr2eUIYznc|Solutions]]

*[[Attach:hw13.pdf|Assignment #13]] - [[Attach:hw13.zip|Files]] - [[https://youtu.be/ntyGGOiOD9w|Solutions 1]] - [[https://youtu.be/mV9HECu07z8|Solutions 2]]

*[[Attach:hw14.pdf|Assignment #14]] - [[Attach:hw14.zip|Files]] - [[ https://youtu.be/v4R6K4RxADE|Solutions 1-2]], [[https://youtu.be/66hOMWZec10|Solution 3]], [[https://youtu.be/Y7YBPqGKr9Y|Solution 4]]

*[[Attach:hw15.pdf|Assignment #15]] - [[Attach:hw15.zip|Files]] - [[https://youtu.be/4grhQ5Y_MWo|Solution 1]], [[https://youtu.be/Lj_-7xIGkeI|Solutions 2-4]]

*[[Attach:hw16.pdf|Assignment #16]] - [[Attach:hw16.zip|Files]] - [[https://youtu.be/BRe7qKIAa34|Solution]]

*[[Attach:hw17.pdf|Assignment #17]] - [[Attach:hw17.zip|Files]] - [[https://youtu.be/EaYEQ30KlWw|Solution
]]
Changed lines 46-47 from:
to:
** [[https://youtu.be/UV7aU7HXv7E | Solutions]]
Changed lines 50-51 from:
to:
** [[https://youtu.be/Gpzv0GfZ0LM|Solutions]]
Changed lines 53-55 from:
to:
** [[https://youtu.be/XOxK4aKvLk0 | Solutions 1-6]]
** [[https://youtu.be/O4_lYRMawXo | Solutions 7-9]]

Deleted line 57:
August 30, 2016, at 07:47 PM by 184.203.103.142 -
Added lines 1-54:
(:title Programming Assignments:)
(:keywords homework, nonlinear, optimization, engineering optimization, Excel, Mathcad, Visual Basic, MATLAB, differential, algebraic, modeling language, university course:)
(:description Assignments for Problem-Solving Techniques for Chemical Engineers at Brigham Young University:)

!!!!Excel Assignments

*[[Attach:hw1.pdf|Assignment #1]]

*[[Attach:hw2.pdf|Assignment #2]]

*[[Attach:hw3.pdf|Assignment #3]]

*[[Attach:hw4.pdf|Assignment #4]] - [[Attach:hw4.zip|Files]]

*[[Attach:hw5a.pdf|Assignment #5]]

*[[Attach:hw6.pdf|Assignment #6]]

!!!!Python Assignments

*[[Attach:hw7.pdf|Assignment #7]] - [[Attach:hw7.zip|Files]]

*[[Attach:hw8.pdf|Assignment #8]] - [[Attach:hw8.zip|Files]]

*[[Attach:hw9.pdf|Assignment #9]] - [[Attach:hw9.zip|Files]]

*[[Attach:hw10.pdf|Assignment #10]]

*[[Attach:hw11.pdf|Assignment #11]] - [[Attach:hw11.zip|Files]]

*[[Attach:hw12.pdf|Assignment #12]] - [[Attach:hw12.zip|Files]]

*[[Attach:hw13.pdf|Assignment #13]] - [[Attach:hw13.zip|Files]]

*[[Attach:hw14.pdf|Assignment #14]] - [[Attach:hw14.zip|Files]]

*[[Attach:hw15.pdf|Assignment #15]] - [[Attach:hw15.zip|Files]]

*[[Attach:hw16.pdf|Assignment #16]] - [[Attach:hw16.zip|Files]]

*[[Attach:hw17.pdf|Assignment #17]] - [[Attach:hw17.zip|Files]]

!!!!MathCAD Assignments

*[[Attach:hw_mathcad_basics.pdf|Assignment #18 - Variables and Equations]]

*[[Attach:hw_mathcad_arrays_functions.pdf|Assignment #19 - Functions, Arrays, and Logical Conditions]]
** [[Attach:hw9_array.zip|Download array.txt for import]]

*[[Attach:hw_mathcad_symbolics_plotting_solve.pdf|Assignment #20 - Symbolic Manipulation, Plots, and Solve Blocks]]

*[[Attach:hw_mathcad_curvefit_solve.pdf|Assignment #21 - Curve Fitting, Advanced Plots, and More on Solve Blocks]]
** [[Attach:hw11_supplemental_file.zip|Assignment #21 - Supplemental Files]]