#!/bin/sh # This is a shell archive (produced by GNU sharutils 4.7). # To extract the files from this archive, save it to some FILE, remove # everything before the `#!/bin/sh' line above, then type `sh FILE'. # lock_dir=_sh29561 # Made on 2016-11-04 11:37 PDT by . # Source directory was `/nfs/guille/ams/users/karti/ece521/c-code/hw4'. # # Existing files will *not* be overwritten, unless `-c' is specified. # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 240 -rw-rw---- intgr8.c # 1185 -rw------- nonlincap.c # 30 -rw------- test19.ckt # 30 -rw------- test20.ckt # 30 -rw------- test21.ckt # 220 -rw------- test22.ckt # 131 -rw------- test23.ckt # 127 -rw------- test24.ckt # 58 -rw------- test25.ckt # MD5SUM=${MD5SUM-md5sum} f=`${MD5SUM} --version | egrep '^md5sum .*(core|text)utils'` test -n "${f}" && md5check=true || md5check=false ${md5check} || \ echo 'Note: not verifying md5sums. Consider installing GNU coreutils.' save_IFS="${IFS}" IFS="${IFS}:" gettext_dir=FAILED locale_dir=FAILED first_param="$1" for dir in $PATH do if test "$gettext_dir" = FAILED && test -f $dir/gettext \ && ($dir/gettext --version >/dev/null 2>&1) then case `$dir/gettext --version 2>&1 | sed 1q` in *GNU*) gettext_dir=$dir ;; esac fi if test "$locale_dir" = FAILED && test -f $dir/shar \ && ($dir/shar --print-text-domain-dir >/dev/null 2>&1) then locale_dir=`$dir/shar --print-text-domain-dir` fi done IFS="$save_IFS" if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED then echo=echo else TEXTDOMAINDIR=$locale_dir export TEXTDOMAINDIR TEXTDOMAIN=sharutils export TEXTDOMAIN echo="$gettext_dir/gettext -s" fi if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null then if (echo -n test; echo 1,2,3) | grep n >/dev/null then shar_n= shar_c=' ' else shar_n=-n shar_c= ; fi else shar_n= shar_c='\c' ; fi f=shar-touch.$$ st1=200112312359.59 st2=123123592001.59 st2tr=123123592001.5 # old SysV 14-char limit st3=1231235901 if touch -am -t ${st1} ${f} >/dev/null 2>&1 && \ test ! -f ${st1} && test -f ${f}; then shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"' elif touch -am ${st2} ${f} >/dev/null 2>&1 && \ test ! -f ${st2} && test ! -f ${st2tr} && test -f ${f}; then shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"' elif touch -am ${st3} ${f} >/dev/null 2>&1 && \ test ! -f ${st3} && test -f ${f}; then shar_touch='touch -am $3$4$5$6$2 "$8"' else shar_touch=: echo ${echo} 'WARNING: not restoring timestamps. Consider getting and' ${echo} 'installing GNU `touch'\'', distributed in GNU coreutils...' echo fi rm -f ${st1} ${st2} ${st2tr} ${st3} ${f} # if test ! -d ${lock_dir} then : ; else ${echo} 'lock directory '${lock_dir}' exists' exit 1 fi if mkdir ${lock_dir} then ${echo} 'x - created lock directory `'${lock_dir}\''.' else ${echo} 'x - failed to create lock directory `'${lock_dir}\''.' exit 1 fi # ============= intgr8.c ============== if test -f 'intgr8.c' && test "$first_param" != -c; then ${echo} 'x -SKIPPING intgr8.c (file already exists)' else ${echo} 'x - extracting intgr8.c (text)' sed 's/^X//' << 'SHAR_EOF' > 'intgr8.c' && void intgr8(x,xdot,h,alpha,beta) X double x; X double xdot; X double h; X double *alpha, *beta; { X /* TR method */ X *alpha = 2.0/h; X *beta = (-2.0/h * x - xdot); X X /* BE method */ X /* X *alpha = 1.0/h; X *beta = -1.0/h * x; X */ X } X X X SHAR_EOF (set 20 10 11 03 18 01 54 'intgr8.c'; eval "$shar_touch") && chmod 0660 'intgr8.c' if test $? -ne 0 then ${echo} 'restore of intgr8.c failed' fi if ${md5check} then ( ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'intgr8.c: MD5 check failed' ) << \SHAR_EOF 625d241c4f473d408812149c078f45c7 intgr8.c SHAR_EOF else test `LC_ALL=C wc -c < 'intgr8.c'` -ne 240 && \ ${echo} 'restoration warning: size of intgr8.c is not 240' fi fi # ============= nonlincap.c ============== if test -f 'nonlincap.c' && test "$first_param" != -c; then ${echo} 'x -SKIPPING nonlincap.c (file already exists)' else ${echo} 'x - extracting nonlincap.c (text)' sed 's/^X//' << 'SHAR_EOF' > 'nonlincap.c' && X // code template outlining procedure for nonlinear capacitor X for(i = 1; i <= numNonLinCap; i++) { X inst = NonLinCap[i]; X Cjo = inst->value; X na = inst->pNode; X nb = inst->nNode; X // Calculate voltage across capacitor. It is assumed that X // at the first iteration of a new timepoint X // Sol has the solution from the previous timepoint X Vc = Sol[na]-Sol[nb]; X X // calculate charge and VL X VL = 0.75-0.1*log(1+exp(-10*(Vc-.75))); X Q = 1.6*Cjo*(1-sqrt(1-VL/0.8)); X dQdV = (Cjo*exp(-10*Vc+7.5)) / (sqrt(0.0625+0.125*log(1+exp(-10*Vc+7.5)))*(1+exp(-10*Vc+7.5))); X if(it_count == 0) { X // first iteration of a given timepoint X if(time_step_count == 1) { X // first time point X inst->qdot = 0; X } X else { X // subsequent time points X inst->qdot = (inst->alpha)*Q+(inst->beta); X } X intgr8(Q,inst->qdot,h,&inst->alpha,&inst->beta); X } X X Gk = (inst->alpha)*dQdV; X Ik = (inst->alpha)*Q-(inst->alpha)*dQdV*Vc+(inst->beta); X X // stamp matrix and rhs X } SHAR_EOF (set 20 10 11 05 14 25 37 'nonlincap.c'; eval "$shar_touch") && chmod 0600 'nonlincap.c' if test $? -ne 0 then ${echo} 'restore of nonlincap.c failed' fi if ${md5check} then ( ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'nonlincap.c: MD5 check failed' ) << \SHAR_EOF d1ca67c8ac99ae38721d2bec88b563cc nonlincap.c SHAR_EOF else test `LC_ALL=C wc -c < 'nonlincap.c'` -ne 1185 && \ ${echo} 'restoration warning: size of nonlincap.c is not 1185' fi fi # ============= test19.ckt ============== if test -f 'test19.ckt' && test "$first_param" != -c; then ${echo} 'x -SKIPPING test19.ckt (file already exists)' else ${echo} 'x - extracting test19.ckt (text)' sed 's/^X//' << 'SHAR_EOF' > 'test19.ckt' && v1 1 0 5 r1 1 2 1 c1 2 0 1e-6 SHAR_EOF (set 20 10 11 03 16 08 30 'test19.ckt'; eval "$shar_touch") && chmod 0600 'test19.ckt' if test $? -ne 0 then ${echo} 'restore of test19.ckt failed' fi if ${md5check} then ( ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'test19.ckt: MD5 check failed' ) << \SHAR_EOF d760b6d223fd988cb3d342a9766e122b test19.ckt SHAR_EOF else test `LC_ALL=C wc -c < 'test19.ckt'` -ne 30 && \ ${echo} 'restoration warning: size of test19.ckt is not 30' fi fi # ============= test20.ckt ============== if test -f 'test20.ckt' && test "$first_param" != -c; then ${echo} 'x -SKIPPING test20.ckt (file already exists)' else ${echo} 'x - extracting test20.ckt (text)' sed 's/^X//' << 'SHAR_EOF' > 'test20.ckt' && v1 1 0 5 c1 1 2 1e-6 r1 2 0 1 SHAR_EOF (set 20 10 11 03 16 08 30 'test20.ckt'; eval "$shar_touch") && chmod 0600 'test20.ckt' if test $? -ne 0 then ${echo} 'restore of test20.ckt failed' fi if ${md5check} then ( ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'test20.ckt: MD5 check failed' ) << \SHAR_EOF df9c2757df528b7d2b701f29c544c215 test20.ckt SHAR_EOF else test `LC_ALL=C wc -c < 'test20.ckt'` -ne 30 && \ ${echo} 'restoration warning: size of test20.ckt is not 30' fi fi # ============= test21.ckt ============== if test -f 'test21.ckt' && test "$first_param" != -c; then ${echo} 'x -SKIPPING test21.ckt (file already exists)' else ${echo} 'x - extracting test21.ckt (text)' sed 's/^X//' << 'SHAR_EOF' > 'test21.ckt' && v1 1 0 5 r1 1 2 1 l1 2 0 1e-6 SHAR_EOF (set 20 10 11 03 16 08 30 'test21.ckt'; eval "$shar_touch") && chmod 0600 'test21.ckt' if test $? -ne 0 then ${echo} 'restore of test21.ckt failed' fi if ${md5check} then ( ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'test21.ckt: MD5 check failed' ) << \SHAR_EOF ef6ad8515bf415f3205abb2702ce4f25 test21.ckt SHAR_EOF else test `LC_ALL=C wc -c < 'test21.ckt'` -ne 30 && \ ${echo} 'restoration warning: size of test21.ckt is not 30' fi fi # ============= test22.ckt ============== if test -f 'test22.ckt' && test "$first_param" != -c; then ${echo} 'x -SKIPPING test22.ckt (file already exists)' else ${echo} 'x - extracting test22.ckt (text)' sed 's/^X//' << 'SHAR_EOF' > 'test22.ckt' && vdd 1 0 5 mp1 2 3 1 1 pmos 20e-6 1e-6 mn1 2 3 0 0 nmos 10e-6 1e-6 cl1 2 0 1e-12 mp2 4 2 1 1 pmos 20e-6 1e-6 mn2 4 2 0 0 nmos 10e-6 1e-6 cl2 4 0 1e-12 mp3 3 4 1 1 pmos 20e-6 1e-6 mn3 3 4 0 0 nmos 10e-6 1e-6 cl3 3 0 1e-12 SHAR_EOF (set 20 10 11 03 16 08 30 'test22.ckt'; eval "$shar_touch") && chmod 0600 'test22.ckt' if test $? -ne 0 then ${echo} 'restore of test22.ckt failed' fi if ${md5check} then ( ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'test22.ckt: MD5 check failed' ) << \SHAR_EOF ac33b7c8b87af1b320e1dbdc7ce73a05 test22.ckt SHAR_EOF else test `LC_ALL=C wc -c < 'test22.ckt'` -ne 220 && \ ${echo} 'restoration warning: size of test22.ckt is not 220' fi fi # ============= test23.ckt ============== if test -f 'test23.ckt' && test "$first_param" != -c; then ${echo} 'x -SKIPPING test23.ckt (file already exists)' else ${echo} 'x - extracting test23.ckt (text)' sed 's/^X//' << 'SHAR_EOF' > 'test23.ckt' && vdd 1 0 5 c1 2 3 25e-12 c2 3 0 100e-12 lm 1 2 12.665e-6 rl 1 2 10e3 vd 2 4 0 m1 4 0 3 3 nmos 10e-6 1e-6 iss 3 5 0.25e-3 vss 5 0 -5 SHAR_EOF (set 20 10 11 03 16 08 30 'test23.ckt'; eval "$shar_touch") && chmod 0600 'test23.ckt' if test $? -ne 0 then ${echo} 'restore of test23.ckt failed' fi if ${md5check} then ( ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'test23.ckt: MD5 check failed' ) << \SHAR_EOF d2c02c913c295b7b777d4b18bc334fdf test23.ckt SHAR_EOF else test `LC_ALL=C wc -c < 'test23.ckt'` -ne 131 && \ ${echo} 'restoration warning: size of test23.ckt is not 131' fi fi # ============= test24.ckt ============== if test -f 'test24.ckt' && test "$first_param" != -c; then ${echo} 'x -SKIPPING test24.ckt (file already exists)' else ${echo} 'x - extracting test24.ckt (text)' sed 's/^X//' << 'SHAR_EOF' > 'test24.ckt' && vdd 1 0 5 c1 2 3 25e-12 c2 3 0 100e-12 lm 1 2 12.665e-6 rl 1 2 10e3 vd 2 4 0 q1 4 6 3 npn rb 0 6 10 iss 3 5 0.25e-3 vss 5 0 -5 SHAR_EOF (set 20 10 11 03 17 44 54 'test24.ckt'; eval "$shar_touch") && chmod 0600 'test24.ckt' if test $? -ne 0 then ${echo} 'restore of test24.ckt failed' fi if ${md5check} then ( ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'test24.ckt: MD5 check failed' ) << \SHAR_EOF 38f537c24b5cb5dcd5a20773e20fe2ea test24.ckt SHAR_EOF else test `LC_ALL=C wc -c < 'test24.ckt'` -ne 127 && \ ${echo} 'restoration warning: size of test24.ckt is not 127' fi fi # ============= test25.ckt ============== if test -f 'test25.ckt' && test "$first_param" != -c; then ${echo} 'x -SKIPPING test25.ckt (file already exists)' else ${echo} 'x - extracting test25.ckt (text)' sed 's/^X//' << 'SHAR_EOF' > 'test25.ckt' && r1 1 2 1000 r2 2 3 500 r3 3 4 300 r4 4 0 200 u1 1 0 1e-12 SHAR_EOF (set 20 10 11 03 16 09 18 'test25.ckt'; eval "$shar_touch") && chmod 0600 'test25.ckt' if test $? -ne 0 then ${echo} 'restore of test25.ckt failed' fi if ${md5check} then ( ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'test25.ckt: MD5 check failed' ) << \SHAR_EOF 4965eb57889d830f3dac94947f043ed6 test25.ckt SHAR_EOF else test `LC_ALL=C wc -c < 'test25.ckt'` -ne 58 && \ ${echo} 'restoration warning: size of test25.ckt is not 58' fi fi if rm -fr ${lock_dir} then ${echo} 'x - removed lock directory `'${lock_dir}\''.' else ${echo} 'x - failed to remove lock directory `'${lock_dir}\''.' exit 1 fi exit 0