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
0 answers

preg_match PHP length and numerical

I'm creating a dummy payment page and checking if the credit card is 16 digits exactly in length and numerical only. The problem is: If the credit card number is numerical and under 16digits it echo's ccno length, but also if the credit card number…
CJava
  • 189
  • 1
  • 5
  • 15
0
votes
1 answer

input array of strings in matlab

Problem: Solve linear equations I have a 3×3 matrix and I wanted to take 3 expressions as inputs which contain matrix cells like 2*b(1,1)+3*b(1,2)+3*b(1,3) 3*b(2,1)+4*b(2,3)+3*b(2,3) and evaluate them with different cell values in matrix 0 1 …
Saiteja Parsi
  • 412
  • 1
  • 5
  • 15
0
votes
2 answers

What range of values would be sensible to use to give a sentiment score to a word?

The program being developed is inputting text and outputting a vector (the document) with sentences and words as rows and columns where words are given a numerical value depending on their sentiment. Functional words (like the, was, were) will be…
0
votes
1 answer

multiplication of 3 matrices in a sum

I want to compute: result = SUM (c=0,N) { V_ck * U_lc * S_c } But my 2D matrices are indexed as 1D and stored as column major. I am trying: float *A,*B; int M,N; A = (float *) malloc( M * N * sizeof(float) ); B = (float *) malloc( M *…
George
  • 5,808
  • 15
  • 83
  • 160
0
votes
1 answer

Numerical precision of implementation for convex quadrilateral area

I have implemented a method to compute a convex quadrilateral area in R3. The method works fine, but I am having numerical precision problems in the 8th decimal place. Take a look on the method: internal static double GetTriangleArea(double ax,…
TapiocaCom
  • 353
  • 5
  • 16
0
votes
1 answer

how to swap double precision number fast in c

I am currently doing matrix transpose with C. In my algorithm there are a lot of swap operations. I need to exchange the two double precision number that two (double*) points points to. void transposenRightHalf(double *m, int size){ double…
user94602
  • 883
  • 1
  • 7
  • 8
0
votes
2 answers

KeyCodes Processing

I'm currently working on a "game", in which I'm encountering trouble with the controls. I'm currently using numerical keyCode values (because they seem more efficient and pretty to me), although nothing seems to happen when trying to bind the…
stinodes
  • 1,269
  • 10
  • 15
0
votes
3 answers

Nonlinear function minimization C++

I've been trying to port a code from MATLAB to C++, and stumbled on a very unexpected difficulty. I can't seem to find the C++ equivalant to MATLAB's fminunc. Simply put, the problems definition is minimizing f(x), for a vector x, a scalar function…
0
votes
1 answer

numerical computation problems in matlab

in this question i am addressing to numerical computation problems in matlab and want to get experience how to avoid this problems/errors in future for example let consider following simple codes t = 0.4 + 0.1 - 0.5 t = 0 it works…
user466534
0
votes
2 answers

Numeric Fields on HTML elements

I have been trying to allow numeric field and one decimal point in my Grid.Its work fine when its suitable for input box. when i am calling onKeyPress the script work fine for "input box" rather than on "Div element" In "Div element",when i am…
user2742540
  • 45
  • 2
  • 7
0
votes
4 answers

Compare two texts numerically

I have these two files which I would like to compare its contents numerically. Text1: C_A C_A 0.0000 0.0000 0 0 50 47 100 390 C_A/I0/I0 INV 0.0200 0.2210 0 0 20 200 30 100 C_A/I0/I2 INV 1.0400 0.2210 0 0 530 200 250 261 Text2: C_A C_A 0.0000 0 0 0…
annel
  • 59
  • 7
0
votes
2 answers

MatLab - Numerical Integration given Conditions - Translate from Mathematica

This doesn't want to work for me in Mathematica - I don't know why not. It usually gives me 0, but sometimes also a different number. I know it should be a small, non-zero number. Would someone be able to help me translate this to MatLab? I am new…
LBogaardt
  • 402
  • 1
  • 4
  • 25
0
votes
1 answer

a predicate to check if the values of a container are in a range?

given a container like std::vector, where T is a generic type for numerical quantities ( like int, float, etc ... ), I would like to have a predicate that takes as arguments : the container itself a range, a type expressing a numerical set of…
user2485710
  • 9,451
  • 13
  • 58
  • 102
0
votes
2 answers

How to avoid RATNZ when NSolving an equation in mathematica

I Need to solve the following non-reducible transcendental equation. I have done as follows: Data = Import["FILE NAME", "Table"]; (*get actual data from a file*) l = Range[31, 249]; (*generate G,t pairs for the equation*) t = Data[[l, 1]]*10^-3;…
Elliot
  • 5,211
  • 10
  • 42
  • 70
0
votes
3 answers

How to find the most frequent words in alphabetical order?

I am trying to find most frequent words in a text file in alphabetical order in this different program. For example, the word: "that" is the most frequent word in the text file. So, it should be printed first: "that #" It needs to be in this type of…
Joe21
  • 45
  • 1
  • 2
  • 11