0% found this document useful (0 votes)
73 views17 pages

Practica Calificada N7

The document describes using the finite difference method to solve a partial differential equation modeling beam deflection. A Python code is provided that implements the finite difference method with N=80 intervals to solve the PDE numerically. The code returns results showing the numerical solution wi at each interval xi compared to the exact solution et, along with the absolute error between the two.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
73 views17 pages

Practica Calificada N7

The document describes using the finite difference method to solve a partial differential equation modeling beam deflection. A Python code is provided that implements the finite difference method with N=80 intervals to solve the PDE numerically. The code returns results showing the numerical solution wi at each interval xi compared to the exact solution et, along with the absolute error between the two.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 17

PRACTICA CALIFICADA N°7

Estudiante: Parado Sosa Daniel Elmer 20164536E


1. Usar el método de diferencias finitas con h=0.1, para resolver el PVF de
deflexión de una viga
T w
y ' ' ( x )= y ( x )+ x ( x−50 ) , 0 ≤ X ≤ L , y ( 0 ) =0= y ( L)
EI 2 EI
Reemplazando los parámetros la ecuación resulta

y ' ' ( x )=6.25 ×10−6 y ( x )+ 5.21×10−7 x ( x−50 )

Para resolver esta ecuación utilizamos el método de diferencias finitas, e


implementamos un código en python:
El código es el siguiente:
from matplotlib import pyplot as plt
import numpy as np
import math
def p(x):
fun=0
return fun
def q(x):
fun=0.00000625
return fun
def r(x):
fun=0.0000005208*x*(x-50)
return fun
def ft(x):
fun=12505.09*math.exp(0.0025*x)+14170.11*math.exp(-0.0025*x)-0.08336*(x**2)+4.168*x-26675.2
return fun
a=0
b=50
alfa=0
beta=0
N=80
h=(b-a)/(N+1)
x=a+h
A=[]
B=[]
C=[]
D=[]
a1=2+(h**2)*q(x)
A.append(a1)
b1=-1+(h/2)*p(x)
B.append(b1)
d1=-(h**2)*r(x)+(1+(h/2)*p(x))*alfa
D.append(d1)
for i in range(int(N-2)):
x=a+(i+2)*h
a1=2+(h**2)*q(x)
A.append(a1)
b1=-1+(h/2)*p(x)
B.append(b1)
c1=-1-(h/2)*p(x)
C.append(c1)
d1=-(h**2)*r(x)
D.append(d1)
x=b-h
a1=2+(h**2)*q(x)
A.append(a1)
c1=-1-(h/2)*p(x)
C.append(c1)
d1=-(h**2)*r(x)+(1-(h/2)*p(x))*beta
D.append(d1)
L=[]
U=[]
Z=[]
l1=A[0]
L.append(l1)
u1=B[0]/A[0]
U.append(u1)
z1=D[0]/L[0]
Z.append(z1)
for i in range(int(N-2)):
l1=A[i+1]-C[i+1]*U[i]
L.append(l1)
u1=B[i+1]/L[i+1]
U.append(u1)
z1=(D[i+1]-C[i+1]*Z[i])/L[i+1]
Z.append(z1)
l1=A[N-1]-C[N-2]*U[N-3]
L.append(l1)
z1=(D[N-1]-C[N-2]*Z[N-2])/L[N-1]
Z.append(z1)
W=[]
w0=alfa
W.append(w0)
wn1=beta
W.append(wn1)
wn=Z[N-1]
W.append(wn)
for i in range(int(N-1)):
w0=Z[(N-2)-i]-U[(N-2)-i]*W[i+2]
W.append(w0)
x=a
print(x,end=" ")
et=ft(x)
print(et,end=" ")
print(w0,end=" ")
e=et-w0
print(e)
plt.plot(x,w0,'ro',x,et,'go')
for i in range(int(N+1)):
x=a+(i+1)*h
print(x,end=" ")
et=ft(x)
print(et,end=" ")
print(W[(N+1)-i],end=" ")
e=et-W[(N+1)-i]
print(e)
plt.plot(x,W[(N+1)-i],'ro',x,et,'go')
plt.xlabel('x')
plt.ylabel('w0')
plt.show()
El programa devuelve los siguientes resultados
PARA N=80
xi yi wi error absoluto
0 0.0 0.003343024362669729 -0.003343024362669729

