started Task 4
This commit is contained in:
		
							parent
							
								
									e108ba6f08
								
							
						
					
					
						commit
						bed9e0c562
					
				| 
						 | 
					@ -5,6 +5,9 @@ import math
 | 
				
			||||||
def h1(x):
 | 
					def h1(x):
 | 
				
			||||||
    return math.sqrt(100 * math.pow(x,2) - 200 * x + 99)
 | 
					    return math.sqrt(100 * math.pow(x,2) - 200 * x + 99)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def h1_diff(x):
 | 
				
			||||||
 | 
					    return (200 * math.pow(x, 2) - 300 * x + 99)/(math.sqrt(100 * math.pow(x, 2) - 200 * x + 99))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def h2(x):
 | 
					def h2(x):
 | 
				
			||||||
    return math.sqrt((10 * x - 9) * (10 * x - 11))
 | 
					    return math.sqrt((10 * x - 9) * (10 * x - 11))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,11 +22,11 @@ y2 = [h2(x_val) for x_val in x]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
plt.plot(x, y1, label='h1(x)')
 | 
					plt.plot(x, y1, label='h1(x)')
 | 
				
			||||||
plt.plot(x, y2, label='h2(x)')
 | 
					plt.plot(x, y2, label='h2(x)')
 | 
				
			||||||
plt.xscale('log', base=10)
 | 
					plt.yscale('log', base=10)
 | 
				
			||||||
plt.legend()
 | 
					plt.legend()
 | 
				
			||||||
plt.show()
 | 
					plt.show()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Aufgabe 4a)
 | 
					# Aufgabe 4a)
 | 
				
			||||||
# Da die Operation nicht gut konditioniert ist, erhält man für den Ausdruck inder Wurzel
 | 
					# Da die Operation nicht gut konditioniert ist, erhält man für den Ausdruck inder Wurzel
 | 
				
			||||||
# bei x = 1.1, -1.4e-14
 | 
					# bei x = 1.1, -1.4e-14 => ein kleiner Rundungsfehler
 | 
				
			||||||
# Somit kann die Wurzel für diesen x Werte nicht berechnet werden.
 | 
					# Somit kann die Wurzel für diesen x Werte nicht berechnet werden.
 | 
				
			||||||
		Loading…
	
		Reference in New Issue