Questions tagged [integral]

This tag should be used for questions related to coding solutions for integrals.

In numerical analysis field, algorithms for integration are a typical example of use for this tag. See also:

819 questions
-1
votes
1 answer

How to plot integrals in MATLAB?

I'm trying to plot the following integral: I only know how to get the answer but I can't figure out how to plot it.
Mary
  • 3
  • 6
-1
votes
1 answer

Basic Integrand Process in R

I've been trying to wrap my head around this problem but I am unfortunately quite new to both integrals and R. Can anyone help me figure out what I might be doing wrong here? The problem is as follows: Question 3 Here's my code so far: ## Question…
-1
votes
2 answers

C++: How to compute an integral with interval bounds?

I am both tired, new to C++ and real bad at dealing with polynomials. That's a bad combo for my assignment. Nevertheless I am trying to solve it. Please note that I might have misunderstood certain parts both mathematically and language-wise. Maybe…
Treeline
  • 475
  • 1
  • 8
  • 23
-1
votes
1 answer

Function defined as an integral: trapz?

I want to calculate a function p of x,y: p(x,y) which is defined by the integral of another function of x and y: p(x,y) = Integral(indefinite) of v(x,y) dx Now, if I have a matrix expressing p on a uniform grid x and y, how do I construct the…
usumdelphini
  • 213
  • 1
  • 11
-1
votes
2 answers

Matlab partial area under the curve

I want to plot the area above and below a particular value in x axis. The problem i am facing is with discrete values. The code below for instance has an explicit X=10 so i have written it in such a way that i can find the index and calculate the…
Bharath S
  • 161
  • 1
  • 12
-1
votes
1 answer

Scipy integral comes out wrong

I'm trying to integrate a function. The function is guaranteed to be non negative: def function(x): something = ... something_else = ... return exp(something) / sqrt(something_else) Now I'm integrating it: def integrand(a, b): …
zmbq
  • 38,013
  • 14
  • 101
  • 171
-1
votes
1 answer

Trapez Method in Java

I found a formula in the Internet for calculating the trapezoid method , it works as it should, but I do not see why should I performed the following lines in the trapez method: sum = 0.5 * bef + (h * sum); i= i+ 2 The first iteration performed by…
Coconut
  • 25
  • 7
-1
votes
1 answer

Calculate implicit integral function contours with python

I guess I am missing something in this code: integrand = lambda t,x,y: (1/(Tiempo-t))*np.exp(-((x-U*(Tiempo-t))**2+y**2)/(4*a*(Tiempo-t))) def z_func(x,y,Rate,Conductivity): integral, err = integrate.quad(integrand,0,Tiempo,args=(x,y,)) …
Margaral
  • 27
  • 1
  • 10
-1
votes
1 answer

integral error (first input argument must be function handle.)

I want to use an integral over a vector but I will see an error for sys_eff which is " First input argument is not function handle." I will be glad to have your guide and thanks in advance. I should mention that all vectors have the same ize as…
Hamed
  • 193
  • 2
  • 9
-1
votes
1 answer

Mathematica Integrate gives back the integrand

i'm trying to Integrate the following function: (q (1 + q) - E^-q Sinh[q])/(-q + Cosh[q] Sinh[q]) - ( 2 q Tanh[q])/(-q + Cosh[q] Sinh[q]) I already solved it numerically but i really need the indefinite integral so used: In[67]:= Integrate[( …
-1
votes
2 answers

Integral 0 to pi/2 using montecarlo in R

Trying to find integral (o to pi/2) of x^2 cosx using montecarlo method. This is my first time so need some direction. To generate random number should I transform the limit of the integral to (0,1) or can I generate random numbers with the…
greenH0rn
  • 65
  • 2
  • 9
-1
votes
1 answer

integration example with matlab

Can someonse show me how to calculate the following in matlab: where g = 9.91 As = 1000 z = 10 zv = 30 zD = 10 pz = 999 Az = 500
KatyB
  • 3,920
  • 7
  • 42
  • 72
-2
votes
1 answer

how to calculate integral with R

Here, I would like to have your helps on implementing calculation of integral on two vector. I checked pages on integral calculation relative to R. But, I have few training on mathematics, so I still can not do that by myself. My objectives is to…
jianfeng.mao
  • 945
  • 3
  • 13
  • 21
-2
votes
1 answer

Basic example of how to do numerical integration in C++

I think most people know how to do numerical derivation in computer programming, (as limit --> 0; read: "as the limit approaches zero"). //example code for derivation of position over time to obtain velocity float currPosition, prevPosition,…
RhinoPak
  • 21
  • 6
-2
votes
1 answer

Integral Coefficients

I am reviewing a proof at the moment and there is terminology that I do not understand. What does it mean for a polynomial to have "integral coefficients"?