Original file(SVG file, nominally 378 × 288 pixels, file size: 39 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary edit

Description
Deutsch: Fit einer parabolischen Funktion
Date
Source Own work, Neufassung und Zusammenfassung von File:Scatterplot1.png und File:AlterGewicht.png vom Benutzer Philipendula
Author Christian Schirm
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Python code

# This source code is public domain

import numpy
import matplotlib.pyplot as plt

#Alter von(yr); bis(yr); Groesse(m); Gewicht(kg)
stat="""0; 1; 0.67; 7.7
1; 2; 0.83; 11.9
2; 3; 0.93; 14.4
3; 4; 1.01; 16.6
4; 5; 1.08; 18.7
5; 6; 1.15; 21.0
6; 7; 1.22; 23.9
7; 8; 1.27; 27.0
8; 9; 1.33; 30.4
9; 10; 1.39; 34.1
10; 11; 1.44; 37.8
11; 12; 1.50; 42.6
12; 13; 1.56; 47.5
13; 14; 1.63; 53.5
14; 15; 1.70; 59.9
15; 16; 1.75; 65.8
16; 17; 1.78; 69.8
17; 18; 1.80; 72.9
18; 20; 1.81; 75.5
20; 25; 1.81; 78.0
25; 30; 1.80; 80.7
30; 35; 1.80; 83.4
35; 40; 1.80; 84.8
40; 45; 1.80; 85.1
45; 50; 1.79; 85.7
50; 55; 1.78; 85.8
55; 60; 1.77; 85.9
60; 65; 1.76; 85.2
65; 70; 1.76; 84.4
70; 75; 1.74; 83.3
75; 80; 1.73; 79.0""".split('\n') #Daten von 2009

gewicht = [list(map(float,i.split(';'))) for i in stat]
x = [(i[1]+i[0])*0.5 for i in gewicht[18:-1]]
y = [i[3] for i in gewicht[18:-1]]

N = 3
A = numpy.zeros((N,N))
for i in range(N):
    for j in range(N):
        A[i,j] = sum(xi**(i+j) for xi in x)
b = numpy.zeros((N))
for i in range(N):
    b[i] = sum(xi**(i)*yi for xi,yi in zip(x,y))
c = numpy.linalg.solve(A, b)
xneu = numpy.sort(numpy.linspace(17, 74.5, num=50).tolist() + x)
yneu = numpy.sum([c[i]*xneu**i for i in range(len(c))],axis=0)

fig = plt.figure(figsize=(4.2, 3.2))
y1, = plt.plot(x,y,'o',label='Messpunkte')
y2, = plt.plot(xneu,yneu,'r-',label='Modellfunktion')
plt.xlabel('x (Alter in Jahren)')
plt.ylabel('y (Gewicht in kg)')
order = y1,y2
plt.legend(order,[p.get_label() for p in order],frameon=True, loc='lower right')
plt.grid(True, alpha=0.7)
plt.tight_layout()
plt.savefig('MDKQ3.svg')

Licensing edit

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current12:06, 23 May 2021Thumbnail for version as of 12:06, 23 May 2021378 × 288 (39 KB)Physikinger (talk | contribs)New Matplotlib version
18:58, 2 February 2011Thumbnail for version as of 18:58, 2 February 2011405 × 315 (50 KB)PhysikingerC (talk | contribs)Text Problem
18:40, 2 February 2011Thumbnail for version as of 18:40, 2 February 2011405 × 315 (48 KB)PhysikingerC (talk | contribs)Text als Text, nicht als Kurven
22:30, 1 February 2011Thumbnail for version as of 22:30, 1 February 2011361 × 264 (49 KB)PhysikingerC (talk | contribs){{Information |Description ={{de|1=Fit einer parabolischen Funktion}} |Source ={{own}} |Author =Christian Schirm |Date =2011-02-01 |Permission = |other_versions = }}

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata