SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
Graph of COULOMB-DRY-FRICTION DAMPED OSCILLATION
In MAPLE, people often use the seq function to create the list.
However, to make switching from maple to javascript and to latex easily, I try to use for..do to create
aray ARR, after that convert aray into list by using function
convert (ARR, list)
1. Problem:
A spring-mass system on horizontal surface performs damped oscillation due to dry frictional force
Fcl = µ.m.g
where µ is the coefficient of dry friction.
When t = 0 the mass was pulled so that the spring stretches a segment of x0 = 4.6 (cm) then it was
loosed.
It's known that:
k
m
= 4
rad
s
where k is stiffness (N/m) of the spring and m (kg) is the mass of the small object.
and the length of the way for one direction movement (from left to right or from right to left)
decreasing steadily to 0.8 (cm).
(below we will see that 0.8 = ai K1 - ai = 2.d)
a- Establish the equation of motion x = x(t).
b- Draw this oscillating graph using MAPLE.
2. Solution:
There are n time intervals. At each interval, the object moves in a certain direction:
The first interval (from 0 to t1) and i = 1:
m.
d
2
x
dt
2
= Kk.x CFcl
Let
k
m
= w
2
and
Fcl
k
= d 0
Fcl
m
= w
2
.d 0
d
2
x
dt
2
+ w
2
. x Kd = 0
Now let substitute x = X + d , and we have a dinamic equation of harmonic oscilation for the variable X
d2
X
dt
2
+ w
2
.X = 0 0 X(t) = A1.cos(w.t + 4
1
)
x(t) = A1.cos(w.t + 4
1
) + d
The second interval (from t1 to t2) and i = 2:
m.
d
2
x
dt
2
= Kk.x KFcl
Similarly we have
x(t) = A2.cos(w.t + 42
) - d
For the i-th time interval we can write
x(t) = Ai.cos(w.t + 4
i
) + K1
i K1
.d (a)
From the initial conditions for the first interval (when t=0 x = x0 and v =
d
d t
x = 0) we can get
4
1
= 0 (if x0>0) ; 4
1
= π (if x0<0) (b)
a- We can show that all phases are equal to 4
1
The function x (t) is a continuous and, at the moment t1 when the mass changes the direction of its
motion, function xi K1 "changes" to xi, so at this moment we have:
xi = xi K1 ; vi = vi K1 = 0
0 - w.Ai.sin w.ti C 4
i
= 0 0 w.ti C 4
i
= p.π p = 0, 1, 2, 3 ...
- w.Ai K1.sin w.ti C 4
i K1
= 0 0 w.ti C 4
i K1
= q.π q = 0, 1, 2, 3 ...
Because 0 ≤ 4
i
! 2 π we have
4
i
- 4
i K1
= 0 OR π 1
However from xi = xi K1 we have
cos(w.ti C 4
i
= cos w.ti C 4
i K1
2
In (2) we can't substitute 4
i
= 4
i K1
C π. So we have
4i
= 4i K1
= 41
3
a- We can show that the amplitude of sinusoidal (harmonic) oscilation (in the interval from ti K 1
to ti is
Ai = x0 K 2. i K 1 C 1 .d
We will call a0 = x0 , a1 , a2 , a3 ... the amplitudes of damped oscillation. We have :
2. Ai = ai K1 C ai 4
According to the work-energy theorem we have:
1
2
.k.ai
2
=
1
2
.k.ai K1
2
KFcl. ai K1 C ai 0 ai = ai K1 K2. d 5
By subtituting (5) to (4) we have
Ai = ai K1 Kd 6 0 Ai K1 = ai K2 Kd 7
From (5),(6),(7) we get
Ai = Ai K1 K2. d 7
So, according to (6)
A1 = a0 Kd = x0 Kd
According to (7)
A2 = x0 Kd K2 d = x0 K 3 d
0 Ai = x0 K 2. iK1 C 1 .d i = 1, 2, 3 ... 8
With MAPLE we have to write : if a0 is the amplitude at t = 0
a0 := abs(x0);
If x0 > 0 then the equation of motion for the i-th half period is:
x(t) = (a0 - (2*(i-1) + 1)*d)*cos(w*t) + (-1)^(i-1)*d; (i = 1,2,3...)
>>
(1)(1)
>>
>>
>>
(2)(2)
>>
>>
>>
If x0 < 0 then the equation of motion for the i-th half period is:
x(t) = (a0- (2*(i-1) + 1)*d)*cos(w*t + Pi) - (-1)^(i-1)*d; (i = 1,2,3...)
ai is the amplitude at the end of i-th half-period.
ai = a0 - (2*d)*i; (i = 1,2,3 ...)
If ai ≤ d then ai ≤
Fcl
k
0 k$ai ≤ Fcl 0 the mass stops
i ≥ (a0 - d)/(2*d)
DEFINITION: The ceiling of a real number x is defined to be the smallest integer no smaller than x.
So the number of half-period is
n = ceil((a0-d)/(2*d)) (9)
# Please correct the data of
# x0 (cm) (x0>0 or x0<0) , w (rad/s), d (cm) as you want
# then click the button with three exclamation points (!!!):
x0:=4.6; w:=4; d:=0.4;
# You need not to change the value of xtext
xtext:= 0.2:
a0 := abs(x0);
x0 d 4.6
w d 4
d d 0.4
a0 d 4.6
with(plots):
n := ceil((a0-d)/(2*d));
T:= 2*Pi/w:
tt := n*1/2*T:
tt1 := 1/100*round(tt*100):
tt2 := parse(sprintf("%.2f",tt1)):
print(`Total time of motion: `,tt,` = `, tt2,` (sec)`);
n d 6
Total time of motion: ,
3 π
2
, = , 4.71, (sec)
P:= Array(1..n):
for i from 1 to n do
if x0 > 0 then
P[i] := plot((a0 - (2*(i-1) + 1)*d)*cos(w*t) + (-1)^(i-1)*d, t=
(i-1)*Pi/w..i*Pi/w,thickness=1,color=blue);
else
P[i] := plot((a0 - (2*(i-1) + 1)*d)*cos(w*t + Pi) - (-1)^(i-1)*d,
t= (i-1)*Pi/w..i*Pi/w,thickness=1,color=blue);
end if;
end do:
pic:= convert(P,list):
B:= Array(1..n+1):
for i from 1 to n+1 do
b:= (a0 - (2*d)*i)*sign(x0);
>>
>>
>>
>>
>>
>>
L:=[[i*Pi/w,0],[i*Pi/w,(-1)^i*b]];
B[i] := plot(L,t=0..4,thickness=0,color=green);
end do:
amp:= convert(B,list):
T0:=textplot([xtext,sign(x0)*a0/2,'a0']):
T1:= textplot([Pi/w + xtext,sign(x0)*(-1)*(a0-2*d)/2,'a1']):
T2:= textplot([2*Pi/w + xtext,sign(x0)*(a0-4*d)/2,'a2']):
tex := [T0,T1,T2]:
LA:=[[0,d],[(n+1)*Pi/w,d]]:
linA:=plot(LA,t=0..4,thickness=0,color=red):
LB:=[[0,-1*d],[(n+1)*Pi/w,-1*d]]:
linB:=plot(LB,t=0..4,thickness=0,color=red):
lin := [linA, linB]:
display(pic,amp,tex,lin);
a0
a1
a2
t
π
4
π
2
3 π
4
π 5 π
4
3 π
2
K3
K2
K1
0
1
2
3
4
display(pic,lin);
t
π
4
π
2
3 π
4
π 5 π
4
3 π
2
K3
K2
K1
0
1
2
3
4
In MAPLE 16, we can export the graph as PDF image:
- Right click the graph.
- Select Export then select Portable Document Format
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
Here is the mpl file. You can select it all , copy , paste the content to Notepad , delete the green
simbol # placed at the beginning of lines and save as coulomb-graph.mpl.
After that you can open this file in MAPLE.
# # Please correct the data of
# # x0 (cm) (x0>0 or x0<0) , w (rad/s), d (cm) as you want
# # then click the button with three exclamation points (!!!):
# x0:=4.6; w:=4; d:=0.4;
# # You need not to change the value of xtext
# xtext:= 0.2:
# a0 := abs(x0);
# with(plots):
# n := ceil((a0-d)/(2*d));
# T:= 2*Pi/w:
# tt := n*1/2*T:
# tt1 := 1/100*round(tt*100):
# tt2 := parse(sprintf("%.2f",tt1)):
# print(`Total time of motion: `,tt,` = `, tt2,` (sec)`);
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
# P:= Array(1..n):
# for i from 1 to n do
# if x0 > 0 then
# P[i] := plot((a0 - (2*(i-1) + 1)*d)*cos(w*t) + (-1)^(i-1)*d, t=
(i-1)*Pi/w..i* Pi/w,thickness=1,color=blue);
# else
# P[i] := plot((a0 - (2*(i-1) + 1)*d)*cos(w*t + Pi) - (-1)^(i-1)*
d, t= (i-1)*Pi/w..i*Pi/w,thickness=1,color=blue);
# end if;
# end do:
# pic:= convert(P,list):
# B:= Array(1..n+1):
# for i from 1 to n+1 do
# b:= (a0 - (2*d)*i)*sign(x0);
# L:=[[i*Pi/w,0],[i*Pi/w,(-1)^i*b]];
# B[i] := plot(L,t=0..4,thickness=0,color=green);
# end do:
# amp:= convert(B,list):
# T0:=textplot([xtext,sign(x0)*a0/2,'a0']):
# T1:= textplot([Pi/w + xtext,sign(x0)*(-1)*(a0-2*d)/2,'a1']):
# T2:= textplot([2*Pi/w + xtext,sign(x0)*(a0-4*d)/2,'a2']):
# tex := [T0,T1,T2]:
# LA:=[[0,d],[(n+1)*Pi/w,d]]:
# linA:=plot(LA,t=0..4,thickness=0,color=red):
# LB:=[[0,-1*d],[(n+1)*Pi/w,-1*d]]:
# linB:=plot(LB,t=0..4,thickness=0,color=red):
# lin := [linA, linB]:
# display(pic,amp,tex,lin);
# display(pic,lin);
3. We can also draw this graph using this html file
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Coulomb OSC</title>
<head>
<style>
body{
font-family:'Arial';
font-size:11pt;
margin:0px; padding:0px;
background-color:#99CCFF;
}
input[type=text]{background-color:white; text-align:center}
button{background-color:#DDDDDD}
</style>
<link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css"
/>
<style>
</style>
<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.
js"></script>
<script src="http://cdn.jsdelivr.net/g/filesaver.js"></script>
</head>
<body onload="init()">
<div align=center>
<h2>COULOMB DAMPED OSCILLATION GRAPH</h2>
<h3>1- Plotting graph using javascript</h3>
<div id="box" class="jxgbox" style="width:700px; height:700px;"></div>
<br>
<label for="gender">Select t_max: </label>
<input type="radio" name="widthRadio" value="15" onclick="init()">15
<input type="radio" name="widthRadio" value="30" checked onclick="init()">30
<input type="radio" name="widthRadio" value="50" onclick="init()">50
&nbsp;&nbsp;
<button onclick="clr()">Clear</button>&nbsp;
Omega:<input type=text id="omega" size=3 value=2>&nbsp;
x_0:<input type=text id="x0" size=4 value=11>&nbsp;
d:<input type=text id="d" size=4 value=0.3>&nbsp;
<button onclick="show()">Show</button>
<br><br>
<button onclick="saveSVG()">Save as SVG</button>
<br><br>
<div id="div1" style="width:420px;height:120px;padding:10px;text-align:left;overflow:auto;
background-color:white">
</div>
<br>
</div>
<script>
wid = 30;
function init(){
var radios = document.getElementsByName('widthRadio');
for (var i = 0, length = radios.length; i < length; i++){
if (radios[i].checked){
wid = radios[i].value;
break;
}
}
brd1 = JXG.JSXGraph.initBoard('box', {boundingbox: [0, 13, wid, -13], axis:true});
}
Pi = Math.PI; nn = 2000; var f
var brd1 = JXG.JSXGraph.initBoard('box', {boundingbox: [0, 13, wid, -13], axis:true});
function show(){
w = Number(document.getElementById('omega').value);
x0 = Number(document.getElementById('x0').value);
d = Number(document.getElementById('d').value);
n = Math.ceil((x0 - d)/(2*d));
for(i= 1; i<= n; i++){
mm1 = x0-(2*(i-1)+1)*d + d;
mm = Math.round(mm1 * 100) / 100;
if(i % 2 == 1){mm ='<span style="color:red">'+ mm + '</span>'}
if((i+1) % 10 == 0 ){mm = mm + '<br>'}
st = document.getElementById('div1').innerHTML;
document.getElementById('div1').innerHTML = st + ' ; ' + mm;
f = brd1.createElement('functiongraph',
[function(x){
if(x>(i-1)*Pi/w && x <i*Pi/w){
011 return (x0-(2*(i-1)+1)*d)*Math.cos(w*x) + Math.pow(-1,i-1)*d;
}else{
return 0
// break;
}
}]);
}
mm2 = (x0-(2*n+1)*d)*Math.cos(Pi*(n+2)) + Math.pow(-1,n)*d;
mm3 = Math.round(mm2 * 100) / 100;
st = document.getElementById('div1').innerHTML;
document.getElementById('div1').innerHTML = st +
'<br><span style="color:green"><b>Stop at: ' + mm3+'</b></span>';
var xr = brd1.create('line',[[0,0],[10,0]],{visible:true, strokeColor: "#CCCCCC"});
}
function saveSVG(){
var svg = new XMLSerializer().serializeToString(brd1.renderer.svgRoot);
// alert(svg);
var blob = new Blob([svg], {type: "text/plain;charset=utf-8"});
saveAs(blob, "cl-damped-1.svg");
}
function clr(){
brd1 = JXG.JSXGraph.initBoard('box', {boundingbox: [0, 13, wid, -13], axis:true});
document.getElementById('div1').innerHTML = '';
}
</script>
</body>
</html>
4. Latex code and using overleaf.com for compiling from tex to pdf
documentclass[crop,tikz]{standalone}
usepackage[utf8]{vietnam}
usepackage[utf8]{inputenc}
usepackage{amsmath,amsxtra,amssymb,amsthm,latexsy m,amscd,amsfonts}
usepackage{pgfplots}
usepackage{tikz}
usepackage{tkz-tab}
usepackage{graphics}
usepackage{fp}
begin{document}
newcommand{ww}{4}
newcommand{posit}{1}
newcommand{xx}{4.6}
newcommand{dd}{0.4}
newcommand{negat}{(-1)*xx}
begin{tikzpicture}small
begin{axis}[trig format plots=rad, axis line style=gray,
samples=120,
width=12.0cm,height=9.0cm,
xmin=0, xmax=2*pi,
ymin=-6, ymax=6,
axis x line=center,
axis y line=center,
xlabel=$t$,ylabel=$x$]
pgfmathparse{ceil((xx - dd)/(2*dd))}edefstoreresult{pgfmathresult}
FPeval{nn}{storeresult};
foreach i in {1,...,nn} {
ifnumposit = 0{
addplot[red,domain=(i-1)*pi/ww:(i)*pi/ww,semithick]
{(abs(xx) -(2*i-1)*dd)*cos(ww*x + pi) - ((-1)^(i-1))*dd};
}
else{
addplot[blue,domain=(i-1)*pi/ww:(i)*pi/ww,semithick]
{((xx-(2*i-1)*dd)*cos(ww*x) + ((-1)^(i-1))*dd)};
}
fi
}
end{axis}
end{tikzpicture}
end{document}
4- Remark
In fact, we only provide an algorithm for the case
|x0| = N.2d + δ where δ ≤ d ; N = 1, 2, 3 ...
However, the above algorithm is still valid for the case
|x0| = N.2d + d + δ (In this case the mass does not pass the x = 0 point).

Más contenido relacionado

La actualidad más candente

Linear transformations and matrices
Linear transformations and matricesLinear transformations and matrices
Linear transformations and matrices
EasyStudy3
 
My presentation all shortestpath
My presentation all shortestpathMy presentation all shortestpath
My presentation all shortestpath
Carlostheran
 

La actualidad más candente (18)

Unit 2 analysis of continuous time signals-mcq questions
Unit 2   analysis of continuous time signals-mcq questionsUnit 2   analysis of continuous time signals-mcq questions
Unit 2 analysis of continuous time signals-mcq questions
 
Matrix of linear transformation
Matrix of linear transformationMatrix of linear transformation
Matrix of linear transformation
 
Using blurred images to assess damage in bridge structures?
Using blurred images to assess damage in bridge structures?Using blurred images to assess damage in bridge structures?
Using blurred images to assess damage in bridge structures?
 
Linear transformation.ppt
Linear transformation.pptLinear transformation.ppt
Linear transformation.ppt
 
Linear transformations and matrices
Linear transformations and matricesLinear transformations and matrices
Linear transformations and matrices
 
Signals and Systems Formula Sheet
Signals and Systems Formula SheetSignals and Systems Formula Sheet
Signals and Systems Formula Sheet
 
linear transfermation.pptx
linear transfermation.pptxlinear transfermation.pptx
linear transfermation.pptx
 
Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...
Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...
Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...
 
Linear transformations-thestuffpoint.com
Linear transformations-thestuffpoint.comLinear transformations-thestuffpoint.com
Linear transformations-thestuffpoint.com
 
Vcla 1
Vcla 1Vcla 1
Vcla 1
 
Linear Combination, Span And Linearly Independent, Dependent Set
Linear Combination, Span And Linearly Independent, Dependent SetLinear Combination, Span And Linearly Independent, Dependent Set
Linear Combination, Span And Linearly Independent, Dependent Set
 
002 ray modeling dynamic systems
002 ray modeling dynamic systems002 ray modeling dynamic systems
002 ray modeling dynamic systems
 
Convergence methods for approximated reciprocal and reciprocal-square-root
Convergence methods for approximated reciprocal and reciprocal-square-rootConvergence methods for approximated reciprocal and reciprocal-square-root
Convergence methods for approximated reciprocal and reciprocal-square-root
 
Introduccio al calculo vectorial
Introduccio  al calculo vectorialIntroduccio  al calculo vectorial
Introduccio al calculo vectorial
 
Discretization
DiscretizationDiscretization
Discretization
 
Ameer 14208
Ameer 14208Ameer 14208
Ameer 14208
 
A block-step version of KS regularization
A block-step version of KS regularizationA block-step version of KS regularization
A block-step version of KS regularization
 
My presentation all shortestpath
My presentation all shortestpathMy presentation all shortestpath
My presentation all shortestpath
 

Similar a Graph for Coulomb damped oscillation

Find the compact trigonometric Fourier series for the periodic signal.pdf
Find the compact trigonometric Fourier series for the periodic signal.pdfFind the compact trigonometric Fourier series for the periodic signal.pdf
Find the compact trigonometric Fourier series for the periodic signal.pdf
arihantelectronics
 
Question 1. a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docx
Question 1.  a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docxQuestion 1.  a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docx
Question 1. a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docx
IRESH3
 
Matrix 2 d
Matrix 2 dMatrix 2 d
Matrix 2 d
xyz120
 
University of manchester mathematical formula tables
University of manchester mathematical formula tablesUniversity of manchester mathematical formula tables
University of manchester mathematical formula tables
Gaurav Vasani
 
Solving the energy problem of helium final report
Solving the energy problem of helium final reportSolving the energy problem of helium final report
Solving the energy problem of helium final report
JamesMa54
 
Conjugate Gradient Methods
Conjugate Gradient MethodsConjugate Gradient Methods
Conjugate Gradient Methods
MTiti1
 

Similar a Graph for Coulomb damped oscillation (20)

Signals and systems: part i solutions
Signals and systems: part i solutionsSignals and systems: part i solutions
Signals and systems: part i solutions
 
convulution
convulutionconvulution
convulution
 
Find the compact trigonometric Fourier series for the periodic signal.pdf
Find the compact trigonometric Fourier series for the periodic signal.pdfFind the compact trigonometric Fourier series for the periodic signal.pdf
Find the compact trigonometric Fourier series for the periodic signal.pdf
 
Calculus III
Calculus IIICalculus III
Calculus III
 
Presentation on calculus
Presentation on calculusPresentation on calculus
Presentation on calculus
 
Lesson 7: Vector-valued functions
Lesson 7: Vector-valued functionsLesson 7: Vector-valued functions
Lesson 7: Vector-valued functions
 
03 Cap 2 - fourier-analysis-2015.pdf
03 Cap 2 - fourier-analysis-2015.pdf03 Cap 2 - fourier-analysis-2015.pdf
03 Cap 2 - fourier-analysis-2015.pdf
 
Question 1. a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docx
Question 1.  a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docxQuestion 1.  a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docx
Question 1. a) (i)(4+i2).(1+i3)4(1+i3)+i2(1+i3)4+i12+i2-6.docx
 
