Tagged Questions

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

161 views

Transcritical Bifurcation phase portraits

An example equation for a Transcritical Bifurcations is given by: $$\dfrac{dx}{dt} = f(x, r) = r x - x^2$$ In Mathematica, we can define the function as: ...
75 views

Plotting the InterpolatingFunction from NDSolve [closed]

I want to plot the solution of a differential equation which i solve it numerically with NDSolve. Here's the code: ...
56 views

How can use Table for two functions obtained from NDSolve? [closed]

I have obtained a numerical solution using NDSolve for two functions a(x) and b(x). how do I use Table to make a list of a(x) vs b(x) values. is it simply Table[{a(x),b(x)},{x,0,100}] or should I use ...
53 views

Difficulty finding roots of an interpolation function from NDSolve

I have been trying to find the point at which one of the solutions of a system of two ODEs crosses zero. I used the method suggested in this answer to a previous question, which seemed to be the most ...
79 views

How to solve different PDE defined in different regions coupled through boundary condition

I would like to solve two different partial differential equations each one defined in a different region and in different coordinates. However the equations are coupled through a boundary condition ...
72 views

Will the solution NDSolveValue finds outside of the region I give it give me bogus results?

I'm using NDSolveValue to solve Laplace's equation for a relatively simple system. I have two rectangles, separated by a small gap, which I define using RegionDifference: ...
74 views

48 views

How to set MaxStepSize for spatial variable in NDSolve?

When applying NDSolve to a 1-D transient heat equation, the following code appears to set MaxStepSize for the temporal variable t. ...
49 views

Errors only when code is iterated

Hello I'm trying to have two for loops sweep two parameters and for each 2-tuple of those parameters I want to solve a differential equation. To do this I have the following code: ...
360 views

How to write a code to solve my ODE problem?

I have the ODE: $$y''+\lambda y = B^3\sin^3(\sqrt{\lambda}x) \ y(0)=0, \int_0^1 y(x)\sin(n\pi x)dx=0$$ I am not sure how to write the mathematica code to solve this ODE, obviously I need here DSolve ...
133 views

How can I fit cyclic experimental curve with a couple of differential equations?

I have an experimental cyclic curve which looks like this: ...
92 views

...
203 views

