Questions tagged [differential-equations]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
42 views

In Plot, different x range shows different result. Is it a bug? [duplicate]

After ODE, plot within {t,0,50} and plot within {t,0,60} have quite different results at some time instants. ...
metroidman's user avatar
1 vote
0 answers
188 views

Bifurcation and stability analyses of delay differential equations

Are there any packages in Mathematica for bifurcation and stability analyses of delay differential equations? For Matlab, there is a nice tool like: https://twr.cs.kuleuven.be/research/software/delay/...
user avatar
0 votes
1 answer
123 views

Mathematica gives weird solution to $y=xy'+y'$ [closed]

So I am practicing solving differential equations using Mathematica, and I will usually get an answer that I can easily verify. (as in I solve the differential equations myself and then check with ...
CrSb0001's user avatar
  • 233
2 votes
1 answer
129 views

NDSolve ignores my NeumannValue boundary conditions

I am trying to solve a simple linear differential equation for $f(x,y)$ on a square with area $L\times L =1$. I consider $(\partial_x^2 + \partial_y^2)f + \partial_x \partial_y f = 0$ with the ...
B. Brekke's user avatar
  • 123
6 votes
2 answers
1k views

Numerically solving radial Schrödinger equation with Yukawa potential

I am trying to solve the radial Schrödinger equation using NDEigensystem but I am running into some issues. There are posts about doing this (see here for example), ...
MarcosMFlores's user avatar
1 vote
0 answers
75 views

Solving PDE for Diffusion Equation with Both Ideal and Excess Potential (Boundary Condition Issue)

I am trying to solve this partial diffusion equation shown $$\dfrac{\partial C_A}{\partial t}=D_A\left[\dfrac{\partial^2C_A}{\partial r^2}+\dfrac2r\dfrac{\partial C_A}{\partial r}+\dfrac1{K_BT}\dfrac1{...
Snowymint's user avatar
1 vote
1 answer
62 views

How the function NDSolve works? [closed]

I am trying to numerically solve a system of ordinary differential equations. ...
Viktoriya Kukanova's user avatar
2 votes
3 answers
182 views

DSolve returns "Inverse functions are being used by solve; so some solutions may not be found", but it seems it returns all results

Sometimes, DSolve would return Inverse functions are being used by Solve, so some solutions may not be found but it seems it has returned all results. For example,...
Y. zeng's user avatar
  • 567
2 votes
1 answer
52 views

ParametricNDSolve doesn't correctly parse black-box function involving both independent variable and parameter

Consider this toy example: f[t_?NumericQ, a_?NumericQ] := t + a tst = ParametricNDSolveValue[{x'[t] == f[t, a], x[0] == 0}, x, {t, 0, 1}, {a}] ...
xzczd's user avatar
  • 66.2k
6 votes
2 answers
664 views

Convert MATLAB code solving 1D wave equation via FFT using ode45 into Mathematica code

I don't quite understand the process of solving differential equations by MATLAB. It seems that it doesn't need the explicit function to specify the required solution, but only needs to input the ...
mozeq's user avatar
  • 295
0 votes
0 answers
28 views

Manual updating of function in Do loop

Previously I had asked a question about solving Maxwells equations with boundary conditions, here Machine overflow when defining boundary conditions. I have managed to successfully run the code ...
Jole Stock's user avatar
1 vote
1 answer
343 views

Fitting delay differential equations (DDE)

I have the following differential equations: $$S'(t) = 0.31 S(t) \Big( 1 - \frac{S(t)}{6.19} \Big)- \frac{a}{1 + B(t)} S(t),$$ $$B'(t) = c (1 - B(t)) - d B(t) S(t) - 3 c (1 - B(t - 18)),$$ where $B(t -...
user avatar
1 vote
1 answer
89 views

Why is the result of "D[y == Log[x*y], x]" "0 == 1/x"? [closed]

In Mathematica 13.3.1, the D[y == Log[x*y], x] gives result 0 == 1/x. It is very weird. At WolframAlpha, its result is ...
Y. zeng's user avatar
  • 567
0 votes
2 answers
141 views

Chi-square minimization error

I'm trying to fit some data into a model using the standard procedure of minimizing the chi-square function using this code: ...
Syn1110's user avatar
  • 51
2 votes
1 answer
120 views

Method of lines - Dirichlet and mixed BC

I have a dissolution problem to solve with two equations (everything is in dimensionless form - concentration, time and distance - EDIT: that came from the second Fick's law, where the distance was ...
Larissa Santos's user avatar
1 vote
1 answer
123 views

Unable to improve accuracy of MethodOfLines

I'm studying a PDE which roughly models a rope subjected to driving on one end. The coordinate $v$ is related to physical time $t$ via the relation $v=t-x$. I'd like to solve the initial value problem ...
phonon's user avatar
  • 105
2 votes
2 answers
178 views

Badly conditioned matrix for boundary ODE

I have a coupled boundary ODE with dependent variables $u=u(x)$ and $z=z(x)$, $$u'' - \frac{1}{z} \left( -3 + u'^2 (3 - c\; e^{-g u} z^4) - 6 u' z' \right) = 0\tag{1}$$ $$z'' + c\; e^{-g u} z^3 (-3 + ...
mathemania's user avatar
0 votes
0 answers
77 views

Solving the integral equation

Why does Wolfram Mathematica just rewrite my code instead of solving the integral equation? SigmaPhiBegin, SigmaPhiEnd are functions depending on Rho, Rho, bEnd, a, Kappa are constants. What needs to ...
Mark's user avatar
  • 15
3 votes
2 answers
156 views

Taylor approximation of integrals

I have BVP as in the picture and I want to solve it numerically by method given as follow. In the original paper, it is motioned that first iteration is computed and other are computed with Taylor ...
Junaid Ahmad's user avatar
2 votes
1 answer
129 views

Using Reduce to simplify (not solve) system of equations

I'm dealing with a Mathematica program that generates a set of coupled non-linear equations involving an unknown function and its derivatives with respect to at least one independent variable. My goal ...
José Ferreira's user avatar
1 vote
2 answers
129 views

Normalized Coincident Detection Probability of Laguerre - Gaussian Modes

I am working on a paper in which a pump mode is passing through SPDC(Spontaneous Parametric Down conversion) is converted into two photons called as signal and idler. In which laguerre-Gaussian mode ...
Qubit's user avatar
  • 45
1 vote
1 answer
71 views

Extract boundary points of an interpolating function obtained by NDSolve

Given a set of coupled nonlinear equations I want to extract the boundary points that appears in the interpolation function obtained as an output to NDSolve function and then to define them directly ...
Daniel Vainshtein's user avatar
2 votes
1 answer
76 views

Discrete number does not work well in DSolve

The code below works fine. ...
metroidman's user avatar
0 votes
1 answer
99 views

Which condition is better for WhenEvent?

I'm solving a non-linear system with NDSolve. See my previous post In the WhenEvent, which one is better for ODE solving ...
metroidman's user avatar
0 votes
0 answers
40 views

Trouble implementing switching hybrid system with NDSolve

I'm trying to use NDSolve to simulate a hybrid nonlinear system that switches between different linear behaviors based on states and inputs (i.e. switching from one linear behavior to another) which ...
Cameron Alred's user avatar
1 vote
0 answers
460 views

How to include impulses in differential equations?

I have two coupled differential equations as follows: $$S'(t) = - \frac{a}{1 + B(t)} S(t),$$ $$B'(t) = \frac{c}{1 + S(t)} B(t) (1 - B(t)) - d B^2(t) \Big( \frac{1 - B(t)}{B(t)} \Big)^n,$$ where $a$, $...
user avatar
0 votes
1 answer
75 views

Solving a differential equations with initial condition (piecewise function)

My code: ...
eraldcoil's user avatar
  • 183
1 vote
1 answer
51 views

Error in using the function NDSolve [closed]

I am trying to numerically solve a system of ordinary differential equations. ...
Viktoriya Kukanova's user avatar
3 votes
2 answers
215 views

Is there a way to improve the speed of the NDSolve in my code?

I want to tell the background before raising the question of details. My boss and I are designing synthersizer in a millimeter-wave chip. He analyzes the transient behavior with Julia. His code is ...
metroidman's user avatar
0 votes
1 answer
200 views

Using ParametricNDSolveValue and MultiNonlinearModelFit to fit an ODE system to datasets

I asked a question here about fitting an ODE system to given datasets. The great answer of @ydd solved the problem nicely. In the mentioned answer, the initial values are taken as the initial points ...
user avatar
0 votes
0 answers
98 views

Problem with function DSolve

Please help me fix the error: ...
Mark's user avatar
  • 15
3 votes
3 answers
115 views

NDSolve fails to solve trivial PDE with mixed partial derivatives

Consider the following PDE with independent variables $(x,t) \in [0,1]\times[0,\infty)$ $$2u_{xt}(x,t)=u_{xx}(x,t)$$ initial condition $u(x,0)=1$ and with boundary conditions $u_x(0,t)=0$ and $u(1,t) =...
phonon's user avatar
  • 105
4 votes
2 answers
424 views

Modeling experimental data with differential equations

I have the following two sets of experimental data, which show the dependencies of two quantities, namely, $S$ and $B$, on time ($0$ h, $3$ h, $6$ h, $9$ h, $15$ h, $18$ h, $21$ h, and $24$ h): ...
user avatar
3 votes
1 answer
94 views

xAct/xCoba and DSolve Don't Work Together

Context I'm trying to derive the Reissner-Nordstrom metric for a charged nonrotating black hole using xAct. The idea is to first have a metric of form $$ds^2 = e^{2\alpha(r)}dt^2-e^{2\beta(r)}dr^2-r^...
mijucik's user avatar
  • 157
2 votes
2 answers
162 views

DSolve doesn't produce the expected result

I have the following function: $$B(t) = \frac{a^n}{a^n + t^n}.$$ By taking derivative from both sides with respect to $t$ and after some manipulation, one obtains: $$B' = - \frac{n}{a} B^2 \left(\frac{...
user avatar
3 votes
2 answers
252 views

Optimizing an ODE fitting algorithm with interpolated data

Given data, I want to find parameters $p_1,p_2,k_1,k_2>0$ that fit the following ODE system $$ \begin{align} b'(t)&=p_1 a(t)-k_1b(t)\\ c'(t)&=p_2b(t)-k_2c(t) \end{align} $$ where $a(t)$ is ...
sam wolfe's user avatar
  • 4,693
3 votes
0 answers
221 views

How to solve the following integrodifferential equation by generic approach?

Consider the following equation: $$ \frac{\partial f}{\partial t} - p H(t)\frac{\partial f}{\partial p} = \mathcal{I}[p,t], \tag 1 $$ Here, f = f[p,t], with p being ...
John Taylor's user avatar
  • 5,733
2 votes
1 answer
103 views

Calculating the largest Lyapunov exponent with NDSolve for a damped pendulum

I'm using Mathematica to compute the maximum Lyapunov exponent for a damped pendulum. Ideally, when the damping is zero, the exponent should be zero, and for finite damping, it should be negative. ...
Mimo Mukherjee's user avatar
1 vote
3 answers
106 views

NDSolve producing oscillatory results

NDSolve producing very oscillatory solutions even after not having any large numbers or warning/errors ...
user105697's user avatar
1 vote
0 answers
55 views

Solving PDE for Diffusion Equation (Boundary Condition Issue) [duplicate]

I am trying to solve this partial diffusion equation shown $$\dfrac{\partial\overset\sim\rho_c}{\partial\overset\sim t}=D_c(\overset\sim r)A\left(\dfrac{\partial^2\overset\sim\rho_c}{\partial\overset\...
Snowymint's user avatar
1 vote
1 answer
77 views

Numerical instability due to convection dominated PDE [duplicate]

I am trying to solve this partial diffusion equation$$\dfrac{\partial\overset\sim\rho_c}{\partial\overset\sim t}=D_c(\overset\sim r)A\left(\dfrac{\partial^2\overset\sim\rho_c}{\partial\overset\sim r^2}...
Snowymint's user avatar
1 vote
1 answer
77 views

Imaginary Result on NDSolve+NIntegrate

I posted the same question in the Physics StackExchange, wondering if it is physics problem. I haven't received any answers, so I am posting in Mathematica StackExchange to see if it is programming ...
Saesun Kim's user avatar
  • 1,810
1 vote
1 answer
251 views

Numerical solving diffusion equation in spherical coordinates

Mathematica nicely solves Poisson's equation in spherical coordinates as ...
Rodion Stepanov's user avatar
1 vote
1 answer
54 views

First order differential equation with two conditions

I want to produce all possible solutions for this equation: ...
Mathecis's user avatar
  • 153
3 votes
1 answer
121 views

How to optimize ODE parameter fitting?

Consider the data ...
sam wolfe's user avatar
  • 4,693
1 vote
1 answer
56 views

How to fit a linear ODE system?

Consider the equations $$ \begin{align} b'(t)=p_1 c(t)-k_1b(t),\\ c'(t)=p_2b(t)-k_2c(t) \end{align} $$ Given data on $b$ and $c$, and initial conditions, how do I find the best fitting parameters $k_1,...
sam wolfe's user avatar
  • 4,693
2 votes
1 answer
86 views

Step problem in NDSolve with FixedStep method

We want to solve a set of ODEs with fixed step, whose size is 1/1000, the related codes are given in the following. The parameters are given by ...
so_sure's user avatar
  • 309
0 votes
1 answer
180 views

How to generate phase plots for the solutions of this ODE system?

...
Math's user avatar
  • 407
2 votes
1 answer
60 views

Getting empty ListLogLogPlot from a Transpose

...
Julian Yussef's user avatar
0 votes
1 answer
111 views

Trying to plot the Fourier transform solution to the heat equation on Mathematica [closed]

I have gotten the solution of the heat equation as where f(y) is the initial heat distribution which I have been given as f(x) = e^([Sigma]x^2). I am supposed to plot this at the value of sigma 1, 2 ...
yen's user avatar
  • 1

1
3 4
5
6 7
152