Dear Sir/Madam,
 
I hope you will be fine. Recently, I have started to use R language. I am new 
in programming. 
I have to fit my data with mathematical equation which I am pasting below. The 
problem is that one of the
parameter named "ep" which is x-axis required a loop so that I could a range of 
data. Please see below the code,
 
 
pi<-3.14159; c<-0.5; xc<-2; s<-6; Hc2<-30; H<-1; ep<-0.01; 
f<-function(k) 1.211*10^(-6)*Hc2/H*(trigamma( ((ep + H/Hc2 + (2*xc/s)^2*(1 - 
cos(k*s))/2)/2*Hc2/H)) -  trigamma(((c + H/Hc2 + (2*xc/s)^2*(1 - 
cos(k*s))/2)/2*Hc2/H))); 
integrate(f,-pi/s,pi/s)$value
I have typed in bold the x-axis. If I execute this model, it works well. But, I 
want to make a loop for this parameter inorder to enter a range of values.For 
instance, from 0.01 to 1 with specific interval (increment interval 0.005). I 
will be really grateful if you help me in this matter.  With best Regards, 
Dawood                                     
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to