Программирование в системе Mathcad

Лабораторный цикл содержит 5 работ по изучению программирования с использованием математической системы Mathcad. Цикл мо

270 79 288KB

Russian Pages 13 Year 1999

Report DMCA / Copyright

DOWNLOAD PDF FILE

Recommend Papers

Программирование в системе Mathcad

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

2

В 5

Mathcad. :«

220400, « 071900 «

1. 2. 3. 4. "

Mathcad"

__

1999

1. 2. 3. 4.

Э. . . . .,

:

»

я . .

:

:

я

:

Mathcad

1.

. ., . ., . . .,

.

MathCAD PLUS 7.0 PRO. .: 345 . Mathcad 6.0 PLUS. , dows 95. .: , 1996, 697 . . . Mathcad 8.0 Pro. .: , 1999, 523 . . ., . . Mathcad: . , 1999, 656 . ч : , , . . .

: -

Mathcad, , , , , , . . .

2. 3.

1999

К 1. 2. 3. 4. 5. 6. 7.

-

»

1. -

»

.

Mathcad. "File" "Edit" "View" "Insert" "Format" "Math"

. . . . . .

, 1998, Win-

.:

.

4

3 8. 9. 10. 11. 12. 13. 14. 15. 16. 17.

"Symbolics" "Window" "Help" .

. .

. 3.

.

XY -

. . . . . XY

.

З ,

. 1

2,

№ 1 2 3 4 5 6 7

. . .

2. 1. 2.

,

. 1

2

-

. 3.

(

-

-

). 3. XY

.

1. . 2. М 1.

. ч

я 3

-

: y=f(x), x,

x, x, ,

XY

, XY

.

В

.

1. 1. 2. 3. 4.

XY

:

, ,

2.

XY

.

.

-

. «

». , , . .

-

1. Ф 1 y = sin(x) y = cos(x) y = |tg(x)| + 0.1 y = (x2-1)/15 y = (x3-2)/15 y = x2 - 10

y = ∫ sin( x )dx x

8

y=

9

y=

Ф 2 z= exp(x+3)/5000 - 1 z = 0.00025e3-x - 0.6 z = (1+x)6 z = 1+sin(x) z = 5cos(x) z = 0.025e-1.2x z=0.02x3

a -2π -2π -2π -2π -2π -5 -5

b 2π 2π 2π 2π 2π 5 5

h π/20 π/20 π/20 π/20 π/20 1 1

z = 0.05x2

1

10

1

z = 0.01x3

-10

10

1

z = - 0.05(x2 + 10cos(x)) z = 0.01(x2 - 40sin(x)) z = sin(x) + sin(2x) z = sin2(x) + cos(x) z = x(0.5 + x)exp(0.1x) z = 5x - x1.5+sin(x)

-8

8

1

-8 -π -π -π 0

8 π π π 5

1 π/8 π/8 π/8 0.5

−5

d (sin(x ) + 7 ⋅ ln(x )) dx

d 1+ 0.2x ⋅sin(x) (e ) dx

10

y = √2+cos(x)

11 12 13 14 15

y = sin2(x/3) y = cos3(x) y = 0.5x + cos2(x) y = sin(x) + cos2(2x) y = |sin(x)|exp(x/2)

6

5 2. М

1 sin ( x) . exp( x)

f1( x) f2( x) a N n

1.9

10

x

0.5

b

40

h

Ф

1

Ф

2

1.

a

2 yn

f1( a

n .h )

0 0 0.79

, , , , .

2. 3.

N

0 .. N

Mathcad

: -

4 b

я

Mathcad

1 zn

n .h )

