anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9....

15
parciális deriválás f x^2 y^2; f Sinx Cosy; g Df, x; h Df, y; ShowGraphicsArray Plot3Df, x, 4, 4, y, 4, 4, AxesLabel StringForm"f ``", f, None, None, DisplayFunction Identity, Plot3Dg, x, 4, 4, y, 4, 4, AxesLabel StringForm" f x ``", g, None, None, DisplayFunction Identity, Plot3Dh, x, 4, 4, y, 4, 4, AxesLabel StringForm" f y ``", h, None, None, DisplayFunction Identity, DisplayFunction $DisplayFunction -4 -2 0 2 4 f Cosy Sinx -4 -2 0 2 4 -1 -0.5 0 0.5 1 -4 -2 0 2 4 f Cosy Sinx -4 -2 0 2 4 f x Cosx Cosy -4 -2 0 2 4 -1 -0.5 0 0.5 1 -4 -2 0 2 4 f x Cosx Cosy f y f y GraphicsArray In[1]:= Érintősík ClearAllf; ClearAllx; ClearAlly; ClearAllx0; ClearAlly0; ClearAllDx; ClearAllDy; ClearAllD; ClearAllnv; ClearAlldx; fx_, y_ 3x^2 2xy 4y^2 6x 2y 4; x0 0; y0 2; Dx Dfx, y,x. x x0, y y0 Dy Dfx, y,y. x x0, y y0 nv 2 Dx, Dy, 1 Out[6]= 10 Out[7]= 18 Out[8]= 20, 36, 2 anal2_03_szelsoertek_demo.nb 1

Upload: others

Post on 16-Dec-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

parciális deriválás

f x^2 y^2;f SinxCosy;g Df, x;h Df, y;ShowGraphicsArrayPlot3Df, x, 4, 4, y, 4, 4, AxesLabel StringForm"f ``", f, None, None,DisplayFunction Identity, Plot3Dg, x, 4, 4, y, 4, 4,AxesLabel StringForm" f

x ``", g, None, None,

DisplayFunction Identity, Plot3Dh, x, 4, 4, y, 4, 4,AxesLabel StringForm" f

y ``", h, None, None,

DisplayFunction Identity, DisplayFunction $DisplayFunction

-4-2

0

2

4

f Cosy Sinx-4

-2

0

2

4

-1-0.5

00.5

1

-4-2

0

2

4

f Cosy Sinx

-4-2

02

4

fx

Cosx Cosy-4

-2

0

2

4

-1-0.5

00.5

1

-4-2

02

4

fx

Cosx Cosy fyfy

GraphicsArray

In[1]:= Érintősík

ClearAllf; ClearAllx; ClearAlly; ClearAllx0;ClearAlly0; ClearAllDx; ClearAllDy; ClearAllD;ClearAllnv; ClearAlldx;

fx_, y_ 3x^2 2x y 4y^2 6x 2y 4;x0 0;y0 2;Dx Dfx, y, x . x x0, y y0Dy Dfx, y, y . x x0, y y0nv 2Dx, Dy, 1

Out[6]= 10

Out[7]= 18

Out[8]= 20, 36, 2

anal2_03_szelsoertek_demo.nb 1

Page 2: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

In[9]:= ErintoSikx0_, y0_ z fx0, y0 Dxx x0 Dyy y0;az x0,y0 pontbeli érintősík egyenlete

dx 5;Plot3Dfx, y, x, x0 dx, x0 dx, y, y0 dx, y0 dx

-4-2

02

4-2

0

2

4

6

-200

-100

0

100

-4-2

02

4

Out[10]= SurfaceGraphics

In[11]:= Plot3DErintoSikx0, y01, 2,x, x0 dx2, x0 dx 2, y, y0 dx2, y0 dx2, Mesh FalseAdott x0 és y0 mellett ezt rakjuk majd a Plot3Dbe,és akkor ábrázolja az érintősíkot.

-2-1

0

1

20

1

2

3

4

-50

0

50

-2-1

0

1

2

Out[11]= SurfaceGraphics

anal2_03_szelsoertek_demo.nb 2

Page 3: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

Parc. deriv, érintősík felület implicit képlettel G 16 x2 9 y2 36 z2 144;x0 3;y0 4;

fx_, y_ z . SolveG, z2Dx x fx, yDy y fx, yDx x fx, y . x x0, y y0;Dy y fx, y . x x0, y y0;nv Dx, Dy, 1 normálvektor ErintoSikx_, y_ fx0, y0 Dxx x0 Dyy y0 érintősík egyenlete

dx 10; rajzolási tartományhoz dd 3; normálvektor hossza

