.


:




:

































 

 

 

 


. Delphi;

.

 

 

2016.

:

:

Delphi;

;

VCL.

 

:

(1)

f(x) a < x< b.

, (1) , f(x) (, , . .) , .

x*, f(x) , . . ,

(1), x* (1).

(1) . , , , , , . (1), .

 

 

:

1) , . . , ;

2) .

, (1), , f(x) , f(x)=0 .

, , , , .

, : , .

, , (1).

.

 

(1) :

(2)

. , (1) , ( ). (1) , . . (1)

.

- ,

. (3)

(3) .

, x = x* (2), ,

(4)

, . . , , *. ,

(5)

- *.

(5)

(6)

*.

(1) (2) , 1. q, .

(1) (2) , (4).

(7)

, - , - .

, .

(1)

,

.

(7), , .

 

, , .

. . Ox, . .

. , , :

, Ox:

:

.. (11)

(12)

- ; - .

- .

, , , (12) ,

(13)

, (12) :

,

. (14)

.

, , (14).

, , . . .

 

, .

, , , . , , , .

(1), , , . . . , . , , . . .

, , , .

 

:

;

;

.

. , .

1

:

, : [2; 3].

: 2,2985.

1.

, , 1.

.

.

1.

 

1-

    Button1 ,
      Edit1 Edit2 Edit3 Edit4 Edit5 Edit6 , . . - Text
Label1 , . , . Caption.
Label2
Label3
Label4
Label5
X0 Label6

 

1-

  ,   GroupBox1 .
RadioButton1 , . ,
RadioButton2
RadioButton3
    RadioGroup1 , .

 

:

1) , . . , . VCL.

2) : , Delphi.

 

()

unit Unit1;

 

interface

 

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, ExtCtrls;

 

type

TForm1 = class(TForm)

RadioGroup1: TRadioGroup;

RadioButton1: TRadioButton;

RadioButton2: TRadioButton;

RadioButton3: TRadioButton;

GroupBox1: TGroupBox;

Edit1: TEdit;

Edit2: TEdit;

Label1: TLabel;

Label2: TLabel;

Edit3: TEdit;

Label3: TLabel;

Button1: TButton;

Edit4: TEdit;

Edit5: TEdit;

Label4: TLabel;

Label5: TLabel;

Edit6: TEdit;

Label6: TLabel;

procedure Button1Click(Sender: TObject);

 

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

Form1: TForm1;

 

implementation

 

 

{$R *.dfm}

procedure uravnenie;

var x,x0,a,b,e,z,g,d: real;

n: integer;

 

function f(x:real):real;

begin

f:=3*sin(sqrt(x))+0.35*x-3.8;

end;

function y(x:real):real;

begin

y:=(3.8-3*sin(sqrt(x)))/0.35;

end;

function y1(x:real):real;

begin

y1:=(3*cos(sqrt(x)))/(0.35*2*sqrt(x));

end;

function f1(x:real):real;

begin

f1:=(3*cos(sqrt(x))/2*sqrt(x))+3.5;

end;

function f2(x:real):real;

begin

f2:=(-3*sin(sqrt(x))-(3*cos(sqrt(x))/sqrt(x)))/4*x;

end;

begin

a:=strtofloat(form1.edit1.text);

b:=strtofloat(form1.Edit2.Text);

e:=strtofloat(form1.edit3.Text);

x0:=strtofloat(form1.Edit6.Text);

if form1.RadioButton1.Checked then

begin

n:=0;

x:=x0;

if y1(x0)<1 then

begin

repeat

z:=y(x);

g:=abs(z-x);

x:=z;

n:=n+1;

until g<e;

form1.Edit4.Text:=floattostr(x);

form1.Edit5.Text:=inttostr(n);

end

else MessageDLG(' . X0',mtError,[mbOK],0);

end;

if form1.radiobutton2.Checked then

begin

n:=0;

x:=x0;

if f(x0)*f2(x0)>0 then

begin

repeat

z:=x-(f(x)/f1(x));

g:=abs(z-x);

x:=z;

n:=n+1;

until g<e;

form1.Edit4.Text:=floattostr(x);

form1.Edit5.Text:=inttostr(n);

end

else MessageDLG(' . X0',mtError,[mbOK],0);

end;

if form1.RadioButton3.Checked then

begin

x0:=a; n:=0;

form1.Edit6.Text:=floattostr(x0);

z:=f(a);

repeat

x:=(a+b)/2;

d:=f(x); inc(n);

if d=0 then

exit

else

if z*d<0 then b:=x

else

begin a:=x; z:=d;

end;

until b-a<=e;

form1.Edit4.Text:=floattostr(x);

form1.Edit5.Text:=inttostr(n);

end;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

uravnenie;

end;

 

end.

 

()

 

 

 

 

 

 

-

 

 

 



<== | ==>
10 | 1. , .
:


: 2016-11-24; !; : 545 |


:

:

, , .
==> ...

1902 - | 1550 -


© 2015-2024 lektsii.org - -

: 0.121 .