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

 < Previous Comment | Next Comment > Help | Reply To Comment | Reply To Topic
 Author Comment/Response o_0 04/16/13 1:18pm Thanks for your response. (* Can't see your data without signing up, so make up some data *) -sorry, I didn't realize that. I've attached the data here. Also, this version of the code should take care of some of the little issues, but I still need to troubleshoot further. (note: I'm trying to integrate over omega. ) c = 300000000; data = Import[ "kk.csv", "CSV"]; column1 = data[[2 ;; -1, 1]]; column2 = data[[2 ;; -1, 2]]; output[omega_] := 1 + (c PlanckConstant)/(2 Pi^2) NIntegrate[ column2/(omega^2 - column1^2), {omega, (column1)^2, 0, \[Infinity]}, Method -> "PrincipalValue", Exclusions -> {(column1^2 - omega^2) == 0}] Plot[output[omega], {omega, 0, 6}, AxesOrigin -> {0, 0}] I also tried this: << NumericalMath`CauchyPrincipalValue` output[omega_] := 1 + (c PlanckConstant)/(2 Pi^2) CauchyPrincipalValue[ column2/(column1^2 - omega^2), {omega, 0, {(column1)^2}, \[Infinity]}] but that also gives a blank graph, along with the message that CauchyPrincipalValue is an obsolete package. Attachment: kk.csv, 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
 < Previous Comment | Next Comment > Help | Reply To Comment | Reply To Topic