f2( a

2

0 1 2 3 4 5 6 T z = 0 9.732 9.636 9.526 9.403 9.266 9.115 8.952

1 0.997 3

2 1.227

. .

К 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.

. . . . . . . . . .

З

3 1.481

.

1.

4 1.758

y = 5 2.058

1. 2. 3.

41.32 32.27

6 2.382

y

7 2.728

n

z n

8 3.094 10 3.88

. .

1. 2.

14.17

3.93

. , -

2.

23.22

,

.

. .

5.12

9 3.479

,

3. 0

10

11 4.291

20

30

(

40

1. 2. 3.

n

trace 1 trace 2

.

3. ,

. . .

4.

Mathcad . .

1. 2. 3. 4.

.

,

. . . .

).

М 1.

ч

7

я 4

8 1

:

2.

Mathcad

,

y ( x, t )

, ,

if x 0 , 1 ,

sin ( x ) . sin ( t ) if t 0 , 1 , x t π

. N

.

, ,

-

n

-

m

. , .

20

M

20

Ф

h

5

0 .. N

1

0 .. M

3.

2

2

:

В № 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

-

y=f(x,t), x x t,

M n,m

t,

M,

N . h, m 2

n

N . h 2

, (

)

0

, .

2.

y=sin(x)cos(t) y=sin(x/2)cos(t) y=sin(2x)cos(t) y = sin(x)cos(t/2) y = sin(x/2)cos(2t) y = sin(2x)cos(2t) y = (1+sin(x)/x)(sin(t)/t) y = (sin(x)/x)cos(t) y = (sin(x)/x)|cos(t)| y = (sin(x)/x)t y = (sin(x)/x)|t| y = (sin(x)/x)sin(t) y = (sin(x)/x)|sin(t)| y = (sin(x)/x)(1-t) y = (sin(x)/x)|t+0.5|

y

x -2π -2π -2π -2π -2π -2π -2π -2π -2π -2π -2π -2π -2π -2π -2π

2π 2π 2π 2π 2π 2π 2π 2π 2π 2π 2π 2π 2π 2π 2π

t -2π -2π -2π -2π -2π -2π -2π -2π -2π -2 -2 -2π -2π -2 -2

2π 2π 2π 2π 2π 2π 2π 2π 2π 2 2 2π 2π 2 2

1

2

3

4

5

6

7

0 0

0

0

0

0

0

0

1 0

0.011

0.02

0.022

0.016

0

-0.024 -0.052

2 0

0.02

0.036

0.041

0.03

0

-0.044 -0.095

3 0

0.022

0.041

0.047

0.034

0

-0.051 -0.109

4 0

0.016

0.03

0.034

0.024

0

-0.036 -0.079

5 0

0

0

0

0

0

0

0

-0.024 -0.044 -0.051 -0.036 0

0.055

0.118

-0.052 -0.095 -0.109 -0.079 0

0.118

0.255

8 0

-0.079 -0.143 -0.164 -0.118 0

0.177

0.382

9 0

-0.097 -0.177 -0.202 -0.146 0

0.219

0.472

10 0

-0.104 -0.189 -0.216 -0.156 0

0.234

0.505

11 0

-0.097 -0.177 -0.202 -0.146 0

0.219

0.472

12 0

-0.079 -0.143 -0.164 -0.118 0

0.177

0.382

13 0

-0.052 -0.095 -0.109 -0.079 0

0.118

0.255

M = 6 0 7 0

0

10

9 3

х

3.

Mathcad

1.

: ,

-

1

, .

2. 3.

0.5

0

0

5

10

0

15

. .

К 1. 2. 3. 4. 5. 6. 7. 8. 9.

20

5 10 15 20

M 4

. . root. . polyroot. . Mathcad.

Given

Find. Minerr.

К

10.

.

З

1

.

1. 0 0.5

0.1

0 0

0.1 0 0.2 0.1 0.5

0

0.2 0

0.1 0.2

0.3 0.7 0.6

0.4

0.8 0.2 0.5 0.7 0.1 0.3 0.4

1 0.9 0.8 0.6

0

0 0

0.1

1. 2. 3.

0.1

0.2

0

0.2

0.1 0 0.5 0.4 0.3 0.2 0.1

0.1

0.5

0

. ,

. . .

2.

0.1

1. 2.

0.2 0.1

,

. f1(x)

3.

y(x)=f1(x) y(x)=0.

0

XY

. ,

-

.

0

4.

,

1. 2.

1

root. .

3. 0.5

-

.

1 1

,

,

. f1(x)

f2(x)

-

.

M Mathcad.

, .

3.

XY ,

. f1(x)

f2(x).

11

12

4.

,

Find, y=f1(x) y=f2(x).

5. 6. М 1.

4. : Given

,

Minerr.

1 2

. ч

...........

я

Find / 3

-

Minerr .

:

[Ctrl]+[=]. «

, .

,

-

».

. ,

5.

Find

Minerr .

f1(x)=0. Find ,

y=f1(x)

-

Э

.

. -

.

: Find( Minerr( : y:=

f2.

2. x:= Given

, . ,

Minerr -

y=f2(x). ,

f1

,

).

y=f1(x) y=f2(x)

. .

)

.

-

x:= Given

. 3.

Find(x,y)=...

-

. root

y=f1(x) y=f2(x)

. : root(

,

 x1  y1 :=Find(x,y)    x1  y1 =...  

). .

: := root(f1(x),x)=... := x0:=root(f1(x),x) 0=...

Find , , x0

.

y:=

,

, В

x1 .

y1

13 №

3. f1(x)-

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

a3 0 0 0 0 0 .1 .2 .3 .4 .5 -.1 -.2 -.3 -.4 -.5

3a2 -1 2 1 9 -4 -5 -3 -6 -9 -7 -4 -6 -9 7 1

a1 4 -2 4 -8 4 4 2 1 1 5 9 -7 -8 8 4

14

f2(x) a0 -1 -15 -1 -70 50 40 30 50 70 60 60 55 75 -75 -1

333 0.2exp(x)-20 40|cos(x)| 10ln(x+5.5) 100|sin(x)| 70cos(x) 60exp(|0.1*x|)-100 20sin(2x) exp(|x|)sin(2x) exp(|x|)cos(3x) -60|cos(x)| 15log(x+5.1) -50ln(x+5.1) -100|cos(x)| 100sin(x/2) 40cos(x/2)

1 Mathcad a0

2

a2

a1 2

a3

a3 . x

2

6 . cos ( x )

f2 ( x ) a

4

x

a,a

b

f1(x)

1

a2 . x

3

f1 ( x )

К

7

4

a1 . x

a0

h

Ф

1

Ф

2

0.5

h .. b 2

6 4

2

8.4

0

22.8 f1( x ) 37.2 51.6 66 x

x

root ( f1 ( x ) , x ) = 2

2

x

1

x

3

root ( f1 ( x ) , x ) = 0.268 root ( f1 ( x ) , x ) = 3.732

2

4

15

16

3

я

4. a

4

a,a

x

b

4

h .. b

h

1. 2. 3.

6 4

2

0

8.4

f1 ( x )

22.8

f2 ( x )

37.2

2

4

66 x

2.2

y

0

Given y

f1 ( x ) x1 y1

x

y

f2 ( x )

find ( x , y )

x1 y1

=

2.25 3.77

0

Given y

f1 ( x ) x1 y1

x

y

x1 y1

=

5.099 ,

Find

Given f1 ( x ) x1 y1 x

y

x1 y1

=

Given

x1 y1

y

f2 ( x )

Minerr ( x , y )

x1 y1

=

Find (

. . . . . . . . .

. , ,

. . ,

. (

2.

).

,

. f(x)

. .

Minerr

,

. FC(x)

. .

4. 1. 2. 3. 4.

,

. p(x) XY

. f(x)

,

.

3.385 5.823 root.

Given

1. 2. 3.

1. 2.

5.823 ,

f1 ( x )

. Add Line ← if , while for break otherwise return on error continue -

3.

3.385

3

y

.

1. 2.

f2 ( x )

Find ( x , y )

Mathcad, .

1. 0.555

3

y

,

З

f2 ( x )

Find ( x , y )

: ,

К 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.

51.6

x

Mathcad

0.5

Minerr).

М 1.

ч

я 4

-

,

:

p(x)

.

17 -

18 , ,

1

,

Mathcad

,

.

2. Mathcad «

,

-

L

1

N

5

».

,

2

( ).

. f( x )

Add Line. ,

x if

.

1 otherwise Ф

4. f(x) -

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

2-

3

В №

1-

1 x 0

1 0 -x 0 1 x x 0 1 -x2 -x2 0 1 x2 x2

0 1 0 -x -x 0 1 x x 0 1 -x2 -x2 0 1

L f( x) d x

R

Ф

L 0

for n ∈ 1 .. N

10 8 9 5 6 7 9 12 10 8 6

1. L

L

1. L

L

f ( x ) . cos

n .π .x

dx

L L f ( x ) . sin

n .π .x

nФ -

dx

-

L L

T R

9

spectum

7 10 8

R

FC ( N , L )

N

1 . 2 .L

FC ( N , L )

A

spectum

B

spectum

К

0.75

0

0.203 A =

2.974 10

4

0.023 2.974 10 8.403 10

0.318 B =

0.159 0.106

4

0.08

3

0.064

: - A, -B

20

19 4

я

5. N p ( x)

A0 n=1

x

L, L

L 50

A n . cos

n .π .x L

Bn . sin

n .π .x

1. 2.

L

.. L

1

: , , , , , , , ,

z-. SmartMath -

-

.

(

f( x ) p( x )

Mathcad

0.5

1

0.5

0 x

Mathcad

0.5

, . .

1

).

К 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18.

Evaluate/Simbolically Evaluate/Floating Point Evaluate/Complex Simplify . Expand ( Factor ( Collect Polinomial Coefficients Variable/Solve Variable/Substitute Variable/Differentiate Variable/Integrate Expand to Series Convert to Partial Fraction ( , , z-. Evaluation Style SmartMath -

. . . ). ). . . . . . . . . , . .

З .

1. 1. 2. 3.

, , , /

2. 1.

. .

,

. . .

,

).

21 2. 3.

f1(x)

22 .

.

.

f1(x).

/

3. 1. 2. 3.

-

-

.

,

.

.

f2(x)

.

5. .

f2(x). 4.

(

1. 2. 3. 4.

.

.

f2(x) XY ,

. f2(x)

, . .

я

XY 4

2.

:

, , , .

.

:

-

,

Mathcad,

, 3.

. ( ).

-

. . .

"

,

F2(x). .

ч

"

-

. . -

-

. 4. . (

, .

,

М 1.

),

.

)

-

.

. .

, .

.

23

24

В № 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

4. f1(x) (1+x)2 (1-x)2 (a+x)2 (a-x)2 (1+x)3 (1-x)3 (a+x)3 (a-x)3 (1+x)4 (1-x)4 (a+x)4 (a-x)4 (1+x)5 (1-x)5 (a+x)5 (a+x)5

1 f2(x) ax3+bx2+cx+d sin(ax) cos(ax) sec(x) exp(ax) x(ln(x)-1) -csc(x) 1/(1+x2) 1/(a+bx) 1/(1-x2) -cos3(x)/3 sin3(x)/3 x2(ln(x)-0.5)/2 -(ln(x)+1)/x ln2(x)/2 ln3(x)/3

Mathcad a

2

f1( x)

(a

x)

3

sin ( x)

f2( x)

Ф

1

Ф

2

x 2 / (a a

3

(a a

3

x)

2 2 3.a .x 3.a .x 3

x) expand 2 2 3.a .x 3.a .x

( x a)

Ф

3 3

x

2 12. x 6 . x

8

3

SmartMath

x

( Ф

3

x

3

3 / (a

x)

Ф

3

3.( x a )

2

3.( x a )

2

( x a)

3

Ф

)

25 4 sin ( x)

Ф

x 1

1.

1 . 4 x 120

2

x

6 F2( x)

1

1.

5

O x

1 . 4 x 120

2

x

6

x

4 , 3.9.. 4 1

f2( x )

0.5

F2 ( x ) 0

0.5 5

0 x

5

Mathcad

. SmartMath, .