So I am trying to solve the movement in space and time of a spreading gravity current. The interface satisfies the following PDE: $\frac{\partial h}{\partial t} = \frac{\partial}{\partial x}\left(h^... 0answers 53 views What I make wrong with Module command; I have a differential equations that I have to solve in two parts.e.g: ... 0answers 56 views Syntax for Neumann/Robin condition in NDSolve [duplicate] I can't follow the logic of how a NeumannValue term is to be incorporated into a pde to provide a BC for NDSolve. The ... 1answer 99 views NDSolve DAE solution order is mixed up Bug in 10.4.0.0, probably introduced earlier. Compare the two solution sets below: in the first one (x == False), there are only 3 dependent variables while in ... 0answers 48 views Time dependent/dynamic parameter in the system of ODEs I am wondering what would be the best way how to code the following situation. I have a solution but I don't think it as elegant as it could be. I have a system with 10 ODEs and lot of parameters. ... 1answer 39 views Define inverse Laplace operator as map from functions to functions I am trying to implement the inverse Laplace operator through P[g_] := h /.NDSolve[{h''[x] == g[x], h[0] == 0, h[1] == 0}, h, {x, 0, 1}][[1]] If I now define ... 0answers 76 views problem with “Infinite expression”, using NDsolve Im trying to solve an heat equation with NDsolve but i have got a Infinite expression error(1/0). this is the code. ... 2answers 39 views Beginners problem, Do Loop, Eigenfunction iteration I am trying to find the first Eigenfunction of the Laplacian (in 1D), i.e. a solution of $$u''(x)=k u(x)\\ u(0)=u(1)=0$$ with minimal$k>0$(in this trivial example, I actually know the analytic ... 1answer 93 views Dog chases his tail ! - “parametric differential/Integral equation”..? I have the following situation where I am interested in the function$m(t)$$$\frac{dm}{dt}=4T(t)^{3}+T(t)^{2}$$ $$T(\tau)=T_{0}-\int_{0}^{\tau}(\frac{dm}{dt})dt*Q_{S}$$ Is there a way to solve ... 0answers 26 views Implementing more accurate boundary conditions in NDSolve I want to solve a second order differential equation numerically. The boundary conditions are needed to be imposed at z=0 and at ... 1answer 159 views Plotting Phase Diagram I have the following problem that I'm sure Mathematica can handle, but it's not working for me! In the following code, I'm trying to replicate the Ramsey Model Phase Diagram. In fact, I want now ... 2answers 280 views Simpler way to type Derivative[1, 0][u][0, x] Though not unbearable, I always feel a little nervous when typing partial derivatives at a specified place e.g.$u^{(1,0)}(0,x)$, which happens a lot when setting initial/boundary conditions for PDEs. ... 0answers 88 views FourierTransform a differental-equations [duplicate] I want to use the command FourierTransform to transform a differential equations from time - domain to complex frequency domain but it don't works. My code is ... 2answers 132 views How do I solve Schrödinger equation with a piecewise periodic Hamiltonian? [duplicate] My Hamiltonian is HI(t) = Piecewise[ {{H1, n τ <= t <= (n + 1/2) τ}, {H2, (n + 1/2) τ <= t <= (n + 1) τ}}] where ... 1answer 195 views Using data from NDSolve into a secondary equation I have this ODE, f''''[y]+Z1*(6 f''[y]*f'''[y]*f'''[y]+3 f''[y]*f''[y]*f''''[y])- N1*N1*f''[y] == 0 subject to boundary conditions ... 2answers 78 views How to simplify a differential equation? Now I get a differential equation like this: (-1 + x) (1 + x)^2 == (2 (1 + x^2) (1 + x^4))/(-2 x (1 + x + x F[x]) + (-1 + x^3) F'[x]) I want to get the standard ... 0answers 46 views Check if interpolated function passes through a specified region Is there an efficient way to check if a curve that was obtained as an Interpolating Function (from solving differential equations numerically) passes through a given region? I am solving for two ... 1answer 58 views How to make Mathematica solve an equation in an analytic class? Here is my small code: ... 1answer 164 views ColorBars or PlotLegends for ElementMeshSurfacePlot3D I want to produce a colorbar legend to the output from ElementMeshSurfacePlot3D (Mathematica 10). The pde was solved using NDSolveValue (FEM pdesolution is the resulting interpolating function) over a ... 1answer 146 views NDSolve with coupled ODE's and unknown singularities I have two coupled ODEs that I am trying to solve numerically. It appears that there is a singularity in the solution to the equations which I am unsure how to get past. Both functions$\alpha$and$\...
49 views

I'm trying to reproduce the following solution to the ODE, $$\frac{d^{2}u}{d\rho^{2}} = \frac{l*(l+1)}{\rho^{2}}u$$ Solution: $$u\left(\rho\right) = C\rho^{l+1}+D\rho^{-l}$$ What I've tried in ...
116 views

Empty WhenEvent action crashes kernel

Bug introduced in 9.0 and persisting through 10.4.1 WhenEvent is new in 9.0. This is an example from the docs, slightly modified (action is wrapped in ...
43 views

How to use NDSolve for mixed types of several equations?

I have three equations, one is partial differential equation and another two are not. They are just normal algebra equations but coupled with the differential equation. I wanna use NDSolve to get ...
121 views

Mathematica Newmark Optimization

Here is my Mathematica code which implements the Newmark method to solve a equation of motion. The variable "ag" contains the accelerations from an earthquake record. Is it possible to optimize this ...
47 views

Extract stiffness matrix from NDSolve

I am solving a set of ODE equations with NDSolve with more than 25 equations. I was wondering is there any way Mathematica gives me the mass and stiffness matrices?
52 views

Numerically solving coupled ODE's with a parameter as initial condition

i'm currently trying to numerically solve a set of coupled ODE's to obtain the functions p(r), h(r) and m(r) in the range of r1 <= r <= r2 with initial conditions m(r1)=a=const and p(r1)=b=const....
73 views

Using an interpolating solution of NDSolve into an algebraic expression

I would like to use the interpolating solution of NDSolve into an algebraic expression without creating a system of a differential equation and algebraic equation. The example is the following, the ...
73 views

How to speed up NDSolve?

I have a program where I need to iterate NDSolve thousands of times for different configurations of a diffusion problem. The thing is, I only need about 3 digits of accuracy. I looked thru previous ...