0.6172839506172839 0.003363183968758676 0.003343024362669729 2.0159606088947322e-05

1.2345679012345678 0.006720336987200426 0.0066800074454991636 4.032954170126238e-05

1.8518518518518516 0.010065566777484491 0.010005059185291768 6.050759219272325e-05

2.4691358024691357 0.013393132314376999 0.013312440721467598 8.069159290940119e-05

3.0864197530864197 0.016697443832526915 0.01659656438239622 0.00010087945013069477

3.7037037037037033 0.019973062782810302 0.0198519936720897 0.00012106911072060078

4.320987654320987 0.023214701850520214 0.0230734432572556 0.0001412585932646128

4.938271604938271 0.02641722492626286 0.026255778954709964 0.0001614459715528968

5.555555555555555 0.029575647095043678 0.029394017719150296 0.00018162937589338152

6.172839506172839 0.03268513461807743 0.032483327631288444 0.00020180698678898268

6.790123456790123 0.035741004954616074 0.0355190278863434 0.00022197706827267044

7.4074074074074066 0.03873872668918921 0.03849658878289397 0.00024213790629523668

8.024691358024691 0.0416739195898117 0.04141163171209133 0.0002622878777203755

8.641975308641975 0.04454235454250011 0.04425992914723136 0.00028242539526874416

9.25925925925926 0.0473399535731005 0.047037404633686816 0.00030254893941368544

9.876543209876543 0.0500627898327366 0.04974013277919927 0.0003226570535373313

10.493827160493826 0.05270708757234388 0.05236433924453075 0.0003427483278131277

11.11111111111111 0.055269222146307584 0.05490640073447527 0.0003628214118323106

11.728395061728394 0.0577457200124627 0.05736284498922986 0.00038287502323283706

12.345679012345679 0.06013325870662811 0.05973035077612542 0.00040290793050268975

12.962962962962962 0.06242866683896864 0.06200574788171727 0.00042291895725136974

13.580246913580247 0.06462892410127097 0.06418601710423522 0.0004429069970357524

14.19753086419753 0.0667311612269259 0.0662682902463934 0.0004628709805325065

14.814814814814813 0.06873266002730816 0.06824985010855963 0.0004828099187485224

15.432098765432098 0.07063085335539654 0.07012813048228446 0.0005027228731120797


16.049382716049383 0.07242332509849803 0.07190071614418968 0.0005226089543083484

16.666666666666664 0.07410781018916168 0.07356534285021653 0.0005424673389451545

17.28395061728395 0.07568219459426473 0.07511989733023343 0.0005622972640313001

17.901234567901234 0.0771445153040986 0.07656241728300317 0.0005820980210954341

18.51851851851852 0.0784929603432829 0.07789109137150974 0.0006018689717731673

19.1358024691358 0.07972586871255771 0.07910425921864458 0.0006216094939131278

19.753086419753085 0.08084173048700904 0.08020041140325253 0.0006413190837565169

20.37037037037037 0.08183918670692947 0.08117818945653696 0.0006609972503925088

20.98765432098765 0.08271702942874981 0.08203638585882475 0.0006806435699250601

21.604938271604937 0.08347420173959108 0.08277394403669049 0.0007002577029005946

22.22222222222222 0.08410979768814286 0.08338995836044027 0.0007198393277025872

22.839506172839506 0.08462306235014694 0.083883674141955 0.0007393882081919434

23.456790123456788 0.08501339179565548 0.08425448763289298 0.0007589041627625026

24.074074074074073 0.08528033307811711 0.08450194602325217 0.0007783870548649374

24.691358024691358 0.08542358426348073 0.08462574744029186 0.0007978368231888744

25.30864197530864 0.08544299439745373 0.08462574094781365 0.0008172534496400791

25.925925925925924 0.08533856352369185 0.08450192654580208 0.0008366369778897709

26.54320987654321 0.08511044269471313 0.08425445517042457 0.0008559875242885595

27.160493827160494 0.08475893393551814 0.08388362869439098 0.0008753052411271667

27.777777777777775 0.08428449027633178 0.08338989992767241 0.0008945903486593659

28.39506172839506 0.08368771574896527 0.08277387261857962 0.0009138431303856581

29.012345679012345 0.08296936537226429 0.08203630145520079 0.0009330639170635063

29.629629629629626 0.08213034517757478 0.08117809206719889 0.0009522531103758891

