Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [differential-equations]

Questions on the symbolic (DSolve, DifferentialRoot) and numerical (NDSolve) solutions of differential equations in Mathematica.

0
votes
0answers
76 views

How can I solve this KdV equation numerically by Mathematica?

I have been trying to solve the following Korteweg-de Vries (KdV) equation using NDSolve but nothing went right! \begin{align} 6 U_{t} + \frac{9}{2} U_{xxx} + 9 U U_{x} - 6 a U_{x} = 0\\ U_{...
0
votes
0answers
39 views

DSolve - 2nd order Differential Equation

I'm trying to solve the DE: $\partial^2 \phi(x)=\frac{\rho(x)}{\epsilon}$ with $ \rho\left(x\right)=0$ for $x<-L$; $ \rho\left(x\right)=\rho_a$ for $-L<x<0$; $ \rho\left(x\right)=\rho_b$ for $...
1
vote
2answers
74 views

Stuck on solving differential equation

I have tried to solve : $$\begin{array}{l} A\frac{1}{r}\frac{d}{{dr}}\left( {r\frac{{du}}{{dr}}} \right) = - B + N{k^2}\frac{{{I_0}\left( {kr} \right)}}{{{I_0}\left( {ka} \right)}}\\ BC:\\ u(r) ...
1
vote
1answer
29 views

How can I reduce the solutions returned by DSolve to a real-valued function over the reals?

I am trying to use DSolve in order to solve the following equation: $\qquad \rho'' +\Omega^2 \rho -\frac{1}{\rho^3}$, where $\rho=\rho(t)$ and $\Omega$ is a ...
2
votes
2answers
181 views

NDSolve error in 2-D heat equation

I'm trying to solve the following PDE by Mathematica in 2-D case in the unit disk using polar cordinates, where $\Omega$ is a bounded domain of $\mathbb{R}^n$, $\Gamma =\partial \Omega$ is the ...
1
vote
2answers
83 views

DSolve does not return a solution when initial condition is added

Consider the following equation $$ y''(x) = -2e^{-y}. $$ The following code DSolve[y''[x] == -2 Exp[-y[x]], y[x], x] //FullSimplify returns ...
2
votes
2answers
102 views

Solving a system of linear ODE with stiff potential

I am trying to solve a second order equation of the form $u^{\prime \prime}(t)+\left(k^2-V(t)\right)u(t)=0$. However, since the $t$ we consider can be quite large ($10^{20}$ or higher) and the ...
0
votes
3answers
126 views

NDSolve fails at the regular singular point of a second-order ODE

Here is the ODE I want to numerically integrate, odey=-l (1 + l) R[y] + (k - y) (-2 Derivative[1][R][y] + (k - y) (R^\[Prime]\[Prime])[y]) If we rearrange it in ...
1
vote
1answer
75 views

Euler-Bernoulli beam equation

I'm trying to solve Euler-Bernoulli beam equation with simply supported edges.$\frac{\partial^2} {\partial x^2} [ E I \frac{\partial^2 w} {\partial x^2}] + \rho S \frac{\partial^2 w} {\partial t^2} = ...
0
votes
1answer
86 views

Integrating Hamiltonian equations using NDSolve

Would someone be able to integrate numerically the equations at the bottom of page 12 in the paper Interstellar Wormholes given some initial conditions of your choice. Reading the first paragraph of ...
5
votes
1answer
241 views

Integrating Hamilton's equations for the Schwarzschild metric

Part 1 I am trying to integrate Hamiltons equations for the Schwarzschild geometry using NDSolve, these equations must all be integrated simultaneously and are nice ODE's. A similar task is done in ...
0
votes
1answer
60 views

NDSolve and interpolating function

What could possibly went wrong in my code? Basically, I am solving the differential equation $\textbf{ode}$ using $\textbf{NDSolve}$. But mathematica says, NDSolve::mxst: Maximum number of 10000 steps ...
0
votes
0answers
67 views

Damped & Negatively Damped harmonic oscillator with variable equilibrium position

I have the well known equation: $$\frac{d^2Q(t)}{dt^2} + 2 \zeta \omega \frac{dQ(t)}{dt} + \omega^{2}Q(t) = 0, $$ where $\zeta= \frac {1}{4\pi}$, $ \omega(t)= \frac{2\pi}{T(t)}= \frac{2\pi}{v(t)} \...
0
votes
0answers
80 views

Help on solving non-linear 2nd Order ODE

I need help on solving the nonlinear equation: $x^3y''(x)-y(x)y'(x)=0$. Mathematica simply repeats the above equation in the output. Input: ...
3
votes
2answers
81 views

Complex solutions to ODEs

How do I solve the following IVP problem in Mathematica so that I get real solutions? $Q'(t)=b - \dfrac{Q(t)}{100-t}; \quad Q(0)=250$ I tried the following: $\text{$\$$Assumptions}=b>0;\text{$\$$...
7
votes
3answers
300 views

Numerical bounce solution

I want to solve numerically the following differential equation $$ y''(x) + \frac{3}{x}y'(x) = \frac{d U(y)}{y}\,,\qquad U(y) = \frac{1}{4}y(x)^2(y(x)-1)^2 -\frac{1}{400}y(x)^3 $$ in the region $x\...
1
vote
1answer
56 views

Partial differential equation heat/diffusion equation 3d

I'm trying to solve the heat/diffusion equation in 3d in spherical symmetry $\partial_t f=D\Delta f$. I wrote : ...
0
votes
1answer
63 views

Solving a Partio-Integral Differential equation

I had a system of three PDEs $$\frac{\partial \theta_h}{\partial x}+\beta_h (\theta_h-\theta_w) = 0$$ $$\frac{\partial \theta_c}{\partial y} + \beta_c (\theta_c-\theta_w) = 0$$ $$ \lambda_h \frac{\...
0
votes
1answer
52 views

Plotting a System of ODE's Phase Portrait

I want to plot a phase portrait, I think I need to use StreamPlot to do this, $$x'=x(a-bx-cy)$$ $$y'=y(d-ex-fy)$$ I know how to plot this with manipulate ...
0
votes
0answers
48 views

Why can't DSolve handle `df/dt = d^2f/dx^2`?

The output of DSolve[D[f[x, t], t] == D[f[x,t],{x, 2}], f[x,t], {x,t}] is just a copy of the input — does this mean DSolve couldn't find an answer? There are ...
2
votes
2answers
175 views

boundary conditions involving time derivative

Can we solve the following PDE by Mathematica, where $\Omega$ is a bounded domain of $\mathbb{R}^n$, $\Gamma =\partial \Omega$ is the boundary of $\Omega$, $\partial_\nu$ is the normal derivative, ...
1
vote
1answer
67 views

Wavepackets as solutions of PDEs

I'm currently doing a mathematica for physicists course and am struggling to solve a problem we were given! I'm supposed to define an initial wavefunction in a harmonic oscillator (displaced, ...
-1
votes
3answers
96 views

Find n-th derivative of the function satisfying differential equation

Assume that $\,\frac{dx}{dt}=(x-a(t))(x-b(t)).$ I want to find a pattern for $x^{(n)}$ by generating subsequently $x^{(2)}, x^{(3)}....\,$ For example $$x''=(x-a(t))(x-b(t))^2+(x-a(t))^2(x-b(t))-a'(t)(...
6
votes
2answers
108 views

Model calibration with phase space data

Forgive me if this is answered elsewhere, I am new to Mathematica and this forum and have tried a number of search phrases to no avail. My question is very general but for example, suppose I throw a ...
0
votes
0answers
48 views

Solving systems of linear differential equations with variable coefficients

I am trying to analytically solve a system of linear ODEs whose coefficients are variable (periodic). ...
1
vote
1answer
100 views

Analyitic and numerical solutions plots of PDE are different! [closed]

I solved the following heat equation PDE analytically by hand and also Maple the solutions were the same. Also, I solved the PDE numerically using Maple. But the analytic solution and numerical ...
3
votes
1answer
273 views

1st-order linear ODE system gives inaccurate/biased solutions

Consider an ODE eigensystem $$ t(y+\frac{1}{s})a(y)+[(q+\frac{1}{2}+\frac{s}{2}y)+s(y\partial_y+\frac{1}{2})]b(y)=\lambda a(y)\\ t(y+\frac{1}{s})b(y)+[(q+\frac{1}{2}+\frac{s}{2}y)-s(y\partial_y+\frac{...
0
votes
1answer
84 views

How to resolve the fail when applying a user-defined solver?

The user-defined function pdetoode and pdetoae, developed by @xzczd, is very useful to deal with a PDE system when there is ...
3
votes
1answer
126 views

Numerically solving a system of ODEs where the functions are vectorized

I am attempting to solve a system of ODEs where a, b, cv1 and ...
2
votes
1answer
157 views

Interpreting Mathematica code on black holes

I am trying to understand the code written down on page 7 of this document (code is in Mathematica) I understand pretty much all of the code on the previous page needed to setup the page 7 code (...
0
votes
1answer
70 views

DSolve error — fewer dependent variables than equations

I try to solve this equation: And I got an answer: DSolve[k'[t] == s k[t]^a - (n + b) k[t], k[t], t] {{k[t] -> E^(-6 t) C[1]}} But now I try this: ...
2
votes
1answer
105 views

How to solve this 2nd-order ODE with quadratic coefficients?

Consider an ODE eigensystem $$ \begin{bmatrix} 0 & d_1-\mathrm id_2 \\ d_1+\mathrm id_2 & 0 \end{bmatrix} \begin{bmatrix} a(y) \\ b(y) \end{bmatrix} = \lambda \begin{bmatrix} a(y) \\ b(...
0
votes
0answers
75 views

Solving a differo-integral equation [duplicate]

I've the following equation for x(t): $$x'(t)\cdot\text{a}+\text{b}\cdot\frac{x'(t)}{x(t)+\text{c}}+\frac{\partial}{\partial t}\left\{\int_0^tx(\tau)\cdot\mathcal{...
0
votes
0answers
49 views

Are the following Mathematica codes correct for solving wave equation PDE? [duplicate]

I wanna solve the following PDE of wave equation using Mathematica. $u_{tt}=u_{xx}$ $0<x<\pi , t>0$ Initial Conditions: $\begin{cases}u(x,0)=sin(x) \\u_{t}(x,0)=1\end{cases}$ Boundary ...
2
votes
0answers
38 views

How to use DirichletCondition with DSolve and not just NDSolveValue?

I know one can use Region and DirichletCondition with NDSolveValue. But I do not know why it ...
-2
votes
2answers
69 views

Solving a 2nd-order nonlinear differential equation [closed]

My equation is [{x[t]*x'[t])'-(F/m)+(b/m)*x(t)*x'(t)==0},x(0)=0,x'(0)=0] It is a form of Newtons momentum equation, but I am having a lot of trouble solving this ...
1
vote
1answer
67 views

Singularities forming on boundary while solving system of pde's

This is a follow up of a previous question I asked regarding solving a system of coupled, non-linear partial differential equations, 2D spatially + time. The equations (shown below) model a magnetic ...
5
votes
2answers
150 views

Laplace equation for a trapezoidal domain

I want to solve Laplace equation over a Isosceles trapezoidal domain. I need an analytical solution . would you please guide me writing the code in mathematica. how to add the boundary conditions ...
1
vote
2answers
103 views

Validating a solution for a differential equation with DiracDelta

For the following differential equation $\displaystyle-\frac{\partial ^2\phi2 (x)}{\partial x^2}+\lambda ~[\phi2 (x)]^3-\mu ^2~\phi2 (x)=\phi2(x)~\delta(x)$ ...
6
votes
4answers
338 views

What is wrong with my approach to solving a heat transfer PDE?

I wanna solve the following heat transfer PDE using Mathematica. $\qquad u_{xx}=u_{t}$ with following conditions: $\qquad \begin{cases}u(x,0)=sin(x) &0<x<\pi &,t>0\\u_{x}(0,t)=1\\...
3
votes
2answers
149 views

Solution or artifact?

I am trying to increase the precision of the code ...
0
votes
2answers
84 views

Correct interpretation of an ODE solution

I am not very good with Mathematica but I am trying to solve the following initial value problem $y''(t)=\lambda_1 y'(t)e^{y(t)}+ \lambda_2 y'(t)e^{-y(t)},$ $ y(0)=0$ I have tried first the ...
0
votes
0answers
56 views

Non-autonomous ODE use NDSolve, error: Step Size is effectively zero; singularity or stiff system is suspected

I have seen this error NDSolve::ndsz many times when I use NDSolve to get the solution of a non-autonomous ODE. I try but all ...
3
votes
1answer
84 views

Creating a domain for NDSolveValue via ParametricRegion

A circular arc $R_2$ can be defined parametrically as $R_2 = \langle x(s),y(s) \rangle : s\in[-s_0,s_0]$ (see code below for specific $x,y$ definitions) where $s_0$ is given (I must make the arc this ...
0
votes
1answer
27 views
1
vote
2answers
76 views

How can I plot this integral?

I am in the following situation: I have a complicated ODE for the function f[x] that has no anlytical solution and an integral that depends on ...
0
votes
0answers
41 views

PDE solution of the form F[x1,x2][x3,x4]

I am trying to solve a PDE on Mathematica and the solution has the form F[x1,x2][x3,x4]. How do you interpret this function in mathematical terms?
3
votes
2answers
108 views

NDsolve with ODE-PDE

Kindly I hope to know what is the wrong here. How to use NDsolve for a coupled ODE-PDE differential equations ...
1
vote
1answer
64 views

ParametricNDSolve[] for Double Damped Pendulum

I am trying to plot Driven Double Pendulum with a control Parameter "Gamma". My understanding is that as this gamma approaches a critical value, the pendulum is pushed towards non-linear regime, and ...
3
votes
1answer
91 views

NDSolveValue for Laplace equation not converging to analytic solution

I'm solving Laplace equation $\nabla^2 \phi = 0$ with BC's $\phi_x(x=\pm 1) = 0,\, \phi_y(y=-h) = 0$ with a specified BC along the circular arc $x^2 + (-1 + y)^2 = 4$, which I call $\Gamma$ (so the ...