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
2 answers

Evaluating derivatives of polynomial and rational functions in Ruby (maybe trig functions as well?)

To specify the topic: I am trying to create a program that can evaluate the derivative of at least polynomial and rational functions (trig/etc. functions would be interesting as well) at a specific point. The answer should be the equation of the…
0
votes
0 answers

Python script to generate gradients not working

I have this python script to generate x,y,z lists and u,v,w lists such that u[i],v[i],w[i] is the gradient vector for point x[i],y[i],z[i]. It doesn't seem to be getting the right values. Does anyone know whats wrong? from math import * def…
omega
  • 40,311
  • 81
  • 251
  • 474
0
votes
1 answer

Javascript - How to parse propositional calculus

I want to make a propositional calculus parser with Javascript, which will elaborate the input and tell if the logical proposition is correct. For example, I would type (A && B) || (B && A) => not(A) and then i would insert in another prompt the…
elmazzun
  • 1,066
  • 2
  • 18
  • 44
0
votes
4 answers

First-order predicate calculus, am I doing this right?

This is the statement: All birds can fly except for penguins and ostriches or unless they have a broken wing. Here is my attempt: ∀x birds(x)→ fly(x)^((birds(x, penguins)^birds(x, ostriches))˅broken(wing)→¬fly(x)) is my attempt correct? how…
Tommy Lee
  • 794
  • 2
  • 11
  • 30
0
votes
2 answers

How to input a polynomial in standard algebraic notation and get its derivative? (Python)

I don't have a problem computing the derivative..it's just that I don't know to handle an entire polynomial in standard algebraic notation :p
prithajnath
  • 2,000
  • 14
  • 17
0
votes
1 answer

Python Matplotlib Quiver wrong orientation

Im creating an ipython notebook on vector calculus. (Basics, at least). On this block of code im trying to have a pseudocolor plot of the function x^2 + XY + Y^2 and plot over it the vector field given by its gradient U = 2X+Y and V = 2Y+X However…
Lucas L
  • 3
  • 3
  • 4
0
votes
1 answer

How to draw normal vectors to an ellipse

How do I draw an ellipse with lines of the same length coming out of it? It's easy to do with a circle, I can just write something like for (u = 0 ; u < 2*pi ; u += 0.001*pi) { drawdot (cos(u), sin(u)) ; drawline (cos(u), sin(u), 2*cos(u),…
user1715857
0
votes
1 answer

Euler's programming function : differential equation as a parameter

I have a programming function written for Eurler's approximations. Currently the function only takes 3 parameters. step size starting f(x) endting f(x) which is what we are approximating Each time I have to use Euler, I have to keep on changing my…
aspiring
  • 1,557
  • 2
  • 20
  • 43
0
votes
2 answers

What is the most efficient way to calculate the slope of a group of doubles (points on a graph, essentially)?

I have an array of length: int lengthOfArray = 5; lengthOfArray = ((lengthOfArray * (lengthOfArray - 1)) / 2); System.out.println(lengthOfArray); With an array of length 5, this will return that there are ten possible outcomes for a similar…
Nick
  • 191
  • 1
  • 2
  • 9
0
votes
3 answers

Using Taylor Polynomials Programmatically in Maple

I am trying to use a Taylor polynomial programmatically in Maple, but the following does not seem to work... T[6]:=taylor(sin(x),x=Pi/4,6);convert(T[6], polynom, x); f:=proc(x) convert(T[6], polynom, x); end proc; f(1); All of the following also…
kzh
  • 19,810
  • 13
  • 73
  • 97
0
votes
1 answer

Mathematical dilemma for creating stock-market style price fluctuations in java program

Ok, basically I have a base price r, and a base stock amount a for item y. Item y's price is x. Lets call the item a pencil. so: r is a base price, lets say $1. a is the typical base stock, lets say 100. y is the current amount in stock. x is the…
Nicolas Mustaro
  • 683
  • 3
  • 8
  • 14
0
votes
2 answers

How to find volume of petrol in horizontal cylindrical tank?

I have a task find out the amount of petrol in a horizontal cylindrical tank. I have 3 parameters. I tried this formula but did't get, help me please V=A*L radios=113.5,length=600,height=10 (height is level(cm) of petrol in Tank at end of the…
user2477724
  • 141
  • 1
  • 4
  • 10
0
votes
1 answer

Using QScriptEngine to compute calculations

I'm creating a diagram modeling tool that connects Items to Tasks. Items have Properties (simple name/value relationships) and Tasks have Formulas. I intend to produce a UI for the users to write in a QLineEdit a formula using C++ syntax ( ie,…
Joum
  • 3,189
  • 3
  • 33
  • 64
0
votes
2 answers

Mathematica: integrate symbolic vector function

I wrote a program that defines two piecewise functions "gradino[x_]" and "gradino1[x_]", where x is a vector of m components. I'm not able to write these functions explicitly using the x_i, I need to keep x as a vector. I need to measure the…
0
votes
1 answer

C++ Incomplete Code about dates, what is the better solution?

Im writing a code that, if you input your birthday date and any other date, it returns the total number of years, months and day that you are alive. Obs.:including (leap) bissextile years. Obs.2:for invalid dates, the output must be "data invalida"…
Student
  • 15
  • 4