Tag Info

New answers tagged

0

lst = Table[{a, NIntegrate[(-(a^2/2) + x (-x + Sqrt[a^2 + x^2]))* Tanh[\[Pi]*x], {x, 0, \[Infinity]}]}, {a, 0.2, 1, 0.05}]; ListPlot[lst]


3

This is at least how I might start such a problem: First define a function that calculates the numerical integral (using your definition) from 0 to some number: res[a_?NumericQ, xmax_?NumericQ] := res[a, xmax] = NIntegrate[ x Tanh[Pi x] Sqrt[x^2 + a^2] - (a^2/2 + x^2) Tanh[\[Pi] x], {x, 0, xmax}, WorkingPrecision -> 50] You might notice ...


1

You try to integrate before theta1 etc. are given numeric values. If I understand correctly how you wish to deal with the lists of parameters, then use Map to apply NIntegrate to each integrand: kick3 = Map[ NIntegrate[#, {s, 0, lb}] &, (eta3 + s^2/(2 rho2))* CSR3linear /. {theta1 -> {0.06}, d -> {8.60435}, sigma3beg -> ...


2

Combined symbolic and numeric calculation can be hard to deal with. You may do the symbolic part first and then do the substitution, or do the pure numeric integration NItegrate many times. Integrate[(n3 + s^2/(2 r))*(c e n)/(g r^(2/3) (s/lb (end - beg) + beg)^(4/3)), {s, 0, lb}][[1]] Output: (3 c e lb n (beg^( 1/3) (5 beg + 6 beg^(2/3) end^(1/3) + 3 ...


0

I suppose I dislike mixing structural operations - like Thread - inside algebraic expressions. My objections are two-fold: 1) I prefer to keep Mathematica operations distinct from actual algebra for aesthetic reasons. 2) If an expression is cut and pasted and changed, operations like Thread can all too easily end up chewing into mathematical ...


4

If this is a vector function then we expect its components to get integrated independently? If this is what you want, then see that vector Piecewise and Piecewise vector are not the same things. NIntegrate, Plot, etc. need to see a List as an outer wrapper to know what to do with inside stuff. intervals = {s < -2, -2 <= s < 1, 1 <= s}; test[s_] ...


1

This is not an answer to your question but a copy and paste from the documentation which you might find inspiring: Boundary Value Problems with Parameters In many of the applications where boundary value problems arise, there may be undetermined parameters, such as eigenvalues, in the problem itself that may be a part of the desired solution. By ...


0

Frame it as a set of Linear ODEs and solve it somehow. I usually use Implicit Runge Kutta in the interaction picture. solver[H_, a_] := soln = Module[{d, init, eq, vars, solargs, t, t0, tf}, d = Dimensions[H][[1]]; t0 = a[[2]]; tf = a[[3]]; t = a[[1]]; u[t_] := Table[Subscript[u, i, j][t], {i, 1, d}, {j, 1, d}]; init = (u[t0] == IdentityMatrix[d]); eq = ...


3

Following @Vitaliy's comment try this formulation: kB = QuantityMagnitude@ UnitConvert[Quantity["BoltzmannConstant"] , "Joule/Kelvin"] pdf[dp_?NumericQ, d0p_?NumericQ, w_?NumericQ] = kB^(-1/3)/(w Sqrt[2 Pi]) 1/dp *E^(-1/(2 w^2) (Log[dp /d0p])^2); mt[b_?NumericQ, Nt_?NumericQ, Ms_?NumericQ, d0p_?NumericQ, w_?NumericQ] := Nt kB^(4/3) Ms Pi /6 ...


4

I think you need to check your equations and/or the numeric values you are using. To me it looks like this problem might well have no solution: equation = 10000 u'[r] (1 + u'[r]) - 1.`*^-6 (r + u[r]) (u[r] + r u'[r]) + 10000 r u'[r] u''[r] + 10000 r (1 + u'[r]) u''[r] == 0; derivativeAtEndPoint[uStart_?NumericQ] := NDSolveValue[{equation, 10000 ...


3

A general remark to start with - speed is in the eye of the beholder. Having said that, there are a couple of things not quite right with your code. First of all, NDSolve isn't doing what you think it does - it returns unevaluated because you didn't give an initial condition and you gave the wrong independent variable - you want to solve for f, not for ...


3

Let's see in detail what the comments are talking about. Define: r[x_] := 2*(1 - (1/3)^2)/(1 + (1/10)*Cos[x]) Compute function under your integral: g[x_] = (Sqrt[(r'[x])^2 + r[x]^2])/(Sqrt[2 (-1 + 1/(r[x]))]) // FullSimplify Plot Im and Re on domain of interest: Plot[{Re@g[x], Im@g[x]}, {x, 0, 2 Pi}] So you are indeed basically integrating the ...


0

I suppose you know that you're dividing by R[x]^(1/4), since it's your equations. And therefore I assume the question is how to integrate the system. Since the division occurs inside an exponential and the argument of the exponential approaches negative infinity at R[1] == 0, the term stays bounded and approaches zero. One solution is to rewrite the Xeq ...


1

I can confirm that using SetDelayed instead of Set is the culprit here. As I get the same error you got with SetDelayed but not with Set The following works fine: α = 0.07; A = Sin[θ]*Sin[θ2]*Cos[φ - φ2] + Cos[θ]*Cos[θ2]; B = Sin[θ]*Sin[θ3]*Cos[φ - φ3] + Cos[θ]*Cos[θ3]; V = Sin[θ2]*Sin[θ3]*Cos[φ2 - φ3] + Cos[θ2]*Cos[θ3]; c2 = (B*c*c3 - c3*c3)/(A*c - c3*V); ...


0

R = 1500; f[r_] := NIntegrate[BesselJ[2, r*k]*BesselJ[1, R*k], {k, 0, Infinity}] sol = Table[Abs[f[r]]^2, {r, R, 2000, 10}]; ListLinePlot[sol, PlotRange -> All]


2

For your first integral, NIntegrate gives warnings or messages about failing to converge when not excluding the singular points. When excluding the singular points I trust the result 13.6216 + 0. I because some alternative methods agree. Monte Carlo sampling: In[76]:= NIntegrate[ 1/Abs[tk], {kx, 0, 2 Sqrt[3] Pi/3}, {ky, 0, 4 Pi/3}, Method -> ...



Top 50 recent answers are included