ODE problem using DSolve

I would like to use DSolve (or NDSolve) to verify that the solution to the ODE problem

-4(v''[t]+(2/r)v'[t])-2*v[t]*Log[v[t]]-(3+(3/2)Log[4 Pi])*v[t]==0, 

with conditions $ \lim_{t\to \infty}v(t)=0$ and $ v'(0)=0$ is given by

v[t]=(4 Pi)^(-3/4)*Exp[-t^2/8]. 

I am able to verify this by hand, but am having trouble using Mathematica to verify it. I would like to use Mathematica to solve this differential equation, and later on modify some terms in the ODE to see how the solution changes.

Perhaps I am making a foolish mistake. I have also tried using NDSolve, but did not obtain the correct solution. I would appreciate any tips. Below you can find the picture of the error messages. Thanks for your help.

Picture of output

sol=DSolve[{-4(v''[t]+(2/r)v'[t])-2*v[t]*Log[v[t]] -(3+(3/2)Log[4 Pi])*v[t]==0,v[Infinity]==0,v'[0]==0},v[t],t] Plot[Evaluate[v[t] /. sol], {t, 0, 10}, PlotRange -> All] 

How to contour plot a quantized function?

I am trying to plot a function over a 2 dimensional region, which takes integer and half integer values.

However, due to numerical approximations and errors, the calculated value of the function sometimes becomes 0.99 or 1.01 instead of exactly 1. When I make a contour plot, it gives a certain color between 0 and 1, another color between 1 and 2, and so on. As a result, 0.99 and 1.01 acquire different colors (while I want both of them to be the same color, because they represent 1).

What would be an efficient way to plot different integers (approximately, upto numerical errors) and half integers with different colors in a contour (or a similar) plot?

Also, the function takes values between -2 and 2, so I don’t need to take care of all integers.

I cannot use floor function because that will send both 0.99 (should be 1) and 0.01 (should be 0) to 0.

Solve Matrix equations with Cross Product: weird system of equations

I would like to find the values {Pfx, Pfy, Pfz} that satisfy the equation A X B = C . The code of everything is at the end, I want to ilustrate with images what i think of first:

A is this:

Matrix A

B is this: {0,0,0}

And C is this: {100,500,200}

The image of the complete code is this one:

Complete code

My variable here are {Pfx,Pfy,Pfz} and the {i,j,k} are the unit vectors. The way that the matrix is shown in the picture corresponds with a trick used to solve in papper this type of matrix.

The solution would give me the value of Pfx in the "x" coordinate (and this would be expressed by Pfx being multiplied with the i vector). And the same mechanism applies with Pfy related with j Vector ; and Pfz related with k.

The problem here comes with the fact that the I can`t find the values {Pfx, Pfy, Pfz} that satisfy the equation A X B = C. I am not sure if the problem lies in the "LinearSolve" comand, in the use of the CrossProduct or in the use of the versor {i, j, k} inside the matrix.

Any kind of help in this regard will be extreamly useful, thanks in advance!!

Code:

i := {1, 0, 0}  j := {0, 1, 0}  k := {0, 0, 1}  LinearSolve[({ {i, j, k},{1, 2, 3},{Pfx, Pfy, Pfz}})\[Cross]({{0},{0},{0}}) == ( {{100},{500},{200}} )]    

How to arbitrarily specify a face of planar graph as an external surface and draw it?

I learned this theorem in the graph theory textbook.

Theorem Every $ 2$ -connected plane graph can be embedded in the plane so that any specified face is the exterior.

G=PlanarGraph[{1 <-> 2, 1 <-> 3, 1 <-> 4, 2 <-> 3,               3 <-> 4, 2 <-> 5, 5 <-> 6, 6 <-> 3},               VertexLabels -> All] 

enter image description here

In the above embedding of this graph, we know $ 1256341$ is boundary exterior face of $ G$ .

I don’t know if there is a way to make the triangle face $ \Delta_{134}$ outside.

The above is just an example. For the graph $ G$ , maybe I can change the layout of some points by VertexCoordinates. But for the large number of vertices, I don’t know if there is a good and unified way to arbitrarily specify an external face and give a good plane drawing.

Applying FunctionContinuous in Module to a function parameter

I have a function:

f[x_] = Tanh[2x - 1] * Cos[x] - Sin[x] / x 

which is discontinuous in $ x=0$ . I am building a Module[], which is supposed to calculating an integral of given function:

MyNIntegral[f_, x_, a_, b_, n_:1000] := Module[{division, result},   If[Not[FunctionContinuous[{f[s], a <= s <= b}, s]], Print["Error"], Print["It is good!"]]   division = Table[a + k * (b - a) / n, {k, 1, n - 1}];   result = (b - a) / n * (f[a] / 2 + Sum[f[division[[k]]], {k, 1, n - 1}] + f[b] / 2);   Return[result]; ] 

Obviously, the function generates the problem – division by zero, when a_ = 0. I would like to inform an user that such a problem occured and abort the evaluation of the Module[].

But some errors have shown up:

  • Set: Tag Times in division$ 651124False is Protected.
  • Part: specification division$ 651124[[1]] is longer than depth of object.
  • Part: specification division$ 651124[[2]] is longer than depth of object.
  • Part: specification division$ 651124[[3]] is longer than depth of object.

Is this caused by the protecion of passed arguments? What can I do with that? How to use a function on a function inside module?

Derivative of NDSolve output

I am trying to study the stability of a 2-dimensional discrete system (X, Y) by finding the Jacobian at the systems non-trivial equilibrium (X*, Y*). The functions that map the system from one iterate, n, to the next are given by the solutions to ordinary differential equations solved at time t = T

X(n+1) = f(x(T), y(T))

Y(n+1) = g(x(T), y(T))

where x(T) and y(T) depend on X(n) and Y(n).

Here is a MWE of the problem

sol[T_?NumericQ, a_, b_, c_, x0_?NumericQ, y0_?NumericQ] :=    NDSolve[{     x'[t] == x0 a - b *x[t]*y[t],     y'[t] == b*x[t]*y[t] - c y[t],     x[0] == 0, y[0] == y0},     {x, y}, {t, 0, T];  xmap[T_?NumericQ, a_, b_, c_, x0_?NumericQ, y0_?NumericQ] :=   x[T] /. sol[T, a, b, c, x0, y0] ymap[tt_?NumericQ, a_, b_, c_, h_, j_, x0_?NumericQ, y0_?NumericQ] :=   h (y[T] /. sol[T, a, b, c, x0, y0])/(1 +       j (y[T] /. sol[T, a, b, c, x0, y0])) 

where x0 and y0 are placeholders for X(n-1) and Y(n-1). Is it possible to take the partial derivatives of xmap and ymap w.r.t. x0 and y0? I tried this

D[xmap[5, 0.5, 0.25, 1, x0, 200], x0] /. x0 -> 100 

But it does not evaluate.

Problem with plotting

So I need to plot this function:

Y(x) = 170 *sin⁡[2 *arctan [[[-x^[4] + 340*x^[3] - 35150*x^[2] + 1062500*x + 3194375]^[1/2] - 2400]/[x^[2] - 290* x + 20525]]] + 20 

and i tried to do it like this

Plot    [170 * sin⁡[2 * arctan [[[-x^[4] + 340*x^[3] - 35150*x^[2] + 1062500*x + 3194375]^[1/2] - 2400]/[x^[2] - 290* x + 20525]]] + 20, {x, 0, 10}] 

but i keep getting syntax error:

Syntax::sntxb: Expression cannot begin with "[[x^[4]+340x^[3]-35150x^[2]+1062500x+3194375]^[1/2]-2400]/[x^[2]-290x+20525]"

Can anyone please help?