Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
It says"Wolfram uses standard principle to calculate integration"
What does it mean?
Presumably it means standard algorithmic methods. (No special magic.)
https://reference.wolfram.com/language/tutorial/Integration.html
"The Wolfram Language knows how to do almost any integral that can be done in terms of standard mathematical functions."
The following information is from a paper relating to symbolic integration in Mathematica 5 and 6. (The current version is Mathematica 11.)
http://library.wolfram.com/infocenter/Conferences/5832/DefiniteIntegration.pdf
Indefinite Integration
The indefinite integration code consists primarily of a partial
implementation of the Risch algorithm [2, 5], in addition to extensive
table lookup methods. …
Definite Integration
Definite integration is done via a number of methods as indicated
below.
Special case contour integration.
Newton−Leibniz code specialized for integrands of the form rational x trig or rational x exponential.
Newton−Leibniz code specialized for integrands containing logs or polylogs.
A general case implementation of Newton−Leibniz integration.
An implementation of definite integration by convolution of MeijerG functions [1].
Mathematica also performs numerical integration.
https://reference.wolfram.com/language/tutorial/NIntegrateIntegrationStrategies.html
Related
Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 months ago.
Improve this question
For a school project I have to determine a function u(t) of time. I have derived an expression of the following form:
(https://i.stack.imgur.com/vNrYb.png)
with a,b,c,d constants (not necessarily integers). I have figured out that this problem is only solvable with numerical integration with initial condition u(0)=u_0, yet I don't know how to do this particular problem.
I have looked at all the numerical integration methods I have learnt so far, but they all seem to apply for polynomials or for functions where you know the function evaluations at specific points.
There are lots of ways to calculate an approximate value for u(t), some simple but requiring a lot of iterations, and more complex requiring fewer iterations. Assuming a,b,c,d are real numbers, and u_0 = u(0) then for t > 0, one could just split the interval between 0 and t into N sub-intervals and calculate
u_(i+1) = u_i + (du/dt)(t_i)*t/N
where t_i = i*t/N
then,
u_N = u(t).
If N is not sufficiently large, the result will be inaccurate. To obtain a satisfactory N is more art than science. Just printing the results for increasing N should give you an idea of how large N needs to be to obtain the level of accuracy you need. Adding higher order terms (d^2u/dt^2 etc.) can sometimes improve speed and accuracy.
You can't numerically integrate anything unless you have values for all those constants.
I don't know what numerical integration schemes you looked at, but I think Euler's method or Runga-Kutta would both be worth trying.
You don't say which language you want to use. Python would be a fine choice. So would Java. Lots of libraries to help.
Wolfram Alpha has a closed-form solution here. It's a separable, non-linear ODE. You'll need to know hypergeometric functions to evaluate.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have a known configuration nodes, weights, bias values, and activation function (tanh) for a neural network. I'd like to build that neural network as some 'neural network' object in R by proscribing the parts, and not fitting a network. How can I do this? I see many options to fit a neural network, but cannot find out how to build a network when I already know the components.
R do provide startweights argument to initialize custom weights, see StackOverflow thread. I also won't see citations for changing bias and transfer function.
Either use MATLAB (which is not a good idea for a R expert) or better design custom network based on following fact:
ANN is just a set of maths operations on input vectors and output vectors, where math operations are adjustment of weights based on error term in a loop using simple back-propogation. Use vectors and maths operations ONLY in R to design a simple ANN with back-propogation training
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have to calculate the probability distribution function of a random variable that is composed of (sum, division, product, exponentiation, etc...) some other simple random variables. It is pretty complex so I am morte then happy to get a numerical solution
While thought this was a very standard thing to do , I was unable to find a framework to do that. I'd preferably use R, but any major language will do.
What I would like therefore is a library that allowed me to:
i) create numerical random variables from classic distributions
ii) compose them by simple operations (+,-,*,/, exp,min, max,...)
Of course I could work with vectors and use convolutions and the like, but I wanted something more polished.
I am also aware that is possible to use simulation to create the variables, then compose them with the operations and finally getting the PDF using a histogram, but again, I would prefer a non - simulating approach.
Try the rv package. Note that if X is an exponential random variable with mean 1, then -log(X) has a standard Gumbel distribution.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm programming some program which calculates the limit of markov chain.
if the markov matrix diverges, I should transform it into the form
dA + (1-d)E, where both A and E are n * n matrix, and all of the elements of E are 1/n.
But if I apply that transformation when the input converges, the wrong value comes out.
Is there any easy way to check if the markov matrix converges?
I'm not going to go into detail, because it's an entire field unto itself. Although the general convergence theorem states that any finite Markov chain that is aperiodic and irreducible converges (to its stationary distribution). Irreducibility is simple to check (it's equivalent to connectedness in graphs), and periodicity is also easy to check (the definition of both is found in the first chapter of the book below, and the convergence theorem is proved in chapter 4 of the book).
It's worth noting that if there isn't irreducibility that can be easily solved in the symmetrical case by splitting the state space into "connected components", and considering each one separately. While periodicity can be patched by doing something similar to what you're suggesting. It's called creating the lazy Markov chain. If you want to understand the whole topic a little better (Mixing times for example will be very helpful in your convergence algorithm), this is an excellent book (available for free):
http://pages.uoregon.edu/dlevin/MARKOV/markovmixing.pdf
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I needed an application for solving linear systems of equations (N up to 10), so I got different codes, and compile them, and they seem to work, but I get lots of problems with precision. I mean, the solvers are really very sensitive to small changes of the system.
So, could somebody recommend to me a reliable commandl ine application for this purpose? Or some useful open source code (and easy to compile)
Thanks
GNU Octave is essentially a free version of Matlab (the syntax is identical for basic operations), so you can try things out there and see how they compare to the answers that you're getting.
Having said that, if your answer is very sensitive to the input, it's possible that your problem is ill-conditioned - you can check this by computing the condition number of the matrix in Octave. It's hard to say what to do in that case without knowing more specifics on the problem.
Also, you don't mention which method you're currently using. Gaussian elimination (i.e. "what you learned in math class") is notoriously numerically unstable if you don't use pivoting (see the wikipedia entry for "Pivoting"); adding that might be enough to improve the quality of the results.
An approach is to use the numpy package in Python. You can create a 2d matrix A and a 1d vector b, then solve Ax=b for x using solve(A, x). It's part of the linalg subpackage of numpy.