1 / 17

S kaitliskā integrēšana

S kaitliskā integrēšana. y. f(x ). a. b. x. Kreisu taisnstūru metode. = *. Labēju taisnstūru metode. Vidēju taisnstūru metode. = *. Trapeču metode. = *. Simpsona metode. = *. Kreisu taisnstūru metodes realizācija Delphi vidē. function pram_lev(x:vector):Real ; begin

reia
Download Presentation

S kaitliskā integrēšana

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Skaitliskā integrēšana

  2. y f(x) a b x

  3. Kreisu taisnstūru metode =*

  4. Labēju taisnstūru metode

  5. Vidēju taisnstūru metode =*

  6. Trapeču metode =*

  7. Simpsona metode =*

  8. Kreisu taisnstūru metodes realizācija Delphi vidē functionpram_lev(x:vector):Real; begin Result := 0; for i := 0 to n-1 do Result:= Result + (x[i+1]-x[i])*ffx(x[i]); end;

  9. Kreisu taisnstūru metodes realizācija Delphi vidē function pram_lev_1(a,b:Real;n:integer):Real; var rrr:Real; begin rrr := 0; h:= (b-a)/n; z := a - h; while z <= b - h do begin z := z + h; rrr := rrr + h*ffx(z); end; pram_lev_1 := rrr; end;

  10. Labēju taisnstūru metodes realizācija Delphi vidē functionpram_prav(x:vector):Real; begin Result := 0; fori := 1 to n do Result := Result + (x[i]-x[i-1])*ffx(x[i]); end;

  11. Vidēju taisnstūru metodes realizācija Delphi vidē functionpram_sred(x:vector):Real; begin Result := 0; fori := 0 to n-1 do Result := Result + (x[i+1]-x[i])*ffx((x[i+1]+x[i])/2); end;

  12. Trapeču metodes realizācija Delphi vidē functiontrapec (x:vector):Real; begin Result := 0; for i := 0 to n-1 do Result := Result + (x[i+1]-x[i])*(ffx(x[i+1])+ffx(x[i]))/2; end;

  13. Simpsona metodes realizācija Delphi vidē function simpson1(a,b:Real;n:integer):real; begin Result := 0; h:=(b-a)/n; for i := 1 to n-1 do begin if i mod 2 = 0 thenResult := Result + 2*ffx(x[i]) elseResult := Result + 4*ffx(x[i]) end; Result := h*(Result + ffx(a) + ffx(b))/3; end;

  14. Skaitliskā integrēšana Mathcad vidē

  15. Skaitliskā integrēšana Matlab vidē function y = fx(x) y = x.*x.*sin(x)/10; i1=quad(@fx,4,9) i1=quad(‘fx’,4,9) i1 = 7.6301

  16. Skaitliskā integrēšana Matlab vidē n = 500; i = 0:n; a = 4; b = 9; h = (b-a)/n; x = a+h*i; y = fx(x); z = trapz(x,y) z = 7.6300

  17. Skaitliskā integrēšana Matlab vidē x = 4:0.0001:9; y = x.*x.*sin(x)/10; z = trapz(x,y) z = 7.6300 x = 4:0.0001:9; y = fx(x); z = trapz(x,y)

More Related