sascha_nrw

5 Reputation

One Badge

14 years, 2 days

MaplePrimes Activity


These are answers submitted by sascha_nrw

I had the same problem.

1. Second order ODE solved numerically using dsolve   
2  I need to integrate the square of this function... over the integral a..b

I found the following (maple 14) may be it works in 13 as well.

 in main block...

ode:=diff(f(zeta),zeta$2)-Tzeta*F(zeta)=0;
ic2 := F(zetamax) = y, D(F)(zetamax) = dy0dx;

dsolinw:=dsolve({odeinw,ic2},numeric,range = a .. b);

 proc block

fint := proc(x)
     local fint ;
     global dsolinw ;
      fint:=rhs( dsolinw(x)[2] );
      fint:=fint*fint;
end proc;

to call ...

MyIntegral:= int ( fint, a..b, numeric =true );

 

may be there is a more elegant solution but I used the same principle as COMMON in fortran...

( "hide" everything if function call does not allow to use more than one variable .. == proc in this case )


Regards,



Page 1 of 1