November 1997  ICTCM X (Chicago)  4

Customized symbolic BVP solver: BVPsolve

> BVPsolve := proc( BVP::set(equation), FN::function )
> local ODE, BC, gSOL, Y, DVAR, IVAR, CONST, cSOL;
> ODE := select( has, BVP, diff );
> BC := BVP minus ODE;
> DVAR, IVAR := op(0,FN), op(1,FN);
> gSOL := dsolve( ODE, FN );
> if gSOL=NULL then
>  RETURN( "No general solution found" )
> fi;
> if nops([gSOL])>1 then
>  RETURN( "Nonunique general solution found" )
> fi;
> CONST := indets(gSOL,name) minus {IVAR};
> Y := unapply( rhs( gSOL ), IVAR );
> cSOL := solve( eval( subs( DVAR=Y, BC ) ), CONST );
> if cSOL=NULL then
>  RETURN( "No particular solution satisfies all BCs" )
> fi;
> subs( cSOL, gSOL );
> end: