Hi Jan
Jan private napsal dne 18.09.2010 12:12:29:
> Hello Petr,
>
> thank you for your ideas. The split() looks most realistic.
>
> What about this idea:
>
> 1. Define three functions Refun1, Refun2, Refun3 for the three different
> sections of the calculations (same as you suggested)
> 2.
Hi Jan
r-help-boun...@r-project.org napsal dne 17.09.2010 12:43:40:
> Hello Petr,
>
> > but I think this is how your code really works. Did you try it?
>
> it does, but the R documentation says somewhere:
> "Warning: for() loops are used in R code much less often than in
> compiled languages. C
Hello Petr,
thank you for your ideas. The split() looks most realistic.
What about this idea:
1. Define three functions Refun1, Refun2, Refun3 for the three different
sections of the calculations (same as you suggested)
2. lambda = (Re <= 2320) * Refun1(Re) + ((Re > 2320) && (Re < 65 * dk))
*
Hello Petr,
> but I think this is how your code really works. Did you try it?
it does, but the R documentation says somewhere:
"Warning: for() loops are used in R code much less often than in
compiled languages. Code that takes a `whole object' view is likely to
be both clearer and faster in R."
Hi Jan
Jan private napsal dne 17.09.2010 12:43:40:
> Hello Petr,
>
> > but I think this is how your code really works. Did you try it?
>
> it does, but the R documentation says somewhere:
> "Warning: for() loops are used in R code much less often than in
> compiled languages. Code that takes a
Hi Jan
but I think this is how your code really works. Did you try it?
Regards
Petr
Jan private napsal dne 16.09.2010 13:22:05:
> Hello Petr,
>
> > If you want to get results of your function for a vector of reynolds
and
> > dk you can use function outer and probably get rid of for cycle in
Hello Petr,
> If you want to get results of your function for a vector of reynolds and
> dk you can use function outer and probably get rid of for cycle in the
> function.
>
> outer(c(100, 530,2410), c(10, 150,200),lambda_wall)
> [,1] [,2] [,3]
> [1,] 0.640 0.6400
Hi
I do not want to go too much deep to internals of your function. What do
you suppose to get as the result.
If you want to get results of your function for a vector of reynolds and
dk you can use function outer and probably get rid of for cycle in the
function.
outer(c(100, 530,2410), c(10,
8 matches
Mail list logo