习题3:
1.
>> syms x f
>>
f=limit((cos(sqrt(x)))^(pi/x),x,0,'right')
f =exp(-1/2*pi)
2.
>> syms x f
>>
f=limit((3*sin(x)+x^2*cos(1/x))/((1+cos(x))*log(1+x)),x,0)
f = 3/2
3.
>> syms x f
>>
f=limit((sqrt(4*x^2+x-1)+x+1)/sqrt(x^2+sin(x)),x,-inf)
f = 1
4.
>> syms x y f
>>
f=limit(limit((x^2+y^2)^(x^2*y^2),x,0),y,0)
f =1
5.
>> syms x y f
>>
y=(tan(sqrt(x+sqrt(x+sqrt(2*x)))))^2
y =tan((x+(x+2^(1/2)*x^(1/2))^(1/2))^(1/2))^2
>> f=diff(y)
f =
tan((x+(x+2^(1/2)*x^(1/2))^(1/2))^(1/2))*(1+tan((x+(x+2^(1/2)*x^(1/2))^(1/2))^(1/2))^2)/(x+(x+2^(1/2)*x^(1/2))^(1/2))^(1/2)*(1+1/2/(x+2^(1/2)*x^(1/2))^(1/2)*(1+1/2*2^(1/2)/x^(1/2)))
6.
>> syms x y f
>> y=(cos(x^2))*(sin(1/x))^2
y =cos(x^2)*sin(1/x)^2
>> f=diff(y)
f =
-2*sin(x^2)*x*sin(1/x)^2-2*cos(x^2)*sin(1/x)*cos(1/x)/x^2
7.
>> syms x f
>>
f=int(sqrt(sin(x)-(sin(x))^3),'x',0,pi)
f =4/3
8.
>> syms x f
>>
f=int(1/x*sqrt((x+1)/(x-1)))
f =
((1+x)/(x-1))^(1/2)*(x-1)/((1+x)*(x-1))^(1/2)*(-atan(1/(x^2-1)^(1/2))+log(x+(x^2-1)^(1/2)))
9.
> syms x y f
>>
f=dsolve('D2y+4*Dy+4*y=exp(-2*x)','x')
f =
1/2*x^2*exp(-2*x)+C1*exp(-2*x)+C2*exp(-2*x)*x
10.
>> syms x y f
>>
f=dsolve('x^2*Dy+x*y=y^2','y(1)=1','x')
f = 2*x/(1+x^2)
习题4:
1.
>> A=[1 2 4 0 5 10 11 21 3 1];
>> plot(A)
2.
(1)
t=[0:0.01:2*pi];
x=sin(t);
y=cos(t);
plot(x,y)
axis([-1.5 1.5 -1.5 1.5])
%限定x轴和y轴的显示范围
grid on
axis('equal')
(2)
t=0:0.1:2*pi;
x=sin(t);
y=cos(t);
z=x+y*i;
plot(z)
axis equal
3. 已知伏安曲线为U=IR, R分别为1欧姆,5欧姆,10欧姆,20欧姆。
(1)在一张图上画出I 在(0-2Π)范围内的U曲线,
(2)添加标题“伏安曲线U=IR”
(3)添加横纵座标的单位“安培”,“伏特”;
(4)添加标出每条线代表的方程。
I=0:pi/20:2*pi;
R1=1.0;
R2=5.0;
R3=10.0;
R4=20.0;
U1=I*R1;
U2=I*R2;
U3=I*R3;
U4=I*R4;
plot(I,U1,I,U2,I,U3,I,U4);
plot(I,U1,I,U2,I,U3,I,U4);
title('伏安曲线U=IR');
xlabel('安培');
ylabel('伏特');
legend('U=I','U=5I','U=10I','U=20I');
4. file---import data---4---A4
x=A4(:,1);
y=[A4(:,2) A4(:,3)];
bar(x,y)
5. A=[1 1 1 1 1 1 1
1 2 2 2 2 2 1
1 2 2 3 2 2 1
1 2 2 2 2 2 1
1 1 1 1 1 1 1];
>> plot(A)
>> bar(A)
6. x=-1:0.01:1;
y=-1:0.01:1;
[X,Y]=meshgrid(x,y);
Z=X.^2+Y.^2;
surf(X,Y,Z);
7. [X,Y,Z]=ELLIPSOID(0,0,0,2,3,4);
surf(X,Y,Z)
view([0 0 1])
view([0 1 0])
to try SPHERE and CYLINDER yourself