12.09.2013 Views

Geheugensteuntje - Wiki

Geheugensteuntje - Wiki

Geheugensteuntje - Wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Oefening 3:<br />

Stel: g(x) goed gekonditioneerd<br />

stabiel algo om g(x) te evalueren.<br />

T.B.: g'(x) = (g(x+h) - g(x))/h (met h --> 0 i/d limiet)<br />

is onstabiel algo.<br />

Uitwerking: (k ∈ |N; y = g'(x))<br />

g(x) = g(x)*(1 + k*ε1)<br />

g(x+h) = g(x+h)*(1 + k*ε2)<br />

g'(x) = (g(x+h)(1+kε2) - g(x)(1+kε1))*(1+ε3)*(1+ε4)<br />

h<br />

= [g(x+h) - g(x)]*(1+ε3 + ε4)<br />

h<br />

+ k*[g(x+h)*ε2 - g(x)*ε1](1 + ε3 + ε4)<br />

h<br />

Oefening 4:<br />

|Δsy| = |y*(ε3+ε4)+k*([g(x+h)*ε2-g(x)*ε1]/h)(1+ε3+ ε4)|<br />

≤ |2εmach*y + kεmachy)| ≈ εmach*|(k+2)y|<br />

|δsy| = |(ε3+ε4)+ k*([g(x+h)*ε2-g(x)*ε1]/(h*y))|<br />

≤ 2εmach + k* |[ε2g(x+h) - ε1g(x)]/[h*y]|<br />

≤ 2εmach + k* (|ε2g(x+h)| + |ε1g(x)|)/|h*y|<br />

≤ 2εmach + k*εmach (|g(x+h)| + |g(x)|)/|h*y|<br />

≤ 2εmach + k*εmach (|g(x+h)| + |g(x)|)/|g(x+h)-g(x)|<br />

Instabiel als h --> 0 (|g(x+h)-g(x)| --> 0)<br />

Instabiel als |g'(x)| --> 0 (Noemer = h*g'(x))<br />

Instabiel als g(x) --> 0 (Noemer --> 0)<br />

1) Gevaarlijke aftrekking voor x ≈ 0.<br />

√(x+1) - 1 = [(√(x+1) - 1)(√(x+1) + 1)]/(√(x+1)+1)<br />

= [(x + 1) - 1] / (√(x+1)+1)<br />

= x/(√(x+1)+1)<br />

2) Gevaarlijke aftrekking voor x ≈ y<br />

(sin(x) ≈ sin(y))<br />

Als sin(x) ≈ sin(y), maar x ≠ y, dan:<br />

sin(x) - sin(y) = 2cos((x+y)/2)sin((x-y)/2)<br />

(Sin is een periodische functie, dus bv. x = π en y = 3π<br />

hebben dezelfde sin, maar (x - y) is geen gevaarlijke aftrekking).<br />

Herschrijven zoals hieronder kan, maar matlab geeft dezelfde resultaten voor het<br />

originele algoritme en het herschreven algo.<br />

sin(x) - sin(y) = [sin(x)-sin(y)][sin(x)+sin(y)] [sin(x) + sin(y)]<br />

= sin2(x) - sin2(y) [sin(x) + sin(y)]<br />

= sin2(x) - (1 - cos2(y)) [sin(x) + sin(y)]<br />

= sin2(x) + cos2(y) - 1 [sin(x) + sin(y)]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!