Conformal mapping
Conformal mappingConformal mapping
Conformal mapping
 
8 Continuous-Time Fourier Transform Solutions To Recommended Problems
8 Continuous-Time Fourier Transform Solutions To Recommended Problems8 Continuous-Time Fourier Transform Solutions To Recommended Problems
8 Continuous-Time Fourier Transform Solutions To Recommended Problems
 
Signals Processing Homework Help
Signals Processing Homework HelpSignals Processing Homework Help
Signals Processing Homework Help
 
Matrix 2 d
Matrix 2 dMatrix 2 d
Matrix 2 d
 
University of manchester mathematical formula tables
University of manchester mathematical formula tablesUniversity of manchester mathematical formula tables
University of manchester mathematical formula tables
 
4th Semeste Electronics and Communication Engineering (Dec-2015; Jan-2016) Qu...
4th Semeste Electronics and Communication Engineering (Dec-2015; Jan-2016) Qu...4th Semeste Electronics and Communication Engineering (Dec-2015; Jan-2016) Qu...
4th Semeste Electronics and Communication Engineering (Dec-2015; Jan-2016) Qu...
 
Solving the energy problem of helium final report
Solving the energy problem of helium final reportSolving the energy problem of helium final report
Solving the energy problem of helium final report
 
time_complexity_list_02_04_2024_22_pages.pdf
time_complexity_list_02_04_2024_22_pages.pdftime_complexity_list_02_04_2024_22_pages.pdf
time_complexity_list_02_04_2024_22_pages.pdf
 