ShowPlot3Dfx, y, x, x0 dx, x0 dx,y, y0 dx, y0 dx, DisplayFunction Identity, PlotPoints 50,Plot3DErintoSikx, y, x, x0 dx2, x0 dx2, y, y0 dx2, y0 dx2,DisplayFunction Identity, Mesh False, Graphics3DThickness0.01, Hue0,Linex0, y0, fx0, y0, x0 dd nv1, y0 dd nv2, fx0, y0 dd nv3,

DisplayFunction $DisplayFunction

16144 16 x2 9 y2

8 x

3 144 16 x2 9 y2

3 y2 144 16 x2 9 y2

23

, 12

, 1

2 233 x 1

24 y

Graphics3D::nlist3 : 10.9592, 14., 0. 0.615975 is not a list of three numbers.

Graphics3D::nlist3 : 10.9592, 13.5918, 0. 1.78743 is not a list of three numbers.

Graphics3D::nlist3 : 11.3673, 13.5918, 0. 2.69167 is not a list of three numbers.

General::stop : Further output of Graphics3D::nlist3 will be suppressed during this calculation.

anal2_03_szelsoertek_demo.nb 3

Page 4: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

-5

0

5

10

-10

-5

0

5

-2.5

0

2.5

5

7.5

-5

0

5

10

Graphics3D

anal2_03_szelsoertek_demo.nb 4

Page 5: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

Iránymenti derivált ClearAllf; ClearAllx; ClearAlly; ClearAllx0; ClearAlly0;ClearAllDx; ClearAllDy; ClearAllD; ClearAlldx;fx_, y_ x3 y2;x0 1;y0 1;Dx x fx, yDy y fx, yD Dx Cos Dy Sin

dx 2;FuggolegesSik Graphics3DPolygon#11, #2 . x #11, #31, #11, #2 . x #11, #32,

#12, #2 . x #12, #32, #12, #2 . x #12, #31 &; ez rajzol egy téglalapot egy megadott egyenesfölé. Használat: FuggolegesSikx1,x2,3x6,z1,z2

PlotD . x x0, y y0, , 0, 2p1 Plot3Dfx, y, x, x0 dx, x0 dx, y, y0 dx, y0 dx, PlotPoints 60b Plot3D1, x, x0 dx, x0 dx,y, y0 dx, y0 dx, PlotPoints 60, Boxed False, Axes False

Showp1, b, Graphics3DPointSize0.02, Hue0, Pointx0, y0, fx0, y0;

ps1 FuggolegesSikx0 dx, x0 dx,y . Solvey y0 DyDx . x x0, y y0 x x0, y1, 1, 5;

Dx,Dy irányvektorú egyenes fölé rajzolt sík. Mint tudjuk,a gradiens irányában a legnagyobb az iránymenti derivált.Showp1, ps1, b, Graphics3DPointSize0.02, Hue0, Pointx0, y0, fx0, y0;ps2 FuggolegesSikx0 dx, x0 dx,

y . Solvey y0 Dx Dy . x x0, y y0 x x0, y1, 1, 2;1,DxDy irányvektorú egyenes fölé rajzoltsík. Lásd: implicit függvény tétel.

Showp1, ps2, b, Graphics3DPointSize0.02, Hue0, Pointx0, y0, fx0, y0;

Házi feladat: Legyen fx,y3x^22x y4y^26x2y4,a ZHban szereplő függvény. Írd fel az x0,y02,1 pontban alegnagyobb iránymenti deriváltat Rajzoltasd ki az ebbe az irányba álló,

2,1,f2,1 pontra illeszkedő függőleges síkot a függvényáltal meghatározott felülettel együtt egy közös ábrában.

3 x2 y2

2 x3 y

3 x2 y2 Cos 2 x3 y Sin

anal2_03_szelsoertek_demo.nb 5

Page 6: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

1 2 3 4 5 6

-3

-2

-1

1

2

3

Graphics

-1

0

1

2

3 -1

0

1

2

3

0

20

40

-1

0

1

2

3

SurfaceGraphics

SurfaceGraphics

anal2_03_szelsoertek_demo.nb 6

Page 7: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

-1

0

1

2

3-1

0

1

2

3

-2.50

2.5

5

-1

0

1

2

3

-1

0

1

2

3-1

0

1

2

3

-2.50

2.5

5

-1

0

1

2

3

-1

0

1

2

3-2

0

2

4

-2.50

2.5

5

-1

0

1

2

3

anal2_03_szelsoertek_demo.nb 7

Page 8: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

Feltételes és lokális szélsőérték

