-
-
Notifications
You must be signed in to change notification settings - Fork 436
Expand file tree
/
Copy pathprob45.pg
More file actions
78 lines (63 loc) · 2.11 KB
/
Copy pathprob45.pg
File metadata and controls
78 lines (63 loc) · 2.11 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
## DESCRIPTION
## Differential Equations: Laplace Transforms
## ENDDESCRIPTION
## Tagged by cmd6a 3/14/06
## DBsubject(Differential equations)
## DBchapter(Laplace transforms)
## DBsection(Basic transformations)
## Institution(ASU)
## MO(1)
## MLT(forward_01)
## MLTleader(1)
## Level(5)
DOCUMENT() ; # This should be the first executable line in the problem.
loadMacros(
"PGstandard.pl",
"PGchoicemacros.pl",
"PGgraphmacros.pl",
"PGasu.pl",
"MathObjects.pl",
"PGcourse.pl"
);
TEXT(beginproblem()) ;
$showPartialCorrectAnswers = 1;
$r = random(2,6,1);
$r2 = 2*$r;
$b = random(14,19,1);
$ans5= FEQ("tanh(s/4)/(s^2*(s^2+$r2*s+$b))");
$graph3 = init_graph(-1,-2,3,2, 'axes'=>[0,0],'grid'=>[4,4]);
$f1 = "x for x in <0,0.5> using color:red and weight:2";
$f2 = "1-x for x in <0.5,1> using color:red and weight:2";
$f3 = "x-1 for x in <1,1.5> using color:red and weight:2";
$f4 = "2-x for x in <1.5,2> using color:red and weight:2";
$f5 = "x-2 for x in <2,2.5> using color:red and weight:2";
$f6 = "3-x for x in <2.5,3> using color:red and weight:2";
plot_functions($graph3, $f1);
plot_functions($graph3, $f2);
plot_functions($graph3, $f3);
plot_functions($graph3, $f4);
plot_functions($graph3, $f5);
plot_functions($graph3, $f6);
$g = image(insertGraph($graph3),
alt=>"Triangular wave function with period 1, showing repeated peaks at height 0.5 occurring at t = 0.5, 1.5, and 2.5, with vertices touching the x-axis at integer values."
);
$func = "\begin{cases}
t, & 0 \leq t < 1/2 \cr
1-t, & 1/2 \leq t < 1
\end{cases}";
BEGIN_TEXT
Take the Laplace transform of the following initial value problem and
solve for \(Y(s) = \mathcal{L}$LBRACE y(t) $RBRACE \):
\[ y'' + {$r2} y' + {$b} y= T(t) \hspace{0.5in} y(0)=0, \; y'(0)=0\]
$PAR
Where \(T(t) = $func ,\hspace{0.2in} T(t+1) = T(t) \).
$PAR
\(Y(s)= \) \{ans_rule(40) \}.
$BR Graph of \( T(t) \) (a triangular wave function):
$BR $g
END_TEXT
Context("Numeric")->variables->are('s'=>"Real");
$ans = Compute("$ans5");
$ans->{limits} = [1,2];
ANS($ans->cmp());
ENDDOCUMENT() ; # This should be the last executable line in the problem.