30.24691358024691 0.08117171219055308 0.08020030102796841 0.0009714111625846733

30.864197530864196 0.08009467442752793 0.07910413585715156 0.0009905385703763703

31.48148148148148 0.07890059093915625 0.07789095502351401 0.0010096359156422374

32.098765432098766 0.0775909717704053 0.07656226794818005 0.001028703822225252

32.71604938271605 0.07616747798601864 0.07511973500822725 0.0010477429777913938

33.33333333333333 0.07463192165960209 0.07356516754064071 0.0010667541189613716

33.95061728395061 0.0729862658881757 0.07190052784662672 0.0010857380415489754

34.5679012345679 0.07123262481400161 0.07012792919628592 0.001104695617715687


35.18518518518518 0.06937326358820428 0.06824963583364617 0.0011236277545581125

35.80246913580247 0.06741059841806418 0.06626806298205472 0.0011425354360094647

36.41975308641975 0.06534719653063803 0.06418577684993008 0.0011614196807079452

37.03703703703704 0.06318577622732846 0.06200549463687351 0.001180281590454954

37.654320987654316 0.060929206851142226 0.05973008454013992 0.0011991223110023042

38.2716049382716 0.05858050881579402 0.05736256576146858 0.001217943054325439

38.888888888888886 0.056142853583878605 0.054906108514273244 0.0012367450696053606

39.50617283950617 0.053619563735992415 0.05236403403119205 0.0012555297048003622

40.123456790123456 0.051014112894335994 0.049739814571997026 0.0012742983223389681

40.74074074074074 0.04833012579547358 0.04703707343186324 0.0012930523636103392

41.358024691358025 0.04557137828669511 0.04425958494999767 0.0013117933366974394

41.9753086419753 0.04274179730055039 0.04141127451862782 0.001330522781922569

42.59259259259259 0.03984546091669472 0.03849621859234999 0.0013492423243447321

43.20987654320987 0.03688659833278507 0.03551864469783733 0.0013679536349477384

43.82716049382716 0.033869589871756034 0.032482931443907744 0.0013866584278482905

44.44444444444444 0.03079896704366547 0.029393608531951443 0.0014053585117140277

45.06172839506173 0.027679412491124822 0.02625535676671847 0.0014240557244063513

45.67901234567901 0.02451576002931688 0.02307300806746602 0.0014427519618508584

46.29629629629629 0.021312994675099617 0.019851545479465632 0.0014614491956339848

46.913580246913575 0.01807625262881629 0.016596103185870296 0.001480149442945996

47.53086419753086 0.01481082130339928 0.013311966519941477 0.001498854783457803

48.148148148148145 0.011522139338921988 0.010004571977636142 0.001517567361285846

48.76543209876543 0.008215796577133005 0.006679507230553748 0.0015362893465792572

49.382716049382715 0.004897534159681527 0.0033425111392432643 0.0015550230204382626

50.0 0.0015732444408058655 0 0.0015732444408058655

PARA N=40

xi yi wi error absoluto
0 0.0 0.006601494665177898 -0.006601494665177898

1.2195121951219512 0.006638573431700934 0.006601494665177898 3.7078766523035434e-05

2.4390243902439024 0.01323130681339535 0.013156974608085693 7.43322053096563e-05

3.6585365853658534 0.01973447229829617 0.019622728482922333 0.00011174381537383538


4.878048780487805 0.026106645913387183 0.025957347914056135 0.0001492979993310481

6.097560975609756 0.032308707130141556 0.03212172711113132 0.00018698001901023414

7.317073170731707 0.03830383856256958 0.03807906250557729 0.0002247760569922888

8.536585365853659 0.044057525556127075 0.04379485240851712 0.00026267314760995697

9.75609756097561 0.04953755594033282 0.04923689669007223 0.00030065925026059176

10.97560975609756 0.05471401966860867 0.054375296480060155 0.0003387231885485162

12.195121951219512 0.059559308570896974 0.059182453890082684 0.00037685468081428974

13.414634146341463 0.06404811607353622 0.06363307175700177 0.0004150443165344547

14.634146341463413 0.06815743700281018 0.0677041534078008 0.00045328359500938775

15.853658536585366 0.0718665673484793 0.07137500244582907 0.0004915649026502183

17.073170731707318 0.07515710404550191 0.07462722255842759 0.0005298814870743213

18.29268292682927 0.07801294485398103 0.07744471734593403 0.0005682275080469978

