Hot answers tagged

18

Motivation (for a new semi-symbolic integration strategy) Consider the following integral, which cannot be done neigther by Integrate: Integrate[BesselJ[y, x^3], {x, 0, ∞}, {y, 0, 1}] (* Integrate[If[Re[y] > -(1/3), Gamma[1/6 + y/2]/(3*2^(2/3)*Gamma[5/6 + y/2]), Integrate[BesselJ[y, x^3], {x, 0, Infinity}, Assumptions -> Re[y] <= -(1/3)]...


5

Maybe commandeer FindRoot with the Villegas-Gayley trick: Updated, with the order of the steps taken by FindRoot saved in icsteps. The results of FindRoot, as saved by NDSolve and shown below as DownValues[], have been sorted by Mathematica and are not in the order in which there were called. This update stores the order in icsteps. Clear[x, t]; Internal`...


4

I think this gives what you want: We construct the integral inside the definition of H by adding another ODE to the NDSolve system, which I called logH. This in fact calculates the integral from ic, not from 0. So to define H we need to subtract logH[0] from logH[t] before exponentiating. This should be a much more accurate (and faster) way of computing ...


3

You have many superfluous sets of {} that generate unexpected output in your code. In particular, the Interpolation functions generated by NDSolve were not returning a scalar value, but instead a unidimensional vector, i.e. a list containing a single value instead. That was probably an unintended consequence of the extra sets of braces in the definitions of ...


3

Clear["Global`*"] yy = 10^-4; rr = 0.999; xx = 10^-15; zz = 10^-4; mm = 10^-4; yy + rr + xx^2 + zz - mm^2 - zz^2/24 ic = -17.5 s = NDSolve[{D[y[t], t] == (3 y[t])/5 - (12 m[t]^2 y[t])/5 + (2 r[t] y[t])/ 5 - (6 x[t]^2 y[t])/5 + (3 y[t]^2)/5 + (7 y[t] z[t])/ 5 - (y[t] z[t]^2)/10, D[r[t], t] == -((2 r[t])/5) - (12 m[t]^2 r[t])/5 + (2 r[...


2

This works Clear[x, y, z] sol = NDSolve[Join[ Thread[{x'[t], y'[t], z'[t]} == {-z[t] x[t] + 1.5 Log[z[t]], z[t] - 1, -(0.64) y[t] + (x[t] + Log[z[t]])/0.8}], Thread[{x[0], y[0], z[0]} == {1, 1, 1}]], {x, y, z}, {t, 0, 100}]; ParametricPlot3D[{x[t], y[t], z[t]} /. sol, {t, 0, 100}]


2

Here is a function for multiplying InterpolatingFunctions generated from a single NDSolve (so that the coordinate grids are the same, as well as one-dimensional). This yields a single InterpolatingFunction that interpolates the product. It carries over derivative information, too. (I've done this before on the site, I think.) Anyway, Integrate on an ...


2

It looks like the best approach is to use spherical coordinates: ω1 = Sqrt[m1 + r^2]; ω2 = Sqrt[m2 + r^2]; f = 1/(ω1 ω2) 1/(ω1 + ω2 + e) + 1/(2 ω1 ω2) 1/(ω1 - ω2 - e) + 1/(2 ω1 ω2) 1/(ω2 - ω1 - e) (* ==> 1/( 2 Sqrt[m1 + r^2] Sqrt[ m2 + r^2] (-e + Sqrt[m1 + r^2] - Sqrt[m2 + r^2])) + 1/( 2 Sqrt[m1 + r^2] Sqrt[ m2 + r^2] (-e - Sqrt[m1 + r^2] + ...


1

Your problem is twofold. The first part is very subtle and sneaky. Your "c" characters are actually typed in as the Unicode Character 'cyrillic small letter es' (U+0441) in the NDSolve expression, as you can see from the following: Inactive[NDSolve][{ I*с00'[t] == с10[t] + с01[t] + с00[t] + с00[t], I*с01'[t] == с11[t] + с00[t] + с01[t] - с01[t], ...


1

You cannot use square brackets for parentheses and must include initial conditions. eqns = { x'[t] == -z[t] (x[t] + 1.5 Log[z[t]]), y'[t] == z[t] - 1, z'[t] == -(.64) (y[t] + (x[t] + Log[z[t]])/.8), x[0] == y[0] == z[0] == 1} // Rationalize // Simplify; sol = NDSolveValue[eqns, {x[t], y[t], z[t]}, {t, 0, 1000}]; Manipulate[ ...



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