matlab first homework


matlab工程分析第一次作业

% 1.1
1^3+5^3+3^3 == 153
1^4+6^4+3^4+4^4 == 1634
5^6+4^6+8^6+8^6+3^6+4^6 == 548834
factorial(1)+factorial(7) == 71^2
factorial(1)+factorial(4)+factorial(5)+factorial(6)+factorial(7)+factorial(8) == 215^2
ans =

  logical

   1


ans =

  logical

   1


ans =

  logical

   1


ans =

  logical

   1


ans =

  logical

   1
% 1.5
cot(pi/5) - 1/5*sqrt(25+10*sqrt(5)) < 10e-15
sin(pi/15) - 1/4*sqrt(7-5^0.5-sqrt(30-6*5^0.5)) <10e-15
pi - 16*atan(1/5)-4*atan(1/239) <10e-15
ans =

  logical

   1


ans =

  logical

   1


ans =

  logical

   1
% 1.9
r=60;a=35;n=4/3;
D = a*pi/180-r*pi/180+asin(n*sin(r*pi/180-asin(sin(a*pi/180)/n)));

D
D =

    0.4203
% 1.13
B=0.6;
K = 3/(1-B)^3*(0.5-2*B+B*(1.5-log(B)))
K =

   23.7420
% 1.17
n=6;
M = 1/sin(pi/n);
temp = (1+M^2)/(4*M);
a = acos(sqrt(temp^2+2)- temp);
a_g1 = (M*(1-M^2)*sin(a))/(1+M*2-2*M*cos(a))^2 
a_g1 =

   -1.3496
% 1.21
epsi = 0.8;
NL = (pi*epsi*sqrt(pi^2*(1-epsi^2)+16*epsi^2))/(1-epsi^2)^2
NL =

   72.0220
% 1.25
x = 0.45;
K = 1.2/x*(sqrt(16*x^2+1)+1/(4*x)*log(sqrt(16*x^2+1)+4*x))^(-2/3)
K =

    1.3394
% 1.29
syms w1 w2 CnW
n=5;epsi=0.1;
CnW1 = cos(n*acos(w1));
CnW2 = cosh(n*acosh(w2));
Tn = 1/sqrt(1+epsi^2*CnW^2);
Tn1 = subs(Tn,CnW,subs(CnW1,w1,0.5))
Tn2 = subs(Tn,CnW,subs(CnW1,w1,1))
Tn3 = subs(Tn,CnW,subs(CnW2,w2,1.5))
Tn1 =

(20*401^(1/2))/401


Tn2 =

(10*101^(1/2))/101


Tn3 =

1/(cosh(5*acosh(3/2))^2/100 + 1)^(1/2)
% 1.33a
syms a t
x = a*sin(t)
y = (a*(2+cos(t))*cos(t)^2)/(3+sin(t)^2)
xp = diff(x, t, 1);
xpp = diff(x, t, 2);
yp = diff(y, t, 1);
ypp = diff(y, t, 2);
n = xp*ypp-yp*xpp;
d = xp^2+yp^2;
n = simplify(n);    
d = simplify(d);
f = n/d^(3/2);
pretty(simplify(f))
x =

a*sin(t)


y =

(a*cos(t)^2*(cos(t) + 2))/(sin(t)^2 + 3)

                  2       2
                 a  cos(t)  (3 cos(t) - 2) 3
------------------------------------------------------------
              /               2         2             2 \3/2
            3 |  2       2   a  sin(2 t)  (cos(t) - 4)  |
(cos(t) - 2)  | a  cos(t)  + -------------------------- |
              |                                  4      |
              \                    4 (cos(t) - 2)       /

simplify the f manully: $$ f = \frac{6\sqrt{2}(cost-2)^3(3cost-2)sect}{a[73-80cost+9cos(2t)]^{3/2}} $$

% 1.33b
syms a t
x = 3*a*t/(1+t^3)
y = 3*a*t^2/(1+t^3)
xp = diff(x, t, 1);
xpp = diff(x, t, 2);
yp = diff(y, t, 1);
ypp = diff(y, t, 2);
n = xp*ypp-yp*xpp;
d = xp^2+yp^2;
n = simplify(n);
d = simplify(d);
f = n/d^(3/2);
pretty(simplify(f))
x =

(3*a*t)/(t^3 + 1)


y =

(3*a*t^2)/(t^3 + 1)

                              2
                           2 a
----------------------------------------------------------
            /  2   8      6      5      3      2      \3/2
    3     2 | a  (t  + 4 t  - 4 t  - 4 t  + 4 t  + 1) |
3 (t  + 1)  | --------------------------------------- |
            |                  3     4                |
            \                (t  + 1)                 /

simplify the f manully : $$ f = \frac{2(1+t^3)^4}{3(1+4t^2-4t^3-4t^5+4t^6+t^8)^{3/2}} $$

% 1.33c
syms a t 
x = a*(t-tanh(t));
y = a*sech(t);
xp = diff(x, t, 1);
xpp = diff(x, t, 2);
yp = diff(y, t, 1);
ypp = diff(y, t, 2);
n = xp*ypp-yp*xpp;
d = xp^2+yp^2;
f = simplify(n/d^(3/2));
f = subs(f, 1+sinh(t)^2, cosh(t)^2);
f = subs(f, cosh(t)^2-1, sinh(t)^2);
pretty(simplify(f))
         2        2
        a  sinh(t)
---------------------------
         /  2        2 \3/2
       3 | a  sinh(t)  |
cosh(t)  | ----------- |
         |          2  |
         \   cosh(t)   /

simplify the f manully: $$ f = csch(t) $$

% 1.37
syms s t
X1s = (0.1*s^3+0.0282*s^2-0.0427*s+0.0076)/(s^4+0.282*s^3+4.573*s^2+0.4792*s+2.889);
f = ilaplace(X1s,s,t);
f = vpa(f,5);
pretty(f)
exp(-0.043599 t) cos(0.87145 t) (- 0.019868 - 0.00098939i) + exp(-0.0436 t) cos(0.87145 t) (- 0.019868 + 0.00098939i)

   + exp(-0.043599 t) sin(0.87145 t) (- 0.00098939 + 0.019868i) + exp(-0.0436 t) sin(0.87145 t) (- 0.00098939 - 0.019868i)

   + exp(-0.097401 t) cos(1.9456 t) (0.069868 - 0.0034957i) + exp(-0.097401 t) cos(1.9456 t) (0.069868 + 0.0034957i)

   + exp(-0.097401 t) sin(1.9456 t) (0.0034957 + 0.069868i) + exp(-0.097401 t) sin(1.9456 t) (0.0034957 - 0.069868i)

文章作者: lovelyfrog
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 lovelyfrog !
  目录