19.51219512195122 0.08042028816998936 0.07981369017206583 0.0006065979979235359

20.73170731707317 0.08236763292734395 0.08172264403567953 0.000644988891664422

21.95121951219512 0.08384577844844898 0.08316238146390549 0.0006833969845434912

23.170731707317074 0.08484782441155403 0.08412600442665671 0.000721819984897315

24.390243902439025 0.08536917074161465 0.0846089142725113 0.0007602564691033542

25.609756097560975 0.08540751760665444 0.08460881168596766 0.0007987059206867736

26.829268292682926 0.08496286534500541 0.08412569666607227 0.0008371686789331451

28.048780487804876 0.08403751453079167 0.08316186852641957 0.0008756460043720937

29.268292682926827 0.0826360659339116 0.08172192591652436 0.0009141400173872383

30.48780487804878 0.08076542060734937 0.07981276686456641 0.0009526537427829579

31.70731707317073 0.07843477992355474 0.07744358884150819 0.0009911910820465525

32.926829268292686 0.07565564566175453 0.07462588884658582 0.001029756815168717

34.146341463414636 0.07244182015347178 0.07137346351417444 0.0010683566392973437

35.36585365853659 0.06880940634437138 0.06770240924202882 0.0011069971023425634

36.58536585365854 0.06477680800162489 0.06363112234090033 0.001145685660724552

37.80487804878049 0.0603647298667056 0.05918029920553184 0.0011844306611737618

39.02439024390244 0.055596177822735626 0.054372936507031976 0.0012232413157036506

40.24390243902439 0.0504964591418684 0.049234331406630624 0.0012621277352377752

41.46341463414634 0.04509318272903329 0.043792081790817616 0.0013011009382156713


42.68292682926829 0.03941625931838644 0.03807608652786683 0.0013401727905196087

43.90243902439024 0.0334979018298327 0.032118545745747996 0.0013793560840847027

45.12195121951219 0.027372625594580313 0.025953961131428956 0.0014186644631513576

46.34146341463415 0.021077248737128684 0.019619136251570947 0.0014581124855577374

47.5609756097561 0.01465089248449658 0.013153176894620082 0.0014977155898764985

48.78048780487805 0.008134981533657992 0.006597491434298077 0.0015374900993599151

50.0 0.0015732444408058655 0 0.0015732444408058655

PARA N=20

xi yi wi error absoluto
0 0.0 0.0128656298244459 -0.0128656298244459

2.380952380952381 0.012919060787680792 0.0128656298244459 5.34309632348913e-05

4.761904761904762 0.02550650326156756 0.025396978419519826 0.00010952484204773336

7.142857142857142 0.037461393454577774 0.037293226418928474 0.0001681670356492998

9.523809523809524 0.0485162616460002 0.04828700566117469 0.00022925598482551046

11.904761904761905 0.05843709291002597 0.05814438971647918 0.00029270319354678803

14.285714285714285 0.06702331878841505 0.0666648855985708 0.00035843318984425665

16.666666666666668 0.07410781018916168 0.0736814266610519 0.00042638352810978053

19.047619047619047 0.07955687148569268 0.07906036667808686 0.0004965048076058243

21.428571428571427 0.08327023575475323 0.08270147510920414 0.0005687606455490879

23.80952380952381 0.08518106125484337 0.08453793354804415 0.0006431277067992236

26.19047619047619 0.08525592901423806 0.08453633335492707 0.0007195956593109981

28.57142857142857 0.08349484168866184 0.08269667447315669 0.0007981672155051439

30.952380952380953 0.07993122355401283 0.07905236542901849 0.0008788581249943445

33.333333333333336 0.07463192165960209 0.07367022451547162 0.0009616971441304689

35.714285714285715 0.0676972082183056 0.06665048215957717 0.0010467260587284366

38.095238095238095 0.05926078418633551 0.05812678447374627 0.0011339997125892412

40.476190476190474 0.049489783948956756 0.048266197990934 0.0012235859580227576

42.857142857142854 0.038584781272220425 0.037269215583946774 0.001315565688273651

45.23809523809524 0.026779796404298395 0.025369763569073087 0.0014100328352253076

47.61904761904762 0.01434230436643702 0.01283520999428914 0.001507094372147879

50.0 0.0015732444408058655 0 0.0015732444408058655


El error disminuye a medida que el valor de N aumenta
Ahora graficamos los resultados
Para N=20

