Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
1answer
60 views

WhenEvent detects only the first event

My code is based on the suggestion in this discussion by Michael E2 And when I'm using the same definitions the WhenEvent function locates only the first time the ...
0
votes
1answer
46 views

Why WhenEvent doesn't work in this case?

yb[a_?NumericQ] := a^2; eqns = {x'[s] == -yb[s], WhenEvent[x'[s] > 0, {yb[s] -> - yb[s]}], x'[0] == 0} NDSolve[eqns, x[s], {s, -50, 50}] The WhenEvent ...
2
votes
1answer
50 views

How to set the NeumannValue conditions when the conditions are Discrete points?

For example i can use Piecewise when the condition is a Continuous function ...
3
votes
1answer
42 views

How to trigger WhenEvent for NDSolve in parallel?

Say I have a system of differential equations that I need to solve for different initial conditions and say the process is sufficiently expensive and I have sufficiently many that I am calculating in ...
1
vote
1answer
35 views

Solution dependent variable -how to use WhenEvent

I'm having trouble using WhenEvent function in two-dimensional functions: My goal is to change the value of a diffusion coefficient $\alpha[x, t]$ as a function of ...
3
votes
3answers
80 views

DSolve returns incorrect solution by automatically assuming positive parameters?

The following code solves a simple 2nd-order linear ODE with real parameters $a,b$. ...
0
votes
2answers
54 views

Specifying history for delay differential equations ``near infinity'' (using NDSolve)

Consider the following DDE: $ f''(x)+ f(x+ 1) = 0.$ For $ x \gg 1$, this DDE should approximately reduce to that of a simple harmonic oscillator: $f''(x)+f(x) \approx 0$. Suppose that for some ...
1
vote
2answers
142 views

Solving a nonlinear system of 2nd order ODEs with NDSolve

I'm trying to solve a 2nd order related ODE system with five dependent variables. The code is: ...
0
votes
1answer
75 views

Solving a difficult differential equation

I've the following DE, describing a physical phenomenon. And the prupose is to solve that DE using Mathematica $$x(t)\cdot r+x'(t)\cdot l+a\cdot\ln\left(1+\frac{x(t)}{b}\right)=0\space\...
2
votes
1answer
125 views

How to solve differential equation with absolute value?

