From 0f5b5da749901e047f25a86ddb361cfd75f5fadc Mon Sep 17 00:00:00 2001 From: sakul-45 <81963567+sakul-45@users.noreply.github.com> Date: Tue, 3 Aug 2021 14:12:08 +0200 Subject: [PATCH] What I already have --- NMRpurity.m | 33 +++++++++++++++++++++++++++++++++ README.md | 3 ++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 NMRpurity.m diff --git a/NMRpurity.m b/NMRpurity.m new file mode 100644 index 0000000..d70e2b1 --- /dev/null +++ b/NMRpurity.m @@ -0,0 +1,33 @@ +%Funktion zur Berechnung von Verunreinigungen in NMRs +function[] = NMRpurity(M_Prod) + +%Aceton +acetone = input('Integration Aceton: '); +impurities(1) = 58.08 * acetone / 6; + +%Et2O +ether = input('Integration Et_2O: '); +impurities(2) = 74.12 * ether / 10; + +%EtOAc +etoac = input('Integration EtOAc: '); +impurities(3) = 88.11 * etoac / 8; + +%H2O +water = input('Integration Wasser: '); +impurities(4) = 18.01 * water / 2; + +n = input('Anzahl weiterer Verunreinigungen: '); +if n == 0 +else + for i=1:n + M = input('Molare Masse: '); + H = input('Anzahl H-Atome: '); + I = input('Integration: '); + impurities(4+i) = M * I / H; + end +end +purity = (M_Prod / (M_Prod + sum(impurities)))*100; +output = ['Reinheit = ',num2str(purity),' %']; +disp(output); +end \ No newline at end of file diff --git a/README.md b/README.md index 8e5730b..b86fdbf 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# nmr-purity-calculator +# NMR purity calculator +MATLAB function for calculating the purity of your product. \ No newline at end of file