Los puntos verdes son los resultados teóricos y los puntos rojos son los resultados
numéricos
Para N=40
Para N=80

La solución analítica del problema es:

y ( x ) =12505.09 e0.0025 x +14170.11 e−0.0025 x −0.08336 x 2+ 4.168 x−26675.2

El grafico de esta ecuación para un intervalo de 0 a 50 es:


2. Resolver el siguiente PVF

x 2 y ' ' ( x ) + x y ' ( x ) + y ( x )=0 ; y (1 )=0 , y ( 2 ) =0.638961

Reordenamos la ecuación diferencial y obtenemos


−1 ' 1
y ' ' ( x )= y ( x )− 2 y ( x)
x x
Para resolver esta ecuación utilizamos el método de diferencias finitas, e
implementamos un código en python:
El código es el siguiente:
from matplotlib import pyplot as plt
import numpy as np
import math
def p(x):
fun=-1/x
return fun
def q(x):
fun=-1/(x**2)
return fun
def r(x):
fun=0
return fun
def ft(x):
fun=52.818*(np.sin((math.pi*math.log(x)/180)))
return fun
a=1
b=2
alfa=0
beta=0.638961
N=20
h=(b-a)/(N+1)
x=a+h
A=[]
B=[]
C=[]
D=[]
a1=2+(h**2)*q(x)
A.append(a1)
b1=-1+(h/2)*p(x)
B.append(b1)
d1=-(h**2)*r(x)+(1+(h/2)*p(x))*alfa
D.append(d1)
for i in range(int(N-2)):
x=a+(i+2)*h
a1=2+(h**2)*q(x)
A.append(a1)
b1=-1+(h/2)*p(x)
B.append(b1)
c1=-1-(h/2)*p(x)
C.append(c1)
d1=-(h**2)*r(x)
D.append(d1)
x=b-h
a1=2+(h**2)*q(x)
A.append(a1)
c1=-1-(h/2)*p(x)
C.append(c1)
d1=-(h**2)*r(x)+(1-(h/2)*p(x))*beta
D.append(d1)
L=[]
U=[]
Z=[]
l1=A[0]
L.append(l1)
u1=B[0]/A[0]
U.append(u1)
z1=D[0]/L[0]
Z.append(z1)
for i in range(int(N-2)):
l1=A[i+1]-C[i+1]*U[i]
L.append(l1)
u1=B[i+1]/L[i+1]
U.append(u1)
z1=(D[i+1]-C[i+1]*Z[i])/L[i+1]
Z.append(z1)
l1=A[N-1]-C[N-2]*U[N-3]
L.append(l1)
z1=(D[N-1]-C[N-2]*Z[N-2])/L[N-1]
Z.append(z1)
W=[]
w0=alfa
W.append(w0)
wn1=beta
W.append(wn1)
wn=Z[N-1]
W.append(wn)
for i in range(int(N-1)):
w0=Z[(N-2)-i]-U[(N-2)-i]*W[i+2]
W.append(w0)
x=a
print(x,end=" ")
et=ft(x)
print(et,end=" ")
print(w0,end=" ")
e=et-w0
print(e)
plt.plot(x,w0,'ro',x,et,'go')
for i in range(int(N+1)):
x=a+(i+1)*h
print(x,end=" ")
et=ft(x)
print(et,end=" ")
print(W[(N+1)-i],end=" ")
e=et-W[(N+1)-i]
print(e)
plt.plot(x,W[(N+1)-i],'ro',x,et,'go')
plt.xlabel('x')
plt.ylabel('w0')
plt.show()

El programa devuelve los siguientes resultados


