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

Changing (convert) letters (string) to numbers using R

I am trying to convert pairs of letters (genotype) like AA, GG, GA to numerical values. So for example I would like AA = 0, GG = 1, AG = 2, CC = 3, TT = 4 etc. A sample of my data looks like this: S1 S2 S3 AA CC AA AA GG TT AA CC GG AA AG AA I have…
Anita
  • 45
  • 2
  • 4
0
votes
1 answer

how to automatically pull new changes from the mercurial main repository to the local repository

is there a way to pull the latest changes from the main repository of mercurial to the local repository(project)? example: we are two people working on the same project, I want to have my project pull the changes that my friend comment…
Ali Hamadi
  • 673
  • 3
  • 11
  • 26
0
votes
1 answer

Not getting results for a finer mesh/grid

Is it possible that a particular scheme (MAC in this case) gives accurate results for one grid size but inaccurate/no results for finer grid size or finer mesh? If yes, then how or why?
0
votes
0 answers

Numerical optimization constraint results in answer that does not conform to constraint

I am working on a constraint problem, trying to implement using Mathematica. My answer appears to work until I try to add additional constraints to select only a small subset of the available variables. Update: download notebook file here for…
0
votes
1 answer

How to call numerical results to integrate a ODE using Runge-Kutta-4 in Python 3?

I'm trying to solve (for m_0) numerically the following ordinary differential equation: dm0/dx=(((1-x)*(x*(2-x))**(1.5))/(k+x)**2)*(((x*(2-x))/3.0)*(dw/dx)**2 + ((8*(k+1))/(3*(k+x)))*w**2) The values of w and dw/dx have been found already…
CamPos
  • 1
0
votes
1 answer

Compute average precision

I am computing the number of significant digits, two numbers have the same. However, the function I have written, will return a big value when the numbers are equal. As a result, the average result is not representative enough, as I will show…
gsamaras
  • 71,951
  • 46
  • 188
  • 305
0
votes
1 answer

jQuery variable in numerical parameter

So I'm very new to jQuery but do certain projects to try to get better. Now I've run into this problem I can't get my head around and donut know what to search for to get help... I've set the variable "height" to the original "data-sizey". This…
Lehar001
  • 73
  • 11
0
votes
1 answer

Integration of a function which is numerical solution of differential equation

I've obtained a numerical solution of a differential equation in a form of a vector (i.e. M(170,1)) by using ode45, and tspan=0:500 (time range). How can I now integrate M(t)dt, when I am not sure how time sequences are distributed? I know, that I…
Boki
  • 1
0
votes
1 answer

extract numerical values from DataFrame string object

I have a DataFrame object of dtype string. A typical row looks like below: '\n\n Dividend Indicated Gross Yield\n \n\n 1.50%\n \n' I am trying to extract only the numerical data from the above string. for…
Siraj S.
  • 3,481
  • 3
  • 34
  • 48
0
votes
3 answers

How to numerically integrate with infinite limit in MATLAB?

I want to numerically integrate an integral with infinite limit. Does anyone have any idea how should I do that? int(x* exp (v*x + (1-exp(v*x))/v),x, o , inf) does not work. Note that I will have values for…
Roza
  • 21
  • 1
  • 4
0
votes
1 answer

Excel VBA Run-time error '13' Type mismatch when value isnt numerical

I have the below code that's returning a mismatch error when the value isn't numerical. What would I change? If Sheet3.Cells(4, 8).Value <= 182 Then Call ThreeSpells End If Thanks in advance :)
Shaun Casey
  • 69
  • 1
  • 6
0
votes
1 answer

when testing for convergence using successive approximation technique, why does this code divide by the guess twice?

While working through the coursera class on scala I ran into the code below (from another question asked here by Sudipta Deb.) package src.com.sudipta.week2.coursera import scala.math.abs import scala.annotation.tailrec object FixedPoint { …
Chris Bedford
  • 2,560
  • 3
  • 28
  • 60
0
votes
2 answers

Building error leads the Code Blocks to quit

I'm writing a C code to solve a numerical problem, I define a 100x100 matrix and fill it with values A is the matrix, b is the solution : A[i][j]=1/(i+j+1) , b[i]= the sum of all values in the ith row Following is my code: #include…
RayaR
  • 11
  • 1
0
votes
0 answers

Numerical higher order derivatives with R

I need to calculate third and fourth order numerical derivatives in R. I suppose I should use the grad (or hessian) function from the numDeriv package recursively but I have problems with evaluation. What is the most efficient way to achieve this?
dkolobok
  • 1
  • 1
0
votes
1 answer

Saving local variables - Java

Here is a program that is supposed to find out whether a sequence of numbers match the mathematical formula a[n+1] = a[n]*b+c for any combination of b and c in the integer range -9:9. import java.util.Scanner; public class Nastaord{ private…
Sahand
  • 7,980
  • 23
  • 69
  • 137