Student Support Forum: 'Kramers-Kronig Mathematica code' topicStudent Support Forum > General > "Kramers-Kronig Mathematica code"

 Next Comment > Help | Reply To Topic
 Author Comment/Response o_0 04/15/13 4:52pm 'm trying to write Mathematica code to use Kramers-Kronig on a csv file with 2 columns. Column 1 is h(eV). It goes from 0 to 6, in increments of 0.1. Column 2 is alpha (cm^-1). For some reason, my code just outputs a blank graph. Can someone please tell me what's wrong with it? The equation I'm trying to implement is at this URL: snag.gy/JLGfL.jpg Here's a link to the data: 4shared.com/file/YSfGsekq/kk_online.html Here's the code: c = 300000000; data = Import["kk.csv", "CSV"]; column1 = data[[All, 1]]; column2 = data[[All, 2]]; Delete[column1, 1]; Delete[column2, 1]; output[omega_] := 1 + (c PlanckConstant)/(2 pi^2) NIntegrate[column2/(column1^2 - omega^2), {omega, (column1)^2, 0, \[Infinity]}, Method -> "PrincipalValue", Exclusions -> Automatic] Plot[output[omega], {omega, 0, 6}, AxesOrigin -> {0, 0}] URL: ,

 Subject (listing for 'Kramers-Kronig Mathematica code') Author Date Posted Kramers-Kronig Mathematica code o_0 04/15/13 4:52pm Re: Kramers-Kronig Mathematica code Bill Simpson 04/15/13 9:32pm Re: Kramers-Kronig Mathematica code o_0 04/16/13 1:18pm Re: Kramers-Kronig Mathematica code o_0 04/16/13 2:32pm Re: Re: Kramers-Kronig Mathematica code Bill Simpson 04/16/13 7:07pm
 Next Comment > Help | Reply To Topic