fx_, y_ Cosx2 Cosy2; függvény gx_ x

4; feltétel

pr 3.5; plotrange loksze Solvex fx, y 0, y fx, y 0, x, y; stacionárius pontok loksze Transposex . loksze, y . loksze, fx . loksze, y . loksze és hozzá a z koordináták

ClearAllFuggolegesSik; FuggolegesSik Graphics3DPolygon#11, #2 . x #11, #31, #11, #2 . x #11, #32,

#12, #2 . x #12, #32, #12, #2 . x #12, #31 &;

p1 Plot3Dfx, y, x, pr, pr, y, gpr, gpr, PlotPoints 50p1 Plot3Dfx, y, x, pr, pr,

y, gpr, gpr, DisplayFunction Identity, PlotPoints 50;p2 FuggolegesSikpr, pr, gx, 0, 2;p3 Graphics3DPointSize0.03, Hue0, Point loksze;Showp1, p2, p3, DisplayFunction $DisplayFunction,PlotRange Automatic, Automatic, Automatic

p1 ContourPlotfx, y, x, pr, pr, y, gpr, gpr,ContourShading True, Contours 20, DisplayFunction Identity;

p2 Plotgx, x, pr, pr, PlotStyle Hue0, DisplayFunction IdentityShowp1, p2, DisplayFunction $DisplayFunction;Solve::ifun : Inverse functions are being used by Solve, so some solutions may not be found.

0, 0, 2, 2

, 0, 1, 2

, 0, 1, 0, 2

, 1, 2

, 2

, 0, 0,2

, 1, 2

,2

, 0

-2

0

2 -4

-2

0

2

00.5

1

1.5

2

-2

0

2

SurfaceGraphics

anal2_03_szelsoertek_demo.nb 8

Page 9: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

-2

0

2 -4

-2

0

2

00.5

1

1.5

2

-2

0

2

Graphics3D

Graphics

-3 -2 -1 0 1 2 3

-4

-3

-2

-1

0

1

2

anal2_03_szelsoertek_demo.nb 9

Page 10: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

ClearAllf; ClearAllF; ClearAllg; ClearAllG; ClearAllx;ClearAlly; ClearAllx0; ClearAlly0; ClearAllDx; ClearAllDy;ClearAllD; ClearAllnv; ClearAlldx; ClearAllpr;

fx_, y_ x^2 1^2 x^2 y x 1^2;

p1 Plot3Dfx, y, x, 2, 3, y, 2, 3loksze SolveDfx, y, x 0, Dfx, y, y 0, x, y;loksze Transposex . loksze, y . loksze, fx . loksze, y . lokszep2 Graphics3DPointSize0.03, Hue0, Point loksze;Showp1, p2, DisplayFunction $DisplayFunction,

AspectRatio Automatic, PlotRange Automatic, Automatic, Automatic;TableShowp1,p2,ViewPoint0.1,k,1,k,10,0,1;

-2-1

01

2

3 -2

-1

0

1

2

3

-150

-100

-50

0

-2-1

01

2

3

SurfaceGraphics

1, 0, 0, 1, 2, 0

-2

0

2-2

0

2-100

-50

0

-2

0

2

anal2_03_szelsoertek_demo.nb 10

Page 11: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

ClearAllf; ClearAllF; ClearAllg; ClearAllG; ClearAllx;ClearAlly; ClearAllx0; ClearAlly0; ClearAllDx; ClearAllDy;ClearAllD; ClearAllnv; ClearAlldx; ClearAllpr;

fx_, y_ 3 x Expy x^3 Exp3 y;

loksze SolveDfx, y, x 0, Dfx, y, y 0, x, y;

loksze loksze2;loksze x . loksze, y . loksze, fx . loksze, y . loksze;

p1 Plot3Dfx, y, x, 2, 2, y, 2, 2, DisplayFunction Identity;p2 Graphics3DPointSize0.03, Hue0, Pointloksze;Showp1, p2, DisplayFunction $DisplayFunction,

ViewPoint 1, 1, 1, PlotRange Automatic, Automatic, Automatic;Solve::ifun : Inverse functions are being used by Solve, so some solutions may not be found.

-2

-1

0

1

2

-2

-1

0

1

2

-100

-50

0

-2

-1

0

1

2

anal2_03_szelsoertek_demo.nb 11

Page 12: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

ClearAllf; ClearAllF; ClearAllg; ClearAllG; ClearAllx;ClearAlly; ClearAllx0; ClearAlly0; ClearAllDx; ClearAllDy;ClearAllD; ClearAllnv; ClearAlldx; ClearAllpr;

