Creating a function?



Could we rename colnew to something more intuitive?  colnew sounds like it
has something to do with new columns (e.g. in a matrix).  I realize that it
is an existing Fortran library, but we don't need to be restricted by IBM
7090 conventions (six BCD characters<http://www.frobenius.com/characters.htm>;
).

If it is important that the name be preserved because people are familiar
with the Fortran package, how about something like netlib_colnew (telling
the user where it came from) or, better, ode_colnew (telling the user what
it does).

But I'd think it would be even better if the name told us that it solves
boundary-value problems for ODEs numerically, e.g. ode_bv_num or something.

             -s

On Wed, Mar 30, 2011 at 10:03, Raymond Toy <toy.raymond at gmail.com> wrote:

>
> I've been working a little with Michel Talon on enhancing colnew.  One
> of the steps is defining a function to return each row of the Jacobian
> of the boundary conditions.
>
> In Michel's example, the boundary conditions are expressed as the
> vector function
>
> g(z) := [z[2] - 2.0d0*z[1]*(v-z[3]-z[4]), z[2] - 2.0d0*z[1]*z[3],
>                z[1] - 1.0d0, z[2] - 2.0d0*z[1]*z[4]];
>
> The function we want is then
>
> dg:jacobian(g(z), [z[1],z[2],z[3],z[4]]);
> dgsub(i, z) := row(dg, i)[1];
>
> However dgsub doesn't work as we need:
>
> dgsub(1, w) -> [-2.0*(-z[4]-z[3]+0.1),1,2.0*z[1],2.0*z[1]]
>
> What is the correct way to define the function dgsub?
>
> I did find that the following definition does what we need:
>
> dgsub(i,z) := ev(row(dg, i)[1]);
>
> dgsub(1,w) -> [-2.0*(-w[4]-w[3]+0.1),1,2.0*w[1],2.0*w[1]]$
>
> dgsub(1,[1,2,3,4]) -> [13.8, 1, 2.0, 2.0]
>
>
> Ray
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>