Questions on the numerical functions of Mathematica, implementing numerical methods and numerical computing with Mathematica.

learn more… | top users | synonyms (1)

2
votes
1answer
83 views

Mathematica unable to solve equation numerically while Wolfram|Alpha can

I want to solve the following equation 2 x == Sinh[x] Mathematica is unable to do so ...
1
vote
1answer
49 views

Numerical evaluation of ChebyshevT

When I evaluate the following Chebyshev series of the first kind in two different ways, I get two very different results: ...
1
vote
0answers
44 views

on convergence in optimization [on hold]

I am trying to solve a nonlinear programming problem using FindMinimum solver on Mathematica. When I execute, it is printing FindMinimum::eit: "The algorithm does not converge to the tolerance of ...
1
vote
2answers
126 views

A problem about function N [duplicate]

Toady,I have a problem about N,described as below: For example N[1/3, 5] (* ==> 0.33333*) and ...
0
votes
0answers
62 views

NMinimize gives an obvious wrong value

I'm trying to minimize a function of 2 lists of the same lenght, but for now the first list has one element, the second is constant. Essentialy, this baffles me: ...
0
votes
1answer
40 views

How to make a discretized NMinimize more precise

I am using Mathematica for physics research and I want to minimize a Hamiltonian equation with respect to two variables (I have also discretized the problem). I have a single constraint. When I plot ...
0
votes
1answer
61 views

Find exact value

I want to know exact x'[t] value where z[t]=0 I know approximate x'[t] value is 107 but I cannot find how to find exact x'[t] value ...
4
votes
1answer
141 views

Using NDSolve to solve Equation of Motion in cylindrical coordinates

