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 on the symbolic (DSolve, DifferentialRoot) and numerical (NDSolve) solutions of differential equations in Mathematica.

0
votes
0answers
26 views

Problem With NDSolve. Non Numerical Value for a derivative at V==0 [on hold]

Sorry for the english, im not a native speaker. If someone could explain me why my NDsolve insnt working on my system of differential equations. I've seen that this usually happens when a symbol of an ...
0
votes
1answer
38 views

Trying to evaluate NDSolve inside of FindRoot

I want to find the equation for the range of a projectile as a function of its elevation angle at launch. Currently, I am stuck in my effort to calculate the time. What I have doesn't work right ...
1
vote
1answer
56 views

Debugging NDSolve to see numerical values at each time-step

I wish to debug my NDSolve function and this is my first time using the Mathematica debugger. I have read around and attempted various different ways of debugging but I cannot figure it out. I want to ...
0
votes
0answers
49 views

Solve second order differential equation with boundary values

I'm a bit new to solving differential equations in Mathematica. I want to solve the differential equation for f(R): Eq = f''[R] + K2[R]*f[R] (*=0*) With the ...
0
votes
1answer
57 views

Randomizing Initial Conditions of NDSolve Differential Equation Phase Space Plots with Looping Structures

I am looking for a way to randomize the initial conditions on the numerical approximation for the angular displacement of a plane pendulum. I have been trying for hours, and believe a For loop is ...
1
vote
1answer
62 views

Is there a way to automate this procedure?

I have some code which numerically solves a differential equation for a given value of the parameter $M0$ and for some initial conditions. The initial conditions will remain fixed throughout the ...
0
votes
1answer
43 views

Symmetric solution of ODE

Is it possible to force DSolve to calculate the symmetric solution? Obviously the ode x''[t] + x[t] == 0 has the symmetric solution ...
3
votes
3answers
98 views

Generate a smooth random function (2D curve) with endpoints specification?

Here is a PDE example, adapted from Wolfram Documentation: ...
5
votes
2answers
507 views

Why Can't `DSolve` Find a Solution for this ODE with y[-x]

I wanted to find a accuracy solution of the following ODE. $$y'(x)+y(x)=-y(-x).$$ But when I try to use DSolve as follows ...
2
votes
1answer
123 views

How to obtain the solution of an ODE in implicit form?

I want to get the general solution of a first-order ODE in implicit form. It should be something like this: With input y'[x] == 1, the desired output is ...
1
vote
2answers
65 views

solving sets of partial Differential equations

