differential geometry – Interpretation of transport equation for a two-form

The vorticity equation arising from the Euler equation for a fluid with velocity $bf u$ reads:

partial_t {bf{w}} + nabla times( {bf{w}} times {bf{u}}) =0

where the vorticity is ${bf{w}} =nabla times {bf{u}}$.

Now, assume that we have a 1-form $u$ and its associated “vorticity” 2-form $w=du$. Is it possible to interpret the above vorticity equation in terms of Lie derivative $L_u$ (or other kind of derivatives) and, possibly, Hodge duality? This would give a geometric meaning to the second term in the equation. Maybe something like

partial_t {w} + L_u w =0 , ?

differential equations – Error on DSolve

I’ve been trying to solve this initial value problem using ‘DSolve()’:

frac{dy}{dt}=1+tspace sin(tspace y),quad y(0)=0, quad t=(0,2)

ClearAll(y, t)
eq1 := {y'(t) == 1 + t *Sin(t y(t)), y(0) == 0};
DSolve(eq1, y(t), {t, 0, 2})

All I get is the Inverse function error.

    Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>

The documentation suggests it has to do with the sine function but I’m not sure how to by-pass it.

Any help would be appreciated.

geometry – Symplectic Hodge Star and Koszul differential

Let $M = text{Spec}(R)$ be a symplectic affine variety of dimension $n$ with the symplectic form $omega$. There is the symplectic Hodge star $star: Omega^k_{M} to Omega^{2n-k}_{M}$ given by the condition that for any $alpha, beta in Omega^k$ we should have $beta wedge alpha = Lambda^k G(beta, alpha) cdot v_n$ where $G(-, -): TM^* times TM^* to R$ is a bivector field corresponding to $omega$ and $v_n = omega^n/n!$. I want to understand the first nontrivial (for me) case: $M = T^* mathbb{A}^2$. In this case $omega = dx_1 dx_2 + dx_3 dx_4$ and $v_2 = dx_1 dx_2 dx_3 dx_4$. Also, $G = frac{partial}{partial_{x_1}} frac{partial}{partial_{x_2}} + frac{partial}{partial_{x_3}} frac{partial}{partial_{x_4}}.$ It seems to me that we have the following

$star(f) = f dx_1 dx_2 dx_3 dx_4$

$star(alpha) = alpha wedge omega$ where $alpha in Omega^1_{M}$

$star(zeta) = -zeta$ for $zeta in Omega^{2}_{M}$

$star(eta) = i_{G} eta$ where $eta in Omega^{3}_{M}$ and $i_{G}$ is the contraction with $G$.

OK, then let us see how the Koszul differential works and it is the place where I met a contradiction in math (of course, the problem is with me but I cannot figure it out).

$textbf{Setup.}$ The Koszul differential $B: Omega^{k}_{M} to Omega^{k-1}_{M}$ has two interpretations, the first one is $B = (i_G, d)$. The second is $B = (-1)^{k+1} star d star.$

$textbf{My misunderstanding.}$ Let $x in Omega^3_{M}$. The first definition gives $Bx = i_G dx – d i_{G}x$. The second definition gives $Bx = star d star x = star d i_{G} x = -d i_{G} x$. As we see, we should have $i_{G} dx=0$ which is not the case, for example, for $x_1 dx_2 dx_3 dx_4.$

$textbf{My quesion.}$ Where is the mistake? Or, can we write down the star isomorphism in the general case? I think it is related to the multiplication by $omega^{n-k}$, but mostly I’m interested how to write down the formula for $star: Omega^{k}_{M} to Omega^{2n-k}_{M}$ for $k>n$. Is there any reference?

differential equations – How to add a velocity boundary condition with specific time period

I have a wave equation for displacement and velocity, I want to add this boundary condition $v(x=0,t>0)=1$
My mathematica code is

sol = NDSolve({1/1000 D(u(x, t), {t, 2}) == D(u(x, t), {x, 2}), 
   D(u(x, t), t) == v(x, t), u(x, 0) == 0, v(x, 0) == 0, 
   v(0, t > 0) == 1, v(L, t) == 0}, {u(x, t), v(x, t)}, {x, 0, L}, {t,
    0, 1})

L is a constant.

differential equations – Infinity: Indeterminate expression 0.0389874+Complexinfinity+Complexinfinity encountered

I’d like to solve 2nd order differential equation:
enter image description here

Which I’d like to draw a graph of x_M and h. m, g, and M is a real constant. Cd is well defined function that has a parameter as x_M’
theta is piecewise defined function,
that appears as below:

enter image description here

for this equation, I used code :

(Theta)0 = 0.5236; 
(Omega)1 = 5.2359877; 
(Omega)2 = 1.396;
t1 = (Theta)0 / (Omega)1;
t2 = (Theta)0 / (Omega)2;
f(t_)=Piecewise({{ -Mod(t,T)*(Omega)1 ,0<=Mod(t,T)<t1},{ -(Theta)0+((Mod(t,T)-t1)*(Omega)2), t1<=Mod(t,T)<(t1+2t2)},{(Theta)0-((Mod(t,T)-t1-2t2)*(Omega)1),(t1+2t2)<=Mod(t,T)<T}})

enter image description here

It is clear that derivative of the function is

thetaprime(t_):=Piecewise({{-5.2359877 ,0<=Mod(t,T)<t1},{ 1.396, t1<=Mod(t,T)<(t1+2t2)},{-5.2359877,(t1+2t2)<=Mod(t,T)<=T}}); 

enter image description here

for differential equation, I used a code

initconds = {x(0) == 0, x'(0) == 0.00001, h(0) == (M + m)/((Rho)*A), h'(0) == 0}
eqns = {m Cos((Theta)(t)) Sin((Theta)(t)) h''(t) + (M + m (Sin((Theta)(t))^2)) x''(t) == - Cd(Derivative(1)(x)(t)) *h(t)* Derivative(1)(x)(t) + m Sin((Theta)(t)) (g Cos((Theta)(t)) + r thetaprime(t)^2),( -M-(m*Cos((Theta)(t))^2))*h''(t) - m Cos((Theta)(t)) Sin((Theta)(t)) x''(t) == -g M + A g (Rho) h(t) - m Cos((Theta)(t)) (g Cos((Theta)(t)) + r thetaprime(t)^2)}

enter image description here

But when I try to solve the Equation,

sol = NDSolve(Append(eqns, initconds), {x, h}, {t, 0, tf}, Method -> {"DiscontinuityProcessing" -> False})

enter image description here

It gives following three errors. I can’t understand why these errors occur.

Infinity::indet: Indeterminate expression 0.0389874 +ComplexInfinity+ComplexInfinity encountered.

Infinity::indet: Indeterminate expression -0.160636+ComplexInfinity+ComplexInfinity+ComplexInfinity+ComplexInfinity+ComplexInfinity encountered.

NDSolve::ndnum: Encountered non-numerical value for a derivative at t == 0..

enter image description here

Please help me to solve the problem.

differential equations – NDSolve evolution in a specific point

m = 0; n = 0; B = 0.7; W = 4;

T1(m_,n_):= NIntegrate((-Log(t))^(m – 1)*LaguerreL(n, m, -Log(t))*LaguerreL(n, m, -Log(t)), {t, 0, 1});

T2(m_,n_):= NIntegrate((-Log(t))^(m – 1)*LaguerreL(n – 1, m, -Log(t))*LaguerreL(n – 1, m, -Log(t)), {t, 0, 1});

T3(m_,n_):= NIntegrate((-Log(t))^(m – 1)*LaguerreL(n, m, -Log(t))*LaguerreL(n – 1, m, -Log(t)), {t, 0, 1});

T4(m_,n_):= NIntegrate((-Log(t))^(m + 1)LaguerreL(n, m, -Log(t))^2Exp(-B/(f0(z))^2*(-Log(t))^mtLaguerreL(n, m, -Log(t))^2)(-2n*(-Log(t))^(m – 1)tLaguerreL(n, m, -Log(t))^2 +2*(m + n)(-Log(t))^(m – 1)tLaguerreL(n, m, -Log(t))LaguerreL(n – 1, m, -Log(t)) – (-Log(t))^mtLaguerreL(n, m, -Log(t))^2 -m*(-Log(t))^(m – 1)tLaguerreL(n, m, -Log(t))^2), {t, 0, 1});

s(m_,n_,B_,W_,z):=NDSolve({f0”(z) + 1/f0(z)(f0′(z))^2 == n!/((n + m)!(2n + m + 1))1/(f0(z))^3(((n + m)!)/n!(-2n – m + 1) + T1(m, n)(2n + m)^2 + 4T2(m, n)(m + n)^2 – 4T3(m, n)(m + n)(m + 2n) + BW^2*T4(m, n, B, z)), f0(0) == 1, f0′(0) == 0},f0(z), {z, 0, 1});



My code is given above. I have some integrations T1,T2,T3,T4 and one differentiations. I want to find the result of NDSolve at a specific value z=0.1, but I am getting some error.
Can you suggest me to how to write the code.

differential equations – Neumann boundary condition ignored

Im trying to solve a system of two PDE (im(t,x) and ia(t,x)) that are dependent on time and distance. I’m using my own anisotropic mesh (thanks to @TimLaska) that is aimed to represent an interface between a membrane and a liquid. The interface is located at L/2 where L = thickness of the system. “im” takes positive values in the interval 0 <= x <= L/2 and is equal to 0 at x > L/2. “ia” behaves similarly.

The problem that I’m encountering is that when I specify a Neumann boundary value at L/2, Mathematica doesn’t find this value in the mesh and the Neumann value is effectively ignored.

These are the functions for creating anisotropic meshes (kindly provided by @TimLaska in one of my previous questions)

(*Import required FEM package*)
(*Define Some Helper Functions For Structured Meshes*)
 pointsToMesh(data_) := MeshRegion(Transpose({data}), Line@Table({i, i + 1}, {i,Length(data)- 1}));
 unitMeshGrowth(n_, r_) :=  Table((r^(j/(-1 + n)) - 1.)/(r - 1.), {j, 0, n - 1})
 meshGrowth(x0_, xf_, n_, r_) := (xf - x0) unitMeshGrowth(n, r) + x0
 firstElmHeight(x0_, xf_, n_, r_) := Abs@First@Differences@meshGrowth(x0, xf, n, r)
 lastElmHeight(x0_, xf_, n_, r_) := Abs@Last@Differences@meshGrowth(x0, xf, n, r)
 findGrowthRate(x0_, xf_, n_, fElm_) :=  Quiet@Abs@ FindRoot(firstElmHeight(x0, xf, n, r) -    fElm, {r, 1.0001, 100000},Method -> "Brent")((1, 2))
 meshGrowthByElm(x0_, xf_, n_, fElm_) := N@Sort@Chop@meshGrowth(x0, xf, n, findGrowthRate(x0, xf, n, fElm))
 meshGrowthByElm0(len_, n_, fElm_) := meshGrowthByElm(0, len, n, fElm)
 flipSegment(l_) := (#1 - #2) & @@ {First(#), #} &@Reverse(l);
 leftSegmentGrowth(len_, n_, fElm_) := meshGrowthByElm0(len, n, fElm)
 rightSegmentGrowth(len_, n_, fElm_) := Module({seg}, seg = leftSegmentGrowth(len, n, fElm);
 extendMesh(mesh_, newmesh_) := Union(mesh, Max@mesh + newmesh)

Here I define a couple of constants and create my own mesh

(* Constants *)
L = 0.1; dim = dia = 1.*^-6; kf = kr = 1; kr = 
(* Mesh generation *)
seg1 = rightSegmentGrowth(L/2., 100, L/1000);
seg2 = leftSegmentGrowth(L/2., 100, L/1000);
totalseg = extendMesh(seg1, seg2);
rh = pointsToMesh@totalseg ;
crd = MeshCoordinates(rh);
mesh = ToElementMesh(crd);

And here is the simple code I use to find the solution alongside the error I get

(*PDE system*)

eqsim = {D(im(t, x), t) - dim D(im(t, x), x, x) == NeumannValue(kf*ia(t, x), x == L/2.) + NeumannValue(0, x == L/2.),im(0, x) == 0.1};
eqsia = {D(ia(t, x), t) - dia D(ia(t, x), x, x) ==  NeumannValue(kr*im(t, x), x == L/2.) + NeumannValue(0, x ==   L/2.), ia(0, x) == 0.1};
sol = NDSolve({eqsim, eqsia}, {im, ia},x (Element) mesh, {t, 0, 60}, Method ->{"MethodOfLines", "SpatialDiscretization" -> {"FiniteElement"}})
(*NDSolve::bcnop: No places were found on the boundary where x==0.05 was True, so NeumannValue(ia,x==0.05) will effectively be ignored.*)
(*NDSolve::bcnop: No places were found on the boundary where x==0.05 was True, so NeumannValue(1. im,x==0.05) will effectively be ignored.*)
(* NDSolve::bcnop: No places were found on the boundary where x==0.05 was True, so NeumannValue(0,x==0.05) will effectively be ignored.*)
(*General::stop: Further output of NDSolve::bcnop will be suppressed during this calculation.*)

I first thought that the discretisation in the mesh didn’t include the point L/2 but after double checking I found out that it’s there

Position(crd, L/2.)
(*{{100, 1}}*)

Similar problems to this have been reported when using Dirichlet conditions here DiscretizeRegion does not include the boundary specified in ImplicitRegion (10.1)
, here PeriodicBoundaryConditions: missing points (a simpler example)
and here Solving Laplace’s equation in 2D using region primitives
, but after reading the solutions provided I haven’t been able to find a solution to my issue.

Any help, feedback or advice is more than welcome (I’m using v

differential equations – Solve PDE with contraints and unknown boundary conditions

I have a 2D PDE

mu = -0.1;
lambda = -1;
x10 = 0;
x20 = 0;
eq = {mu*x1 + D(h1(x1, x2), x1)*mu*x1 + 
     D(h1(x1, x2), x2)*lambda*(x2 - x1^2) == mu*(x1 + h1(x1, x2)), 
   lambda*(x2 - x1^2) + D(h2(x1, x2), x1)*mu*x1 + 
     D(h2(x1, x2), x2)*lambda*(x2 - x1^2) == 
    lambda*(x2 + h2(x1, x2))};

The problem is that I don’t know the boundary condition of the PDE, but I do have a constraint that the gradient of h1 and h2 at point (x10, x20) is zero.

D(h1(x1, x2), x1)/.{x1 -> x10, x2 -> x20} == 0
D(h1(x1, x2), x2)/.{x1 -> x10, x2 -> x20} == 0
D(h2(x1, x2), x1)/.{x1 -> x10, x2 -> x20} == 0
D(h2(x1, x2), x2)/.{x1 -> x10, x2 -> x20} == 0

How can I approximate h1(x1, x2) and h2(x1, x2) numerically in Mathematica?

Differential Equation Solution By Power Series

Solve $(1 + x)y’ = py; y(0) = 1$, where $p$ is an arbitrary constant.

First I plugged in the guess $y = sum_{n = 0}^infty a_n x^n$:

$(1 + x)(sum_{n = 0}^infty a_n x^n)’ = psum_{n = 0}^infty a_n x^n$

Then I expanded the derivative and multiplication:

$sum_{n = 0}^infty n a_n x^{n – 1} + sum_{n = 0}^infty n a_n x^n = psum_{n = 0}^infty a_n x^n$

Then I shifted the left index (the first term yielding $0$ allows the lower bound to remain $0$) and algebraically combined the summations:

$sum_{n = 0}^infty (n + 1)a_{n + 1} x^n + (n – p)a_n x^n = 0$

This leads to the following recurrence relation:

$a_{n + 1} = frac{p – n}{n + 1}a_n$

Thus for various values of $n$:

$a_1 = p a_0$, $a_2 = frac{p(p – 1)}{2}a_0$, $a_3 = frac{p(p – 1)(p – 2)}{6} a_0$, etc.

So applying definitions for the exponential taylor series and falling factorial, the guessed solution would be:

$y = sum_{n = 0}^infty frac{p! a_0 x^n}{n! (p – n)!} = sum_{n = 0}^infty a_0 e^x p^{underline n}$

Solving the initial value problem:

$1 = sum_{n = 0}^infty a_0 e^0 p^{underline n} implies a_0 = frac{1}{sum_{n = 0}^infty p^{underline n}}$

My final solution is:

$y = frac{sum_{n = 0}^infty e^x p^{underline n}}{sum_{n = 0}^infty p^{underline n}}$

However, the answer is supposed to be $y = (1 + x)^p$. Are these identical, or did I make an error somewhere?

differential equations – Normalizing x-axis to some parameter

I have the following code

fp = 5.97;
Δ = 0; 
f1 = fp + Δ;
f2 = fp - Δ;
f4 = 5.38413;
ωp = 2 π*fp;
ω1 = 2 π*f1;
ω2 = 2 π*f2;
ω4 = 2 π*f4;
ω3 = (ω1 + ω2 - ω4);
a = 10; 
NN = 200*a;
LL = 1200*10^-3;
I0 = 0.1;
I1 = 0.48*I0;
I2 = 0.48*I0;
zchar = 50;
Cj = 39*10^-6;
CC0 = 480*10^-6;

k1 = Sqrt(1 - Cj LL ω1^2)/(a*Sqrt(CC0 LL) ω1);
k2 = Sqrt(1 - Cj LL ω2^2)/(a*Sqrt(CC0 LL) ω2);
k3 = Sqrt(1 - Cj LL ω3^2)/(a*Sqrt(CC0 LL) ω3);
k4 = Sqrt(1 - Cj LL ω4^2)/(a*Sqrt(CC0 LL) ω4);

κ1 = -(k1/(8 I0^2*LL^2*(1 - LL*Cj*ω1^2))); 
κ2 = -(k2/(8 I0^2*LL^2*(1 - LL*Cj*ω2^2)));
κ3 = -(k3/(8 I0^2*LL^2*(1 - LL*Cj*ω3^2)));
κ4 = -(k4/(8 I0^2*LL^2*(1 - LL*Cj*ω4^2)));
α11 = -(k1/(16*I0^2*LL^2*(1 - LL*Cj*ω1^2)));
α12 = -(k1/(8*I0^2*LL^2*(1 - LL*Cj*ω1^2)));
α13 = -(k1/(8*I0^2*LL^2*(1 - LL*Cj*ω1^2)));
α14 = -(k1/(8*I0^2*LL^2*(1 - LL*Cj*ω1^2)));
α21 = -(k2/(8*I0^2*LL^2*(1 - LL*Cj*ω2^2)));
α22 = -(k2/(16*I0^2*LL^2*(1 - LL*Cj*ω2^2)));
α23 = -(k2/(8*I0^2*LL^2*(1 - LL*Cj*ω2^2)));
α24 = -(k2/(8*I0^2*LL^2*(1 - LL*Cj*ω2^2)));
α31 = -(k3/(8*I0^2*LL^2*(1 - LL*Cj*ω3^2)));
α32 = -(k3/(8*I0^2*LL^2*(1 - LL*Cj*ω3^2)));
α33 = -(k3/(16*I0^2*LL^2*(1 - LL*Cj*ω3^2)));
α34 = -(k3/(8*I0^2*LL^2*(1 - LL*Cj*ω3^2)));
α41 = -(k4/(8*I0^2*LL^2*(1 - LL*Cj*ω4^2)));
α42 = -(k4/(8*I0^2*LL^2*(1 - LL*Cj*ω4^2)));
α43 = -(k4/(8*I0^2*LL^2*(1 - LL*Cj*ω4^2)));
α44 = -(k4/(16*I0^2*LL^2*(1 - LL*Cj*ω4^2)));

A10 = (I1*zchar)/(ω1*Sqrt(2));
A20 = (I2*zchar)/(ω2*Sqrt(2));

α1 = α11*Abs(A10)^2 + α12*Abs(A20)^2;
α2 = α21*Abs(A10)^2 + α22*Abs(A20)^2;
α3 = α31*Abs(A10)^2 + α32*Abs(A20)^2;
α4 = α41*Abs(A10)^2 + α42*Abs(A20)^2;

ΔkL = (k1 + k2) - k3 - k4;

system(j_) := {A1'(x) == 
  E^(-I*ΔkL*x) + 
 I*A1(x)*(α11*Abs(A1(x))^2 + α12*
     Abs(A2(x))^2 + α13*Abs(A3(x))^2 + α14*
A2'(x) == 
  E^(-I*ΔkL*x) + 
 I*A2(x)*(α21*Abs(A1(x))^2 + α22*
     Abs(A2(x))^2 + α23*Abs(A3(x))^2 + α24*
A3'(x) == 
  E^(I*ΔkL*x) + 
 I*A3(x)*(α31*Abs(A1(x))^2 + α32*
     Abs(A2(x))^2 + α33*Abs(A3(x))^2 + α34*
A4'(x) == 
  E^(I*ΔkL*x) + 
 I*A4(x)*(α41*Abs(A1(x))^2 + α42*
     Abs(A2(x))^2 + α43*Abs(A3(x))^2 + α44*
     Abs(A4(x))^2), A1(0) == A10, A2(0) == A20, 
A3(0) == j*(A10 + A20), A4(0) == 0};

sol(j_) := NDSolve(system(j), {A1, A2, A3, A4}, {x, 0, NN})

LogLinearPlot({10*Log10(Abs((A3(NN)/A3(0)) /. sol(j))^2), 10*Log10(Abs((A3(NN)/A3(0)) /. sol(10^-5))^2) - 1}, {j, 10^-5, 5}, PlotRange -> {Full, All}, AxesOrigin -> {0, 0}, PlotStyle ->{Directive(Black), Directive(Gray, Dashed)}, ImageSize -> Large)

(A10 + A20) // N

Upon running, it should generate a plot like the following:
enter image description here

One can see that under the system(j_) and sol(j_) function, I am attempting to solve the (four) differential equations (A1(x),A2(x),A3(x),A4(x)) numerically. In particular, I’ve defined my initial condition for A3(0) with respect to j where j is the variable to be plotted on the x-axis. As one can see, I am plotting j normalized to A10+A20 as shown in the condition A3(0)==j*(A10+A20)

In particular, the x intersection between the black and the gray-dashed curve should be sensitive to the parameter I0 (set to 0.1 in this case). However, changing I0 to any other parameter doesn’t change the plot whatsoever (one can check this). I confirmed my suspicion by redefining my initial condition for A3(0) as simply A3(0)==j (rather than A3(0)==j*(A10+A20)) and the intersection between the black and gray curve indeed changes as I0 changes. This seems to suggest that I am normalizing to the wrong parameter (A10+A20), but this shouldn’t be a problem. Because A3(0) represents some wave amplitude and A10+A20 represents the initial pump amplitudes and it is conventional to normalize the wave with respect to the pump amplitudes.

What is the problem here? Is I0 some how dependent on the x-axis so that something cancels when I define my A3(0) as A3(0)==j*(A10+A20)? Any suggestions for normalizing the x-axis?

Thank you.