+ All Categories
Home > Documents > Tema de Control 2

Tema de Control 2

Date post: 23-Dec-2015
Category:
Upload: neacsugeorgianaalina
View: 32 times
Download: 1 times
Share this document with a friend
Description:
tema
18
TEMA DE CONTROL Nume: Specializare: Anul: Grupa:
Transcript

TEMA DE CONTROL

Nume:

Specializare:

Anul:

Grupa:

Subgrupa:

K=20,05

1.Scrieti un program cu ajutorul caruia sa puteti calcula si afisa f(k), f(2k), f(3k), f(4k), f(5k), f(6k), f(7k), f(8k), f(9k), f(10k), pentru urmatoarea functie:

f ( x )={arctg ( x+1 )+( x−9 )7+ 5√ x−7+3x+2+sin (2 x+3 )−tg (2x−6 ) ,daca x<12arcctg ( x+1 )+ x9+5x+8+ 6√x+2−ln4 ( x+2 )−cos (5 x−4 ) , daca x≥12

Rezolvare:

Program

1.Varianta fara „if”

k=20.05x=k:k:10*kfx=atan(x+1)+x.^9+5.^(x+8)+(x+2).^(1/6)-log(x+2).^4-cos(5*x-4)

2.Varianta cu „if”

k=20.05a=12x=k:k:10*kn=length(x)for i=1:n if (x(i)<a) f(i)=atan(x(i)+1)+(x(i)-9)^7+3^(x(i)+2)+sin(2*x(i)+3)-tan(2*x(i)-6) else f(i)=acot(x(i)+1)+x(i)^9+5^(x(i)+8)+(x(i)+2)^(1/6)-log(x(i)+2)^4-cos(5*x(i)-4) endend

Rezultat

f(k)=4,0375

f(2k)=4,1731

f(3k)=4,3133

f(4k)=4,4581

f(5k)=4,6079

f(6k)=4,7627

f(7k)=4,9227

f(8k)=5,0880

f(9k)=5,2589

f(10k)=5,4356

2.Scrieti un program cu ajutorul caruia sa puteti calcula si afisa g(k), g(2k), g(3k), g(4k), g(5k), g(6k), g(7k), g(8k), g(9k), g(10k), pentru urmatoarea functie:

g ( x )={ (x+6)3−arctg ( x−8 )−62 x+2+ 3√x−11−sin (5 x−8 )+ tg (3 x−9 ) , daca x<12arcctg ( x+1 )+(x+1)9−5x+8+ log7

3 (5 x−8 )−cos (8 x+24 )−6√2x+5 , daca12≤x<15

7x +1+ 9√5 x+2−log82 ( x+2 )−sin (8x+2 )−arcctg (9 x−4 )+( x−2 )5 , daca x ≥15

Rezolvare:

Program

1.Varianta fara „if”

k=20.05x=k:k:10*kgx=7.^(x+1)+(5*x+2).^(1/9)-(log(x+2)/log(8)).^2-sin(8*x+2)-acot(9*x-4)+(x-2).^5

2.Varianta cu „if”

k=20.05a=12;b=15x=k:k:10*kn=length(x)for i=1:n if (x(i)<a) g(i)=(x(i)+6)^3-atan(x-8)-6^(2*x(i)+2)+(x(i)-11)^(1/3)-sin(5*x(i)-8)+tan(3*x(i)-9) elseif(x(i)>=a)&(x(i)<b) g(i)=acot(x(i)+1)+(x(i)+1)^9-5^(x(i)+8)+(log(5*x(i)-8)/log(7))^3-cos(8*x(i)+24)-(2*x(i)+5)^(1/6) else g(i)=7^(x(i)+1)+(5*x(i)+2)^(1/9)-(log(x(i)+2)/log(8))^2-sin(8*x(i)+2)-acot(9*x(i)-4)+(x(i)-2)^5 endend

Rezultat

g(k)=6,1562g(2k)=5,4141g(3k)=4,7615

g(4k)=4,1876g(5k)=3,6828g(6k)=3,2389g(7k)=2,8484g(8k)=2,5051g(9k)=2,2031g(10k)=1,9376

3.Sa se reprezinte grafic functia f(x) pe intervalul [-5,5] cu pasul 0,2

f(x){arctg ( x+1 )+(x−k )7+ 5√k−7+3x+2+sin (2 x+k )−tg (2x−6 ) , daca x<0

arctg ( x+k )+x9+5x+8+ 6√k+2−ln4 ( x+2 )−cos (5k−4 ) , daca x ≥1

Inserati in graficul functiei obtinute axele „x” , „y”, sagetile pentru axele respective, lgenda „f(x)” si titlul „GRAFICUL NR.1”

Rezolvare:

Program

k=20.05a=-5;b=5;p=0.2;c=1x=a:p:bn=length(x)for i=1:n if(x(i)<c) f(i)=atan(x(i)+1)+(x(i)-k)^7+(k-7)^(1/5)+3^(x(i)+2)+sin(2*x(i)+k)-tan(2*x(i)-6) else f(i)=acot(x(i)+k)+x(i)^9+5^(x(i)+8)+(k+2)^(1/6)-log(x(i)+2)^4-cos(5*k-4) endendplot(x,f)gridxlabel('x')ylabel('y')title('GRAFICUL NR.1')

Rezultat

4.Sa se reprezinte grafic functia g(x) pe intervalul [-9,9] cu pasul 0,3.

g ( x )={ (x+k )3−arctg ( x−k )−62x+2+ 3√ x−11−sin (5x−k )+tg (3x−9 ) , daca x<0arcctg ( x+k )+(x+1)9−5x +8+ log7

3 ( x+k )−cos (8 x+24 )− 6√2 x+k ,daca0≤x<5

7x+1+ 9√5 x+k−log82 ( x+k )−sin (8x+k )−arcctg (9 x−k )+( x−2 )5 , daca x ≥5

Inserati in graficul functiei obtinute axele „x”, „y”, sagetile pentru axele respective, legenda „g(x)” si titlul „GRAFICUL NR.2”

Rezolvare:

Program

1.Varianta fara „if”

k=20.05x1=-9:0.3:0x1=x1'g1=(x1+k).^3-atan(x1-k)-6.^(2*x1+2)+(x1-11).^(1/3)-sin(5*x1-k)+tan(3*x1-9)x2=0:0.3:5x2=x2'g2=acot(x2+k)+(x2+1).^9-5.^(x2+8)+(log(x2+k)/log(7)).^3-cos(8*x2+24)-(2*x2+k).^(1/6)x3=5:0.3:9x3=x3'g3=7.^(x3+1)+(5*x3+k).^(1/9)-(log(x3+k)/log(8)).^2-sin(8*x3+k)-acot(9*x3-k)+(x3-2).^5x=[x1;x2;x3]%coucaternare

G=[g1;g2;g3]plot(x,G)grid

2.Varianta cu „if”

k=20.05a=-9;b=9;p=0.3;c=0;d=5x=a:p:bn=length(x)for i=1:n if(x(i)<c) g(i)=(x(i)+k)^3-atan(x(i)-k)-6^(2*x(i)+2)+(x(i)-11)^(1/3)-sin(5*x(i)-k)+tan(3*x(i)-9) elseif(x(i)>=0)&(x(i)<5) g(i)=acot(x(i)+k)+(x(i)+1)^9-5^(x(i)+8)+(log(x(i)+k)/log(7))^3-cos(8*x(i)+24)-(2*x(i)+k)^(1/6) else g(i)=7^(x(i)+1)+(5*x(i)+k)^(1/9)-(log(x(i)+k)/log(8))^2-sin(8*x(i)+k)-acot(9*x(i)-k)+(x(i)-2)^5 endendplot(x,g)gridxlabel('ox')ylabel('oy')title('GRAFICUL NR.2')

Rezultat

5.Sa se reprezinte grafic functia P(n) pe intervalul [500,6000] cu pasul 20.

P(n)= -0.0000008n2 + 0.0108n + 8.1748 +k

Inserati in grafiucul functiei obtinute pe axa absciselor „n[rot./min.]”, pe axa ordonatelor P[kW], titlul „PUTEREA IN FUNCTIE DE TURATIE” si modificati culoarea curbei plane obtinute, din albastru in rosu.

Rezolvare

Program

k=20.05a=500;p=20;b=600n=a:p:bx=length(n)for i=1:x p(i)=(-0.0000008)*n(i)^2+0.0108*n(i)+8.1748+kendplot(n,p)gridxlabel('n[rot./min.]')ylabel('P[kW]')title('PUTEREA IN FUNCTIE DE TURATIE')

Rezultat

6.Sa se reprezinte grafic functia P(n) pe intervalul [500,6000] cu pasul 20.

P(n)= -0.0000008(n+k)2 + 0.0108(n-k) + 8.1748

Inserati in grafiucul functiei obtinute pe axa absciselor „n[rot./min.]”, pe axa ordonatelor P[kW], titlul „PUTEREA IN FUNCTIE DE TURATIE” si modificati culoarea curbei plane obtinute, din albastru in negru.

Rezolvare: Program

k=20.05a=500;p=20;b=600n=a:p:bx=length(n)for i=1:x p(i)=(-0.0000008)*(n(i)+k)^2+0.0108*(n(i)-k)+8.1748endplot(n,p)gridxlabel('n[rot./min.]')ylabel('P[kW]')title('PUTEREA IN FUNCTIE DE TURATIE')

Rezultat

7.Scrieti un program cu ajutorul caruia sa puteti calcula si afisa suma elementelor vectorului v = [arctg( k + 2 ) ( k - 3 )7 5√k−2 4k + 2 sin( 2k + 4) tg( 2k – 3)]

pana cand intalneste un numar mai mare ca 7k

Rezolvare

Program

1.Varianta cu „if”

k=20.05b=7^kv=[atan(k+2),(k-3)^7,(k-2)^(1/5),4^(k+2),sin(2*k+4),tan(2*k-3)]n=length(v)S=0for i=1:n if v(i)<=b S=S+v(i) else break endend

2.Varianta cu „while”

k=20.05b=7^kv=[atan(k+2),(k-3)^7,(k-2)^(1/5),4^(k+2),sin(2*k+4),tan(2*k-3)]n=length(v)while(v>b) s=sum(v)end

Rezultat

S= 1,8855

8. Scrieti un program cu ajutorul caruia sa puteti calcula si afisa suma elementelor vectorului

u= [ arcctg (k + 3) k3 5k+8 6√k+2 ln4 (k + 2) cos(5k – 4)]

pana cand intalneste un numar mai mare ca ln e8k

Rezolvare

Program

1.Varianta cu „if”

k=20.05e=2.7182b=log(e^(8^k))v=[acot(k+3),k^3,5^(k+8),(k+2)^(1/6),log(k+2)^4,cos(5*k-4)]n=length(v)S=0for i=1:n if v(i)<=b S=S+v(i) else break endend

2.Varianta cu „while”

k=20.05e=2.7182b=log(e^(8^k))v=[acot(k+3),k^3,5^(k+8),(k+2)^(1/6),log(k+2)^4,cos(5*k-4)]n=length(v)while(v>b) s=sum(v)end

Rezultat

S= 4.0375

9.Scrieti un program cu ajutorul caruia sa puteti genera si afisa o matrice cu sase linii si cinci coloane, ale carei elemente sunt:

B={ (k+2)3−acrtg (k−6 )−62k +1+ 3√k−3−sin (5k−4 )+tg (3k−9 ) , daca| j−i|=2arctg ( k+7 )+(k−1)9−5k+3 log6

4 (5k−2 )−cos (8k+11 )−6√2k+10 , daca i= j+1

7k+2+ 9√5k+3−log73 (k+1 )−sin (8k+1 )−arcctg (9k−2 )+(k−2 )3∈rest

Rezolvare:

Program

k=20.05n=6 %liniim=5 %coloanefor i=1:n for j=1:m if abs(i-j)==2 B(i,j)=(k+2)^3-atan(k-6)-6^(2*k+1)+(k-3)^(1/3)-sin(5*k-4)+tan(3*k-9)

elseif i==j+1 B(i,j)=acot(k+7)+(k-1)^9-5^(k+3)+(log(5*k-2)/log(6))^4-cos(8*k+11)-(2*k+10)^(1/6) else B(i,j)=7^(k+2)+(5*k+3)^(1/9)-(log(k+1)/log(7))^3-sin(8*k+1)-acot(9*k-2)+(k-2)^3 end endend

Rezultat

4,3094 4,3094 -9,5944 4,3094 4,3094

-1,2920 4,3094 4,3094 -9,5944 4,3094

-9,5944 -1,2920 4,3094 4,3094 -9,5944

4,3094 -9,5944 4,3094 4,3094 4,3094

4,3094 4,3094 -1,2920 -1,2920 4,3094

4,3094 4,3094 -9,5944 -9,5944 -1,2920

10. Scrieti un program cu ajutorul caruia sa puteti genera si afisa o matrice cu sase linii si cinci coloane, ale carei elemente sunt:

{7k +2arcctg (k+7 )+ 4√5k+3−log7

3 (3k+1 )−sin (8k+1 )−arcctg (9k−2 )+(k+2 )2 , daca| j−i|=2

(k+1)2−5k+3+ log62 (2k+1 )−cos (8k+11)+arcctg (k+7 )−4√2k+10 , daca i= j+1

(k+2)2−arctg ( k−6 )−6k+1+ 4√k+3−sin (5k−4 )+ log62 ( 4k+1 )+tg (3k−9 ) ,∈rest

Rezolvare:

Program

k=20.05n=6 %liniim=6 %coloanefor i=1:n for j=1:m if abs(i-j)==2 B(i,j)=7^(k+2)+acot(k+7)+(5*k+3)^(1/4)-(log(3*k+1)/log(7))^3-sin(8*k+1)-acot(9*k-2)+(k+2)^2 elseif i==j+1 B(i,j)=(k+1)^2-5^(k+3)+(log(2*k+1)/log(6))^2-cos(8*k+11)+acot(k+7)-(2*k+10)^(1/4) else B(i,j)=(k+2)^2-atan(k-6)-6^(k+1)+(k+3)^(1/4)-sin(5*k-4)+(log(4*k+1)/log(6))^2+tan(3*k-9) end endend

Rezultat

-2.3992 -2.3992 4.3093 -2.3992 -2.3992 -2.3992

-1.2919 -2.3992 -2.3992 4.3093 -2.3992 -2.3992

4.3093 -1.2919 -2.3992 -2.3992 4.3093 -2.3992

-2.3992 4.3093 -1.2919 -2.3992 -2.3992 4.3093

-2.3992 -2.3992 4.3093 -1.2919 -2.3992 -2.3992

-2.3992 -2.3992 -2.3992 4.3093 -1.2919 -2.3992

11.Determinati si apoi notati valoarea determinantului matricei B:

RezolvareProgramk=20.05n=6 %liniim=6 %coloanefor i=1:n for j=1:m if abs(i-j)==2 B(i,j)=7^(k+2)+acot(k+7)+(5*k+3)^(1/4)-(log(3*k+1)/log(7))^3-sin(8*k+1)-acot(9*k-2)+(k+2)^2 elseif i==j+1 B(i,j)=(k+1)^2-5^(k+3)+(log(2*k+1)/log(6))^2-cos(8*k+11)+acot(k+7)-(2*k+10)^(1/4) else B(i,j)=(k+2)^2-atan(k-6)-6^(k+1)+(k+3)^(1/4)-sin(5*k-4)+(log(4*k+1)/log(6))^2+tan(3*k-9) end endendd=det(B)%calculul determinantului

Rezultatdet(B)= -9.4421e+101

12.Determinati inversa matricei B si notati rezultatul:

RezolvareProgramk=20.05n=6 %liniim=6 %coloanefor i=1:n for j=1:m if abs(i-j)==2

B(i,j)=7^(k+2)+acot(k+7)+(5*k+3)^(1/4)-(log(3*k+1)/log(7))^3-sin(8*k+1)-acot(9*k-2)+(k+2)^2 elseif i==j+1 B(i,j)=(k+1)^2-5^(k+3)+(log(2*k+1)/log(6))^2-cos(8*k+11)+acot(k+7)-(2*k+10)^(1/4) else B(i,j)=(k+2)^2-atan(k-6)-6^(k+1)+(k+3)^(1/4)-sin(5*k-4)+(log(4*k+1)/log(6))^2+tan(3*k-9) end endend%calculul inverseiC=inv(B) Rezultat

-1.0391 3.1803 -1.2325 -1.4950 1.0391 -5.85058.0874 1.0391 9.0309 1.16862 -8.0873 1.0391-1.1663 -1.4950 9.6296 -3.8202 1.1686 -1.4950-9.0309 -4.8148 0 0 9.0309 0-1.0391 -5.8505 0 -1.4950 1.0391 3.180-8.0875 -1.0391 -9.0309 -1.1663 8.0874 -1.0391

13.Determinati rangul matricei B si apoi notati rezultatul

RezolvareProgramk=20.05n=6 %liniim=6 %coloanefor i=1:n for j=1:m if abs(i-j)==2 B(i,j)=7^(k+2)+acot(k+7)+(5*k+3)^(1/4)-(log(3*k+1)/log(7))^3-sin(8*k+1)-acot(9*k-2)+(k+2)^2 elseif i==j+1 B(i,j)=(k+1)^2-5^(k+3)+(log(2*k+1)/log(6))^2-cos(8*k+11)+acot(k+7)-(2*k+10)^(1/4) else B(i,j)=(k+2)^2-atan(k-6)-6^(k+1)+(k+3)^(1/4)-sin(5*k-4)+(log(4*k+1)/log(6))^2+tan(3*k-9) end endend%calculul rangr=rank(B)

Rezultatrang(B)=6

14.Determinati cel mai mare element al matricei B

RezolvareProgramk=20.05n=6 %liniim=6 %coloanefor i=1:n for j=1:m if abs(i-j)==2 B(i,j)=7^(k+2)+acot(k+7)+(5*k+3)^(1/4)-(log(3*k+1)/log(7))^3-sin(8*k+1)-acot(9*k-2)+(k+2)^2 elseif i==j+1 B(i,j)=(k+1)^2-5^(k+3)+(log(2*k+1)/log(6))^2-cos(8*k+11)+acot(k+7)-(2*k+10)^(1/4) else B(i,j)=(k+2)^2-atan(k-6)-6^(k+1)+(k+3)^(1/4)-sin(5*k-4)+(log(4*k+1)/log(6))^2+tan(3*k-9) end endendM=max(max(B)) %max(B)=vec

Rezultatxmax=4.3094e+018

15.Determinati cel mai mic element al matricei B

RezolvareProgramk=20.05n=6 %liniim=6 %coloanefor i=1:n for j=1:m if abs(i-j)==2 B(i,j)=7^(k+2)+acot(k+7)+(5*k+3)^(1/4)-(log(3*k+1)/log(7))^3-sin(8*k+1)-acot(9*k-2)+(k+2)^2 elseif i==j+1 B(i,j)=(k+1)^2-5^(k+3)+(log(2*k+1)/log(6))^2-cos(8*k+11)+acot(k+7)-(2*k+10)^(1/4) else B(i,j)=(k+2)^2-atan(k-6)-6^(k+1)+(k+3)^(1/4)-sin(5*k-4)+(log(4*k+1)/log(6))^2+tan(3*k-9) end endendm=min(min(B))

Rezultatxmin= -2.3993e+016

16.Rezolvati sistmul de ecuatii B*X=C, undeX=[x1 x2 x3 x4 x5 x6]t

C=[arctg(k-2) 6k+1 4√k+5 sin(2k+4) log 62(2x-1) tg(2k-4)]t


Recommended