Considering two functions $\psi_{1}(u,v)$ and $\psi_{4}(u,v)$. we have these two parial differential equation for them $(-2 i Sech[\frac{u}{\alpha}] \frac{\partial\psi_{4}}{\partial u}+2 i Sech[\...
4
votes
1answer
89 views

Solve PDEs with finite difference scheme by modifying NDSolve-based solver

Motivation As discussed here, NDSolve uses different difference orders for various spatial derivatives and the implicit design could cause trouble in certain cases....
3
votes
2answers
64 views

Using NDSolve with conditional expression

I am trying to solve the 2nd order ODE for a harmonic oscillator under the influence of a harmonic restoring force, a sliding friction force, and a static friction force. My equations are below: $$ x'...
0
votes
0answers
31 views

Differential equation and equation with parameter

I have the equations x[t] == Exp[m t] && (2 t + 1) x''[t] + 2 (2 t - 1) x'[t] - 8 x[t] == 0 Please tell me which function to use to solve it and find the ...
1
vote
1answer
81 views

Having trouble working with two mass, three spring dynamic system

I am following a dynamic analysis example https://www.math24.net/mass-spring-system/ and trying to implement it in Mathematica. However, I am having trouble even getting simple properties like the ...
0
votes
1answer
110 views

Solve a Second-Order Differential Equation Numerically, with boundary conditions?

Below is an ODE with BC define as x[R]=0, x'[0]=0, x'[R]=0 and parameter n. The ODE is stiff at certain data, and I need to see the behavior of x' and x for given ...
1
vote
1answer
70 views

PDE in 3D: Specification boundary condition at infinity

I'm trying to solve the Schrodinger equation and having difficulties to define a limitless region because the problem has the Dirichlet conditions at infinity. Maybe I don't need such a region and ...
-1
votes
1answer
64 views

Elliptical orbit simulation [on hold]

I want to plot the full orbit ellipse. ...
0
votes
2answers
91 views

How can I know how many points are used to by the interpolating function returned by NDSolve?

In a problem in which the solution has oscillations that I solved, the amplitude of the oscillations is much lower than I expected. It looks as if the interpolating function doesn't use enough points ...
1
vote
1answer
92 views

Solving the Dirac equation in an arbitrary metric [closed]

I want to solve Dirac equation in a metric like $ds^2=g(u,v)\,du\,dv$. The relations of $u$ and $v$ with Minkowski coordinates $t$ and $x$ are given by functions $A$ and $B$, $t=A(u,v)$ and $x=B(u,v)$....
0
votes
0answers
44 views

Solving a 4th. order ODE knowing two particular solutions [closed]

I have a fourth order homogeneous linear ODE with smooth variable coefficients. Solving the equation is not easy at all, but fortunately I have two explicit exact solutions at hand. I would like to ...
0
votes
0answers
30 views

DSolve ordinary differential equation initial conditions not working 11.2

I have a differential equation that I want solved using initial conditions. The differential equation is: DSolve[{y''[x] == (g (A*y[x]*p - m))/m}, y[x], x] ...
6
votes
2answers
134 views

Switched linear systems

I'm curious whether it is possible to solve switched linear systems within the framework of NDSolve. For example a system of linear ode's like $$x'(t) = \left\{\...
2
votes
1answer
78 views

Analyze stability of equilibria using Routh-Hurwitz conditions

For an assignment, I need to analyze the stability of a system very close to equilibrium, using "Routh-Hurwitz conditions". I have already obtained the characteristic equation of my system, but I do ...
0
votes
1answer
47 views

Boundary Condition Problem - Diffusion Equation

So, in my 1D diffusion equation, everything works as I would expect. ...
2
votes
1answer
193 views

Solve integro-differential equations

I am trying to numerically solve the following integro-differential equation and get some plots for $n(s)$ vs $s$: $$ \dot{n}(s)-\frac{\dot{w}(s)}{2w(s)}\int_{-\infty}^s ds'\frac{\dot{w}(s')}{w(s')}(...
1
vote
1answer
48 views

How can I solve this non linear system of ODEs using NDSolve?

I want to find solutions to the system: $$\begin{align*} -2b'(s)\sin(b(s)) &= \sin(b(s))(a'(s)b''(s) - a''(s)b'(s)) - (a'(s))^3 \sin^2(b(s))\cos(b(s)) \\ &(a'(s))^2\sin^2(b(s))+(b'(s))^2 = 1\...
0
votes
0answers
49 views

Simulating the motion of the Earth around the sun based on Kepler’s laws

I am using Mathematica 10.3. I want fo perform a computational analysis of the motion of the Earth around the sun based on Kepler’s laws. Here is my code so far. ...
0
votes
0answers
49 views

Solving delayed differential equations with Mathematica

Attempting to solve a delayed differential equation with the given model below, which has the structure of h[x[t - 1]] - .88*x[t]. We have defined h[x_,t_] as a piecewise below, that gives the value 3....
3
votes
2answers
113 views

Schrödinger equation for a hydrogen atom and lack of memory

I'm trying to solve the Schrödinger equation for a hydrogen atom in the Cartesian coordinate system. This is my code ...
2
votes
1answer
67 views

Solving Initial Boundary Value Problem (Second Order PDE)

My attempt at a solution for $ u(x,t) $ is below, I don't think my $ G(t) $ and $ \phi(x) $ can satisfy the initial condition $ \dfrac{\mathrm du}{\mathrm dt}(x,0)=4 + 3\cos(2 \pi x) $ when ...
3
votes
2answers
64 views

Parametric plot from the results of NDSolve

I'm having a bit of trouble making a ParametricPlot from two curves, At fisrt I was having difficulty solving my systems of autonomous ODEs, but then finally got a ...
0
votes
1answer
57 views

Nonlinear differential equation system with initial conditions in the different point

I faced with unusual (at least for me) problems. I have a three nonlinear equations $ \dot x = f(x,y,z)\quad \dot y = g(x,y,z)\quad \dot z = h(x,y,z) $ and the following initial conditions $x(0)=1$,...
0
votes
2answers
65 views

Using WhenEvent to calculate the period of an orbit

I'm having trouble trying to have Mathematica tell me when the period of the orbit of my system is. Namely, I'm trying to use Mathematica to find the orbital period of the Earth around the Sun. Here's ...
9
votes
5answers
231 views

NDEigenvalues vs. FindRoot for finding the eigenvalues of Airy equation?

Say I am trying to find the first 5 eigenvalues of the differential equation $f''(x)=\lambda x f(x)$, on the interval [-1,0], with boundary conditions $f(-1)=f(0)=0$. I will try to do this 3 ways, ...
0
votes
1answer
49 views

Do-loop with ParametricNDSolveValue not giving expected results

I have written code that using a Do-loop. In the loop I am changing the value of x, v, l and R, and looking at the computed ...
3
votes
0answers
64 views

Force exact number of streamlines in StreamPlot

The StreamPlot command has an option for the number of StreamPoints. When I try the first it does not appear to allow you to choose anything other than $10$ (for ...
5
votes
0answers
47 views

Details of NDSolve calling LSODA

Inspired by my question regarding the computation time of NDSolve using the LSODA backend I was wondering how NDSolve is actually calling LSODA (what arguments are sent to LSODA), i.e. what are the ...
7
votes
2answers
494 views

Solving for Stokes flow in 3D?

I am trying to extend Stokes flow example to 3D but I get an error. Not sure what's wrong. For example we define the region and this works: ...
2
votes
2answers
49 views

NDSolve producing message Power::infy

I am trying to solve geodesic equations in some 3D black hole spacetime. It is a coupled ODE system with boundary conditions. Due to the symmetry of the spacetime, I expect the solutions to be even ...
0
votes
1answer
64 views

Plotting the orbit of the Earth around the Sun. Error: step size is effectively zero; singularity or stiff system suspected

I've been asked to plot the orbit of the Earth around the sun over a period of three years. I've copied my exact code below. When I try to run it I get a series of errors, the first being: NDSolve:...
0
votes
1answer
50 views

Estimating parameters for pair of differential equations efficiently

I'm trying to estimate the parameters for the following pair of differential equations ...
0
votes
0answers
45 views

Parametric solution of a system of two nonlinear ODEs with data describing only one the functions

I have the following pair of nonlinear ordinary differential equations ...
0
votes
1answer
73 views

How do I plot the solution of a differential equation?

I am unable to plot the solution to this differential equation in Mathematica representing the current in a RLC circuit with a sinusoidal input. ...
3
votes
2answers
187 views

Solving a non-linear ODE system with ParametricNDSolveValue

I'm trying to solve a non linear ODE numerically with ParametricNDSolve, but as far as I got is shown below. My problem is to set the find root correctly. What I ...
0
votes
1answer
61 views

Combined ParametricNDSolveValue with Do loop?

two weeks ago, I post a question see, and I got its answer, however, I would like to vary the values: g from (0.02 to 0.07), R from (0.1 to 0.3),and k2 from (0.03 to 0.07) by an increment of 0.01 ...
1
vote
1answer
78 views

Simulating a combination of PDEs and ODEs

I am trying to simulate a combination of PDEs and ODEs, given below. $$ \begin{matrix} -L\dfrac{\partial}{\partial t}I(t,z)&=&\dfrac{\partial}{\partial z}V(t,z)+RI(t,z)\\ C\dfrac{\...
1
vote
0answers
39 views

Using NDSolve for coupled PDE's with moving boundary conditions [duplicate]

im trying to solve numerically a one dimensional case of "Stefan solidification problem". The equations, along with BC's and IC's are: I want to solve for P1(X,T),P2(X,T) and Xs(T) is the moving ...
2
votes
0answers
49 views

Solving ODE using `NDSolve`ProcessEquations` in an iterative fashion [closed]

I want to solve the following ODE using NDSolveProcessEquations but in an iterative way. $\ddot{x}(t)+5\dot{x}(t)+3x(t)=2\cos(2\pi t)$ $\dot{x}(0)=0,\,x(0)=1$ I ...