calculus

Calculate volume of hollow tilted cylinder inside cube, without a grid

三世轮回 提交于 2019-12-11 18:30:09
问题 I have a hollow cylinder with inner radius r1 and outer radius r2. This cylinder is tilted from the Z axis towards the X axis, then rotated around the Z axis and then translated along X and along Y. I also have a cube between a range of X and Y values. I then want to calculate how large a volume of the hollow cylinder is inside the cube. %set variables r1 = 0.9; r2 = 1.0; z1 =-1.0; z2 = 1.0; beta = pi/4; gamma = pi/8; %create inner surface [X,Y,Z] = cylinder(r1, 100); %outer surface [Xx,Yy,Zz

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

浪子不回头ぞ 提交于 2019-12-11 18:15:19
问题 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 回答1: For computer algebra in Python, sympy is the way to go. Computing the derivative of a polynomial in sympy is straightforward: >>> import sympy as sp >>> x = sp.symbols('x') >>> sp.diff(3*x**4 + 8*x**2 - 3*x + 1) 12*x**3 + 16*x - 3 回答2: The code is not concise, because I want to clearly show each step how it calculates. import re def FirstDerivative

How to create a calculus derivative solver using Javascript? [closed]

邮差的信 提交于 2019-12-11 11:06:48
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I've been trying to create my own JavaScript program for solving problems in Calculus such as taking the derivative of an equation, but as of yet have not succeeded. I would be greatly appreciative if someone

Java estimate a derivative at a point

被刻印的时光 ゝ 提交于 2019-12-11 07:44:29
问题 I am currently writing a calculator application. I am trying to write a derivative estimator into it. The formula below is a simple way to do it. Normally on paper you would use the smallest h possible to get the most accurate estimate. The problem is doubles can't handle adding really small numbers to comparatively huge numbers. Such as 4+1E-200 will just result in 4.0. Even if h was just 1E-16, 4+1E16 will in fact give you the right value but doing math it it is inaccurate because anything

seek a better design suggestion for a trial-and-error mechanism in python?

一世执手 提交于 2019-12-11 07:44:24
问题 See below data matrix get from sensors, just INT numbers, nothing specical. A B C D E F G H I J K 1 25 0 25 66 41 47 40 12 69 76 1 2 17 23 73 97 99 39 84 26 0 44 45 3 34 15 55 4 77 2 96 92 22 18 71 4 85 4 71 99 66 42 28 41 27 39 75 5 65 27 28 95 82 56 23 44 97 42 38 … 10 95 13 4 10 50 78 4 52 51 86 20 11 71 12 32 9 2 41 41 23 31 70 12 54 31 68 78 55 19 56 99 67 34 94 13 47 68 79 66 10 23 67 42 16 11 96 14 25 12 88 45 71 87 53 21 96 34 41 The horizontal A to K is the sensor name, and vertical

Problems with the Trapezoidal Rule

北城以北 提交于 2019-12-11 03:08:42
问题 I'm having some troubles to calcule the integral of e^x inside and interval [b.a] using fortran. I think I'm doing something wrong in the funcion calls. Thanks for helping me. program trapezium implicit none integer :: i, n, b, a real :: sumation, mean, deltax, f(i), integral ! The value of the integral using the trapezium rule can be found using ! integral = (b - a)*((f(a) +f(b))/2 + sumation_1_n-1 )/n write(*,*) "type the limits b, a and the number of intervals" read *, b, a, n deltax = (b

How to find the distance between a point and a parabola in code

跟風遠走 提交于 2019-12-10 19:28:13
问题 I am trying to find the closest point on a parabola to an arbitrary point in 2d, for a DirectX pixel shader. A great amount of googling has revealed to me that this is a common pre-calculus homework problem. Unfortunately, the hundreds of relevant answers all say things like "Once you have this equation, use your graphing calculator's minimum function and it will tell you the answer is 6." I confess that I recall nothing of pre-calculus. I recognize that the equation I seek is probably

Is there a Calculus library for JavaScript? [closed]

[亡魂溺海] 提交于 2019-12-10 03:42:01
问题 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 3 years ago . Does anyone know of a Calculus library for JavaScript? I've done some Googling and haven't come up with anything. I applied for the WolframAlpha API, but that's expensive unless they choose to give me a grant. Ideally, I could feed an Array of 2d points into a function, and get back the graph (Array) of points

Smooth of series data

非 Y 不嫁゛ 提交于 2019-12-08 05:39:03
问题 i need to smooth better this kind of plot, I've already used a moving average (10 points) to get this plot but it's not yet perfect. I want to remove all these little peaks dued by noise, I need to consider only the bigger ones because I'm counting the num of beats from a sensor. (ie.: in the first 30 seconds I should have just one peak instead of several successive little peaks) I thought to use a cubic spline but isn't simple to implement in C and it's going to take almost 1-2 weeks of work

Implicit differentiation with Scilab?

别说谁变了你拦得住时间么 提交于 2019-12-08 03:17:13
问题 Can somebody tell me how to implicitly differentiate equations in Scilab ? Example: x^2+y^2=25 (a circle equation) The derivative is: dy/dx=−x/y How can we accomplish this implicit differentiation in Scilab? May be with diff or dassl or another function of Scilab? 回答1: Scilab is oriented to numerical computations. You can go to http://www.wolframalpha.com and type "differentiate x^2 + y^2 = 25 in x" into the input box. 来源: https://stackoverflow.com/questions/34560820/implicit-differentiation