I have a set of coupled differential equations which represents the equation of motion of a particle in cylindrical coordinates with the following Hamiltonian: $$ H=\frac{1}{2m} \left( p_r^2 + ...
1
vote
1answer
70 views

FindRoot with vector functions

I'm trying to solve a system of non-linear equations with FindRoot, and I get the answer, but also a ...
0
votes
0answers
24 views

NIntegrate Issue: Changing integration limits makes calculation time extremely long

After a long time developing some code in mathematica and finally getting it to work, I have unfortunately encountered an odd problem: When I change the limits of integration (and shift the function ...
1
vote
0answers
50 views

Solve set of non-linear equations with least-squares-fitting - constrain results?

I'm trying to solve a set of functions to determine the material properties from a set of measurement values. (To set up this method I just want to fit my model with some already calculated data). My ...
0
votes
1answer
79 views

how to solve second order nonlinear coupled differential equations using NDSolve with hyperbolic function

i have to solve some solitons scattering through this coupled equations. i need to get two different graph, but still the graph did not come out. and also the equations quite complicated containing ...
0
votes
1answer
122 views

Is this function convex?

How can I determine convexity of the function f = Log[ x, 1 + (x^a - 1) (x^b - 1)/(x - 1)] with the parameters $a,\,b$ belonging to the interval $(0,1)$ in ...
5
votes
3answers
272 views

RK4 Gravity Simulator

I have the following RK4 solver which splits the two 2nd order ODEs, used to calculate x and y positions under the influence of a gravitating body where $$x''(t)=\frac{G m ...
2
votes
1answer
121 views

Euler's method for a 2nd order ODE

This is my first post on this site. Also, I'm new to Mathematica. I'm trying to solve my first problem with Mathematica. It's about solving a 2nd order differential equation. I dont have the explicit ...
1
vote
0answers
44 views

How to find a scaling parameter in matrix inversion process by MMA?

I simply would like to find the inverse of a given matrix $A$ by the iterative method $X_{k+1}=X_k(2I-AX_k)$ using $X_0=\frac{1}{\sigma_{max}^2}A^*$. An example is as follows ...
5
votes
3answers
184 views

Numerical evaluation of a sum

I am trying to compute numerically NSum[(-1)^n/n^3, {n, 1, Infinity}]. Of course, using first Sum would work here, but often ...
0
votes
1answer
88 views

Solving for the time-evolution operator in a periodically driven system

I am looking at the Hamiltonian $$H(t)=\begin{pmatrix} 0 & e^{i\Omega t}\\ e^{-i\Omega t}& 0\end{pmatrix}$$ I am trying to solve for the unitary operator $U(t,0)=\mathcal{T}\exp(-i\int_0^t ...
0
votes
2answers
137 views

find the real root

I have the following equation: \begin{equation} (y-1)^{b1} - C~~ y~~ \exp(a x)=0 \end{equation} where $a, b$ are real constants, $C$ may be a complex number. I need to find the real solution of the ...
0
votes
1answer
73 views

Numerical vs Symbolic Integration: Loss of precision

I am trying to integrate the following expression over the time interval $0\leq t \leq \text{period}$. ...
1
vote
1answer
126 views

Runge-Kutta 2nd Order ODE Solver

Suppose I have a 2nd order ODE of the form y''(t) = 1/y with y(0) = 0 and y'(0) = 10, and ...
0
votes
1answer
96 views
4
votes
3answers
278 views

Creating a 3D List Line Plot From Discrete Points

Given the following Runge-Kutta ODE solver and the graphical output below, how do I get a 3D line plot instead of a 3D point plot? I see that there is no ListLinePlot3D function, so I thought it might ...
0
votes
2answers
126 views

Numeric mixed derivatives

In short I need NumericCalculus`ND extended to mixed partial derivatives. This can be done by nesting them, but care has to be taken to evaluate underling ND only when the parameters become numeric. ...
0
votes
0answers
42 views

Ideas for NDSolve?

I'm currently trying to find a numerical solution to a differential equation of the form: D[W[X], {X, 4}] ==(-(1/(delta + G - (G X)/L)^2) + 1/(delta + (G X)/L)^2) ...
0
votes
1answer
92 views

How to implement the second loop

Here I have a problem that probably needs two loops, but I am not sure how to implement them together. The code calculates M for various values of parameter ...
0
votes
0answers
91 views

Mean Squared Deviation for Population Data

I've been using the Lotka-Volterra equation to estimate population sizes and need to find the MAD (mean absolute deviation), MSD (mean squared deviation) and mape (mean absolute percentage error) for ...
2
votes
0answers
63 views

Complicated output from simple Eigenvalues problem

I have code that uses Eigenvalues on matrices of various sizes. But the output of what should be a very simple problem, namely finding the eigenvalue of a 1x1 matrix, is overly complicated. ...
0
votes
1answer
75 views

NMinimize holding problem

I have a function that I want to minimize numerically through an NMinimize command (because it's very complicated analytically). The minimizer call looks as follows: ...
4
votes
1answer
111 views

NDSolve - sampling for result during the computation

I am using NDSolve for a Langevin dynamics problem. I want to the know long term behaviour of my system ($t>1$) but it has to be simulated with very small time steps ($dt\sim 10^{-9}$). An example ...
2
votes
1answer
136 views

Area between Contours in ContourPlot

I feel slightly foolish for asking this because I am so close, but I'm having trouble, so I will anyway. I asked this question two days ago regarding finding the lengths of contours. Now, I'd like to ...
0
votes
0answers
46 views

Numeric function not fully evaluating

I'm running into an issue where it seems Mathematica is not fully evaluating the output of my function h[t_]. I included the definition of phi[t_] just to demonstrate that it is a numerically defined ...
2
votes
1answer
206 views

Different Poincaré maps for same Equation

I've seen the Wolfram Poincaré example. I'd like to modify this sample in order to have a list of Poincaré maps. In the example the event is captured only when ...
4
votes
1answer
157 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 ...
0
votes
0answers
87 views

complicated Numerical Integration, FEM application

I am trying to calculate a 2d Integral which has another 2d integral in the integrands. here is the setup: ...
2
votes
1answer
40 views

Results of ArgMax as a function of a parameter with InterpolatingFunctions

I would like to obtain a function and its derivatives, where the function is defined as the solution to a maximization problem. The obvious approach ...
0
votes
0answers
28 views

NMaximize not satisfying binary constraint

I'm solving an optimization problem in Mathematica with binary integer constraints. It works alright with other constraints. But the only problem is that both NMaximize and NArgMax are not treating ...
0
votes
0answers
32 views

FindRoot with units error: Message text not found

This is sort of embarrassing. I'm working on a document to extol the virtues of Mathematica, and I can't get it to solve a relatively simple system of equations involving units. In this code, when I ...
0
votes
1answer
50 views

NIntegrate and NumericQ [closed]

I need to do numerical integration --> differentiation --> numerical integration. I tried to apply the technique described in the accepted answer to a similar question: ...
0
votes
1answer
59 views

Scaling the time axis of an interpolated function (as in a solution from NDSolve)

I'm wondering how I can change the units of the x (time) axis when plotting a solution from NDSolve. I have obtained three solutions to a system of differential equations, all of which exist over the ...
2
votes
2answers
162 views

How to solve this numerically?

May I ask what is the best way to evaluate ...
4
votes
1answer
419 views

Why IntegerPart[x/(x/2)]=1?

Consider this code x = 0.109354682484; IntegerPart[x/(x/2)] (* 1 *) Precision[x] (* MachinePrecision *) Why does it give 1 ? Version number: 9.0 on Mac 10.9.2 ...
1
vote
1answer
65 views

Discrete sampling of interpolating function returned by NDSolve

When solving an ODE with NDSolve, Mathematica returns an interpolation function. I need a discrete sampling of this function however. Naively, I can write this as (example): ...
0
votes
1answer
220 views

Heat Transfer equation by numerical methods

I want to solve the following heat conduction equation using numerical methods: D[u[x, t], t] -alpha*D[u[x, t], {x, 2}] == 0 u[x, 0] == 1/(1 + x^2)^0.25, u[-10, t] == u[10, t] == 0, ...
1
vote
0answers
33 views

How to find discretezation error of NDSolve

Is there a way to find out how large the truncation, round-off, and other errors that occur from discretizing a differential equation are while using the default settings in NDSolve? Or would I have ...
0
votes
0answers
46 views

FindRoot to find numerical solution of a given index

I want to find solutions of a system of multivariate nonlinear equations of a specific index (i.e., the no. of positive eigenvalues of the Jacobian evaluated at the solution). I know the FindRoot ...
5
votes
1answer
85 views

How to enforce numerical precision throughout a package

I developed a big package that does quite a bit of numerics. Is there a way to enforce that all numerical computations are done with a pre-defined accuracy? For example, can one use something like ...
1
vote
2answers
122 views

Mathematica can't minimize a function

Mathematica seems not to be able to minimize this univariate function over integer arguments, $r>2, r \in \mathbb{Z}$. ...
1
vote
1answer
103 views

Numerically solving an ODE for a parameter

My equation is as follows: sol = ParametricNDSolve[{(f'[r]^2 - 1) f'[r] r == 6.2 (f'[1])^2/1000, f[1] == a}, {f}, {r, 1, 3}, {a}] where the function ...
0
votes
0answers
83 views

Boundary Value Problem- using NDSolve or another method

I am trying to solve a set of coupled partial differential equations, with defined boundary conditions using mathematica. Here are the equations and the boundary conditions. ...