Solution set 3
Solution set 3Solution set 3
Solution set 3
 
Mathematical formula tables
Mathematical formula tablesMathematical formula tables
Mathematical formula tables
 
Affine Yield Curves: Flexibility versus Incompleteness
Affine Yield Curves: Flexibility versus IncompletenessAffine Yield Curves: Flexibility versus Incompleteness
Affine Yield Curves: Flexibility versus Incompleteness
 
Conjugate Gradient Methods
Conjugate Gradient MethodsConjugate Gradient Methods
Conjugate Gradient Methods
 

Más de phanhung20

Play audio-continuously
Play audio-continuouslyPlay audio-continuously
Play audio-continuously
phanhung20
 
Playing videos. See:slideshare.net/phanhung20/non-stop-random2b
Playing videos. See:slideshare.net/phanhung20/non-stop-random2bPlaying videos. See:slideshare.net/phanhung20/non-stop-random2b
Playing videos. See:slideshare.net/phanhung20/non-stop-random2b
phanhung20
 

Más de phanhung20 (20)

Search videos with youtube api3
Search videos with youtube api3Search videos with youtube api3
Search videos with youtube api3
 
Search and play more than 50 clips
Search and play more than 50 clipsSearch and play more than 50 clips
Search and play more than 50 clips
 
