Old and senile as I am, this looks to me like a problem in calculus of variations.See, e.g., en. wikipedia.org/wiki/Calculus_of_variations. You are not likely to get the solution by guessing that the shape is elliptical, or catenary, or parabolic, etc. I am too old and lazy to try to solve it myself. I would like to see someof you who are smarter and more energetic than I give it a go. I feel reasonably certain that the problem has a closed form solution and that writing that out in J would not be difficult. What would be reallyimpressive would be a numerical method of doing calculus of variations, in J, of course.

On 2/23/2013 4:28 PM, Ric Sherlock wrote:
Kip,
Alternative formulations for your adverb that require fewer calculations of
u y.

Max1 =: 1 : 0

  ((= >./)@:u # ] ,. u) y

)


Max2 =: 1 : 0

  fnres=. u y

  where=. (= >./) fnres

  where # y ,. fnres

)

I'd be interested in a tacit implementation of one of the adverbs Max
above. I came up with the same as Pepe for a simple Max ( >./@: )  but
can't see how to "factor out" the verb area from the adverbs in the
following:
Max3=: (({~ area ((i. >./)@:)) , area (>./@:))

On Sun, Feb 24, 2013 at 9:18 AM, km <k...@math.uh.edu> wrote:

Borrowing ideas from Raul, I like

  Max =: 1 : 0
  max =. >./ u y
  where =. max = u y
  where # y ,. u y
  )

which identifies the max and where it occurs:

     *: Max i:2
  _2 4
   2 4
     (4 - *:) Max i:2
  0 4

Sent from my iPad


On Feb 23, 2013, at 1:04 PM, Jose Mario Quintana <
jose.mario.quint...@gmail.com> wrote:

I did not see your second post!

   area=. ] * 50 - %&2
   area(max=. (>./) @:)  0 to 100
1250
   max
./@:
On Sat, Feb 23, 2013 at 1:46 PM, km <k...@math.uh.edu> wrote:

Can we have an adverb Max so that  f Max y  finds the maximum of  f  on
the list  y  ?

Sent from my iPad


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.2899 / Virus Database: 2641/6125 - Release Date: 02/23/13



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to