Use an adverb:

   G =: 1 : '^@:(m&*)'
   _2 1 G
^@:(_2 1&*)

--Kip Murray

On Sunday, March 15, 2015, Jon Hough <[email protected]> wrote:

> Kip, Raul,Thanks for replying.
> The matrix way would probably be better.
> As a follow up question, I am having trouble creating an
> adverb/conjunction to build solutions from.
> if I define the conjunction
>
> F =: 2 : '^@:(n&*)'
>
>
> and I give, as my noun argument, the solutions to some polynomial (e.g.
> >1{ p. _2 1 1)
>
> Then I need to do
>
> '' F _2 1
>
>
>
>
> ^@:(_2 1&*) NB. the two solutions (without constants)
>
>
>
>
> Which gives me my verb "solution". Please note that I had to give '' as
> the left argument to F to return my verb.
>
>
> Is there some other way of doing this?
> i.e. I want some "part of speech" (conjunction or adverb I suppose) that
> takes
> a noun and returns a verb.
>
>
> It seems conjunctions take verbs and nouns and return verbs
>
>
> Conj: V x N --> V
>
>
> but since, in my case for F, the verb is superfluous, is there any "part
> of speech" that takes a noun and returns a verb?
>
>
> I hope my question made sense. My motivation is, I don't see why I should
> need to pass an empty verb '' to F to
> return a verb. I only want to give F my noun and from that, I want to get
> a verb.
>
>
> Regards,
> Jon
>
>
>
> > From: [email protected] <javascript:;>
> > Date: Sun, 15 Mar 2015 14:46:35 -0400
> > To: [email protected] <javascript:;>
> > Subject: Re: [Jprogramming] Solving Differential Eqns with J
> >
> > Oops, I should have seen that.
> >
> > Thanks,
> >
> > --
> > Raul
> >
> > On Sun, Mar 15, 2015 at 2:45 PM, Kip Murray <[email protected]
> <javascript:;>> wrote:
> > > Raul, where you have  _1 * y  you need  _2 * y
> > >
> > > --Kip
> > >
> > > On Sunday, March 15, 2015, Raul Miller <[email protected]
> <javascript:;>> wrote:
> > >
> > >> On Sat, Mar 14, 2015 at 7:11 AM, Kip Murray <[email protected]
> <javascript:;>
> > >> <javascript:;>> wrote:
> > >> > I recommend a matrix approach involving eigenvalues and
> eigenvectors,
> > >> > and assume you have a way to find eigenvalues and eigenvectors for
> an n
> > >> by
> > >> > n matrix which has n linearly independent eigenvectors.  I confine
> my
> > >> > attention to linear differential equations with constant
> coefficients and
> > >> > right hand side 0, for example
> > >> >
> > >> > u''' - u'' - 4 u' + 4 u = 0  with initial conditions  u(0) = 2 ,
> u'(0) =
> > >> _1
> > >> > , and u''(0) = 5
> > >> >
> > >> > This has the solution  u(t) =  ( ^ _2 * t ) + ( ^ t )  where I use
> a mix
> > >> of
> > >> > conventional and J notation.
> > >>
> > >> I decided to try converting your notes here to J, and I ran into a
> snag.
> > >>
> > >> First, I tried expressing your initial constraints in J:
> > >>
> > >> constraint=: 1 :0
> > >>   if. 0  = y do.
> > >>     assert. 2 = u y
> > >>     assert. _1 = u D. 1 y
> > >>     assert. 5 = u D. 2 y
> > >>   end.
> > >>   assert. 0= (u D.3 + (_1*u D.2) + (_4 * u D. 1) + 4 * u) y
> > >> )
> > >>
> > >> And then I expressed your solution in J:
> > >>
> > >> solution=:3 :0
> > >>   (^ _1 * y) + ^ y
> > >> )
> > >>
> > >> Or, alternatively:
> > >>
> > >> tacitsolution=: +&^ -
> > >>
> > >> And then I tested my code to see if I had gotten it right:
> > >>
> > >>    solution constraint 0
> > >> |assertion failure
> > >> |   _1=u D.1 y
> > >>
> > >> Looking at this:
> > >>    solution D.1 (0)
> > >> 9.76996e_8
> > >>    tacitsolution D.1 (0)
> > >> 9.76996e_8
> > >>
> > >> working this through manually,
> > >>
> > >> dsolution=: 3 :0
> > >>    (_1 * ^ _1*y) + ^ y
> > >> )
> > >>
> > >>    dsolution 0
> > >> 0
> > >>
> > >> So J's implementation of D. isn't perfect, but I'm wondering if you
> > >> might not also have a typo somewhere in your presentation here?
> > >>
> > >> Thanks,
> > >>
> > >> --
> > >> Raul
> > >> ----------------------------------------------------------------------
> > >> For information about J forums see
> http://www.jsoftware.com/forums.htm
> > >>
> > >
> > >
> > > --
> > > Sent from Gmail Mobile
> > > ----------------------------------------------------------------------
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


-- 
Sent from Gmail Mobile
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to