Search 500-video-clips
Search 500-video-clipsSearch 500-video-clips
Search 500-video-clips
 
Color ss2-pvh-bta1
Color ss2-pvh-bta1Color ss2-pvh-bta1
Color ss2-pvh-bta1
 
Pvh bai-tap-a2-2014-th-11(1)
Pvh bai-tap-a2-2014-th-11(1)Pvh bai-tap-a2-2014-th-11(1)
Pvh bai-tap-a2-2014-th-11(1)
 
Cau hoi thi vatly 2014 4 tin chi
Cau hoi thi vatly 2014 4 tin chiCau hoi thi vatly 2014 4 tin chi
Cau hoi thi vatly 2014 4 tin chi
 
Cau hoi-thi-catly-2014-thang11
Cau hoi-thi-catly-2014-thang11Cau hoi-thi-catly-2014-thang11
Cau hoi-thi-catly-2014-thang11
 
Pvh 11-2014-btvl-a1
Pvh 11-2014-btvl-a1Pvh 11-2014-btvl-a1
Pvh 11-2014-btvl-a1
 
Debai table1
Debai table1Debai table1
Debai table1
 
Bai tap-a1
Bai tap-a1Bai tap-a1
Bai tap-a1
 
Thi nghiema2
Thi nghiema2Thi nghiema2
Thi nghiema2
 
