diff --git a/Formeln.py b/Formeln.py index c02668f..acef9c7 100644 --- a/Formeln.py +++ b/Formeln.py @@ -3,24 +3,38 @@ import Klassen as k konstante_eins = k.Groesse(None, None, True, 1) Formeln = [k.Formel('Kraftformel', i=k.Groesse('F', 'N', False), a=k.Groesse('m', 'kg', False), - b=k.Groesse('a', 'm/s²', False), z=k.Groesse(None, None, True, 1), y=k.Groesse(None, None, True, 1), - x=k.Groesse(None, None, True, 1)), + b=k.Groesse('a', 'm/s²', False), c=konstante_eins, z=konstante_eins, + y=konstante_eins, x=konstante_eins), k.Formel('Gleichm. beschl. Bew.', i=k.Groesse('s', 'm', False), a=k.Groesse(None, None, True, 0.5), b=('a', 'm/s^2', False), c=k.Groesse('t', 's', False), z=konstante_eins, x=konstante_eins, y=k.Groesse(None, None, True, 2)), k.Formel('Gewichtskraft', i=k.Groesse('Fg', 'N',False), a=k.Groesse(None,None,True,9.81),b=('h','m',False), - z=konstante_eins,y=konstante_eins,x=konstante_eins), + c=konstante_eins, z=konstante_eins,y=konstante_eins,x=konstante_eins), k.Formel('Spannenergie', i=k.Groesse('Espann','J', False), a=k.Groesse(None, None, True, 0.5), b=k.Groesse('D', 'N/m', False), c=k.Groesse('s', 'm', False), x=konstante_eins, y=konstante_eins, z=k.Groesse(None, None, True, 2)), - k.Formel('Potentielle Energie' , i=k.Groesse('Epot','J',False),b=k.Groesse('m','kg', False), - c=k.Groesse('Höhe','m',False), z=konstante_eins,y=konstante_eins,x=konstante_eins), + k.Formel('Potentielle Energie' , i=k.Groesse('Epot','J',False),a=k.Groesse('m','kg', False), + b=k.Groesse(None, None, True, 9.81), c=k.Groesse('h','m',False), z=konstante_eins, + y=konstante_eins,x=konstante_eins), k.Formel('Kinetische Energie',i=k.Groesse('Ekin','J', False), a=k.Groesse(None, None, True, 0.5), b=('m', 'kg', False), c=('v', 'm/s', False), z=konstante_eins, x=konstante_eins, y=k.Groesse(None, None, True, 2)), k.Formel('Elektrische Leistung', i=k.Groesse('P', 'W', False), a=k.Groesse('U', 'V', False), b=k.Groesse('I','A', False), c=konstante_eins, z=konstante_eins, x=konstante_eins, y=konstante_eins), k.Formel("Geschwindigkeit", i=k.Groesse ('v', 'm/s',False), a=k.Groesse('s', 'm', False), - b=k.Groesse ('t','s', False), z= konstante_eins, y= konstante_eins, x=k.Groesse(None,None,True,-1)) + b=k.Groesse ('t','s', False), z= konstante_eins, y= konstante_eins, x=k.Groesse(None,None,True,-1)), + + k.Formel('Wiederstand', i=k.Groesse('R', 'Ohm', False), a=k.Groesse('U', 'V', False), + b=k.Groesse('I', 'A', False), c=konstante_eins, z=konstante_eins, y=k.Groesse(None, None, True, -1), + x=konstante_eins), + k.Formel('Impuls', i=k.Groesse('p', 'N*s', False), a=k.Groesse('m', 'kg', False), + b=k.Groesse('v', 'm/s', False), c=konstante_eins, z=konstante_eins, y=konstante_eins, + x=konstante_eins) ] + +def looper(geg, ges): + for formel in Formeln: + temp_is_solvable = formel.is_solvable(geg, ges) + if temp_is_solvable[0]: + formel.solve(temp_is_solvable[1]) \ No newline at end of file diff --git a/Main.py b/Main.py new file mode 100644 index 0000000..e69de29 diff --git a/user-IO.py b/user-IO.py new file mode 100644 index 0000000..e69de29