PARA N=80
xi yi wi error absoluto
1 0.0 0.012764330192391326 -0.012764330192391326
1.0123456790123457 0.011311160282107432 0.012764330192391326 -0.001453169910283894
1.0246913580246915 0.022485211705765343 0.02537205441198613 -0.0028868427062207873
1.037037037037037 0.03352543794951129 0.037824217077352715 -0.0042987791278414275
1.0493827160493827 0.044435006123199304 0.05012192177416545 -0.005686915650966143
1.0617283950617284 0.05521697222109129 0.06226632492005929 -0.007049352698968003
1.074074074074074 0.06587428625975907 0.07425862994801628 -0.008384343688257218
1.0864197530864197 0.07640979712240756 0.08610008196527992 -0.009690284842872363
1.0987654320987654 0.08682625712952072 0.09779196284860106 -0.010965705719080343
1.1111111111111112 0.09712632635417974 0.10933558674006254 -0.012209260385882797
1.123456790123457 0.10731257669897845 0.12073229591084646 -0.013419719211868006
1.1358024691358024 0.11738749575016892 0.131983456963132 -0.014595961212963068
1.1481481481481481 0.1273534904234879 0.14309045734287185 -0.01573696691938395
1.1604938271604939 0.1372128904150284 0.1540547021385193 -0.01684181172349089
1.1728395061728394 0.1469679514695381 0.16487761114288785 -0.01790965967334976
1.1851851851851851 0.15662085847761265 0.17556061615724403 -0.01893975767963138
1.1975308641975309 0.16617372841242053 0.18610515851847917 -0.019931430106058634
1.2098765432098766 0.17562861311583777 0.19651268683179385 -0.020884073715956075
1.2222222222222223 0.18498750194316177 0.20678465489277736 -0.021797152949615595
1.2345679012345678 0.19425232427493352 0.21692251978408303 -0.022670195509149504
1.2469135802469136 0.20342495190380172 0.22692774013310504 -0.023502788229303323
1.2592592592592593 0.21250720130381345 0.23680177451816165 -0.024294573214348192
1.2716049382716048 0.2215008357890155 0.24654608001169373 -0.02504524422267823
1.2839506172839505 0.2304075675677828 0.2561621108499062 -0.0257545432821234
1.2962962962962963 0.23922905969885785 0.26565131721912 -0.026422257520262143
1.308641975308642 0.2479669279546943 0.2750151441498713 -0.027048216195177027
1.3209876543209877 0.25662274259732487 0.28425503051049916 -0.02763228791317429
1.3333333333333333 0.2651980300716356 0.29337240809260823 -0.028174378020972612
1.345679012345679 0.27369427462061535 0.30236870078138595 -0.028674426160770594
1.3580246913580247 0.28211291982685216 0.31124532380429637 -0.02913240397744421
1.3703703703703702 0.29045537008428524 0.3200036830521725 -0.02954831296788729
1.382716049382716 0.2987229920039629 0.3286451744671868 -0.029922182463223868
1.3950617283950617 0.3069171157573255 0.33717118349259984 -0.030254067735274337
1.4074074074074074 0.31503903636031805 0.3455830845795782 -0.030544048219260156
1.4197530864197532 0.3230900149014313 0.3538822407467241 -0.030792225845292787
1.4320987654320987 0.3310712797165834 0.36207000318829147 -0.030998723471708067
1.4444444444444444 0.33898402751358336 0.3701477109273639 -0.031163683413780563
1.4567901234567902 0.3468294244487447 0.37811669051054886 -0.03128726606180415
1.4691358024691357 0.354608607158078 0.3859782557409978 -0.031369648582919796
1.4814814814814814 0.3623226837453402 0.39373370744680214 -0.031411023701461926
1.4938271604938271 0.3699727347290862 0.40138433328202944 -0.03141159855294323
1.5061728395061729 0.3775598139507525 0.4089314075578693 -0.03137159360711678
1.5185185185185186 0.38508494944567784 0.4163761911015432 -0.03129124165586539
1.5308641975308641 0.3925491442788613 0.4237199311408041 -0.0311707868619428
1.5432098765432098 0.39995337734715936 0.4309638612120123 -0.031010483864852945
1.5555555555555556 0.4072986041495241 0.438109201089921 -0.030810596940396895
1.567901234567901 0.41458575752679994 0.44515715673743905 -0.030571399210639116
1.5802469135802468 0.4218157483725102 0.4521089202737667 -0.03029317190125652
1.5925925925925926 0.4289894663159885 0.45896566995941607 -0.029976203643427568
1.6049382716049383 0.43610778037913633 0.46572857019673514 -0.029620789817598803
1.617283950617284 0.44317153960801986 0.4723987715446547 -0.029227231936634845
1.6296296296296295 0.4501815736804515 0.478977410746471 -0.028795837066019514
1.6419753086419753 0.4571386934906477 0.48546561076956063 -0.028326917278912955
1.654320987654321 0.46404369171198856 0.4918644808560069 -0.027820789144018365
1.6666666666666665 0.4708973433388601 0.4981751165831876 -0.027277773244327508
1.6790123456790123 0.477700406208504 0.5043985999334442 -0.026698193724940145
1.691358024691358 0.4844536215037509 0.5105359993720169 -0.026082377868266005
1.7037037037037037 0.491157714237476 0.5165883699324867 -0.025430655695010684
1.7160493827160495 0.4978133937195661 0.5225567533090224 -0.024743359589456282
1.728395061728395 0.5044213540071496 0.5284421779547801 -0.0240208239476305
1.7407407407407407 0.5109822743388057 0.5342456591858514 -0.02326338484704571
1.7530864197530864 0.5174968195534322 0.5399681992901979 -0.022471379736765718
1.765432098765432 0.5239656404944159 0.5456107876410536 -0.02164514714663779
1.7777777777777777 0.5303893743997226 0.5511744008143125 -0.020785026414589902
1.7901234567901234 0.5367686452784888 0.5566600027094534 -0.019891357430964596
1.8024691358024691 0.5431040642746744 0.5620685446735908 -0.018964480398916406
1.8148148148148149 0.5493962300183037 0.5674009656282645 -0.018004735609960743
1.8271604938271604 0.5556457289648011 0.572658192198615 -0.01701246323381389
1.8395061728395061 0.5618531357229026 0.5778411388446169 -0.015988003121714223
1.8518518518518519 0.5680190133715997 0.5829507079940616 -0.01493169462246191
1.8641975308641974 0.5741439137665566 0.5879877901770133 -0.013843876410456701
1.876543209876543 0.580228377836413 0.5929532641614736 -0.012724886325060636
1.8888888888888888 0.5862729358693736 0.5978479970900168 -0.011575061220643224
1.9012345679012346 0.5922781077904635 0.602672844617172 -0.01039473682670844
1.9135802469135803 0.5982444034298112 0.6074286510473481 -0.00918424761753689
1.9259259259259258 0.6041723227823049 0.6121162494731139 -0.007943926690809011
1.9382716049382716 0.6100623562589557 0.6167364619136555 -0.006674105654699836
1.9506172839506173 0.6159149849302782 0.6212900994532535 -0.005375114522975344
1.9629629629629628 0.6217306807619976 0.625777962379633 -0.0040472816176354565
1.9753086419753085 0.627509906843366 0.6302008403220477 -0.0026909334786816563
1.9876543209876543 0.6332531176083677 0.6345595123889765 -0.0013063947806087883
2.0 0.6389607590500753 0.638961 -2.409499246791569e-07