Thi nghiema1
Thi nghiema1Thi nghiema1
Thi nghiema1
 
Ly thuyetdosai so1
Ly thuyetdosai so1Ly thuyetdosai so1
Ly thuyetdosai so1
 
Bai tap a1
Bai tap a1Bai tap a1
Bai tap a1
 
Play audio-continuously
Play audio-continuouslyPlay audio-continuously
Play audio-continuously
 
How to-save-video-list
How to-save-video-listHow to-save-video-list
How to-save-video-list
 
Xem video-lien-tuc
Xem video-lien-tucXem video-lien-tuc
Xem video-lien-tuc
 
Non stop random2b
Non stop random2bNon stop random2b
Non stop random2b
 
Playing videos. See:slideshare.net/phanhung20/non-stop-random2b
Playing videos. See:slideshare.net/phanhung20/non-stop-random2bPlaying videos. See:slideshare.net/phanhung20/non-stop-random2b
Playing videos. See:slideshare.net/phanhung20/non-stop-random2b
 
Playing videos continously
Playing videos continously Playing videos continously
Playing videos continously
 

Último

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Último (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 

Graph for Coulomb damped oscillation

  • 1. Graph of COULOMB-DRY-FRICTION DAMPED OSCILLATION In MAPLE, people often use the seq function to create the list. However, to make switching from maple to javascript and to latex easily, I try to use for..do to create aray ARR, after that convert aray into list by using function convert (ARR, list) 1. Problem: A spring-mass system on horizontal surface performs damped oscillation due to dry frictional force Fcl = µ.m.g where µ is the coefficient of dry friction. When t = 0 the mass was pulled so that the spring stretches a segment of x0 = 4.6 (cm) then it was loosed. It's known that: k m = 4 rad s where k is stiffness (N/m) of the spring and m (kg) is the mass of the small object. and the length of the way for one direction movement (from left to right or from right to left) decreasing steadily to 0.8 (cm). (below we will see that 0.8 = ai K1 - ai = 2.d) a- Establish the equation of motion x = x(t). b- Draw this oscillating graph using MAPLE. 2. Solution: There are n time intervals. At each interval, the object moves in a certain direction: The first interval (from 0 to t1) and i = 1: m. d 2 x dt 2 = Kk.x CFcl Let k m = w 2 and Fcl k = d 0 Fcl m = w 2 .d 0 d 2 x dt 2 + w 2 . x Kd = 0 Now let substitute x = X + d , and we have a dinamic equation of harmonic oscilation for the variable X d2 X dt 2 + w 2 .X = 0 0 X(t) = A1.cos(w.t + 4 1 ) x(t) = A1.cos(w.t + 4 1 ) + d The second interval (from t1 to t2) and i = 2: m. d 2 x dt 2 = Kk.x KFcl Similarly we have x(t) = A2.cos(w.t + 42 ) - d For the i-th time interval we can write
  • 2. x(t) = Ai.cos(w.t + 4 i ) + K1 i K1 .d (a) From the initial conditions for the first interval (when t=0 x = x0 and v = d d t x = 0) we can get 4 1 = 0 (if x0>0) ; 4 1 = π (if x0<0) (b) a- We can show that all phases are equal to 4 1 The function x (t) is a continuous and, at the moment t1 when the mass changes the direction of its motion, function xi K1 "changes" to xi, so at this moment we have: xi = xi K1 ; vi = vi K1 = 0 0 - w.Ai.sin w.ti C 4 i = 0 0 w.ti C 4 i = p.π p = 0, 1, 2, 3 ... - w.Ai K1.sin w.ti C 4 i K1 = 0 0 w.ti C 4 i K1 = q.π q = 0, 1, 2, 3 ... Because 0 ≤ 4 i ! 2 π we have 4 i - 4 i K1 = 0 OR π 1 However from xi = xi K1 we have cos(w.ti C 4 i = cos w.ti C 4 i K1 2 In (2) we can't substitute 4 i = 4 i K1 C π. So we have 4i = 4i K1 = 41 3 a- We can show that the amplitude of sinusoidal (harmonic) oscilation (in the interval from ti K 1 to ti is Ai = x0 K 2. i K 1 C 1 .d We will call a0 = x0 , a1 , a2 , a3 ... the amplitudes of damped oscillation. We have : 2. Ai = ai K1 C ai 4 According to the work-energy theorem we have: 1 2 .k.ai 2 = 1 2 .k.ai K1 2 KFcl. ai K1 C ai 0 ai = ai K1 K2. d 5 By subtituting (5) to (4) we have Ai = ai K1 Kd 6 0 Ai K1 = ai K2 Kd 7 From (5),(6),(7) we get Ai = Ai K1 K2. d 7 So, according to (6) A1 = a0 Kd = x0 Kd According to (7) A2 = x0 Kd K2 d = x0 K 3 d 0 Ai = x0 K 2. iK1 C 1 .d i = 1, 2, 3 ... 8 With MAPLE we have to write : if a0 is the amplitude at t = 0 a0 := abs(x0); If x0 > 0 then the equation of motion for the i-th half period is: x(t) = (a0 - (2*(i-1) + 1)*d)*cos(w*t) + (-1)^(i-1)*d; (i = 1,2,3...)
  • 3. >> (1)(1) >> >> >> (2)(2) >> >> >> If x0 < 0 then the equation of motion for the i-th half period is: x(t) = (a0- (2*(i-1) + 1)*d)*cos(w*t + Pi) - (-1)^(i-1)*d; (i = 1,2,3...) ai is the amplitude at the end of i-th half-period. ai = a0 - (2*d)*i; (i = 1,2,3 ...) If ai ≤ d then ai ≤ Fcl k 0 k$ai ≤ Fcl 0 the mass stops i ≥ (a0 - d)/(2*d) DEFINITION: The ceiling of a real number x is defined to be the smallest integer no smaller than x. So the number of half-period is n = ceil((a0-d)/(2*d)) (9) # Please correct the data of # x0 (cm) (x0>0 or x0<0) , w (rad/s), d (cm) as you want # then click the button with three exclamation points (!!!): x0:=4.6; w:=4; d:=0.4; # You need not to change the value of xtext xtext:= 0.2: a0 := abs(x0); x0 d 4.6 w d 4 d d 0.4 a0 d 4.6 with(plots): n := ceil((a0-d)/(2*d)); T:= 2*Pi/w: tt := n*1/2*T: tt1 := 1/100*round(tt*100): tt2 := parse(sprintf("%.2f",tt1)): print(`Total time of motion: `,tt,` = `, tt2,` (sec)`); n d 6 Total time of motion: , 3 π 2 , = , 4.71, (sec) P:= Array(1..n): for i from 1 to n do if x0 > 0 then P[i] := plot((a0 - (2*(i-1) + 1)*d)*cos(w*t) + (-1)^(i-1)*d, t= (i-1)*Pi/w..i*Pi/w,thickness=1,color=blue); else P[i] := plot((a0 - (2*(i-1) + 1)*d)*cos(w*t + Pi) - (-1)^(i-1)*d, t= (i-1)*Pi/w..i*Pi/w,thickness=1,color=blue); end if; end do: pic:= convert(P,list): B:= Array(1..n+1): for i from 1 to n+1 do b:= (a0 - (2*d)*i)*sign(x0);
  • 4. >> >> >> >> >> >> L:=[[i*Pi/w,0],[i*Pi/w,(-1)^i*b]]; B[i] := plot(L,t=0..4,thickness=0,color=green); end do: amp:= convert(B,list): T0:=textplot([xtext,sign(x0)*a0/2,'a0']): T1:= textplot([Pi/w + xtext,sign(x0)*(-1)*(a0-2*d)/2,'a1']): T2:= textplot([2*Pi/w + xtext,sign(x0)*(a0-4*d)/2,'a2']): tex := [T0,T1,T2]: LA:=[[0,d],[(n+1)*Pi/w,d]]: linA:=plot(LA,t=0..4,thickness=0,color=red): LB:=[[0,-1*d],[(n+1)*Pi/w,-1*d]]: linB:=plot(LB,t=0..4,thickness=0,color=red): lin := [linA, linB]: display(pic,amp,tex,lin); a0 a1 a2 t π 4 π 2 3 π 4 π 5 π 4 3 π 2 K3 K2 K1 0 1 2 3 4 display(pic,lin);
  • 5. t π 4 π 2 3 π 4 π 5 π 4 3 π 2 K3 K2 K1 0 1 2 3 4 In MAPLE 16, we can export the graph as PDF image: - Right click the graph. - Select Export then select Portable Document Format
  • 6. >> >> >> >> >> >> >> >> >> >> >> >> >> >> Here is the mpl file. You can select it all , copy , paste the content to Notepad , delete the green simbol # placed at the beginning of lines and save as coulomb-graph.mpl. After that you can open this file in MAPLE. # # Please correct the data of # # x0 (cm) (x0>0 or x0<0) , w (rad/s), d (cm) as you want # # then click the button with three exclamation points (!!!): # x0:=4.6; w:=4; d:=0.4; # # You need not to change the value of xtext # xtext:= 0.2: # a0 := abs(x0); # with(plots): # n := ceil((a0-d)/(2*d)); # T:= 2*Pi/w: # tt := n*1/2*T: # tt1 := 1/100*round(tt*100): # tt2 := parse(sprintf("%.2f",tt1)): # print(`Total time of motion: `,tt,` = `, tt2,` (sec)`);
  • 7. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> # P:= Array(1..n): # for i from 1 to n do # if x0 > 0 then # P[i] := plot((a0 - (2*(i-1) + 1)*d)*cos(w*t) + (-1)^(i-1)*d, t= (i-1)*Pi/w..i* Pi/w,thickness=1,color=blue); # else # P[i] := plot((a0 - (2*(i-1) + 1)*d)*cos(w*t + Pi) - (-1)^(i-1)* d, t= (i-1)*Pi/w..i*Pi/w,thickness=1,color=blue); # end if; # end do: # pic:= convert(P,list): # B:= Array(1..n+1): # for i from 1 to n+1 do # b:= (a0 - (2*d)*i)*sign(x0); # L:=[[i*Pi/w,0],[i*Pi/w,(-1)^i*b]]; # B[i] := plot(L,t=0..4,thickness=0,color=green); # end do: # amp:= convert(B,list): # T0:=textplot([xtext,sign(x0)*a0/2,'a0']): # T1:= textplot([Pi/w + xtext,sign(x0)*(-1)*(a0-2*d)/2,'a1']): # T2:= textplot([2*Pi/w + xtext,sign(x0)*(a0-4*d)/2,'a2']): # tex := [T0,T1,T2]: # LA:=[[0,d],[(n+1)*Pi/w,d]]: # linA:=plot(LA,t=0..4,thickness=0,color=red): # LB:=[[0,-1*d],[(n+1)*Pi/w,-1*d]]: # linB:=plot(LB,t=0..4,thickness=0,color=red): # lin := [linA, linB]: # display(pic,amp,tex,lin); # display(pic,lin); 3. We can also draw this graph using this html file <!DOCTYPE HTML> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>Coulomb OSC</title> <head> <style> body{ font-family:'Arial'; font-size:11pt; margin:0px; padding:0px; background-color:#99CCFF; } input[type=text]{background-color:white; text-align:center} button{background-color:#DDDDDD} </style> <link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css"
  • 8. /> <style> </style> <script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore. js"></script> <script src="http://cdn.jsdelivr.net/g/filesaver.js"></script> </head> <body onload="init()"> <div align=center> <h2>COULOMB DAMPED OSCILLATION GRAPH</h2> <h3>1- Plotting graph using javascript</h3> <div id="box" class="jxgbox" style="width:700px; height:700px;"></div> <br> <label for="gender">Select t_max: </label> <input type="radio" name="widthRadio" value="15" onclick="init()">15 <input type="radio" name="widthRadio" value="30" checked onclick="init()">30 <input type="radio" name="widthRadio" value="50" onclick="init()">50 &nbsp;&nbsp; <button onclick="clr()">Clear</button>&nbsp; Omega:<input type=text id="omega" size=3 value=2>&nbsp; x_0:<input type=text id="x0" size=4 value=11>&nbsp; d:<input type=text id="d" size=4 value=0.3>&nbsp; <button onclick="show()">Show</button> <br><br> <button onclick="saveSVG()">Save as SVG</button> <br><br> <div id="div1" style="width:420px;height:120px;padding:10px;text-align:left;overflow:auto; background-color:white"> </div> <br> </div> <script> wid = 30; function init(){ var radios = document.getElementsByName('widthRadio'); for (var i = 0, length = radios.length; i < length; i++){ if (radios[i].checked){ wid = radios[i].value; break; } } brd1 = JXG.JSXGraph.initBoard('box', {boundingbox: [0, 13, wid, -13], axis:true}); } Pi = Math.PI; nn = 2000; var f
  • 9. var brd1 = JXG.JSXGraph.initBoard('box', {boundingbox: [0, 13, wid, -13], axis:true}); function show(){ w = Number(document.getElementById('omega').value); x0 = Number(document.getElementById('x0').value); d = Number(document.getElementById('d').value); n = Math.ceil((x0 - d)/(2*d)); for(i= 1; i<= n; i++){ mm1 = x0-(2*(i-1)+1)*d + d; mm = Math.round(mm1 * 100) / 100; if(i % 2 == 1){mm ='<span style="color:red">'+ mm + '</span>'} if((i+1) % 10 == 0 ){mm = mm + '<br>'} st = document.getElementById('div1').innerHTML; document.getElementById('div1').innerHTML = st + ' ; ' + mm; f = brd1.createElement('functiongraph', [function(x){ if(x>(i-1)*Pi/w && x <i*Pi/w){ 011 return (x0-(2*(i-1)+1)*d)*Math.cos(w*x) + Math.pow(-1,i-1)*d; }else{ return 0 // break; } }]); } mm2 = (x0-(2*n+1)*d)*Math.cos(Pi*(n+2)) + Math.pow(-1,n)*d; mm3 = Math.round(mm2 * 100) / 100; st = document.getElementById('div1').innerHTML; document.getElementById('div1').innerHTML = st + '<br><span style="color:green"><b>Stop at: ' + mm3+'</b></span>'; var xr = brd1.create('line',[[0,0],[10,0]],{visible:true, strokeColor: "#CCCCCC"}); } function saveSVG(){ var svg = new XMLSerializer().serializeToString(brd1.renderer.svgRoot); // alert(svg); var blob = new Blob([svg], {type: "text/plain;charset=utf-8"}); saveAs(blob, "cl-damped-1.svg"); } function clr(){ brd1 = JXG.JSXGraph.initBoard('box', {boundingbox: [0, 13, wid, -13], axis:true}); document.getElementById('div1').innerHTML = ''; } </script> </body> </html>
  • 10. 4. Latex code and using overleaf.com for compiling from tex to pdf documentclass[crop,tikz]{standalone} usepackage[utf8]{vietnam} usepackage[utf8]{inputenc} usepackage{amsmath,amsxtra,amssymb,amsthm,latexsy m,amscd,amsfonts} usepackage{pgfplots} usepackage{tikz} usepackage{tkz-tab} usepackage{graphics} usepackage{fp} begin{document} newcommand{ww}{4}
  • 11. newcommand{posit}{1} newcommand{xx}{4.6} newcommand{dd}{0.4} newcommand{negat}{(-1)*xx} begin{tikzpicture}small begin{axis}[trig format plots=rad, axis line style=gray, samples=120, width=12.0cm,height=9.0cm, xmin=0, xmax=2*pi, ymin=-6, ymax=6, axis x line=center, axis y line=center, xlabel=$t$,ylabel=$x$] pgfmathparse{ceil((xx - dd)/(2*dd))}edefstoreresult{pgfmathresult} FPeval{nn}{storeresult}; foreach i in {1,...,nn} { ifnumposit = 0{ addplot[red,domain=(i-1)*pi/ww:(i)*pi/ww,semithick] {(abs(xx) -(2*i-1)*dd)*cos(ww*x + pi) - ((-1)^(i-1))*dd}; } else{ addplot[blue,domain=(i-1)*pi/ww:(i)*pi/ww,semithick] {((xx-(2*i-1)*dd)*cos(ww*x) + ((-1)^(i-1))*dd)}; } fi } end{axis} end{tikzpicture} end{document}
  • 12. 4- Remark In fact, we only provide an algorithm for the case |x0| = N.2d + δ where δ ≤ d ; N = 1, 2, 3 ... However, the above algorithm is still valid for the case |x0| = N.2d + d + δ (In this case the mass does not pass the x = 0 point).