0% found this document useful (0 votes)
28 views

Varianta - 13 Rusu Cristina: Lucrare de Laborator nr.1

1) The document is a lab report in Romanian that localizes and finds the roots of two equations: x3 + 10x - 9 = 0 and ln(x) - sin(2x) = 0. It plots the equations, uses a root-finding algorithm to find the roots, and displays the results. 2) It presents a local program that uses the bisection method to localize roots within intervals. It prompts the user for input and displays the intervals containing roots. 3) A second local program improves on the first by additionally precisely calculating the roots within the localized intervals using bisection until a precision of 10^-4 is reached. It displays the root number and value for each root localized

Uploaded by

Rita Lefter
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Varianta - 13 Rusu Cristina: Lucrare de Laborator nr.1

1) The document is a lab report in Romanian that localizes and finds the roots of two equations: x3 + 10x - 9 = 0 and ln(x) - sin(2x) = 0. It plots the equations, uses a root-finding algorithm to find the roots, and displays the results. 2) It presents a local program that uses the bisection method to localize roots within intervals. It prompts the user for input and displays the intervals containing roots. 3) A second local program improves on the first by additionally precisely calculating the roots within the localized intervals using bisection until a precision of 10^-4 is reached. It displays the root number and value for each root localized

Uploaded by

Rita Lefter
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

Varianta -13

Rusu Cristina
Lucrare de laborator nr.1
Tema : Localizarea radacinilor si metoda injumatatirii
Subiectul 1. Localizarea rdacinilor
a) x3 + 10x - 9 = 0 ;
b) ln x sin 2x = 0 .

Rezolvare :
a) x3 + 10x - 9 = 0 ;
> plot(x^3+10*x-9,x=-4..4,y=-40..40);

plot([x^3,9-10*x],x=-4..4,y=-10..10);

> f:=x^3+10*x-9;
>
> fsolve(f,x);

f := x 3 +10 x 9
.8406020638

>

b) ln x sin 2x = 0 .
> plot(ln(x)-sin(2*x),x=1..10);

plot([ln(x),sin(2*x)],x=1..4);

> f:=ln(x)-sin(2*x);
> fsolve(f,x);

f := ln( x ) sin( 2 x )

1.399428866

Subiectul 2;
Program local;
uses crt;
var a,c,b,h,x1,x2:real;
function fnl(x:real):real;
begin
fnl:=x*x*x+x-3;
end;
begin
clrscr;
writeln('introdu extremit segm a si b, pasul h');
jreadln(a,b,h);
x1:=a;x2:=x1+h;
while x2<=b do begin
if fnl(x1)*fnl(x2)<0 then writeln('[',x1:12:4,';',x2:12:4,']');
x1:=x2;
x2:=x1+h;
end;
readkey;
end.

introdu extremit segm a si b, pasul h


-2
2
0.1
[
1.2000;
1.3000]

Subiectul 3;
Program Localizarea si Precizarea radacinilor .
program Localizare_Precizare;
uses crt;
const e=1E-4;
var x1,x2,y1,y2,x,a,b,h:real;
r:integer;
Function fnl(x:real):real;
begin
fnl:=x*x*x+x-3;
end;
procedure precizare(x1,x2:real);
var c,r1:real;
begin
while abs(x2-x1)>e do begin
c:=(x1+x2)/2;
if fnl(x1)*fnl(c)<0 then x2:=c else x1:=c; end;
r1:=(x2+x1)/2;
writeln('radacina=',r1:6:6);end;
begin
clrscr;
writeln('Localizarea si precizarea radacinilor');
write('introdu datele a,b,h: ');
readln(a,b,h);
x1:=a;
x2:=x1+h;
while x2<=b do begin
if fnl(x1)*fnl(x2)<0 then begin
r:=r+1;
writeln(r,' radacina a ecuatiei apartine segmentului:','[',x1:6:3,';',x2:6:3,']');
precizare(x1,x2);end;
x1:=x2;
x2:=x1+h;
end;
readkey;
end.

You might also like