Questions tagged [numerical]

This tag is for questions concerning problems using numbers which either cannot be exactly solved, or where the exact solution may be much more difficult to acquire than by using numerical methods.

This tag is for questions concerning problems using numbers which either cannot be exactly solved, or where the exact solution may be much more difficult to acquire than by using numerical methods.

It includes questions about algorithms, precision and accuracy of underlying numbers, advantages and disadvantages of several methods, error propagation, problems with the underlying numbers and data structures.

508 questions
0
votes
1 answer

numerical integration of matrix in Matlab

I have to numerically evaluate, in Matlab, the integral of the product of two functions A(x,y) and B(x,y). These two functions are in 2-dimensional array form. The integral should read as following I understand that the function such as "trapz"…
Giuseppe P.
  • 21
  • 1
  • 6
0
votes
1 answer

pack multiple c++ objects and pass to function

I am using a c library to do integration, where the integrand is declared as fun(...,void *fdata,...) which uses *fdata pointer to pass external variables, however, before doing numerical integration, I need to interpolate the raw data using other …
lorniper
  • 626
  • 1
  • 7
  • 29
0
votes
0 answers

Matlab: ODE with unusual initial conditions

I am trying to solve differential equation numerically: y'' + a * y * sin(x) + b * y = 0 with initial conditions: y(0) = 0 y'(0) = y'(1) But there are only simple initial conditions in examples. And I can't use solvers like ode45. Is there any way…
cordalace
  • 1
  • 2
0
votes
1 answer

PHP - Sort keys of an array that are different strings but contain numbers at the end

I have the following keys in my array: Array ( "Danger - 69" => Array(); "Fab - 67" => Array(); "Cat - 68" => Array(); ) I want it to be ordered by the number in the string and not the first letter in the string itself, like…
0
votes
1 answer

Fast incomplete gamma function

What is a fast way to calculate the incomplete gamma function, or at least a "good" approximation of it, in C++? Background What I ultimately need to calculate Given a number of Bernoulli trails N, with probability p of success, I'm ultimately…
Museful
  • 6,711
  • 5
  • 42
  • 68
0
votes
1 answer

Reading with Matlab specific lines from a file and converting them to numerical values

I create a code in MATLAB that optimizes an ANSYS study, so i want to check the ANSYS output file and see if the results are acceptable or not. This code has as imputs parameters that are used by ANSYS to create the model. These parameters change at…
dolving
  • 3
  • 2
0
votes
0 answers

Mathematica. Integration of an oscillating function

I need help with an integral in Mathematica: I need to calculate the integral of x^(1/4)*BesselJ[-1/4, a*x]*Cos[b*x] in the x variable (a and b are parameters) between 0 and Infinity. The function is complicated and no analytic primitive exist, but…
0
votes
1 answer

bash short by two columns

I've this dataset: 12363 111111 12363 222222 12363 3456 12364 2895 12364 257363 12364 246291 12364 243701 12364 243699 I would like to sort this by first column, numerical value, reverse and by second column, numerical value, reverse. Result would…
Tomi Mester
  • 109
  • 1
  • 12
0
votes
1 answer

Matlab, Numerical Line Integral in a cube fof each point to a reference point

I have scalar Electric Fields in a cube of 256*256*256 (1 mm steps ) and I am trying to calculate voltage at each point according to a reference point. to do so: I need to do the line integral along each line connecting each point in the cube to the…
0
votes
1 answer

Solve Integral Equation using matlab

Line 227: f1 = @t v*w*cot((sqrt(v))*(t-t2) + acot((sqrt(u2/w))))/(rout - rb/2 - (t - t2)*(t - t2)*g*(sin(k))/2); Line 228: f2 = @t x4t2d - quad(f1, t2, t2d); Lin3 229: t2dapprox = t2 + 0.1; Line 230: t2d = fsolve(f2, t2dapprox); Matlab is giving…
0
votes
3 answers

Show numerical keyboard_android

I want to show numerical keyboard when edittext is focused. I tried myEditText.setInputType(InputType.TYPE_CLASS_NUMBER) but then it only accepts number as an input and ignores backspace etc. I just want that numerical keyboard is showed rather…
sparrkli
  • 661
  • 1
  • 7
  • 17
0
votes
1 answer

Using MPFR And Adding - How many Digits are Correct?

I have a pretty easy question (I think). As much as I've tried, I can not find an answer to this question. I am creating a function, for which I want the user to enter two numbers. The first is the the number of terms of a certain infinite series…
Rick Farr
  • 3
  • 1
0
votes
1 answer

Timing numerical operations on large vectors. How to draw a fair comparison?

I am timing some simple numerical operations to decide how (i.e., using what tools from what library) I am going to implement a computationally intensive simulation. The code below computes the sum of two inner products of vectors using (1) MTL4…
Drake
  • 857
  • 5
  • 10
0
votes
0 answers

Modify dependent variable in stiff solver (vode)

I am using the dvode ODE solver from netlib to solve a stiff sparse system (the application is atmospheric chemistry). On the first call of the subroutine dvode completes a set of initialisation tasks, and takes the array of initial value of the…
nullglob
  • 6,903
  • 1
  • 29
  • 31
0
votes
2 answers

Actual math formula involved with C++ code

Question: I am trying to find the mathematical formula used in conjunction with this C++ code below. I am trying calculate by hand the solution be hand.I have found formulas involving logarithms but nothing below. and the solution they provide do…
user1560265
  • 57
  • 1
  • 2
  • 8