Para N=40
xi yi wi error absoluto
1 0.0 0.02500558426308246 -0.02500558426308246
1.024390243902439 0.022214279177205906 0.02500558426308246 -0.0027913050858765533
1.048780487804878 0.0439058168538083 0.049408793106942205 -0.005502976253133902
1.0731707317073171 0.06509864692433805 0.07321806160802845 -0.008119414683690401
1.0975609756097562 0.08581518296926992 0.09644255927886991 -0.010627376309599992
1.1219512195121952 0.10607636071183058 0.1190920346606882 -0.013015673948857623
1.1463414634146343 0.12590176515489868 0.14117668386336174 -0.015274918708463064
1.170731707317073 0.14530974433347563 0.16270703937210843 -0.0173972950386328
1.1951219512195121 0.16431751133880057 0.18369387603750592 -0.01937636469870535
1.2195121951219512 0.1829412360359403 0.20414813165902207 -0.021206895623081756
1.2439024390243902 0.20119612769956893 0.22408083998136977 -0.022884712281800834
1.2682926829268293 0.21909650962614946 0.2435030742631897 -0.024406564637040246
1.2926829268292683 0.23665588663961662 0.26242589986122944 -0.02577001322161282
1.3170731707317074 0.2538870062876421 0.2808603345103734 -0.026973328222731296
1.3414634146341464 0.2708019144231759 0.29881731517871674 -0.02801540075554082
1.3658536585365852 0.2874120057783205 0.3163076705439857 -0.028895664765665185
1.3902439024390243 0.3037280700623786 0.3333420982783857 -0.02961402821600706
1.4146341463414633 0.31976033405115883 0.3499311464478283 -0.030170812396669466
1.4390243902439024 0.33551850007872663 0.3660851984320725 -0.030566698353345856
1.4634146341463414 0.3510117812944085 0.3818144608576101 -0.030802679563201596
1.4878048780487805 0.36624893400587394 0.3971289541075946 -0.03088002010172064
1.5121951219512195 0.3812382873926003 0.41203850503479955 -0.030800217642199257
1.5365853658536586 0.3959877708421802 0.4265527415562035 -0.03056497071402331
1.5609756097560976 0.410504939134098 0.44068108885273516 -0.030176149718637135
1.5853658536585367 0.4247969956712221 0.4544327669361675 -0.029635771264945432
1.6097560975609757 0.43887081393785765 0.46781678937809945 -0.0289459754402418
1.6341463414634148 0.4527329573443775 0.4808419630242446 -0.028109005679867072
1.6585365853658538 0.46638969760185256 0.4935168885415515 -0.027127190939698953
1.6829268292682928 0.47984703175544674 0.5058499616665915 -0.026002929911144723
1.707317073170732 0.4931106979923699 0.5178493750416715 -0.024738677049301605
1.7317073170731707 0.5061861903286873 0.5295231205406713 -0.02333693021198402
1.7560975609756098 0.5190787722690692 0.5408789920000228 -0.021800219730953585
1.7804878048780488 0.5317934895244816 0.5519245882818541 -0.020131098757372512
1.8048780487804879 0.5443351818647233 0.5626673166063522 -0.01833213474162887
1.829268292682927 0.5567084941754878 0.573114396099088 -0.01640590192360014
1.8536585365853657 0.5689178867831678 0.5832728615065794 -0.014354974723411629
1.8780487804878048 0.5809676451048361 0.5931495670398926 -0.012181921935056517
1.9024390243902438 0.5928618886756466 0.6027511903117464 -0.009889301636099801
1.9268292682926829 0.6046045796012446 0.6120842363375031 -0.0074796567362585
1.951219512195122 0.61619953047858 0.6211550415746939 -0.004955511096113918
1.975609756097561 0.627650411824748 0.6299697779794369 -0.002319366154688862
2.0 0.6389607590500753 0.638961 -2.409499246791569e-07

