Questions tagged [calculus]

Calculus is the study of change of one or more variables with respect to another variable. Calculus has two main operators: differentiation and integration. Differentiation can be used to study the change of one variable with respect to another. Integration can be used to find the area bounded by a function.

Calculus plays an important role in computer science, for example, in the comparison of the performance of various algorithms and the complexity of various problems. These are often expressed using big O notation, which relies on the idea of the limits of ratios of functions as a variable tends to infinity.

On the practical programming side, there are several fields that will require calculus to a greater or lesser extent:

  • Numerical analysis and computation.
  • Signal processing (Image, video, audio, etc).
  • Data analysis and prediction for business applications.
  • Modeling of dynamical systems.
  • Machine learning.
  • Physics engines for video games.
580 questions
-1
votes
2 answers

Calculate angle of reach for projectile given velocity and distance

I've been trying to implement projectile motion in Javascript and I'm stuck at figuring out the angle (from which to derive the x and y velocity) var v = 1; var d = 10; var g = -1; var angle = 0.5 * Math.asin((g*d)/(v*v)); I would've expected…
Dries
  • 995
  • 2
  • 16
  • 45
-1
votes
1 answer

Minimization of bounds for production capacity and production capability

My question is, using the below functions, how can I numerically find the optimized values of USL and LSL so that the return value of the function Pythag is at a global minimum (i.e. the gradient of Pythag == 0) while somehow tethering Cp and Cpk so…
Todd Muller
  • 11
  • 2
  • 7
-1
votes
1 answer

Derivate from rest of the division

Rest of division (f(x) mod g(x) = h(x)) I mean for example (3.15 mod 3.14 = 0.01). In General what are Derivatives of that kind of function ? dh(x)/dx dh(x)/df(x) dh(x)/dg(x)
-1
votes
1 answer

creating incremental values for central difference

The first part of the code works fine and prints off values for sin in increments of .01 radians. Between 0-25 (degrees) that is 2500 values. The second part of the code is trying to evaluate sin(x) using the central difference method, while…
-1
votes
1 answer

Java: How can I make this calculus method on limits more efficient?

how can I initialize all of my variables more easier? is there a calculus package? is there a more efficient solution overall? import java.util.Scanner; public class limits { public static void main(String[] args) { String introMessage = " …
Robinhoets
  • 56
  • 2
  • 11
-1
votes
1 answer

How to compute limiting value

I have to compute the value of this expression (e1*cos(θ) - e2*sin(θ)) / ((cos(θ))^2 - (sin(θ))^2) Here e1 and e2 are some complex expression. In the case when θ approach to PI/4, then the denominator will approach to zero. But in that case e1 and…
-1
votes
1 answer

Trapezoid and Simpson rule in Python?

I have to write the trapezoid and simpson rule in python for the function e^((-x)^2). Here's what I got so far. The answer it gives out is 8218.7167913 but the answer according to my teacher is something like 1.77251356..... Where did I go…
Robert
  • 1
  • 3
-1
votes
2 answers

What is the best solution for filling limited variables in PHP

Let's say I have 3 variables $a; $b; $c = 30; What I wish to do here is that I have to divide $c and put it in the first 2 variables which can be easily done by doing. $a = $c / 2; $b = $c / 2; However what if in $b there is a maximum value limit…
Efekan
  • 1,497
  • 12
  • 31
-1
votes
1 answer

Approximation of a root using Halley's method in R

Alright, so I'm working on a small R program in order to do approximation using Halley's method. Basically I need to be able to approximate to 9 decimal places the value of 59^(1/7) using Halley's method. What I have for the first order recurrence…
EthanLWillis
  • 930
  • 4
  • 14
  • 27
-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

Choosing number of subdivisions m and n for approximating Double Integral in context of images

I have a few double integrals that I have to approximate that are based on getting motion parameters from a sequence of images, and I have chosen to use Riemann Sums for that purpose. These integrals are under the domain R = [-w,w]x[-h,h], where 2w…
-2
votes
1 answer

Difficulties using matplotlib plot method

Very recently I have been tasked with ploting a derivative using Python and matplotlib. This is my code: x=np.linspace(-100,100,num=50) funcion=(56*(x**3))-(38.999*(x**2))+(4.196*x-0.15) plt.plot(x, funcion) The resulting plot is this: Plot…
-2
votes
1 answer

Is there a semantic error in my code that I'm missing?

I made a code to try and compute the partial sum of a series, but it keeps producing a result that's about 0.01 off. It looks pretty straightforward to me and I haven't been able to spot what my mistake might've been, but there's definitely…
-2
votes
2 answers

How do I install SymPy?

I really want to learn how to use python for stuff like calculus, math in general. I've heard that you can use SymPy, but i have no clue as to how to download it. There aren't any plugins on pycharm. Can anyone help out? And do ya'll know a better…