Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Integro-differential analog of Love's equation via power

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79849] Re: Integro-differential analog of Love's equation via power
  • From: chuck009 <dmilioto at comcast.com>
  • Date: Tue, 7 Aug 2007 01:23:31 -0400 (EDT)

Hello Dr. Bob.  Yea, my code had some syntax errors:  I meant to specify the "1" as g[x]=1 and not f[x] which conflicted with the calculations.  I also explicitly define the kernel.

a = -1; 
b = 1; 
y0 = 1/2; 
n = 40; 
g[x_] := 1; 
K[x_, t_] := 1/((x - t)^2 + 1); 

xs = N[Table[x, {x, a, b, (b - a)/(n - 1)}], 6]; 
xs = xs /. x_ /; x == 0 -> 0.0001;

cs = Table[Subscript[c, k], {k, 0, n}];

lhs = cs . Table[(i - 1)*xs^(i - 2), {i, 1, n + 1}]; 

rhs = g[xs] + cs . Table[NIntegrate[Evaluate[K[xs, t]*t^i], {t, a, b}],{i, 0, n}]; 
      
sol = Solve[lhs == rhs /. Subscript[c, 0] -> y0, Drop[cs, 1]];

f[x_] = Sum[Subscript[c, i]*x^i, {i, 0, n}] /. First[sol] /. 
   Subscript[c, 0] -> y0;
   
Plot[f[x],{x,a,b}]   
   
fd[x_] = D[f[x], x]; 

Plot[g[x] + NIntegrate[f[t]*K[x, t], {t, a,b}] - fd[x], {x, a,b},
   PlotRange -> All]; 







> The code below is incomplete or otherwise doesn't
> work (at this machine, 
> anyway). f is undefined when Solve is executed, so f
> appears in "sol".  
> Then, when f[x_] is defined, we get infinite
> recursion.


  • Prev by Date: Re: forming continuous "trail" with Locator
  • Next by Date: Projectile motion
  • Previous by thread: Re: problems with delayed write: tag list
  • Next by thread: Projectile motion