The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
1answer
68 views

How to chop a complex number?

I'm solving some differential equations by iterating and I want to use Chop to get rid of noice smaller than a certain threshold. However, I found that Chop only "chops" the real part, not the ...
0
votes
0answers
40 views

How to resolve underflow occurrences?

I am solving a second order differential equation described by odey below. For the asymptotics, I have the following code which will be used as initial conditions for NDSolve. ...
0
votes
0answers
40 views

How to solve forward Kolmogorov birth-death equations for unspecified number of populations

I'm attempting to use a forward Kolmogorov differential equation to model a birth-death process. This is fairly trivial when there's only one population, but I'm working with an unspecified and time-...
13
votes
1answer
534 views

NDSolve`FiniteDifferenceDerivative gives wrong result when the precision is not MachinePrecision

Bug introduced in 8 or earlier and persisting through 11.0.1, fixed in 11.3 or earlier. I want to get a pseudospectral differentiation matrix by ...
0
votes
0answers
40 views

Non-linear ODE from closed-loop system and Response (Part II)

I again need help with the Mathematica. We have the following affine system. I need to get expressions describing the changes of $x_{1} \left( t \right)$ or $x_{2} \left( t \right)$. The only thing ...
0
votes
1answer
39 views

How to create a correct density plot from “NDSolve” solution?

I would like to create the projection of a solution in plane from the differential equation set solution. However, the way I did it is not as I would like it, it does not have a smoothness. Here's ...
0
votes
2answers
99 views

Numerical resolution of non-linear coupled ODEs

I have problem with my code in Mathematica. I have introduced the set of coupled non-linear ODES. This is the resolution part: ...
4
votes
1answer
87 views

Adaptive Meshrefinement NDSolve&FiniteElements

In a simple example I try to solve the heat equation using NDSolve and Method->"FiniteElement". I know that NDSolve gives ...
0
votes
0answers
28 views

Solving differential equations and plotting the function against a parameter

I wrote the following code using the function NDSolveValue ...
1
vote
1answer
48 views

How to solve this ODE by DSolve or NDSolve?

I try to solve this second order ODE to get k: $ \frac { \partial }{\partial z} ~ \frac{ \partial } {\partial \bar{z}}~ k[z, \bar{z}] = 5 $ Where z is complex coordinates, so to take the ...
0
votes
0answers
46 views

Why the StreamPlot and NDsolve diverge about this vector field?

I frequently use Streamplot and NDSolve for representing vector fields and their trajectories. But for the first time these tools present different dynamics. How can I fix it? I am putting here the ...
0
votes
0answers
48 views

Second order differential equation not getting solved using DSolve

I am trying to solve this second order differential equation $-\frac{k T}{q n(x)} \frac{d^2n(x)}{dx^2} + \frac{k T}{q (n(x))^2} (\frac{d n(x)}{dx})^2 = \frac{q}{\epsilon} (N_D(x) - n(x))$. So I want ...
0
votes
0answers
27 views

Solving numerically a dissipative non-linear system of coupled ODEs [duplicate]

My problem is to integrate a set of couple non-linear and first order ODEs. They are Eqs. (45) -- (50) in the paper https://arxiv.org/pdf/1901.03380.pdf. This is the set of differential equations I ...
0
votes
0answers
34 views

Plotting NDSolve function in complex coordinates

I have this system of equations: $- \ddot{z} + \frac{1}{g} \frac{\partial g}{\partial z} \dot{z}^2 + \frac{1}{g} \frac{\partial g}{\partial z^*} \dot{z} \dot{z}^*$ =0 , $- \ddot{z}^*+ \frac{1}{g^*} ...
3
votes
2answers
54 views

Checking NDEigensystem Results

I'm looking to verify the output of a call to NDEigensystem. I'm doing this by plotting the operator acting on the Interpolating Function outputs versus the ...
7
votes
2answers
4k views

ndsz : step size is effectively zero; singularity or stiff system suspected

This is the first time I ask a question. I have seen many solutions to this error and tried but they are not working. Here is the code. ...
6
votes
1answer
450 views

Meniscus outside of a cylinder - axisymmetric Young-Laplace equation in semi-infinite domain

How to solve the axisymmetric Young-Laplace equation $$\frac{z'(r)}{r \sqrt{z'(r)^2+1}}+\frac{z''(r)}{\left(z'(r)^2+1\right)^{3/2}}=z(r)$$ with b.c.s $$z'(1)=-2$$$$z'(\infty)=0$$ where $z=Z/l_c$ ...
1
vote
0answers
31 views

Time optimization of motion using mathematica

Let us say I have a double pendulum, with the torque equations and the initial and final poisition of the end point of the pendulum. I have constraints on the maximum and minimum values of torques. I ...
1
vote
3answers
74 views
0
votes
0answers
44 views

Using FullSimplify to simply expressions involving differential operators

I am trying to simplify some long formulas involving differential operators in $n$ variables. For example, I want to simplify $$\left(\frac{\partial}{\partial x}-\frac{\partial}{\partial y}\right) \...
0
votes
1answer
55 views

Differential equation is not working

I am trying to solve Differential equation, but its not working. Even, if I am using rhs=1, still it does not work. Any idea will help me a lot ...
0
votes
1answer
73 views

Nonatomic expression expected at position 1 in First[None]

This is a follow-up question to an earlier question:Solving a system of PDEs on a piecewise polynomial domain. I tried to solve the system of equations from one of my previous post with the different ...
5
votes
1answer
181 views

Mathematica code for bifurcation diagram in 3D

Good day. I need help with the code in mathematica to plot the bifurcation diagram (e vs z*) or (e vs x*), for the system ...
1
vote
1answer
51 views

Hybrid ODE simulation with very small parameters

I am trying to solve a Hybrid dynamical system using NDSolve and WhenEvent. I am able to simulate when the parameters are close ...
0
votes
0answers
37 views

How to solve a system of five second order differential equations with boundary conditions?

I want to solve system of five differential equations of second order with their respective boundary conditions. So, I create a function that depends on their solutions. Such as ...
2
votes
1answer
47 views

NDSolve Maxsteps Reached Error

I'm trying to solve a system of Equations. The code is commented below, I am mainly conserved with the last few lines, specifically the NDSolve line. No matter what I do to the Maxsteps option, the ...
0
votes
0answers
49 views

Recommended model for hysteresis

I have a fabric-based strain sensor and would like to find out what other recommended models can be used in the hysteresis modelling. I have tried using the cubic function for loading and unloading ...
6
votes
3answers
191 views

Include boundary conditions in wave equation solver

I'm solving a wave equation using mathematica. I already included the initial displacement and velocity. However, I don't seem to be able to include boundary conditions $u(-\pi,t)=u(\pi,t)=0$. ...
2
votes
1answer
56 views

Mathematica crashes with non-integer exponents using NDSolve

I want to solve a system of coupled PDEs. It works fine if I set $i=0.$ ($i$ is in the exponent of the PDEs) or $i=1.$ in the code. However, if I set, e.g., $i=0.1$ NDSolve crashes after a few seconds....
0
votes
0answers
50 views

Solving ODEs in several variables for a single function?

Consider differential equations such as ...
6
votes
1answer
105 views

Stabilized Inverted Pendulum Blog Post Broken in 12.0?

One of the old Wolfram blog posts that I use frequently is this demonstration of the LQR gains computation. https://blog.wolfram.com/2011/01/19/stabilized-inverted-pendulum/ I've been able to trust ...
10
votes
0answers
231 views

Solving Maxwell's Equations in Mathematica

For the sake of demonstration (for my students) and practice, I wanted to numerically calculate the electric and magnetic field (3D) for a sphere of uniform density moving slightly to the right and ...
0
votes
1answer
82 views

How to solve set of linear differential equation in Mathematica?

I have a set of linear differential equations and are written in this format [X']=[Y]-[R] where [P][Y]=[Q] My actual P matrix size is of 20x20 and Q is of 20x1 and Y is of 20x1. I have written this ...
1
vote
1answer
50 views

How do I formulate a Dirichlet boundary condition for which the boundary depends on the other variable?

I am trying to solve the Poisson equation on a cylindrical grid. $$ \frac{1}{r^2} \frac{\partial}{\partial r} r^2 \frac{\partial f(r, \theta)}{\partial r} = n(r, \theta) $$ Analytically, there is ...
0
votes
1answer
53 views

Asymptotic solution of a second-order ODE containing InverseFunction

Essentially, I have a second-order differential equation given by ode below. In order to solve it, I need to obtain an asymptotic solution where $g(x)$ must vanish at infinity which will be used after ...
2
votes
2answers
99 views

Trouble second-order ordinary differential equations with integral terms

I am a beginner of mma. During the learning of differential equations, I encountered a very difficult problem, a second-order system of ordinary differential equations with integral terms. This ...
6
votes
1answer
235 views

Neumann boundary condition is not satisfied

I want to solve the diffusion equation on a disk centered at (0,0) with a radius of 1. I also want the flux at a radius of 0.8 to be zero. I have this initial condition at time zero: ...
6
votes
1answer
377 views

Can NDSolve address spherical gravitational collapse?

As far as I know spherical gravitational collapse -of central importance to theoretical physics- is thought to be out of the scope of Wolfram Mathematica. However there are cases, as in this article,...
3
votes
1answer
73 views

Coupling DirichletCondition of one dependent variable to the value of the second

Maybe due to my limited experience with PDEs solving I could not find the answer to the following issue. Let's say we have a simple advection along a line: ...
2
votes
2answers
150 views

How to use NDSolve with limited RAM?

How can I use NDSolve when running out of RAM? The code I am implementing: ...
0
votes
0answers
43 views

Slope Fields in Mathematica and Sketching Appropriate Solution Curves

How would I plot the differential equation dv/dt = 32-1.6v, where v(0)=0 I also need to solve for the limiting velocity. I am having a hard time figuring out how to find the limiting velocity. I ...
1
vote
1answer
103 views

Shooting Method for Numerical Solution

I am trying to solve the following nonlinear differential equation using the shooting method. The equation is a boundary value problem with boundary condition x[0]=Pi and x[Infinity]=0. In order to ...
6
votes
3answers
447 views

Compare FEM mesh with the mesh created within Mathematica

This is a follow-up question to an earlier question: Make uniform mesh with quad elements Question: How to solve system of equations with NDsolve on the mesh created in Ansys in order to compare it ...
0
votes
1answer
74 views

Simplifying $\left(f\left(x\right)\frac{\partial}{\partial x}\right)^nf\left(x\right)$ into a summation

In case you're wondering how to get differentials to act like operators in Mathematica, I stumbled across a package Carl Woll made to solve this issue in this question. There's a a more recent version ...
0
votes
2answers
45 views

Using MinValue with NDSolve

A simplified example looks like this. The basic idea is to maximize fHelper by adjusting \[Alpha] for each ...
3
votes
1answer
67 views

Unable to use ElementMarker in DirichletCondition with structured quad mesh

I would like to use ElementMarker in a DirichletCondition on a structured quad mesh, but I am receiving the error: ...
12
votes
1answer
807 views

Simulating a partial differential equation - reaction-diffusion systems and Turing patterns

I want simulate a reaction-diffusion system described by a PDE called the FitzHugh–Nagumo equation. The system that has been proposed by Alan Turing as a model of animal coat pattern formation and is ...
2
votes
1answer
62 views

Mathematica 12: avoid crashing when using NDSolve on a large domain

I have a set of coupled PDEs, that I'd like to solve numerically using Mathematica (11.3 or 12.0). The problem is, that I need to solve in on a large domain to make sure that there are no boundary ...
0
votes
0answers
47 views

ReplaceAll error on trying to extract solutions the results of DSolve

I'm trying to solve symbolically a system of differential equations (simplified example): ...