Re: Integro-differential analog of Love's equation via power series
- To: mathgroup at smc.vnet.net
- Subject: [mg79846] Re: Integro-differential analog of Love's equation via power series
- From: chuck009 <dmilioto at comcast.com>
- Date: Tue, 7 Aug 2007 01:21:57 -0400 (EDT)
I made a mistake posting my code above: The 1 in the equation I'm coding as g[x_]:=1 and then I use g[xs] in the rhs calculations. I've also used this code to solve:
f'[x]=1-1/3x+Integrate[xt f[t],{t,0,1}] with good results, the solution of which is just f[x]=x.
a = -1;
b = 1;
y0 = 1/2;
n = 40;
g[x_] := 1;
xs = N[Table[x, {x, -1, 1, (b - a)/(n - 1)}], 6];
cs = Table[Subscript[c, k], {k, 0, n}];
lhs = cs.Table[(i - 1)*xs^(i - 2), {i, 1, n + 1}];
rhs = g[xs] + (
1/Pi)*cs.Table[NIntegrate[Evaluate[t^i/((xs -
t)^2 + 1)], {t, -1, 1}], {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, -1, 1}]
fd[x_] = D[f[x], x]
Plot[fd[x], {x, -1, 1}]
Plot[1 + (1/Pi)*NIntegrate[f[t]/((x - t)^2 +
1), {t, -1, 1}] - fd[x], {x, -1, 1}, PlotRange -> All];