I'm a newbie here, I want to solve this equation for my assignment: mg - c x'[t] Abs[x'[t]] = m x''[t] I'm using ...
0
votes
1answer
55 views

Breaks in a LogPlot

I am trying to plot the residuals of a pde solution, using LogPlot. ...
2
votes
1answer
75 views

Solving the Liouville-Bratu-Gelfand equation on the surface of a cube

How do I solve the equation: ...
1
vote
1answer
68 views

Problem displaying Killing equations

What I'm trying to do is to compute the Killing equations and then solve them using DSolve to determine their solutions. I have a problem understanding where my Mathematica program doesn't work ...
0
votes
1answer
73 views

Differentiation of absolute value [duplicate]

I tried to differentiate D[Abs[z],z] and instead of Sign[z], I got the following: ...
4
votes
1answer
154 views

NDSolve`Iterate with shared variables

I'm trying to parallelize a set of NDSolves that share a few variables. Here is a short working example: ...
-3
votes
3answers
126 views

Gives me a complex solution [closed]

A := DSolve[{D[((It - Ir) * x / L + Ir) * w''[x], {x, 2}] - p/Y, w[x] == 0, w'[0] == 0, w''[L] == M0/(Y*Ir), w'''[L] == -P/(Y*Ir)}, w[x], x] I want a real ...
-1
votes
1answer
154 views

Stability issue of time dependent PDE with variable dependent coefficients [closed]

I have the following PDE: $\qquad \frac{\partial P(x_1,x_2,t)}{\partial t} = -\frac{\partial}{\partial x_1}[F_1(x_1,x_2)P] - \frac{\partial}{\partial x_2}[F_2(x_1,x_2)P] + D(\frac{\partial^2 P}{\...
1
vote
1answer
58 views

Use InterpolatingFunction in differential equations involving derivatives and integrals of the InterpolatingFunction [duplicate]

I solved a problem of solid mechanics, 11 unknown components of displacement functions, i.e., ut0[x, y], wt0[x, y], wc0[x, y], .... ...
0
votes
1answer
188 views

Solving Differential Equation System for HIV Treatment Model

I was working on a project about optimal strategies for HIV treatment, models used from [Butler, Kirschner, and Lenhart] 1997. This model explains the spread of HIV viruses in the human body, where ...
0
votes
2answers
161 views

Solving the 3D Poisson equation on the surface of a cube using a relaxation method

The code below is from another question asked by someone else about solving the 3D Laplace equation for truncated octahedron in a cube matrix, How to solve Laplace equation in 3D?. I wanna know, how ...
4
votes
3answers
107 views

Plotting an Equation Using ParametricNDSolve

I'm trying to plot the solution of a set of differential equations and see how the solution changes when the value of a certain variable de is changed. The equations have solutions to the values of de ...
1
vote
2answers
158 views

A numerical boundary conditions paradox

For $(t,z)\in[0,1]\times[-1,0]$ zmin = -1; tmax = 1; and some fields $w(t,z)$ and $y(t,z)$ ...
0
votes
0answers
58 views
0
votes
1answer
46 views

How to force Mathematica to evaluate a limit in the boundary conditions of a differential equation?

I'm experiencing troubles in obtaining the result of an ordinary differential equation with a boundary condition at infinity. I write down ...
0
votes
0answers
47 views

Domain of d.e , Region plot

$$y^{2/3}+(y')^{2/3}=b^{2/3}.$$ This is d.e which solving with parametres. I want frist find and Plot Domain of this D.E with help manipulate for b. When i transformate this d.e in explicit shape, i ...
0
votes
1answer
81 views

Solution of $\frac{dx}{dt}=0,1x(1-x)-0,03(1+\sin(2\pi t))$ I

I want solve differential equation: $\frac{dx}{dt}=0,1x(1-x)-0,03(1+\sin(2\pi t))$ DSolve[x'[t] == 0.1*x[t]*(1 - x[t]) - 0.03*(1 + Sin[2*Pi*t]), x[t], t] It ...
0
votes
1answer
82 views

How to use a test function correctly to terminate a While loop?

I define a test function in order to stop my While loop: ...
-1
votes
1answer
88 views

Solving two coupled PDEs with the pdetoode function posted on this site [closed]

I want to solve two coupled PDEs with pdetoode function: feq = {D[ϕ, t] + U*D[ϕ, y] - D[ϕ, {y, 2}] - (s0 - 1/20*y^2)*ϕ == 0} and ...
6
votes
1answer
120 views

Looking for examples of numerically solving coupled PDE and ODE

I am about to solve a system of coupled PDE and ODE in thermodynamics. My system is a bit complicated, so I would like to learn from some examples before coding my own system. I searched this site ...
0
votes
1answer
56 views

Putting first solution of three NDsolve into an array and plotting

Suppose I have three differential equations systems, each one of them has 4 equations. I find the 4 solutions of each one, let's call them x,y,z,w. Now, I want to take $x_1$,$x_2$,$x_3$ and put them ...
1
vote
1answer
64 views

solving coupled pde with conditions

I have two coupled PDE ...
7
votes
1answer
185 views

How to solve this 2nd-order ODE with singularity?

I tried solving the eigenvalue problem of a 2nd-order ODE $$[b^2(k-2)^2y^2-2b(k-2)(1+2ky)+4k^2+b^2(k-2)3y]f(y) \\- 3b(3by-2)f'(y)\\-(3by-2)^2f''(y)=\lambda f(y)$$ with ...
0
votes
1answer
54 views

Solving coupled pde

I am new to Mathematica and I want to solve this coupled pde I used this DSolve but it did not work. I am not sure what I did wrong. This is how I used ...
9
votes
1answer
160 views

FiniteElement v.s. TensorProductGrid: which is reliable for Schrödinger equation with periodic b.c.?

This is a problem comes up in the discussion under this post and I think it's worth starting a new question for it. I suspect the underlying issue is the same as in this post, but not sure. Consider ...
1
vote
1answer
85 views

NDSolve: method of lines: unexpected error: insufficient boundary conditions

As a test of my ability to master the Method of Lines I tried to NDSolve the PDE's system $$\partial_t \varphi = \varpi\qquad\partial_t\varpi=\frac{1}{r}\partial^...
0
votes
1answer
38 views

NIntegrate error message: “The integrand…has evaluated to non-numerical values for all sampling points in the region with boundaries…”

I am trying to solve the following problem in Mathematica. However, the problem is that R0 is an equation itself, an integral, to be more specific. So I always get the above error message. An ...
1
vote
2answers
175 views

Time-dependent Schrödinger equation and density plot

I'm interested in the density plot of the solution of a 1D time-dependent Schrödinger equation with a given potential. So I have: ...
0
votes
0answers
67 views

Implicit derivative of set of equations

I have an equation and I want to take its derivative with respect to two variables. However, it contains some parameters which need to solve them together to find them (Pn, omega, gamma). These ...
10
votes
1answer
129 views

How to solve (O/P)DE via cellular automaton?

I heard that one can solve differential equations by a cellular automaton. Even though I have searched some papers, which seem too formal to me, I do not get the hang of it. Anyone knows how to get ...
3
votes
2answers
117 views

A complicated use of NDSolve

I am looking for a particular type of plots. OK, let me explain, Here is my DE (I don't know what to call it), where, $\frac{\partial p}{\partial r} =0$, $r_1=\epsilon$, $r_2=1+\phi\cos(2\pi z)$. ...
0
votes
0answers
46 views

How can NDSolve be used to solve the heat equation as a first order system?

For reasons left unsaid, I tried to approximate the solution of the heat equation with initial and boundary data as a first-order system using the following code block: ...
0
votes
0answers
60 views

Solving an Elliptic Equation? [duplicate]

[CapitalOmega] = Rectangle[{0, 0}, {0.5, 0.5}]; ...
0
votes
1answer
74 views

Partial differentiation using Mathematica

I am trying to solve and verify the below equation using Mathematica. $\frac{\partial}{\partial b} \sum_{i=1}^n y_i \log\left[ \frac{\sum_{i=1}^n y_i}{1-\prod_{i=1}^n (1-b)^{Exp[x_i\beta]}} \right]$ ...
0
votes
1answer
70 views

Lowering operator for spherical harmonics [duplicate]

I need to be able to generate all of the $ l=2 $ spherical harmonics using the lowering operator. The specific question is listed below. Any assistance would be much appreciated! Thanksenter image ...
0
votes
1answer
43 views

POD - proper orthogonal decomposition for Reduced Order Modelling

I am trying to figure out how to perform a Proper Orthogonal composition, of which an example of the procedure and analysis are found in the following tutorial video: https://www.youtube.com/watch?v=...
0
votes
0answers
33 views

ParametricNDSolve plot following the tutorial not working (with my system)

I'm trying to simulate the following system: $X'_1=a\frac{X_1^{0.4}}{X_2^{0.15}}-X_1^{0.2},$ $X_2'=X_1-X_2^{0.2}$ $X'_1(0)=X'_2(0)=1$ I simulate the system with the following code: ...
0
votes
1answer
50 views
1
vote
0answers
37 views

Normal form for Hopf bifurcation

I'm trying to obtain the normal form for the Hopf bifurcation using mathematica. I was looking at the following article: downloads.hindawi.com/journals/sv/1995/581272.pdf and I´ve tried to solve (25)...
0
votes
0answers
79 views

DSolve for ODEs with terms like $ y^2(t) $

Mathematica does not give me any solution for the ODEs as follows: ...