- .
> Funny. While it was considered obsolete and superseded by
> FoldList in
> Mathematica 2, Mathematica 1 (!) already did
> have a function Accumulate, defined as
> Accumulate[f, g[e1, e2, e3, ...]] <==> g[e1, f[e1, e2], f[f[e1,
> e2], e3],
> ...]
> so that
> Accumulate[Plus, Range[5]] <==> {1, 3, 6, 10, 15}
> However, Accumulate in Mathematica 1 clearly was not restricted
> to Plus
> but rather specifically intended for dealing
> with functions that take exactly two arguments - so, I believe that
> Accumulate in Mathematica 6 is much less usable
> than the former in Mathematica 1.
> Maybe I'm missing something here - but what was the rationale behind
> re-implementing Accumulate in such a restricted
> version now?
/oskar
> You are missing just one thing - performance. Accumulate in this
> restricted sense is incredibly fast - and extremly useful.
> Andrzej Kozlowski
>
===
Subject: [Q] Nonlinear Fitting in symbolic Integration ..?
I have experiment data and am trying to fit data to convoluted equation.
The equation contains UnitStep and symbolic Integrate function.
I think that these functions have some compolited problems according to
searching
about related problems in archives.
But still, I have no idea whether the problem is in UnitStep, symbolic
Integrate or NonlinearRegress.. -_-.
Does anybody out there have any ideas for this ?
Any help would be appreciated.
I pasted math code.
Hwoarang.
Math Code :
-----------------------------------------------------------------------------
Remove[Global`*];
<< Statistics`NonlinearFit`
k0 = 1; k1 =. ; k2 =. ; tau1 =. ; tau2 =. ;
response[t_, x_] := (UnitStep[t - x]*{k2*(1 - E^(-((t - x)/tau2))) +
(k1*(1 - E^(-((t - x)/tau1))))/E^((t - x)/tau2)})/E^(x^2/(2*0.1^2))
convol[t_] = Integrate[(k0*response[t, x])/(2*Pi*0.1^0.5), {x, -1, 0},
Assumptions -> {{t, k1, k2, tau1, tau2} Á.99 Reals && t > 0
&& tau1 > 0 &&
tau2 > 0 && k1 > 0 && k2 > 0}, GenerateConditions -> False] +
Integrate[(k0*response[t, x])/(2*Pi*0.1^0.5), {x, 0, 20},
Assumptions -> {{t, k1, k2, tau1, tau2} Á.99 Reals && t > 0
&& tau1 > 0 &&
tau2 > 0 && k1 > 0 && k2 > 0}, GenerateConditions -> False]
dat = Import[Reflsmooth.txt, Table];
ListPlot[dat];
NonlinearRegress[dat, convol, t, {{k1, 0.4, 0.35, 0.45},
{k2, 0.04, 0.035, 0.045}, {tau1, 0.35, 0.3, 0.4}, {tau2, 0.25, 0.2, 0.3}},
ShowProgress -> True]
--------------------------------------------------------------------------
Jiwan Kim, Ph. D. Candidate,
Dept. of Physics and Center for Nanospinics of Spintronic Materials,
KAIST 373-1, Guseong-dong, Yuseong-gu, Daejeon, 305-701, Republic of Korea
Tel: +82-42-869-8163
Cel: +82-16-870-7419
Fax: +82-42-869-8162
E-mail: hwoarang@kaist.ac.kr
===
Subject: Help on drawing intervals
How can I visualize the intervals [2n, 2n+1) for n=-10 to 10 in
mathematica? Any help would be much appreciated
===
Subject: Re: get help info into my program
str = Plot::usage
??
Jens
> Hello Mathematica UG:
How can I get the result of the '?' command into my program? When I
> evaluate the following:
?Plot
> %
the result I get is:
{Null}
Is it possible to get the results of the '?' command?
This is not a frivolous question. I use the '?' command during my
> debugging and I want to make my program (which are executed sometimes
> by other people) more robust by checking various things (using '?')
> before and during their execution.
TIA.
>
===
Subject: Re: get help info into my program
> Hello Mathematica UG:
How can I get the result of the '?' command into my program? When I
> evaluate the following:
?Plot
> %
the result I get is:
{Null}
Is it possible to get the results of the '?' command?
This is not a frivolous question. I use the '?' command during my
> debugging and I want to make my program (which are executed sometimes
> by other people) more robust by checking various things (using '?')
> before and during their execution.
>
I don't really understand your question ... but perhaps the alternative
syntax Information[Plot] will help.
Also check Plot::usage
--
Szabolcs
===
Subject: Re: What is the precedence wrt Mathematica infix operators
in The Mathematica Book, Fourth Edition, page 1012
Jens
> Hello Mathematica UG:
I cannot find operator precedence documented anywhere. With the
> operators from Fortran (in the old days) this was always clear, i.e
> '/' before '-'.
I have been reading some code in the Trott Guidebooks which has
> constructions like 'Head @@ face[[i]] / order'. I can guess that Part
> has precedence in this expression, but what about Apply vs. Times?
Looking at the OutputForm shows that Apply has precendence. But,...
- Is this documented somewhere?
> - Do all Mathematica operators take precedence over arithmetic operators?
TIA.
>
===
Subject: Re: What is the precedence wrt Mathematica infix operators
There is an undocumented function, Precedence, which can be useful:
Precedence /@ {Plus, Minus, Times, Power, Apply, Map}
gives the output:
{310., 480., 400., 590., 620., 620.}
I can't remember where I got this info, but it may have been in a
presentation by Kris Carlson.
Tom Dowling
On 10/31/07, congruentialuminaire@yahoo.com