The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
1answer
46 views

Force mathematica to consider variables as real [on hold]

I want to implement an optimization of the form: NMinimize[{function,{constraints:A1^2+A2^2+A3^2+A4^2 ==1}},{A1, A2, A3, A4}] where I want to tell mathematica ...
0
votes
0answers
46 views

How to get x = 1.234 from {x -> 1.234}? [duplicate]

I'm a complete beginner in Mathematica (started a couple of days ago). I've solved a function using "Solve" and the result is this one: Out[1] = {x -> 0.000942939} How do I get the 0.000942939 ...
3
votes
1answer
131 views

Recognize physical constants?

Is there some way to ask Mathematica to recognize physical constants, such as 32 or 9.81 (gravitational acceleration, in different units, at Earth's surface)? I have in mind something like the ...
1
vote
0answers
49 views

Using Classifier with NearestNeighbors methods

I am using a Machine learning toolbox on mathematica. I have 8 classes. Training data: for each class, there 100 samples with size 160. I used this code. ...
0
votes
0answers
36 views

Maintaining working precision in my program

I am badly stuck with this program I am writing. I want output of program below to be precise up to 25 digits after decimal point. I am supplying all inputs with precision 25. But after each iteration ...
0
votes
1answer
45 views

How to calculate digits of Trott Constants?

How to calculate digits of numbers (Trott Constant) whose continued fraction representation is the same as the digits of its radix representation with Mathematica?
0
votes
0answers
34 views

Handling a matrix with components greater than machine precision

I have four quantities stemming from a 4th order differential equation. I can represent these as a vector which is a product of a 4X4 matrix $$ M=\left\{v,\frac{\partial v}{\partial x},\frac{\partial ...
0
votes
1answer
87 views

Precision of Eigensystem? [closed]

I was using Eigensystem to obtain the rotation matrix. However, I find out Mathematica does not fully diagonalize my matrix (or say not precise enough). My matrix ...
3
votes
2answers
111 views

Torus-geometry algebraic equations using Nsolve and Reduce

Somehow a set of naive-looking equations cannot be solved by using NSolve. Mathematica returns a message like this: ...
1
vote
1answer
118 views

How to find and express all polynomial roots with greatest precision?

I've already plowed through the documentation and a bunch of other Questions on this, but I've only found partial or tangentially related answers. I need numerical results for all of the complex ...
0
votes
2answers
88 views

How to make an Histogram where the data are strings? [duplicate]

Histogram[{3, 3, 2, 2, 2, 2, 2, 1, 1}] works great to give you an histogram in which mathematica counts the occurence of each number and makes the plot. Is there a ...
1
vote
0answers
38 views

Combining Manipulate and NDEigenvalues [closed]

I think there may be a quick solution to this problem which I can't seem to fix at the moment. The question is how do we eliminate the error in the following ...
2
votes
1answer
47 views

Non-integral common denominator

I have a list r = {114.49, 311.876, 538.704} whose elements are multiples of a non-integer value. I want to find the common denominator ...
2
votes
0answers
41 views

Differences in AbsoluteTiming for similar codes

Consider the two following codes with the same SeedRandom (which ensures the same set of random numbers) but different use of the ...
1
vote
2answers
164 views

How to solve this two algebraic equation simultaneously for u and H ?(all real number)

I want to find the non-zero value of H when beta is changing(especially what value of beta when increasing will there be a non-zero H value). H is between [0,100]. This is actually the calculation ...
0
votes
0answers
52 views

Trying to find parameters for a system of inequalities

So I have a system of 4-dimensional system of ODEs and I'm trying to find any values of parameters that satisfy properties I need. In this picture, I want two basins of attraction, one of which the ...
0
votes
2answers
109 views

Significantly different results between Mathematica and Wolfram Alpha with large radicals and small numbers [closed]

I have some code which involves tiny numbers being put to the power of very large numbers. The function I'm looking at is $\varphi = \omega(T) \left(1 - (1 - \epsilon)^{n_{e}(T)} \right)$ when ...
3
votes
2answers
207 views

Creepy numerical artefacts of a closed-form solution

I'm wishing you a nice day and here is my problem: I tried to obtain relation between chemical potential and temperature in a semiconductor and I arrived at this equation: $$ 2 e^{-\Delta/kT} \left( ...
0
votes
1answer
86 views

Why does my function return an expression rather than a number? [closed]

I feel like I'm going insane. I have a function $f(x)=e^{-x^2}$ which I need to evaluate using forward, backward and central first order finite differences with intervals ...
8
votes
2answers
306 views

Matching pair of numbers {a,-a}, where a is numeric

Imagine you have a list of pairs of numbers, such as {{2,-2}, {1,5}, {1,-3},{-3,3}} The task is to reduce the given list to a list of pairs of type ...
1
vote
1answer
54 views

Determine whether one value is divisible by another [closed]

How do I determine whether one number is evenly divisible by another in the case of large numbers, for example: 52^52 / 52!
2
votes
2answers
209 views

Center column heading in TableForm

I have a TableForm as follows: ...
0
votes
0answers
26 views

why i cannot get appropriate number with my custom precision? [duplicate]

why i cannot get appropriate number with my custom precision? In[25]:= N[(1 + Exp[-30])/(1 + Exp[-29.9]), 1000] Out[25]= 1. I expect to see a few digits after ...
0
votes
0answers
89 views

Numerical Integration/Function

I have a problem with a function defined numerically through an integral of the form: ...
0
votes
1answer
75 views
1
vote
1answer
97 views

The problem (time) caused by ?NumericQ

In here, I asked a related (similar) question. Using ?NumericQ seems have slowed down the entire calculation. But I now have a more serious problem: ...
0
votes
1answer
58 views

Error with numerical summation - how to specify “n choose r”?

I'm trying to do the following sum: NSum[((50000 - x) choose x)*(1/3^15)^x*((3^15 - x)/3^15)^(50000 - x), {x, 1, 4}] But I keep getting an error saying: ...
1
vote
1answer
85 views

How to indroduce a value for the functions inside a matrix? [closed]

I would like to assign certain values to the X and Y variables which are inside the functions in the matrix. Thus, I would like to get a matrix with values based on the transformation in Psi matrix. ...
6
votes
2answers
747 views

Could I define 0^0 to be 1? [duplicate]

Many occasions, where I need to work numerically with functions. For a variable strictly between 0 and 1, during the optimization, it could become 0.^0 or 0^0, which then become indeterminate. Is ...
0
votes
0answers
84 views

Speed up numerical optimization (for plotting and solving)?

Briefly speaking, I want to plot a function PIfun[], which its value is based on numerical optimization using NMaximize. It ...
2
votes
4answers
247 views

Problem in finding the numerical maximum

I need to find the numerical maxima of the function $$i(s)=\bigg[ \frac{\sin{50\pi (\cos s+1)}}{\sin{10\pi (\cos s+1)}} \bigg] ^2$$ Or in the mathematica input form: ...
1
vote
0answers
69 views

Central binomial coefficient [closed]

I am tasked with creating a recursive definition of the binomial coefficients that stores previously calculated values. this is what I have: ...
3
votes
1answer
113 views

Inverse prediction function

I am trying to write a code which learns a data set. Now, I want to know the input value for a given output value. Consider, the following code ...
7
votes
2answers
233 views

Why does N[Re@f] give complex result?

Consider this code: ...
1
vote
1answer
48 views
3
votes
1answer
114 views

Dealing with square roots [duplicate]

Consider following expression: $$ \sqrt{-\left(2 \sqrt{x^{-8/3}-x^{-4/3}+1}\, x^{4/3}+5\right) x^{4/3}+4 \sqrt{x^{-8/3}-x^{-4/3}+1}\, x^{4/3}+2 x^{8/3}+5} $$ In code: ...
0
votes
2answers
66 views

Eigenvectors inside a maniupulate function

I am trying to make a physics application and it requires that the eigenvectors be taken for a 3x3 matrix. It is my intention that Mathematica never have to deal with the matrices symbolically. ...
1
vote
1answer
89 views

Why does one Monitor expression work while another fails?

I have a (somewhat involved) function f[x?NumericQ, y?NumericQ] and for some reason it behaves differently when given a Table ...
0
votes
3answers
367 views

Why is 1. x (Times[1.`, x]) not simplified to x?

This is maybe a silly question, but I could not think of any logical reason why it is not simplified automatically. I was working with a big linear equation system with some constrained inequalities ...
3
votes
1answer
72 views

Strange NSum behavior for slightly larger number of terms

For some sums, NSum gives me the result nicely for some number of terms, but if I add one more term, it suddenly becomes much slower. I haven't found the minimum example for which this can be ...
0
votes
1answer
187 views

FindRoot for numerical function and how to search more than one root

I have to find the first few zeros of function for which I have not the analitycal expression. The function is named f in the following code and it is the result of ...
1
vote
1answer
39 views

Numeric values from transform

How would I create a table of values from a transformation? eg: ...
1
vote
1answer
166 views

Why is Mathematica not able to calculate more digits [duplicate]

When I want a numerical value with a precision of 50 digits... N[1.15/(1 - E^-0.2)^2, 50] Why is Mathematica not able to provide the desired solution? And I ...
2
votes
2answers
247 views

Display truncation of numerical values when writing to a file

I am trying to copy some numerical values of parameters from a plain text file into Mathematica, then arranging them in a list and exporting them to another text file, with .ini extension. My problem ...
0
votes
1answer
325 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
2answers
627 views

Why are my recursive functions running so slowly? And how do I fix them?

I am working with making numerical solvers for a modeling class I am in, and I want to use the internal recursion handling that is built into mathematcia, but there seems to be a problem. NDSolve ...
6
votes
1answer
105 views

Machine precision infinity

Is it possible to obtain the machine precision (double) version of Infinity? This is useful when using LibraryLink and C ...
1
vote
1answer
158 views

How do assign an interval of values to a variable in order to use them in a function?

From my code (below) I have K1 and K2 set to zero in order to test this numerical method. However, K1 is on an interval from 0 to 32, and K2 is on an interval from 0 to 8. I would like to know if ...
3
votes
3answers
262 views

FindRoot constrained to maximum

I am using FindRoot to find the local maximum op some function, by examining where its derivative is zero. However, keeping the starting value the same, sometimes ...
2
votes
3answers
370 views

Re-arranging / selecting of a data table very slow in For loop [duplicate]

My task is quite simple; I have a table of data like M = {{1,2}, {1,3}, {3,4}, {5,1}, {6,9}, {6,8}, {6,1}}; so the table is sorted with respect to the first ...