Displaying 20 results from an estimated 231 matches for "conc".
Did you mean:
xconc
2010 Apr 26
1
finite difference scheme for 2D differential equations
...But I want to write a similar code for,say, a two dimensional
diffusion equation. Any kind of help/advice is highly appreciated.
Here is how I did for the 1D equation (in this case for 1D diffusion)
Equation: dc/dt = D*d^2c/dx^2
dx = 10
dt = 0.1
D = 15
n = 20
tstep = 200
C = 50
dt = 0.1
dx = 10
conc<-matrix(0,tstep,n)
conc[1,1:10] = C
for (i in 2:tstep) {
for (j in 1:n){
if (j==1){
conc[i,j] = conc[i-1,j] - dt*(D/dx^2)*(conc[i-1,j] - conc[i-1,j+1])
}
conc[i,j] = conc[i,j]
if(j >1 && j < n){
conc[i,j] = conc[i-1,j] + dt*(D/dx^2)* (conc[i-1,(j-1)] - 2*conc[i-1,j] +
conc[i-1,(j...
2005 Oct 11
2
Problems with plot function
Hello all R users,
My simulation function works correctly, but I have problems with plot
function. You will find the following code using it.
Thank you for your help
##################################################"
simulation <- function(k, n){
conc <- seq(0,10,by=0.5)
#choixg <- seq(1, length(conc))
choixg <- rep(0,length(conc))
for (i in 1:length(conc)){
choixg[i] <- (k + conc[i])^2/((k+conc[i])^n + (k+1)^n)
}
return(choixg)
}
simulation(5,1)
plot(conc, choixg, main ="fonction de choix", col= "blue&qu...
2005 Oct 13
1
problems with loop and plot function
Hi all R users,
I have problems with my second loop for drawing the three curves in the
same graphic. I need help please
Thank you in advance
#########################################################################
simulation <- function(k, n){
conc <- seq(0,100,by=0.5)
#choixg <- seq(1, length(conc))
choixg <- rep(0,length(conc))
for (i in 1:length(conc)){
choixg[i] <- (k + conc[i])^n/((k+conc[i])^n + (k+1)^n)
}
#return(data.frame(choixg, conc))
return(list(choixg=choixg, conc = conc))
}
#cbind(simResult$conc, simRe...
2005 Apr 19
3
Help with predict.lm
Hi
I have measured the UV absorbance (abs) of 10 solutions of a substance at
known concentrations (conc) and have used a linear model to plot a
calibration graph with confidence limits. I now want to predict the
concentration of solutions with UV absorbance results given in the new.abs
data.frame, however predict.lm only appears to work for new "conc" variables
not new &qu...
2023 Oct 24
2
How to Calculate the Mean by Multiple Groups in R
Hi,
I think you're misunderstanding which set of variables go on either
side of the formula.
Is this what you're looking for?
> aggregate(OD ~ Time + Target + Conc, data = df, FUN = "mean")
Time Target Conc OD
1 1 BACT 1 765.3333
2 1 BACT 2 745.3333
3 1 BACT 3 675.0000
> aggregate(ODnorm ~ Time + Target + Conc, data = df, FUN = "mean")
Time Target Conc ODnorm
1 1 BACT 1 108.33333
2 1 BAC...
2007 Jul 16
5
formula(CO2)
The formula attribute of the builtin CO2 dataset seems a bit strange:
> formula(CO2)
Plant ~ Type + Treatment + conc + uptake
What is one supposed to do with that? Certainly its not suitable for
input to lm and none of the examples in ?CO2 use the above.
2008 Nov 11
2
strsplit (regex)
#how do I break these up into first two letters (RM), number, and then
the last part
#is there an easily accessible regex tutorial on the internet?
v = (structure(1:122, .Label = c("RM215Temp", "RM215SpCond", "RM215DO.Conc",
"RM215Depth", "RM215pH", "RM215ORP", "RM215Turbidity.", "RM215Battery",
"RM215DO.", "SCTemp", "SCSpCond", "SCDO.Conc", "SCDepth", "SCpH",
"SCORP", "SCTurbidity.",...
2012 Aug 07
2
Passing arguments to a function within a function ...
...table to each pollutant.
I have functions that work on their own but when is have to use the
one within the other, I don't know how to specify its arguments
Here are example data and the functions:
########################################################
## Example data frame with population, concentration and cases ##
x = data.frame(Name = LETTERS[1:10],
pop=sample(x=1000:10000,size=10),
Xbabies = 0.106,
Xkids = 0.232,
Xteens = 0.375,
Xadults = 0.235,
Xaged = 0.52,
cases = sample(x=100:...
2006 Jul 18
2
Using corStruct in nlme
...fit corCAR1, corGaus and corExp correlation structures to my data. I either
get the error "step halving reduced below minimum in pnls step" or
alternatively R crashes.
My dataset is similar to the CO2 example in the nlme package. The one major
difference is that in my case the 'conc' steps are not the same for each 'Plant'. I have replicated the problem using the CO2 data in nlme (based off of the Ch08.R script).
This works (when 'conc' is the same for each 'Plant':
(fm1CO2.lis <- nlsList(SSasympOff, CO2))
(fm1CO2.nlme <- nlme(fm1CO2.lis, co...
2012 Nov 09
9
lm function - strange error
I am following a document teaching how to use regression and right at the
onset I get an R error. I understand that variables "conc" and "signal"
should have the same length but I am using the what R manual suggests to
drop the error and it is not cooperating. What gives? The manual says
that the default is na.ombit by the way, not that it's addition does
anything
How do I make it omit the extra items?...
2023 Oct 24
1
How to Calculate the Mean by Multiple Groups in R
Also,
> aggregate(cbind(OD, ODnorm) ~ Time + Target + Conc, data = df, FUN = "mean")
Time Target Conc OD ODnorm
1 1 BACT 1 765.3333 108.33333
2 1 BACT 2 745.3333 88.33333
3 1 BACT 3 675.0000 18.00000
(You might wish for "cbind(OD,ODnorm) ~ . - Well", but aggregate.formula is not smart enough for tha...
2004 Aug 16
2
using nls to fit a four parameter logistic model
...I am working on what appears to be a fairly simple problem for the
following data
test=data.frame(cbind(conc=c(25000, 12500, 6250, 3125, 1513, 781, 391,
195, 97.7, 48.4, 24, 12, 6, 3, 1.5, 0.001),
il10=c(330269, 216875, 104613, 51372, 26842, 13256, 7255, 3049, 1849, 743,
480, 255, 241, 128, 103, 50)))
> test
conc il10
1 25000.000 330269
2 12500.000 216875
3 6250.000 104613
4 3125.000...
2005 Sep 14
1
Long lines with Sweave
I have used Sweave a lot the latest year, but never really used any long
function calls.
If I have code which look like this
-------------------------------------------------------------
gof <- benthic.flux(ID="Gulf of Finland",
meas.conc=conc,
bw.conc=bw.conc,
time=times,
substance=expression(DIC~(mmol~m^{-3}))
)
-------------------------------------------------------------
I get the output by Sweave in my pdf file, like this:
--------------------...
2023 Oct 24
2
How to Calculate the Mean by Multiple Groups in R
Hello,
I have a data frame with different groups (Time, Target, Conc) and
each entry has a triplicate value of the measurements OD and ODnorm.
How can I merge the triplicates into a single mean value?
I tried the following:
```
df = data.frame(Time=rep(1, 9), Well=paste("A", 1:9, sep=""),
OD=c(666, 815, 815, 702, 739, 795, 657, 70...
2023 Jul 02
0
How to plot both lines and points by group on ggplot2
Thank you that is exactly it!
The problem was to connect each point of the series 'Conc' with a line.
Best regards
Luigi
On Sat, Jul 1, 2023 at 8:33?PM Chris Evans <chrishold at psyctc.org> wrote:
>
>
> On 01/07/2023 19:20, Luigi Marongiu wrote:
> > Hello,
> > I have a dataframe with measurements stratified by the concentration
> > of a certain su...
2003 Oct 30
2
'nls' and its arguments
...ike to supply every parameter in the formula.
To illustrate this, let's look at the last example of 'nls' help
page:
## weighted nonlinear regression
data(Puromycin)
Treated <- Puromycin[Puromycin$state == "treated", ]
weighted.MM <- function(resp, conc, Vm, K)
{
## Purpose: exactly as white book p.451 -- RHS for nls()
## Weighted version of Michaelis-Menten model
## ---------------------------------------------------------------
## Arguments: `y', `x' and the two parameters (see book)
## ------...
2009 Sep 03
2
dividing a dataframe column by different constants
Dear R users, today I've got the following problem.
Here you are a dataframe as example.
There are some SAMPLES for which a CONCentration was recorded through TIME.
The time during which the concentration was recorded is not always the same,
10 points for Sample A, 7 points for Sample B and 11 for sample C
Also the initial concentration was not the same for the three samples.
I would like express the concentrations as % of...
2009 Dec 18
2
NLS-Weibull-ERROR
...as the initial inputs to NLS.
I tried multiple times but still i m getting the same error of Error in
nlsModel(formula, mf, start, wts) :
singular gradient matrix at initial parameter estimates.
The Program is as below
> vel <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14)
> df <- data.frame(conc, vel)
> df
conc vel
1 0.077 1
2 0.328 2
3 0.882 3
4 1.195 4
5 1.884 5
6 3.577 6
7 6.549 7
8 13.000 8
9 33.690 9
10 52.220 10
11 90.140 11
12 166.050 12
13 233.620 13
14 346.890 14
> plot(df$vel, df$conc)
> para0.st <- c(K=450,
+...
2012 Mar 27
4
Help on predict.lm
...ble. I'm
trying to use “lm“ to first estimate parameter values from a set of
calibration measurements, and then later to use those estimates to calculate
another set of values with “predict.lm”.
First I have a calibration dataset of absorbance values measured from
standard solutions with known concentration of Bromide:
> stds
abs conc
1 -0.0021 0
2 0.1003 200
3 0.2395 500
4 0.3293 800
On this small calibration series, I perform a linear regression to find the
parameter estimates of the relationship between absorbance (abs) and
concentration (conc):
> linear1 <- lm(a...
2007 Jun 04
0
nls problems
...ages but not core R like 'stats'.
#####################
##
## SLIGHT MODIFICATIONS TO CURRENT EXAMPLES
## THAT DON'T WORK (except with my modifications)
##
# Weighted Michaelis-Menten model
# with data = a list that can not be coerced to a data.frame
TreatIrreg <- with(Treated, list(conc1=conc[1], conc.1=conc[-1], rate=rate))
# Passing arguments using a list that can not be coerced to a data.frame
weighted.MM1 <- function(resp, conc1, conc.1, Vm, K){
conc <- c(conc1, conc.1)
resp <- TI$rate
#
pred <- (Vm * conc)/(K + conc)
(resp - pred) / sqrt(pred)
}
Pur.wt1 &...