Para N=20
xi yi wi error absoluto
1 0.0 0.047994097498877335 -0.047994097498877335
1.0476190476190477 0.042884378862134 0.047994097498877335 -0.005109718636743338
1.0952380952380953 0.08386211695255047 0.09375816622507956 -0.009896049272529087
1.1428571428571428 0.12309553637202501 0.13735881419523005 -0.014263277823205037
1.1904761904761905 0.16072707392725671 0.17886970317683146 -0.018142629249574743
1.2380952380952381 0.19688240219326333 0.2183685453832848 -0.021486143190021456
1.2857142857142856 0.2316729612940256 0.2559349334642972 -0.024261972170271595
1.3333333333333333 0.2651980300716356 0.29164877979981074 -0.026450749728175127
1.380952380952381 0.2975464336839099 0.3255892034878811 -0.02804276980397119
1.4285714285714286 0.328797961625805 0.3578337474946597 -0.02903578586885469
1.4761904761904763 0.35902455317502513 0.38845783988321314 -0.02943328670818801
1.5238095238095237 0.3882912945868788 0.4175344356764045 -0.029243141089525748
1.5714285714285714 0.4166572628105038 0.4451337923386791 -0.02847652952817531
1.619047619047619 0.44417624322850185 0.4713233438740947 -0.027147100645592837
1.6666666666666665 0.4708973433388601 0.49616764738046404 -0.025270304041603964
1.7142857142857142 0.49686551997379225 0.5197283824486147 -0.0228628624748225
1.7619047619047619 0.5221220342742122 0.5420643886732461 -0.019942354399033912
1.8095238095238095 0.5467048459832026 0.5632317301923921 -0.016526884209189574
1.8571428571428572 0.5706489565185301 0.5832837789167248 -0.01263482239819469
1.9047619047619047 0.5939867086071302 0.6022713101807299 -0.00828460157359967
1.9523809523809523 0.6167480489187899 0.620242606115486 -0.003494557196696113
2.0 0.6389607590500753 0.638961 -2.409499246791569e-07
El error disminuye a medida que el valor de N aumenta

Ahora graficamos los resultados


Para N=20

Los puntos verdes representan los valores teóricos y los puntos rojos, los valore
numéricos
Para N=40

Para N=80

La solución analítica del problema es:


y ( x ) =52.818 sin ( ln x )

El grafico de esta ecuación para un intervalo de 1 a 2 es:

You might also like