0% found this document useful (0 votes)
21 views4 pages

Resultados

The document contains the results of running a finite difference method with constant coefficients to solve a PDE on the interval [-1,1] with varying levels of discretization (16, 32 and 100 points). For each level of discretization it provides the numerical solution vector 'sol', error vector 'error' and maximum error 'e'.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views4 pages

Resultados

The document contains the results of running a finite difference method with constant coefficients to solve a PDE on the interval [-1,1] with varying levels of discretization (16, 32 and 100 points). For each level of discretization it provides the numerical solution vector 'sol', error vector 'error' and maximum error 'e'.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

>> [sol,error,e]=diferencias_finitas_ctes(-1,1,16,1,1,0,0)

sol =

Columns 1 through 10

0 0.0642 0.1343 0.1969 0.2361 0.2365 0.1862 0.0808


-0.0736 -0.2580

Columns 11 through 16

-0.4413 -0.5833 -0.6401 -0.5732 -0.3593 0

error =

Columns 1 through 10

0 -0.0013 -0.0030 -0.0049 -0.0067 -0.0083 -0.0092 -0.0092


-0.0082 -0.0061

Columns 11 through 16

-0.0033 -0.0002 0.0025 0.0040 0.0033 -0.0000

e =

0.0092

>> [sol,error,e]=diferencias_finitas_ctes(-1,1,32,1,1,0,0)

sol =

Columns 1 through 10

0 0.0292 0.0610 0.0943 0.1276 0.1594 0.1880 0.2114


0.2280 0.2358

Columns 11 through 20

0.2335 0.2196 0.1933 0.1541 0.1021 0.0381 -0.0365 -0.1195


-0.2082 -0.2990

Columns 21 through 30

-0.3879 -0.4703 -0.5414 -0.5961 -0.6296 -0.6374 -0.6155 -0.5609


-0.4717 -0.3474

Columns 31 through 32

-0.1892 0

error =

Columns 1 through 10

0 -0.0001 -0.0003 -0.0005 -0.0007 -0.0009 -0.0011 -0.0013


-0.0015 -0.0017

Columns 11 through 20

-0.0019 -0.0020 -0.0021 -0.0022 -0.0022 -0.0021 -0.0020 -0.0018


-0.0016 -0.0013

Columns 21 through 30

-0.0010 -0.0006 -0.0003 0.0001 0.0004 0.0007 0.0008 0.0009


0.0009 0.0008

Columns 31 through 32

0.0005 -0.0000

e =

0.0022

>> [sol,error,e]=diferencias_finitas_ctes(-1,1,100,1,1,0,0)

sol =

Columns 1 through 10

0 0.0088 0.0178 0.0272 0.0369 0.0467 0.0568 0.0670


0.0774 0.0878

Columns 11 through 20

0.0983 0.1087 0.1191 0.1293 0.1394 0.1493 0.1590 0.1683


0.1772 0.1857

Columns 21 through 30

0.1937 0.2011 0.2080 0.2142 0.2197 0.2244 0.2283 0.2313


0.2334 0.2345

Columns 31 through 40

0.2346 0.2337 0.2316 0.2285 0.2241 0.2186 0.2119 0.2039


0.1946 0.1841

Columns 41 through 50

0.1724 0.1594 0.1451 0.1296 0.1128 0.0948 0.0757 0.0555


0.0341 0.0118

Columns 51 through 60

-0.0116 -0.0359 -0.0609 -0.0868 -0.1133 -0.1404 -0.1680 -0.1960


-0.2242 -0.2526

Columns 61 through 70

-0.2810 -0.3093 -0.3374 -0.3651 -0.3923 -0.4188 -0.4446 -0.4693


-0.4930 -0.5155
Columns 71 through 80

-0.5365 -0.5559 -0.5737 -0.5895 -0.6034 -0.6151 -0.6245 -0.6315


-0.6359 -0.6376

Columns 81 through 90

-0.6364 -0.6324 -0.6253 -0.6151 -0.6017 -0.5850 -0.5650 -0.5416


-0.5148 -0.4845

Columns 91 through 100

-0.4508 -0.4137 -0.3732 -0.3293 -0.2821 -0.2317 -0.1782 -0.1216


-0.0622 0

error =

1.0e-03 *

Columns 1 through 10

0 -0.0040 -0.0082 -0.0126 -0.0172 -0.0220 -0.0269 -0.0321


-0.0375 -0.0430

Columns 11 through 20

-0.0487 -0.0546 -0.0606 -0.0667 -0.0729 -0.0792 -0.0857 -0.0921


-0.0987 -0.1052

Columns 21 through 30

-0.1118 -0.1184 -0.1249 -0.1313 -0.1377 -0.1440 -0.1502 -0.1562


-0.1620 -0.1676

Columns 31 through 40

-0.1730 -0.1782 -0.1830 -0.1876 -0.1918 -0.1957 -0.1992 -0.2023


-0.2050 -0.2072

Columns 41 through 50

-0.2090 -0.2103 -0.2111 -0.2114 -0.2112 -0.2104 -0.2091 -0.2072


-0.2047 -0.2017

Columns 51 through 60

-0.1981 -0.1940 -0.1892 -0.1840 -0.1781 -0.1718 -0.1649 -0.1575


-0.1496 -0.1413

Columns 61 through 70

-0.1326 -0.1234 -0.1139 -0.1040 -0.0939 -0.0835 -0.0729 -0.0621


-0.0513 -0.0404

Columns 71 through 80

-0.0295 -0.0186 -0.0079 0.0026 0.0129 0.0229 0.0325 0.0416


0.0502 0.0583

Columns 81 through 90

0.0657 0.0723 0.0782 0.0832 0.0873 0.0904 0.0925 0.0934


0.0932 0.0917

Columns 91 through 100

0.0890 0.0849 0.0794 0.0726 0.0642 0.0544 0.0431 0.0303


0.0159 -0.0000

e =

2.1141e-04

>>

You might also like