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.