aboutsummaryrefslogtreecommitdiff
path: root/src/input/damped.input.pamphlet
blob: 4e0e5310ca6c6ad175c4833c162342e7513762cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input damped.input}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{License}
<<license>>=
--Copyright The Numerical Algorithms Group Limited 1994.
@
<<*>>=
<<license>>
-- Input file to solve linear second order differential equations
-- with driving force A*cos(wt).

-- The equation is solved at y(0)=y'(0)=0 for 
--    (i)   an overdamped, forced motion example  c**2-4*k*m > 0
--    (ii)  critically damped                     c**2-4*k*m = 0
--    (iii) underdamped                           c**2-4*k*m < 0

-- The resulting equations are then plotted.

)clear all
y := operator y
deq := m*D(y x, x, 2) + c*D(y x, x) + k*(y x) = A * cos (w * x)

solve(deq, y, x=0, [0,0])                     -- takes a few minutes
ex:=%
eval(%, [c=6,k=5,m=1,A=6*sqrt(5),w=sqrt(5)])  -- c**2-4*k*m = 16
draw(%,x=0..15,title=="Overdamping")

eval(ex, [k=5,m=1,A=6*sqrt(5),w=sqrt(5)])     -- c**2-4*k*m = 0
limit(%,c=sqrt(20),"right")                   -- otherwise division by zero
draw(%,x=0..15,title=="Critically Damped")

eval(ex, [c=2,k=5,m=1,A=6*sqrt(5),w=sqrt(5)]) -- c**2-4*k*m = -16
trigs %
rule1 := rule sin(-x) == - sin(x)
rule2 := rule cos(-x) ==   cos(x)
rule2 rule1 %% (-3)
draw(%,x=0..15,title=="Underdamped")
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}