summaryrefslogtreecommitdiff
path: root/3137/CH16/EX16.30/Ex16_30.sce
blob: cc5f53e31466d63a0d83925951767fd24c1b23c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//Initilization of variables
u=0.2 //coefficient of friction
ma=1.2 //kg
mb=2 //kg
g=9.8 //m/s^2
//Calculations
Nb=mb*g //N
F=u*Nb //N
//Using equations of motion
//Solving for T and a
A=[-1,-ma;1,-mb]
B=[-ma*g;F]
C=inv(A)*B
T=C(1) //N
a=C(2) //m/s^2
//Taking the sum of the moments
x_m=-(F*0.15+T*0.15)/Nb //m
x=x_m*1000 //mm
//Result
clc
printf('The acceleration of block A is %f m/s^2 and Nb acts at a distance %f mm\n Negative sign indictaes that the side assumed is incorrect',a,x)