# Tag Info

19

Let me show how to roll your own numerical solution to a non-linear integral equation using a collocation method. It's fun! This will involve two approximations. First, we will approximate the function B[x] by its values at n particular points in the range {x, 0, 1}. The integral over x will be replaced by a weighted sum over n, i.e., a quadrature rule. ...

11

If you want to solve the Fredholm equation of the second kind which is an integral equation of the form $$f(x) - \lambda\int_{a}^{b} K(x,y)f(y)dy = g(x), \quad \forall x \in [a, b]$$ you can use the following code. We follow the simplistic source. One can make it much better by considering further implementation aspects as well as injecting more state of ...

11

Mathematica is an incredible tool for checking conjectures and making sketches. I'm going to demonstrate it below. Let's start with checking that in case when $R_0$ (I replaced it with $R$) is a polynomial, the solution of this Volterra equation reduces to linear ODE. Lets take some derivatives of the equation: ClearAll[P, R, s, t]; eqn = P[t] == R[t] + ...

11

I am not interested in the closed form solution of M(T) - and that's a great pity, since your equation can be solved exactly by using Laplace transform - for the numbers you have, and in the general case you can go a long way using the same approach. Analytical solution Applying Laplace transform to both sides of your equation, $\int_{0}^{\infty}e^{-p ... 10 If what you really want is to find all natural numbers$a$and$b$on the surface for a given$n$, a search among the divisors of$2n$will do it efficiently even for sizable values of$a$and$b$. To do this, we find all divisors$k$of$2n$(Divisors), then all divisors of the quotient$2n/k$(Divisors again), forming triples$(u,v,w)$for which$uvw=2n$... 10 This is not an answer, but a hint how to possibly proceed. It is a pity to pass on some nice Wolfram Language abilities. Let me know if I should remove it. Idea is: I think YOU should be the first to derive this integral - if it is possible. Consider only rational numbers. If this integral behaves smoothly - which it obviously does: ... 10 In Version 9 currently, we can do (using the Undocumented form of Integrate): Integrate[Boole[z >= 0] z, {x, y, z} ∈ Sphere[{0, 0, 0}, 4]] 64 Pi Note: This is undocumented behaviour and functionality may change or behave differently in newer versions of Mathematica so use with caution e.g. as noted by Szabolcs in the comment, Sphere in V10 ... 9 Something similar showed up on StackExchange a while back (last August). http://stackoverflow.com/questions/6974929/how-can-i-reference-a-specific-point-of-my-function-inside-ndsolve Here is a variant from one response that I cobbled together to illustrate your case. I chose the kernel function (your R_0) to be e^(-x) + x sin(x) - x cos(x^2). I attempt to ... 9 There are many sources that give practical advice on how to program such an integral equation. So I went a different route and asked myself how to get a solution by using the most literal application of the defining equation. By that I mean no explicit discretization, keeping the integral. That can be done using the assumption that the fixed-point theorem ... 7 Using your definitions (using the placeholder pattern f1[y_] instead of the absolute pattern f1[y] is usually a good idea if you want to use it as a function that works with numerical values, too. Also using := (SetDelayed) instead of = (Set) inserts the left hand side value y into the definition every time you use it, which is closer to the behavior you ... 7 Since you explicitly asked for a way to do this integral in spherical coordinates, here is a formulation that works in all versions of Mathematica. First I define the spherical coordinates, and then I do the triple integral using the Jacobi determinant: {x, y, z} = r {Cos[ϕ] Sin[θ], Sin[ϕ] Sin[θ], Cos[θ]}; Integrate[ z Abs[Det[D[{x, y, z}, {{r, θ, ... 6 Your s lives on the ray [1,infinity). Integrate can kinda figure out s is real. Tell it about the other variables and then we'll proceed from there. i1 = Integrate[(-(Cos[b*s] - (2*Sin[b*s]*(a*d - b*c))/(a^2 + b^2))/ E^(a*s))^2, {s, 1, \[Infinity]}, Assumptions -> {Element[{b, c, d}, Reals], a > 0}] (* Out[152]= 1/4 (1/a + 1/(2 a - 2 I b) + ... 6 This might help you get started. I think this is a variation on a method called Frobenius' method; the idea is to use the fact that the equation is linear to expand the solution over a set of basis functions (here B-Splines) and find the corresponding coefficients. It should provide you with an approximate solution (which you can improve upon while adding ... 6 The integral is conditionally convergent. You can progress using substitution:$u=2^{\frac{r}{b}}\iff r= b\log_2 u $Hence,$\frac{dr}{du}=\frac{b}{u\ln 2}$You can do these substitutions in Mathematica: f[r_, b_, la_, k_] := 2^(r/b) Exp[k (2^(r/b) - 1)/la]/(b la) exp = f[x, a1, a2, a3] /. {2^(x/a1) -> u}; ex = D[a1 Log[2, u], u]; ans = Integrate[a1 ... 6 Here I define the expression and integrate it term by term using Distribute. Then I differentiate each term but with a Defer wrapping it, so the derivatives aren't actually carried out. FInally, I replace the terms that weren't integrated by the original function: expression = -Sin[t] + g[t] (* ==> g[t] - Sin[t] *) integrals = ... 6 The more natural way to express this problem is Integrate[Boole[x^2 + y^2 + z^2 <= 16] z, {x, -4, 4}, {y, -4, 4}, {z, 0, 4}] (* ==> 64 Pi *) This works in version 9 and earlier. In version 10 we can get fancy and do Integrate[Boole[z >= 0] z, {x, y, z} ∈ Ball[{0, 0, 0}, 4]] (* ==> 64 Pi *) 5 Here is a series-expansion way of doing your integral. Expand the integrand as Sum[(-1)^n Sin[θ/2]^(n β), {n, 0, ∞}] (* 1/(1+Sin[θ/2]^β) *) Integrate each term in the sum using Integrate[Sin[θ/2]^(n β), {θ, 0, π}] (* ConditionalExpression[(Sqrt[π] Gamma[1/2 (1 + n β)])/Gamma[1 + (n β)/2], Re[n β] > -1] *) Fold it all together to obtain ... 5 Since OP seems to be interested in numerical calculations, this might be more suitable: f0[x_]:= 1/Sqrt[2*Pi*1^2]*E^(-(x + 1)^2/(2*1^2)) q[1, A_, B_, f_] := f q[n_ /; n > 1, A_, B_, f_][x_] := Module[{ω},tempIntegrate[Evaluate[q[n - 1, A, B, f]][ω] f[x - ω], {ω, A, B}]] p[n_, A_, B_, f_] := tempIntegrate[q[n, A, B, f][x], {x, -∞, B}] + ... 5 I found a good solution. The new version of Mathematica is using the symbolic processing, so we can just turn it off. b[i_] := NIntegrate[(Sin[x] - 1) x^i, {x,-5,5}, Method->{Automatic,"SymbolicProcessing"->0}] source: Techniques for Accelerating NIntegrate Evaluations http://support.wolfram.com/kb/3442 5 Compute the indefinite integral instead. b[i_] := b[i] = Integrate[(Sin[x] - 1) x^i, x] Timing@N[Sum[(b@i /. x -> 5) - (b@i /. x -> -5), {i, 30}], 8] (* {0.359375, -3.7741840*10^20} *) 5 Not knowing what the actual differential equation is, I can only point out one obvious problem: you should define Clear[r,f,y]; M1[r_] = Integrate[(1 + f*Exp[-(r/y)^2])*(r)^2, r] instead of using := NIntegrate because you seem to be looking for an indefinite integral there. For numerical integration you have to specify integration limits. The Clear is ... 5 Clear["Global`*"] expr = y^2 - 2 x^2 y + 6 x^3 - 3*x*y + 2 y - 6; Integrate[ expr Boole[y >= 2*x^2 - 2 && y <= 3*x], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}] -(36625/2688) Reduce[y >= 2*x^2 - 2 && y <= 3*x, y] (x == -(1/2) && y == -(3/2)) || (-(1/2) < x < 2 && -2 + 2 x^2 ... 4 I was not going to post this because in a previous edit (now gone) you showed a very difficult problem. Anyway, the current question could be answered as follows: You want to find f[x] satisfying f[x] == Integrate[f[x] g[x], x] for a known g[x]. Differentiating: f'[x] == g[x] f[x] So for example g[x_] := Sin@x^2; fs = DSolve[f'[x] == g[x] ... 4 For the scalar case: Set up a function, h, depending on EFermi, and use FindRoot to solve h[EFermi]==c Clear[g, f, h]; g[x_] = Exp[-x^2/5000]; f[x_, EFermi_] = (1 + Exp[(x - EFermi)/25])^-1; h[EFermi_?NumericQ] := NIntegrate[g[x] f[x, EFermi], {x, -200, 200}] c = 100; sol = FindRoot[h[e] == c, {e, 10}] h[e] /. sol (* {e -> 55.2154} *) (* 100. *) ... 4 f[t_?NumericQ] = Sqrt[(-50.8938 Sin[8.4823 t])^2 + (4 - 11.3097 Sin[11.3097 t])^2]; Looking at a plot of f[t] to find an initial value for t in FindRoot Plot[f[t], {t, 0, .1}] Clear[a] a = a /. FindRoot[ NIntegrate[f[t], {t, 0, a}] == 1, {a, 0.08}] // Quiet 0.0680318 Check NIntegrate[f[t], {t, 0, a}] 1. Show[ RegionPlot[0 ... 4 You set up the integral incorrectly. You are mixing up$\varphi$and$\theta$. 4 There exist few typos in your kernel definition. This is how your kernel looks assuming a=2 (we denote it as A while defining the kernel as Kpart in the following). Please utilize the code from here to solve your problem. Below I changed the constants and functional arguments of FredholmKind2 to fit your particular problem. n = 20;(*number of ... 3 This is a way which will give you a the final solution in terms of$\beta$. The idea is generate a Table of solution for different$\beta$value and then find a fitting function. I choose here$-10<\beta<10\$. data = Table[{\[Beta],NIntegrate[1/(Sin[\[Theta]/2]^\[Beta] + 1), {\[Theta],0,\[Pi]}]}, {\[Beta], -10, 10, .5}]; ListPlot[data] sol1 = ...

3

How about: numPoints = 10; dd[a_, b_, n_] := (a + 1) (b + 1) (a + b + 2)/2 - n FindInstance[ dd[aa, bb, nn] == 0 && aa > 0 && bb > 0 && nn > 0, {aa, bb, nn}, Integers, numPoints] One could be slicker, but this works.

3

Rahbar and Hashemizadeh's approach You could use the code provided by PlatoManiac in response to a similar question which implements the method from Rahbar and Hashemizadeh's paper A Computational Approach to the Fredholm Integral Equation of the Second Kind. NISolve.nb The Mathematica library includes code for Numerical Solution of One-Dimensional Linear ...

Only top voted, non community-wiki answers of a minimum length are eligible