MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Operations on InterpolatingFunction

  • To: mathgroup at
  • Subject: [mg100889] Re: Operations on InterpolatingFunction
  • From: Alexei Boulbitch <Alexei.Boulbitch at>
  • Date: Wed, 17 Jun 2009 04:45:13 -0400 (EDT)


Solving a simple differential equation:
ifun = First[
   u /. NDSolve[{u''[t] + u[t] == 0, u[0] == 0, u'[0] == 1},
     u, {t, 0, \[Pi]}]]

returns the InterpolationFunction object, as expected. I can integrate  
this function (and obtain another InterpolatingFunction to be plotted,  
etc.) by:

Integrate[ifun[t], t]

1. Why doesn't the following produce an InterpolatingFunction in the same way?

Integrate[ifun[t]^2, t]

2. How can I normalize the solutions found using NDSolve?  
Norm[ifunt[t]] doesn't work...

Thanks for any help.

Dear Porsha,
It seems that the built-in function Norm does not apply to integrals, does it?
Why not to define a norm that you need. Say, you need the Hilbert norm on your interval {0,Pi}:

ifun = First[
  u /. NDSolve[{u''[t] + u[t] == 0, u[0] == 0, u'[0] == 1},
    u, {t, 0, \[Pi]}]];


In[43]:= a = NIntegrate[f[x]^2, {x, 0, Pi}];  (* This is the square of the norm *)

fn[x_] := f[x]/Sqrt[a];                       (* This is the normalized function *)

NIntegrate[fn[x]^2, {x, 0, Pi}]                (* this is control *)

Out[45]= 1.

Have fun and success, Alexei

Alexei Boulbitch, Dr., habil.
Senior Scientist

ZAE Weiergewan
11, rue Edmond Reuter
L-5326 Contern

Phone: +352 2454 2566
Fax:   +352 2454 3566


This e-mail may contain trade secrets or privileged, undisclosed or otherwise confidential information. If you are not the intended recipient and have received this e-mail in error, you are hereby notified that any review, copying or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal from your system. Thank you for your co-operation.

  • Prev by Date: Restrictions for J/Link-ed Programs?
  • Next by Date: Re: erroneous result when adding reals
  • Previous by thread: Re: Operations on InterpolatingFunction
  • Next by thread: Creating Matrix from vectors specific issue.