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

learn more… | top users | synonyms (3)

4
votes
0answers
64 views

Extraneous reaped data with NDSolve and WhenEvent

Bug introduced in 9.0 or earlier and fixed in 10.1 In exploring What is the range of values $x$ for which $f(x)$ is higher than $k$ over a given domain?, I came across the following strange ...
2
votes
1answer
38 views
2
votes
0answers
272 views

Crank-Nicolson scheme for the Schrödinger equation

I am trying to solve the 1-D Schrödinger equation with the Crank-Nicholson method. I use the atomic units: time < 10^-14 => 413 a.u.t. length 30 * 10^-9 m => 567 Bohr radii ...
4
votes
3answers
246 views

Implementing Picard's Iteration for solving ODEs

Picard's Iteration is a way of solving the IVP $$y'(x)=f(x,y(x)), \quad y(x_0)=y_0 $$ It consists of defining the following sequence of functions recursively: $$y_0(x):=y_0 \\ ...
4
votes
2answers
174 views

DSolve misses a solution of a differential equation

[Note that in the cited duplicate, DSolve not finding solution I expected, the general solution returned by DSolve is missing a solution for quite different reasons ...
0
votes
1answer
135 views

How to solve constraint differential equations using If function

I have to solve a series of differential equations along with a constraint that has to be satisfied at each point of time where $t\in [0, 100]$ The model parameters are ...
2
votes
1answer
65 views

Potential flow over cylinder with FEM: Pressure field is flipped

Much in the fashion of a few problems already answered on Mathematica.SE (1, 2), I am trying to solve the Laplace equation in velocity potential $\phi$ to simulate irrotational, inviscid flow over a ...
0
votes
1answer
76 views

How to make the plot smooth

There are some stranges point which cause the figure isn't smooth. I think that the reason is the method of numericial integration. Here is my code, it's pleasure that one can revise the drawbacks in ...
-5
votes
1answer
58 views

how to change parameters in NDSolve?

I want to solve a PDE with parameters chosen based on the sign of derivative. For instance in the following PDE ...
2
votes
1answer
68 views

How can I write a loop to get many values from a solution?

I am looking at the value of x[t] at day t = 200 over several years. I tried to do it using a For-loop but it didn't work. This ...
0
votes
0answers
41 views

Evaluate result from NDSolve is slow

I am calculating some partial differential equations with NDSolve, it does it well. However when I try to Evaluate the ...
0
votes
0answers
49 views

PDE: Inconsistent equation dimensions

EDIT: I need to solve the following PDE: $\nabla^2\vec{A}=-\mu_{0}\vec{j}$ where $\vec{j}=\sigma\vec{E}$ and $\sigma=1*10^{10}$ which basically boils down to three different PDE's; ...
3
votes
2answers
69 views

Error control for NDSolve

I have a problem controlling the numerical error associated with the following non-linear ODE : ...
11
votes
1answer
191 views

How to specify PDE Boundary condition on Bspline?

Context I would like to solve a PDE on a boundary which is parametrized as a BSpline. I am trying to solve the force-free Grad-Shafranov equation on a ...
0
votes
1answer
45 views

Output with NDSolve

I use of the following differential equation: s = NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 30}] Output. The solution in a plot. What is ...
2
votes
1answer
233 views

Runge-Kutta-2 on System

After spending some time using the Mathematica documentation and this Mathematica.SE answer, I implemented the Runge-Kutta-2 routines. I am hoping someone can validate what I did and tell me that it ...
4
votes
1answer
125 views

Unexpected results from trying to solve Laplace's equation

I am trying to find the solution to Laplace's equation: $\dfrac{\partial^2 u}{\partial x^2}+\dfrac{\partial^2 u}{\partial y^2}=0$ over the following region of space: the vertices of the triangle ...
0
votes
0answers
58 views

Two warning messages in NIntegrate and NDSolve

Everybody I am trying to replicate the Figure.7 of the article arXiv:1103.2683 However my plot is different from it, which is as follows Then we can find the differences between both figures, first ...
0
votes
1answer
77 views

How to resolve the singularity in NDSolve

I ran into a problem in my Mathematica code. There is a singularity or stiff system in NDSolve. The explicit code is as follows: ...
5
votes
1answer
508 views

How to solve fluid flow problem based on Navier-Stokes equations?

Does anyone know or can provide any examples how fluid flow problem can be formulated and solved in Wolfram Language? Simplest cases of 1D or 2D flows based on Navier-Stokes equations or even their ...
1
vote
2answers
60 views

NDSolve giving NDSolve::deqn: message when given my system of equations [on hold]

I am so new on Mathematica. I hope my question is suitable. I have looked the Documentation Center and looked also on StackExchange but I could not handle the problem. It gives always the error ...
2
votes
3answers
349 views

How can I apply calculus to functions obtained from NDSolve?

Originally, I asked the question below, but the real underlying issue is as follows: When we solve an ODE numerically, I get the answer like this: ...
-2
votes
0answers
55 views

discontinuous equation [on hold]

I want too solve this discontinuous equation and plot results. Plot[{x1[t], x2[t]}, {t, 0, 10}] If M and P are function of time or constant.
0
votes
0answers
37 views

How do I solve first order non-linear system of PDE: $\partial f^i(x,y)/\partial z = F^i(f^1,f^2,…,f^n)$?

I've previously posted this question in Mathmatics.SE but never receive a response. The old post can be found here: ...
1
vote
0answers
79 views

How can I solve the 2D Laplace equation with Neumann boundary conditions? [on hold]

I would like to solve the following boundary value problem for $u(x,y)$: PDE $\quad \quad \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} = 0$ Domain $\quad \quad 0 \le x \le ...
2
votes
1answer
95 views

How can I check that the general solution obeys the original differential equation?

