(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2"; MacintoshStandardFontEncoding; fontset = title, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, "times"; fontset = subtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, "times"; fontset = subsubtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, "times"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, "times"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, "times"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, "times"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "times"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "times"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, 24, "courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-4, 24, "courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, "courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, "courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, "courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, "courier"; fontset = name, inactive, noPageBreakInGroup, nohscroll, preserveAspect, M7, italic, B32768, 10, "times"; fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 12, "times"; fontset = leftheader, 12, "times"; fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, italic, 12, "times"; fontset = leftfooter, 12, "times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "times"; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "times"; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "courier"; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "times"; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "times"; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "times"; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "times"; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "times"; paletteColors = 128; automaticGrouping; currentKernel; ] :[font = input; preserveAspect; fontSize = 12] (* Mathematica system homework example: This program can be used to simulate the response of a first order system towards most forcing function. *) :[font = input; preserveAspect; fontSize = 12] (* Load the Laplace package *) Needs["Calculus`LaplaceTransform`"] :[font = input; preserveAspect; fontSize = 12] (* USER - INPUT YOUR FORCING FUNCTION HERE! *) f[t_] := 0.5 Sin[5 t] :[font = input; preserveAspect; fontSize = 12] (* Laplace transform the forcing function *) fbar[s_] := LaplaceTransform[f[t],t,s] :[font = input; preserveAspect; fontSize = 12] (* Define the first order transfer function *) G1[s_] := gain/(tau s + 1) :[font = input; preserveAspect; fontSize = 12] (* Define the Laplace transform of the first order output in terms of the transfer function and input *) y1bar[s_] := G1[s] fbar[s] :[font = input; preserveAspect; fontSize = 12] (* Find the time domain solution *) y1[t_,gain_,tau_] = InverseLaplaceTransform[y1bar[s],s,t]; :[font = input; preserveAspect; fontSize = 12; startGroup] (* Define the first order response as a plot *) first[gain_,tau_] := Plot[y1[t,gain,tau]/gain, {t,0,10},AxesLabel -> {TIME,OUPUT}] :[font = message; inactive; preserveAspect; endGroup] General::spell1: Possible spelling error: new symbol name "first" is similar to existing symbol "First". :[font = input; preserveAspect; fontSize = 12; startGroup] first[8,1] :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 41; pictureTop = 2; pictureWidth = 418; pictureHeight = 258] %! %%Creator: Mathematica %%AspectRatio: .61803 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations 0.0238095 0.0952381 0.245485 2.35469 [ [(2)] .21429 .24549 0 2 Msboxa [(4)] .40476 .24549 0 2 Msboxa [(6)] .59524 .24549 0 2 Msboxa [(8)] .78571 .24549 0 2 Msboxa [(10)] .97619 .24549 0 2 Msboxa [(TIME)] 1.025 .24549 -1 0 Msboxa [(-0.1)] .01131 .01002 1 0 Msboxa [(-0.05)] .01131 .12775 1 0 Msboxa [(0.05)] .01131 .36322 1 0 Msboxa [(0.1)] .01131 .48095 1 0 Msboxa [(0.15)] .01131 .59869 1 0 Msboxa [(OUPUT)] .02381 .61803 0 -4 Msboxa [ -0.001 -0.001 0 0 ] [ 1.001 .61903 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath [ ] 0 setdash 0 g p p .002 w .21429 .24549 m .21429 .25174 L s P [(2)] .21429 .24549 0 2 Mshowa p .002 w .40476 .24549 m .40476 .25174 L s P [(4)] .40476 .24549 0 2 Mshowa p .002 w .59524 .24549 m .59524 .25174 L s P [(6)] .59524 .24549 0 2 Mshowa p .002 w .78571 .24549 m .78571 .25174 L s P [(8)] .78571 .24549 0 2 Mshowa p .002 w .97619 .24549 m .97619 .25174 L s P [(10)] .97619 .24549 0 2 Mshowa p .001 w .0619 .24549 m .0619 .24924 L s P p .001 w .1 .24549 m .1 .24924 L s P p .001 w .1381 .24549 m .1381 .24924 L s P p .001 w .17619 .24549 m .17619 .24924 L s P p .001 w .25238 .24549 m .25238 .24924 L s P p .001 w .29048 .24549 m .29048 .24924 L s P p .001 w .32857 .24549 m .32857 .24924 L s P p .001 w .36667 .24549 m .36667 .24924 L s P p .001 w .44286 .24549 m .44286 .24924 L s P p .001 w .48095 .24549 m .48095 .24924 L s P p .001 w .51905 .24549 m .51905 .24924 L s P p .001 w .55714 .24549 m .55714 .24924 L s P p .001 w .63333 .24549 m .63333 .24924 L s P p .001 w .67143 .24549 m .67143 .24924 L s P p .001 w .70952 .24549 m .70952 .24924 L s P p .001 w .74762 .24549 m .74762 .24924 L s P p .001 w .82381 .24549 m .82381 .24924 L s P p .001 w .8619 .24549 m .8619 .24924 L s P p .001 w .9 .24549 m .9 .24924 L s P p .001 w .9381 .24549 m .9381 .24924 L s P [(TIME)] 1.025 .24549 -1 0 Mshowa p .002 w 0 .24549 m 1 .24549 L s P p .002 w .02381 .01002 m .03006 .01002 L s P [(-0.1)] .01131 .01002 1 0 Mshowa p .002 w .02381 .12775 m .03006 .12775 L s P [(-0.05)] .01131 .12775 1 0 Mshowa p .002 w .02381 .36322 m .03006 .36322 L s P [(0.05)] .01131 .36322 1 0 Mshowa p .002 w .02381 .48095 m .03006 .48095 L s P [(0.1)] .01131 .48095 1 0 Mshowa p .002 w .02381 .59869 m .03006 .59869 L s P [(0.15)] .01131 .59869 1 0 Mshowa p .001 w .02381 .03356 m .02756 .03356 L s P p .001 w .02381 .05711 m .02756 .05711 L s P p .001 w .02381 .08066 m .02756 .08066 L s P p .001 w .02381 .1042 m .02756 .1042 L s P p .001 w .02381 .1513 m .02756 .1513 L s P p .001 w .02381 .17484 m .02756 .17484 L s P p .001 w .02381 .19839 m .02756 .19839 L s P p .001 w .02381 .22194 m .02756 .22194 L s P p .001 w .02381 .26903 m .02756 .26903 L s P p .001 w .02381 .29258 m .02756 .29258 L s P p .001 w .02381 .31613 m .02756 .31613 L s P p .001 w .02381 .33967 m .02756 .33967 L s P p .001 w .02381 .38677 m .02756 .38677 L s P p .001 w .02381 .41031 m .02756 .41031 L s P p .001 w .02381 .43386 m .02756 .43386 L s P p .001 w .02381 .45741 m .02756 .45741 L s P p .001 w .02381 .5045 m .02756 .5045 L s P p .001 w .02381 .52805 m .02756 .52805 L s P p .001 w .02381 .55159 m .02756 .55159 L s P p .001 w .02381 .57514 m .02756 .57514 L s P [(OUPUT)] .02381 .61803 0 -4 Mshowa p .002 w .02381 0 m .02381 .61803 L s P P 0 0 m 1 0 L 1 .61803 L 0 .61803 L closepath clip newpath p p .004 w .02381 .24549 m .02505 .24598 L .02629 .24746 L .02753 .2499 L .02877 .25329 L .03001 .25759 L .03125 .26277 L .03373 .27564 L .03869 .31027 L .04365 .35412 L .05357 .45453 L .05853 .50306 L .06349 .54524 L .06597 .56287 L .06845 .57768 L .07093 .58936 L .07217 .59395 L .07341 .59766 L .07465 .60046 L .07589 .60235 L .07713 .60331 L .07837 .60332 L .07961 .60237 L .08085 .60047 L .08209 .59762 L .08333 .59381 L .08581 .58338 L .08829 .56931 L .09325 .53104 L .10317 .42269 L .1131 .29452 L .11806 .23278 L .12302 .17781 L .12798 .13301 L .13046 .1153 L .13294 .10111 L .13418 .09539 L .13542 .09062 L .13666 .08682 L .1379 .08399 L .13914 .08215 L .14038 .0813 L .14162 .08144 L .14286 .08256 L .1441 .08466 L .14534 .08773 L .14782 .09667 L .1503 .10922 L .15278 .12513 L .15774 .16581 L Mistroke .1627 .21575 L .17262 .3288 L .17758 .38391 L .18254 .43285 L .18502 .4539 L .1875 .47215 L .18998 .48729 L .19246 .49902 L .1937 .50354 L .19494 .50714 L .19618 .50979 L .19742 .51149 L .19866 .51222 L .1999 .51198 L .20114 .51077 L .20238 .50859 L .22222 .35965 L .23214 .23882 L .24206 .12678 L .24702 .08343 L .2495 .06628 L .25198 .05254 L .25322 .04701 L .25446 .04242 L .2557 .03878 L .25694 .0361 L .25818 .03439 L .25942 .03366 L .26066 .03392 L .2619 .03515 L .26314 .03736 L .26438 .04053 L .26687 .0497 L .26935 .06249 L .27183 .07868 L .27679 .12009 L .28175 .17106 L .29167 .28735 L .29663 .34471 L .30159 .39629 L .30655 .43855 L .30903 .45526 L .31151 .46861 L .31399 .47839 L .31523 .48187 L .31647 .48441 L .31771 .48597 L .31895 .48656 L .32019 .48618 L .32143 .48482 L Mistroke .32267 .48249 L .32391 .4792 L .32639 .46979 L .32887 .45675 L .33135 .4403 L .33631 .3983 L .34127 .34659 L .35119 .2283 L .35615 .16964 L .36111 .11658 L .36607 .07267 L .36855 .05509 L .37103 .04085 L .37227 .03505 L .37351 .03017 L .37475 .02623 L .37599 .02324 L .37723 .02122 L .37847 .02018 L .37971 .02011 L .38095 .02102 L .38219 .0229 L .38343 .02576 L .38591 .0343 L .38715 .03996 L .38839 .04652 L .39087 .06218 L .39583 .10276 L .40079 .15328 L .41071 .27003 L .41567 .32835 L .42063 .38134 L .4256 .42542 L .42808 .44315 L .43056 .45759 L .43304 .4685 L .43428 .47257 L .43552 .47569 L .43676 .47784 L .438 .47903 L .43924 .47924 L .44048 .47847 L .44172 .47673 L .44296 .47402 L .4442 .47035 L .44544 .46574 L .44792 .45378 L .4504 .43835 L .45536 .39813 L .46032 .34779 L Mistroke .47024 .23074 L .4752 .17191 L .48016 .11818 L .48512 .07316 L .4876 .0549 L .49008 .03989 L .49256 .0284 L .4938 .02403 L .49504 .02061 L .49628 .01814 L .49752 .01665 L .49876 .01614 L .5 .0166 L .50124 .01804 L .50248 .02045 L .50496 .02813 L .5062 .03337 L .50744 .03952 L .50992 .05442 L .51488 .09369 L .51984 .14329 L .52976 .25961 L .53968 .37248 L .54464 .41801 L .54712 .43659 L .5496 .45196 L .55084 .45835 L .55208 .46385 L .55332 .46842 L .55456 .47206 L .5558 .47473 L .55704 .47644 L .55828 .47718 L .55952 .47693 L .57937 .35299 L .59921 .12326 L .60417 .07702 L .60665 .058 L .60913 .04217 L .61161 .02979 L .61285 .02497 L .61409 .02108 L .61533 .01814 L .61657 .01616 L .61781 .01516 L .61905 .01514 L .62029 .0161 L .62153 .01803 L .62277 .02092 L .62401 .02477 L Mistroke .62897 .04931 L .63145 .0667 L .63393 .08711 L .63889 .13562 L .64881 .25116 L .65873 .36528 L .66369 .4121 L .66617 .43148 L .66865 .44771 L .67113 .46053 L .67237 .46558 L .67361 .4697 L .67485 .47288 L .67609 .47509 L .67733 .47633 L .67857 .47659 L .67981 .47587 L .68105 .47418 L .68229 .47152 L .68353 .46791 L .68601 .45787 L .68849 .44425 L .69345 .40719 L .69841 .35925 L .70833 .24414 L .71825 .12943 L .72321 .08197 L .72569 .0622 L .72817 .04554 L .73065 .03227 L .73189 .02698 L .73313 .02261 L .73437 .01919 L .73562 .01672 L .73686 .01523 L .7381 .01472 L .73934 .01518 L .74058 .01661 L .74182 .01902 L .74306 .02239 L .7443 .02671 L .74554 .03195 L .74802 .04512 L .75298 .08137 L .75794 .12869 L .76786 .24327 L .77778 .35845 L .78274 .4065 L .7877 .4437 L .79018 .45742 L Mistroke .79142 .46294 L .79266 .46754 L .7939 .4712 L .79514 .47391 L .79638 .47565 L .79762 .47641 L .79886 .47619 L .8001 .475 L .80134 .47284 L .80258 .46971 L .80382 .46563 L .80506 .46062 L .80754 .4479 L .8125 .41244 L .81746 .36572 L .82738 .25168 L .8373 .136 L .84226 .08736 L .84722 .04938 L .8497 .03522 L .85094 .02946 L .85218 .02462 L .85342 .02072 L .85466 .01777 L .8559 .01578 L .85714 .01477 L .85838 .01473 L .85962 .01567 L .86086 .01759 L .8621 .02047 L .86334 .02431 L .86458 .02908 L .86706 .04135 L .87202 .076 L .87698 .12208 L .8869 .23554 L .89683 .35165 L .90179 .40087 L .90427 .42173 L .90675 .43961 L .90923 .4542 L .91171 .46526 L .91295 .4694 L .91419 .4726 L .91543 .47483 L .91667 .47609 L .91791 .47638 L .91915 .47569 L .92039 .47402 L .92163 .47138 L Mistroke .92287 .46778 L .92411 .46325 L .92659 .45143 L .92907 .43613 L .93155 .4176 L .93651 .37216 L .97619 .01513 L Mfstroke P P % End of Graphics MathPictureEnd :[font = output; output; inactive; preserveAspect; fontSize = 12; endGroup] Graphics["<<>>"] ;[o] -Graphics- :[font = input; preserveAspect; fontSize = 12] (* We see from this example that the output of a first order system to a sine wave forcing function is also a sine wave, it takes about 5 multiples of the time constant to reach the steady oscillation *) ^*)