Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

5
votes
1answer
363 views

Solving homogeneous Fredholm Equation of the second kind

I am trying to solve a homogeneous Fredholm integral equation of the second kind, i.e. $\lambda y(x) = \int\limits_a^b e^{i[\phi(t)+k(t-x/M)^2]} y(t)\,dt$ where $\lambda$ is the eigenvalue (to be ...
5
votes
1answer
818 views

Solve system of ordinary differential equations that doesn't have an initial condition (t=0), but has an inifinity condition (t=infinity)?

I have a question for solving t -> Infinity on Mathematica. First, I have a system of ODEs: ...
5
votes
1answer
122 views
5
votes
1answer
98 views

Finding minimum fly-by radius between Mars and spacecraft from interpolating function

I've written an interplanetary trajectory solver/plotter that plots the path taken by a spacecraft on an Earth-Mars mission, but have run into a little trouble when the spacecraft actually reaches ...
5
votes
1answer
273 views

Proper use of arbitrary number of variables

So, I'm working on a project where the number of independent variables is not fixed. Consider a problem of $N$ independent variables, $\boldsymbol{r}$. I want to perform different things with them. ...
5
votes
0answers
118 views

Numerical solution of Schrödinger-type equation in Mathematica [duplicate]

I want to solve the following differential equation numerically: \begin{equation} i\partial_{t}\psi(r,t)=\left[-\frac{\Delta}{2m}+g\left|\psi(r,t)\right|^{2}+V_{d}(r,t)\right]\psi(r,t) \end{equation} ...
5
votes
0answers
86 views

Modify NDSolve`StateData (if possible)

I am trying to solve a PDE that needs to be scaled constantly (refer to this). @andre suggests I modify NDSolve`StateData. Now, the problem is, I'm not used to ...
4
votes
2answers
679 views

Does Mathematica have a command analogous to ode45 of MATLAB?

Does anybody know if Mathematica has an analogue of MATLAB's ode45 command? I need to solve a second order coupled ODE system of equations.
4
votes
2answers
583 views

How to solve for an Z-Score of a T-Distribution?

I'm looking for the Z-Score for a distribution, where the integrated area sums up to 0.90. Unfortunately I always get an error from Mathematica, ...
4
votes
5answers
382 views

Problem using WhenEvent to constrain solution

Note: This question has also been posted at the Wolfram Community Problem: Simulate pressure in volume 1 and 2 for 1 second. The circuit is as follows: From this I set up the governing DE for ...
4
votes
5answers
307 views

NIntegrate::slwcon Problem

I have a problem with numerical integration of this function. Integral value is zero, but NIntegrate[] needs a lot of time to calculate this. Is there any way to ...
4
votes
4answers
868 views

Numerical differentiation methods

Is it possible to write a code in Mathematica that implements various differentiation methods (like forward, central, extrapolated, etc.)?
4
votes
1answer
498 views

Is it possible to calculate a Lebesgue integral in Mathematica?

As the title says, I wonder if it is possible to calculate a Lebesgue integral in Mathematica, especially when the domain of integration is $\mathbb{R}^N$, or in other words multivatiate Lebesgue ...
4
votes
2answers
164 views

LevinRule and SphericalBessels

I'm currently looking at a simplified problem that approximates another problem I'm looking into. In this simplified problem I at least have an analytic integrand and can easily provide all info on ...
4
votes
3answers
289 views

How could I get the value of y[t] at each specific interpolation point?

sol = NDSolve[{Derivative[2][y][t] + Sin[y[t]] == 0, Derivative[1][y][0] == 0, y[0] == 1}, y, {t, 0, 2}] the above-mentioned differential equations can be solved ...
4
votes
1answer
237 views

Integral of integral — it takes too much time

When I evaluate the following expression in Mathematica, it takes so much time that I don't want to wait for the evaluation to complete. So I think that there must be a better approach. ...
4
votes
2answers
202 views

How to use NIntegrate when there are symbolic constant coefficients

I would like to numerically integrate an equation such as the one below in which there are symbolic constant coefficients. I used a very simple code but it doesn't work in general, that tried to deal ...
4
votes
3answers
515 views

Numerical solution of a differential equation with NIntegrate coefficients

I am trying to solve a linear ODE with a variable coefficient which is given in terms of an integral I can only do numerically. That is, I have an equation of the form $$ ...
4
votes
1answer
336 views

Differential Equations with Matrices

I'm trying to implement the differential equation of a Cellular Neural Network in Mathematica as seen below: ...
4
votes
1answer
886 views

Incorrect solution of diffusion equation with Neumann boundary conditions

I want to set up a PDE model, which takes a two-dimensional diffusion equation into account. The key problem is that I have some trouble in solving the two-dimensional diffusion equation numerically. ...
4
votes
1answer
95 views

How to use WhenEvent with a vector ODE in NDSolve

I have an ODE system I'd like to specify as a vector equation in NDSolve. I'm not clear on how to use WhenEvent for a system ...
4
votes
2answers
443 views

WhenEvent in NDSolve

How come this doesn't work as I intended? ...
4
votes
1answer
181 views

How to find derivative of a numerical solution, where precision is ambiguous?

I am trying to take the derivative of a numerical solution. I am concerned that the way I'm doing this may be problematic due to numerical error; I think there must be a better way but I'm not very ...
4
votes
2answers
162 views

Calculating the area under a curve, but above a certain threshold value

so here I am with a time series of data (hours (t) and corresponding measurements (a)). ...
4
votes
1answer
164 views

Find lengths of contours in a ContourPlot

I am trying to find the lengths of different contours in the following plot: It is a complicated piecewise function evaluated on the unit disk. I am hoping there is an easy, generalized way to ...
4
votes
2answers
321 views

Why does this integral have a complex component?

I wanted to find the probability of my normally-distributed random variable being at least 15, so I set up this integral: ...
4
votes
1answer
176 views

How to demonstrate lack of stability with advection equation

I am trying to that using a coarse grid with an explicit method for, say, the advection equation leads to an unstable solution. The trouble is Mathematica avoids unstable solutions with good ...
4
votes
1answer
298 views

Error Interpretation in NIntegrate

I am using a recursion algorithm developed by Migdal for Lattice Field Theory, and I have the following code: ...
4
votes
2answers
717 views

How to Solve this ODE with Mixed Boundary condition

I have an ODE equation which is sort of y''[x] + 2 y'[x]/x + .0001 (y[x])^3 ==0 subject to the boundary conditions ...
4
votes
2answers
431 views

Numerical Integration as Model for Nonlinear Fit

I'm trying to do a fit for parameters of a function within an integral but I'm getting errors when I try and run it. Essentially I want the following fit to work out: ...
4
votes
1answer
462 views
4
votes
2answers
2k views

How to handle NDSolve::ndsz problem (singularity problem)

I have 2 second order differential equations (non-linear). The physics behind them is correct. I verified the equations many times. It is a solid pendulum with a mass-spring at the end of it. Now, ...
4
votes
2answers
1k views

PDE Boundary Conditions

I am solving a PDE using Mathematica and I would like to know how to implement the condition that the two-variable function y[t,s] is zero whenever ...
4
votes
1answer
198 views

How to choose MaxStepFraction for optimal speed of NDSolve

I'm trying to use NDSolve to solve a 1D Schrodinger's equation, and it seems that MaxStepFraction has huge effect on the ...
4
votes
1answer
367 views

Multiple simultaneous events in EventLocator method for NDSolve

I'm using NDSolve to integrate a system of ODEs, and EventLocator to stop the integration when it leaves a certain region in phase space. This works perfectly as it should. However, I've also added ...
4
votes
0answers
283 views

NDSolve: ProcessEquations and Reinitialize with Piecewise functions

I am having trouble with using NDSolve`Reinitialize when the system consists of a pieceise function. If we define the ODE system ...
4
votes
2answers
253 views

Numerical Integration with InverseErfc

I am trying to numerically integrate an equation that involves InverseErfc (embedded in the copula defined). The equation looks like the following: $$ \int_0^T \int_0^\infty \int_0^\infty ...
4
votes
0answers
278 views

Increase precision of custom function

I hope the title is not misleading: Suppose I have a function that is quite complicated, e.g. f[u_] := Exp[-Exp[- Abs[c.u]^a] Sin[d.u] Sin[(Abs[c.u]^a) ... I ...
3
votes
2answers
180 views

Integration and Fourier transform

I would like to calculate the distribution function from the characteristic function. There is a formula given as $$F_X(x)=\frac{1}{2}+\frac{1}{2\pi}\int_{0}^\infty \frac{e^{i w x}\phi(-w)-e^{-i w ...
3
votes
2answers
2k views

Solving a system of ODEs with the Runge-Kutta method

I´m trying to solve a system of ODEs using a fourth-order Runge-Kutta method. I have to recreate certain results to obtain my degree. But I'm a beginner at Mathematica programming and with the ...
3
votes
1answer
741 views

How to plot and solve the numerical solution of a integro-differential equation

I have a integro-differential equation of the form $y'(t) = - \int_0^t {y(t_1 )} e^{t_1 - t} dt_1, {\rm{ t}} \in {\rm{[0,10], y(0) = 1}}$ My code is: ...
3
votes
2answers
291 views

Speed of convergence for NIntegrate

I'm trying to optimise numerically a function that entails computing the expected value of a truncated trivariate normal distribution and this is taking extremely long -I also get warned about ...
3
votes
1answer
167 views

Convergence in NIntegrate vs Integrate

I am faced with this situation that for a certain integration, $\int _0 ^\infty \frac { \tanh (\pi \sqrt{x} )} {\sqrt{x+10} } dx$ - the command Integrate returns ...
3
votes
1answer
315 views

Why this numerical integration takes so long?

Let me explain the problem. I am trying to integrate a one dimensional integral: $$\int {g\left( {{k_x}},parameter1,parameter2,...\right)d{\mkern 1mu} {k_x}} $$ for the sake of clarity, I will give ...
3
votes
1answer
374 views

Solving the Sine Gordon PDE in mathematica

how can i solve this equation in mathematica? this is sine-gordon eq. but the boundary condition can not recognized by mathematica . thank you for you attention. ...
3
votes
1answer
274 views

Evaluating function only when its optional argument is numeric

I want to have the argument 'a' for myf2 in form of optional argument, but at the same time I need to evaluate the function only if 'a' is Numeric, see also my previous question. ...
3
votes
3answers
603 views

How to integrate a function over a 3D planar polygon?

I am trying to integrate a function over a planar polygon in 3D. In 2D, this is fairly straightforward, using either answer from this question (I use the second answer). If we use an equilateral ...
3
votes
1answer
255 views

Could the PrecisionGoal for NDSolve be a negative number?

The help of Mathematica doesn't say so much about the PrecisionGoal for NDSolve, and I never considered much about it even after ...
3
votes
1answer
563 views

NDSolve Problem

I am trying to solve a chemical equilibrium ODE with NDSolve where one function is the argument to another. I.E. My equations look like: ...