For example: I solved the following differential equation: y''[x] == (λ x^(3/4) y[x])/Sqrt[1-x] that 0<x<1 with the ...
11
votes
1answer
410 views

Inconsistent results of second derivative of inverse fourier transform

Bug introduced in 9.0 or earlier and persisting through 10.2.0 I am trying to get the Green's function of a toy diffusion equation $$\frac{\partial^2 u(x,t)}{\partial x^2} = ...
0
votes
1answer
61 views

Solving an NODE in series

How can I solve this NODE in series y''[x]^2 + (1/2)*y'[x] + (1/2) y[x] == p x + q. `p` and `q` are constant. But do not know how to actually solve it with ...
0
votes
0answers
66 views

Solving a series of non-homogeneous differential equations

I have the following system of differential equations $$\rho1(t) = {(c1-\lambda(t))\over 2k1} $$ $$\dot\lambda(t)={\beta \lambda(t)-{(c1-\lambda(t))^2\over 4k1}}$$ and $$\rho2(t) = {(c2-x(t))\over ...
-1
votes
0answers
38 views

How to solve a certain PDE [closed]

I would like to find the solutions $C(x,r)$ and $V(x,r)$ of the following partial differential equation. with the boundary and initial conditions where a and ...
0
votes
1answer
49 views

Solving a differential equation with multiple coefficients [closed]

I have a syntax problem solving a differential equation in Mathematica (10th version). The input for the equation I need to solve is as follows: ...
9
votes
0answers
66 views

MMA breaks down when `DSolve` -ing a third-order linear ODE

My code is: DSolve[y'''[x] + (x^3 + a^3) y[x] == 0, y[x], x] It should be noted that similar code not only meets the similar problem but also returns more ...
-1
votes
1answer
58 views

ParametricPlot not plotting the results I'm getting from NDSolve

I try to plot a phase diagram with ParametricPlot but everytime Mathematica does nothing. I start by ; ...
1
vote
0answers
78 views

How to obtain the magnetic field of the following set up [closed]

This is the experimental set up: A ferromagnetic cylindrical disk (of irrelevant dimensions) has either sides set at different electric potentials (left side at 0 volts and right side at 1 volt). A ...
1
vote
1answer
76 views

If[ ] not evaluating properly inside NDSolve[ ]

I am trying to solve a set of equations with the NDSolve. I encounter an error which I try to explain it with the below example. ...
4
votes
1answer
66 views

NDSolve returns asymmetric solution to a symmetric equation

I am trying to find the potential of a conducting cylindrical electrode by solving the Laplace's equation. Both, the boundary conditions and the equation are symmetric w.r.t. the change $r\to-r$. ...
4
votes
0answers
69 views

How do I programatically set up an NDSolve with lots of equations?

I'd like to set up... NDSolve[x1'[t]==2,x1[0]==0, x2'[t]==2,x2[0]==0, x3'[t]==2,x3[0]==0, x4'[t]==2,x4[0]==0, x5'[t]==2,x5[0]==0, ... etc Can I somehow use ...
32
votes
2answers
1k views

Variable naming changes everything

Bug fixed in 10.0.0 I am having a rather unusual problem I do not understand with Mathematica where renaming one of the variables of my function causes the function to stop "working". Here is the ...
6
votes
1answer
103 views

Accuracy of Grad-Shafranov PDE's NDSolveValue over implicit region

Context I need to solve for the toroidal flux of the magnetic field above an accretion disc. For this purpose, I define the region over which the flux is non zero, ...
13
votes
2answers
1k views

Neumann boundary conditions in NDSolve over nontrivial region

The problem I would like to solve involves diffusion in the following region ...
3
votes
0answers
66 views

Verification of results given by NDSolve

I am trying to solve a system of ODEs using NDSolve. The differential equations used are obtained by applying method of lines to actual governing equation. The system includes differential equations ...
0
votes
1answer
83 views

How can I use NDSolve with a variable parameter?

I'm a new user and I can't understand how to solve this function for variable values of vr (for example vr from 0 to 5 in steps ...
0
votes
2answers
81 views

Matrixform ndsolve for mobile robot dynamic equations

Error is: NDSolve::ndsdtc: The time constraint of 1.` seconds was exceeded trying to solve for derivatives, so the system will be treated as a system of differential-algebraic equations. You ...
17
votes
2answers
249 views

Getting rid of spikes in the PDE solution

Preamble: I am solving a PDE in a domain representing a rectangle 10X10 with several circular holes, say, like this one (n is the number and r is the radius of the holes): ...
15
votes
5answers
14k views

How can I plot the direction field for a differential equation?

I'd like to plot the graph of the direction field for a differential equation, to get a feel for it. I'm a novice, right now, when it comes to plotting in Mathematica, so I'm hoping that someone can ...
0
votes
1answer
124 views

Plotting a NDSolve solution

I'm working on a neutrino oscillations problem, and am running into issues ploting the solution to my differential equations. The equations have non-analytic solutions so I'm using the ...
6
votes
1answer
107 views

Kernel Crash while using “ValuesOnGrid” method of InterpolatingFunction

I was experiencing some kernel crash while using "ValuesOnGrid" method of an InterpolatingFunction returned by ...
0
votes
1answer
45 views

Ndsolve parametricplot

Ndsolve solution cant manipulate parametric plot!! ...
1
vote
0answers
45 views

Transient PDE with a complex boundary condition

I am trying to solve a PDE, but one of the boundary conditions is complex, because it includes an integral over the function that I am looking for. The code is shown below ...
0
votes
2answers
71 views

NDSolveValue and DirchletConditions for cylindrical disk

my aim in this is to model the current flow of a cylindrical disk with one end set to potential 0 and the other end set to potential 1. In this section of code I am trying to find the scalar ...