Mathcad - Solution of ODEs
Mathcad - Solution of ODEs
Mathcad - Solution of ODEs
d2 d
m x c x k x = f ( t) = sin ( 5 t)
2
dt dt
tf 40 m 1 c 0.3 k 4 ω 5
Given
d2 d
m x ( t) c x ( t) k x ( t) = sin ( ω t)
2
dt dt
x Odesolve t tf
0.2
0.1
x ( t) 0
0.1
0.2
0 10 20 30 40
t
Other Solvers can as well be used such as
d 1
y2 ( t) = sin ( ω t) c y2 ( t) k y1 ( t)
dt m
0.1 x ( 0) = y1 ( 0)
Initial Conditions IC
0.05 x' ( 0) = y2 ( 0)
y1
Set of ODEs
D ( t y) 1
sin ( ω t) c y1 k y0
m
ts 0 tf 40 NN 500 The integer number of discretization intervals
(NN-1) used to interpolate the solution function.
S Adams IC ts tf NN D
X S1 T S0 X' S2 t ts ts 0.01 tf
0.2
0.1
X
0
x ( t)
0.1
0.2
0 10 20 30 40
T t
0.2
0.1
X
0
x ( t)
0.1
0.2
0 1 2 3 4 5
T t
d f ( t)
f ( t) = k u ( t) atanh
d 1
Friction element given below can be represented by
dt dt α μ N
where f(t) is the friction force and u(t) is the input motion (x) to the friction element.
NN 1000
3
110
Non-stiff Solver
Stiff Solver
Force
0 IC
1103
0 5 10 15
Time
3
110
Non-stiff Solver
Stiff Solver
Force
0 IC
3
110
1 0.5 0 0.5 1
Displacement
As can be seen from the solutions, the non-stiff solver "rkfixed" cannot detect the stick slip
transitions correctly. Therefore, one should use a stiff solver such as "BDF" in order to
obtain the correct solution of a stiff problem. For stiff problems, non-stiff solvers require
very small time steps which are not practical in most situations.