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
0
votes
1 answer

Lambda Calculus Reduction explanation

I'm having some problems with the b-reduction of the next two lambda expressions, somebody can explain me a little bit how to solve them: (λ f . λ x . f (f x)) (λ x . x (λ x . λ y . x))
helloStack
  • 45
  • 7
0
votes
1 answer

Sea Level Java Project

I am trying to develop a program that calculates the sea level all the way up to the year 2100. Based on research I have found that the sea level will be 2.5 feet(which is 30 inches) - 6.5 feet(which is 78 inches). My program asks the user to enter…
gainz
  • 1
0
votes
0 answers

Lambda calculus operator precedence and reduction strategies

1. In lambda calculus applications have higher precedences than abstractions. Now in this example the author shows two reductions in normal and applicative order. The first is: (λx.x^2 (λx.(x+1) 2))) → (λx.x^2 (2+1)) → (λx.x^2 (3)) → 3^2 → 9 My…
0
votes
1 answer

Not sure why C prints out NaN

I was coding up a short program to compute right endpoints for a given graph (not shown here), so to avoid tedious computation, I decided to write up a short program to do the work for me. Yet my C program just prints out nan. I am very rusty on C,…
Flair
  • 2,609
  • 1
  • 29
  • 41
0
votes
1 answer

Calculating volume of a revolved surface in Python

I have the following curve: The curve is defined by a set of data points. How can I calculate the volume that will be enclosed by this curve if it is rotated by 360 degrees about the horizontal axis? I can calculate the area underneath the curve…
Jonny
  • 1,270
  • 5
  • 19
  • 31
0
votes
2 answers

My program to calculate e stopped working

I have made a python program to calculate e and it worked up until a while ago but now all of the sudden it doesn't work anymore and is behaving very oddly. Here is the source code: from decimal import * import time dig = int(input('Enter number of…
user4127117
0
votes
0 answers

2D array to 3D plane

I am trying to create a 3D plane out of a collection of 2D points for a game I am making. I have omitted the Z axis in my illustration as the depth is constant. Also the plane will consist of multiple 3D models; one per line segment: The original…
Krizla
  • 1
0
votes
1 answer

Solve differentiated equation at value in Matlab

As a programming exercise I have written a Matlab function which finds the derivative of a function using the finite difference method. In a script I have called the function and wish to check it using the built-in functions, except I am having…
Finn LeSueur
  • 479
  • 5
  • 18
0
votes
0 answers

Estimate loads for the peak traffic by calculus

I found a interesting topic realted to Q&A With Nine Great Programmers , In the Q3 section : Do you think mathematics and/or physics are an important skill for a programmer? Why? One of the programer Steve Yegge says : I had to estimate loads for…
holmes2136
  • 477
  • 5
  • 14
0
votes
1 answer

Arrays operations in Matlab

I would like a function to compute the following operation: I made this function that requires a matrix at its input, and returns the distances between every two lines of it in another matrix. RGB_dist_full…
Tanatos Daniel
  • 558
  • 2
  • 9
  • 27
0
votes
2 answers

Java round to next 5000

I am looking for some java math.round formula which converts next to nearest 5000 value. Suppose if the value is 15555, this should convert to 20000. If the value is 18555, this should also convert to 20000 (since this should give the next 5000…
user3226440
  • 559
  • 1
  • 8
  • 23
0
votes
2 answers

program a neural network

So I have read a little bit about neural networks, and I hear stuff having to do with input, output, weights, activation functions,hidden layers,3 layer approach, and some calculus, but what does any of this have to do with programming an actual…
0
votes
2 answers

Calculte new width and height of the video based on the original width, height and ratio

After searching through - I wasn't able to find the answer so I'll give it a shot here. I need to resize desktop video in order to feet it on mobile screen, let's say original width of the video was 1915 and original height was 1075, I calculated…
inside
  • 3,047
  • 10
  • 49
  • 75
0
votes
1 answer

PROC IML trapezoidal rule

proc iml; start tr(x,y); * create function called tr; N = nrow(x); dx = x[2:N] - x[1:N-1]; ymean = (y[2:N] + y[1:N-1]) / 2; return(dx` * ymean ); finish tr; x = do(-2,5,0.01); print "Integral of a over x is" ( tr(x,0#x+1) ); *Answer is 7; I keep…
0
votes
2 answers

Formula for PI-regulation Proportional Integral algorithm

I've been reading this website: http://www.csimn.com/CSI_pages/PIDforDummies.html and I'm confused about the proportional integral part. Here's what it says. Proportional control Here’s a diagram of the controller when we have enabled only P…
mberna
  • 313
  • 5
  • 18