Graphics`ImplicitPlot`pr 1.5;Fx_, y_ x^2 y;Ennek a szélsőértékeit keressükGx_, y_ x2 y2 1;a G0 feltétel mellett, azaz az egységkörön.DFx_, y_ DFx, y, x, DFx, y, yDGx_, y_ DGx, y, x, DGx, y, y

p1 Plot3DFx, y, x, pr, pr, y, pr, pr, DisplayFunction Identity;p2 Plot3DGx, y, x, pr, pr, y, pr, pr, DisplayFunction Identity;p Plot3D0, x, pr, pr, y, pr, pr, Mesh False, DisplayFunction Identity;Showp1, p, DisplayFunction $DisplayFunctionShowp2, p, DisplayFunction $DisplayFunctionShowp1, p2, p, DisplayFunction $DisplayFunctiongx_ y . SolveGx, y 0, y2ft_ Cost, Sint;Kihasználom, hogy az egységkör a feltétel, és paraméterezem.

A lehetséges szélsőértékhelyek:feltloksze SolveDFx, y m Gx, y, x 0,

DFx, y m Gx, y, y 0, DFx, y m Gx, y, m 0, x, y, m2 x, 12 x, 2 y

-1

0

1

-1

0

10

2

-1

0

1

Graphics3D

anal2_03_szelsoertek_demo.nb 12

Page 13: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

-1

0

1

-1

0

1

-1

0

1

2

-1

0

1

Graphics3D

-1

0

1

-1

0

10

2

-1

0

1

Graphics3D

1 x2

m 12

, x 0, y 1, m 12

, x 0, y 1,

m 1, x 3

2, y

12, m 1, x

3

2, y

12

anal2_03_szelsoertek_demo.nb 13

Page 14: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

Ábrázolom a kört és néhány Fkonstans görbét.p3 ImplicitPlotGx, y 0, x, pr, pr,

y, pr, pr, AxesOrigin 0, 0, DisplayFunction Identity;p4 ImplicitPlotFx, y 1.5, x, pr, pr, y, pr, pr,

AxesOrigin 0, 0, DisplayFunction Identity;p5 ImplicitPlotFx, y 1, x, pr, pr, y, pr, pr,

AxesOrigin 0, 0, DisplayFunction Identity;p6 ImplicitPlotFx, y 0.5, x, pr, pr, y, pr, pr,

AxesOrigin 0, 0, DisplayFunction Identity;p7 ImplicitPlotFx, y 0.5, x, pr, pr, y, pr, pr,

AxesOrigin 0, 0, DisplayFunction Identity;p8 ImplicitPlotFx, y 1, x, pr, pr, y, pr, pr,

AxesOrigin 0, 0, DisplayFunction Identity;Showp3, p4, p5, p6, p7, p8, DisplayFunction $DisplayFunction;Ebből leolvasható, hogy F feltételes minimuma 1,míg a feltételes maximum nagyobb egynél, de kisebb másfélnél.

-1.5 -1 -0.5 0.5 1 1.5

-1.5

-1

-0.5

0.5

1

1.5

A kör paraméterezését használva felírhatom Pi6onként F és G gradiensét.dfelt Tableft, DGft1, ft2, t, 0, 2Pi, Pi6;dfv Tableft, DFft1, ft2, t, 0, 2Pi, Pi6; Graphics`PlotField`pdfelt ListPlotVectorFielddfelt, VectorHeads True;pdfv ListPlotVectorFielddfv, VectorHeads True;A lehetséges szélsőértékhelyeken a gradiensek párhuzamosak. Ha f gradiense nem

merőleges a kör érintőjére, akkor az egyik irányba kicsit elmozdulva nagyobb,a másik irányba kicsit elmozdulva kisebb értékeket vesz föl f,tehát nem lehet szélsőérték.Showp3, pdfelt, pdfv, DisplayFunction $DisplayFunction, Axes None;Látható az előbb kiszámolt négy szélsőértékhely. Azalsó és a felső lokális minimum, a két oldalsó maximum.

General::spell1 : Possible spelling error: new symbol name "pdfelt" is similar to existing symbol "dfelt".

anal2_03_szelsoertek_demo.nb 14

Page 15: anal2 03 szelsoertek demousers.itk.ppke.hu/~vago/labor2010/anal2_03_szelsoertek... · 2015. 9. 2. · Parc. deriv, érintősík felület implicit képlettel G 16 x 2 9y2 36 z 144

General::spell1 : Possible spelling error: new symbol name "pdfv" is similar to existing symbol "dfv".

anal2_03_szelsoertek_demo.nb 15