matlab,equation,numerical-methods,exponential

Here is some code that can find the best solution to your problem, if there is one. In this case, there is no reasonable solution, but defining A by M([4 2]) (for example) does work reasonably well. A = [1 2 3; 3 4 1; 2 4 4] %// the...

data,weka,data-mining,equation,linear-regression

If the vendor is equal to any of the line's nominal values, then the value is a one, otherwise, the value is a zero. For example, in line 1: -152.7641 * vendor=microdata,prime,formation,harris,dec,wang,perkin-elmer,nixdorf,bti,sratus,dg,burroughs,cambex,magnuson,honeywell,ipl,ibm,cdc,ncr,basf,gould,siemens,nas,adviser,sperry,amdahl The value would be subtracted by 152.7641 if and only if the vendor is equal to one of...

matlab,matrix,equation,differential-equations

If A, B, C, P1, P2, P3 are all numerical, why don't you simply use the ldivide or \ operator? This will allow you to solve your linear system directly. I can see that you have the following relationships: R*P1 = A R*P2 = B R*P3 = C You can...

math,volume,equation,exponential

Here's a derivation of the function. All it takes is some algebra. Model and Constraints We want an exponential function of the following form, that takes number between 0 and 1: f(t) = a * bt + c The function must satisfy these constraints you gave: f(0) = 0 =...

c++,int,decimal,rounding,equation

You've defined BKDMG to be of type int meaning that it can only hold integers. So, yes, if you assign it a real-number value it will round it down to the next integer value. Using double or float would probably suffice for this example. Your conditions are also wrong: if...

c++,linear-algebra,equation,linear

You don't allocate the second dimension for the EquationHolder. Since is a 2D matrix you have to allocate the second dimension also. Change your double for loop to the following: float ** EquationHolder=new float *[3]; for (int i=0; i<NumEquations; i++) { EquationHolder[i] = new float[3]; cout<<"Please Enter The Information Of...

Problem to find the amount of solutions of a Diophantine equation Ax+By+Cz=D is equal to Coin Change Problem with sum D and coin denominations A,B,C. It could be solved by dynamic programming (taking into account limited ranges of x,y,z). DP gives also solutions of equation.

assembly,x86,nasm,equation,square

You've got a typo here: FLD dword [zmB] ; zmC - st0, zmB - st1, zmC - st2 That instruction should be FLD dword [zmC] By the way, you can replace these two lines: FLDZ ; 0 - st0, zmC - st1, zmB - st2, zmC - st3 FADD st0,st2...

python,math,equation,quadratic

If you got an answer, it must have been a complex number (which are not included by default in Python). Look at the line math.sqrt(B5**2 - 4*A5*C5). This evaluates as so: math.sqrt(B5**2 - 4*A5*C5) math.sqrt(0**2 - 4*5*6.5) math.sqrt(0 - 130) math.sqrt(-130) The function math.sqrt doesn't find complex roots. You should...

It looks like you are missing the l in substitute(). That is, use substitute(yourFormula, l). Here's a MWE without the r^2 that parallels the one you're looking at (which I think is at ggplot2: Adding Regression Line Equation and R2 on graph). library(ggplot2) # Function to generate correlated data. GenCorrData...

I think you need to put a return statement after the call to generateNumbers in } else if (operator == 4) { if ((number1%number2==0) && (number1>number2)) { actualAnswer = number1 / number2; } else { generateNumbers(); } equation.append(" / "); } since that will restart the whole process, rather than...

The procedure to convert from base b to base 10 is to multiply each digit in position k (from right to left, starting at 0) by b^k. I won't give away all of the answers but for 25 in base s, it is 2 * s^1 + 5 * s^0...

matlab,graph,plot,equation,polar-coordinates

Utilize the output of your polar call to address and change line properties. In this case we're interested in the LineWidth property. w = 0.1; SAU = 0.1; r = 0:100; Phi = 2*pi/w*(1-SAU)*r/500; h.myplot = polar(Phi, r); h.myplot.LineWidth = 8; % Adjust as necessary This assumes you have R2014b...

Replace your algebra with your numbers (substitute them): 3 <= 4 && !(2 >-5 | 4 >7) Now both sides of the && need to be true in order for the whole thing to be true. So; (3 <= 4) is true; ! means 'not'/opposite of (2 >- 5) is...

I am mostly confused by the introduction of [k] in the equation as I don't know how it changes the list. someList[k] is an item accessor for the kth item of the list. So for a list a = [2, 3, 5, 7], a[k] will return the kth number....

matlab,equation,nonlinear-functions

There are several mistakes in your code. For a start, fzero is for finding numerical roots of a non-linear equation, it is not for symbolic computations (check the documentation), so get rid of syms x. The correct way to call fzero in your case is a as follows: A =...

jquery,flot,equation,chemistry

Those red lines are isopleths. In order to plot them you vary the independent variable against the equation with enough granularity to produce points to approximate the curve. According to wikipedia, your Hendersonâ€“Hasselbalch equation for blood is: pH = 6.1 + log(HCO3MM/(0.03*PCO2)) Where pH is x and HCO3MM is your...

javascript,algorithm,equation,createjs

If I understand it correctly, you want circleSpeed to be a function of distance, such that circleSpeed is 0.5 when distance is 100. circleSpeed is 2 when distance is 20. There are infinity functions which fulfill that, so I will assume linearity. The equation of the line with slope m...

matlab,equation,equation-solving,nonlinear-functions

I see, I got to almost the same place as you, however, I got to line 309, since apparently using isfinite on a sym does not cause a crash in matlab 2014b. However, isfinite returns false, still giving an error. But to the point: it seems that fzero is not...

algorithm,math,language-agnostic,equation,polynomial-math

Solving several polynomial equations in several variables is a hard problem. Doing so in polynomial time in the average case is Smale's 17th problem. It is unlikely that you will find a fast and simple algorithm for doing so that actually works. You might look at "Ideals, varieties, and algorithms"...

Found the following package: http://www.emacswiki.org/emacs/download/AuxLabel Make sure to read the LIMITATIONS section....

We do know the equations of the curves. They are of the form a*x**2 + b*x + c, where a,b, and c are the elements of the vector returned by np.polyfit. Then we just need to find the roots of a quadratic equation in order to find the intersections: def...

graph,plot,wolfram-mathematica,equation

Running some examples for x = 3 for x=3: 40500*(3^(-0.1)+2^(-0.1)+1^(-0.1)) 114574. This can be found using Sum: Sum[40500*i^(-0.1), {i, 3}] or using Fold Fold[#1 + 40500*#2^(-0.1) &, 0, {1, 2, 3}] 114574. FoldList outputs the intermediate steps. FoldList[#1 + 40500*#2^(-0.1) &, 0, {1, 2, 3}] {0, 40500., 78287.8, 114574.} Accumulating...

Store previous time in a private member. private long previousTime; Initialize it in the constructor. previousTime = System.currentTimeMillis(); Compare it with current time in run method (each iteration of game loop) long currentTime = System.currentTimeMillis(); double elapsedTime = (currentTime - previousTime) / 1000.0; System.out.println("Time in seconds : " + elapsedTime);...

AsciiMath does not have a built-in way to do this, i.e., generate <math> elements with display="block" (and thus neither does MathJax). The displaystyle setting adds displaystyle="true" to the math. As per the MathML spec display="block" entails displaystyle="true" but not vice versa; the main difference is that the former is set...

For any physically-reasonable pendulum, your h should be less than 1 (seconds) to model this properly. But you're casting to int which rounds down, so you get h=0 (no time step). Instead, use float: h=float(input("h: ")) q=float(input("Angle: ")) l=float(input("Pendulum length: ")) ...

algorithm,math,formula,equation

One way to approach this would be to adjust C so that it absorbs the factor A+B. Then the ratio of A to B would be exact, and X, Y, and C would all be integers. Let D = 5*(A+B), C2 = ceiling(C/((double)D)) * D (round up so you get...

vhdl,multiplication,equation,signed

Since x and y are of datatype signed, you can multiply them. However, there is no multiplication of signed with real. Even if there was, the result would be real (not signed or integer). So first, you need to figure out what you want (the semantics). Then you should add...

The problem is the row D[i]=sqrt(A**2+(rng1[i]**2)+(2*A*(rng1[i])*Tetha) The parentheses don't match up, just add one at the end like this and it will work. D[i]=sqrt(A**2+(rng1[i]**2)+(2*A*(rng1[i])*Tetha)) ...

performance,equation,computer-architecture,parallelism-amdahl

Suppose current execution time is 100 seconds. Desired speedup is 6/5, so that means the new time over the old time should be 5/6, a reduction of 16.67% or 16.67 seconds. (That's all Amdahl's law is!) You know that 20 seconds are spent in memory access, 50 seconds are spent...

php,shell,special-characters,equation

Just I changed lang like below before shell_exec $locale = 'en_US.utf-8'; setlocale(LC_ALL, $locale); putenv('LC_ALL='.$locale); shell_exec('echo "password" | sudo -S /root/.cabal/bin/texmath latexfile > outputfile'); Then it generates file with special characters. Referred from SO...

(A * x) - (y / A) = B Assume A is not zero. Solving for X: AAX - y = B * A AAX = (B * A) + y X = [(B * A) + y]/[A * A]...

A mock answer to your question probably looks like function x_c = f_x_c(H,A,B,C,D) x_c = H*A; x_c = x_c + B*asinh(C/H) - B*asinh(D/H); end and a call to solver is H = fzero(@(H)(f_x_c(H,1,1,1,1)+1400),1); ...

python,mysql,mysql-python,equation

Sorry for the late answer. I highly suggest to make the ID an INT with AUTO INCREMENT and PRIMARY KEY in order to prevent duplicates, but this would not allow you to change it freely as you want. You need to check if there is a duplicate of the name...

ios,objective-c,properties,equation

Try breaking it down like this: self.button4.hidden = NO; self.button3.hidden = self.button4.hidden; // We just set self.button4.hidden to NO, so this passes that value to self.button3.hidden self.button2.hidden = self.button3.hidden; self.button1.hidden = self.button2.hidden; It's just setting them all to NO in a clever way...

After even more Googling around I came up with this gem Calculus, and it does exactly what I've been looking for. The Readme file is pretty self-explanatory, so I won't be copying this here....

Define the function as: int quadraticEquation(int a,int b, int c) Without & signs to pass the parameters by value instead of by reference (althought as juanchopanza states on a comment it is not extrictly required). And call it as: cout << "The solution is: " << quadraticEquation( a, b, c);...

matlab,math,equation,equation-solving

Hope this helps. It's not meant to be optimal. It was tested in octave that has a few slightly different parsing rules that matlab, I'm generally good keeping within the shared syntax of octave and matlab but offering fair warning. function x=solver(A,y,freeVars) % % x=solver(A,y,freeVars) % % Solve system of...

Generally this is done (if the eq is in the format you have) with an Ax=b system. Let me show you how to do it with a simple example of 2 eq with 2 unknowns. 3*l1-4*l2=3 5*l1 -3*l2=-4 You can build the system as: x (unknowns) will be a unknowns...

order,wolfram-mathematica,equation

here is a way to extract the value automatically: ode = y'' + y' + y == 0 ; Max[Cases[ ode , Derivative[n_][y] :> n , Infinity]] 2 note this just finds the largest derivative in the expression, it doesn't verify if the expression is actually an ode.....

assembly,equation,tasm,dosbox,operands

Your program is almost good, you only have some issues with operand sizes, which is normal. So I took your code and made some little changes, those changes are commented and pointed by arrows (<========) and they are : Fixed the operand size problem. I still use DB because I...

javascript,encryption,type-conversion,rsa,equation

well, the parseInt function within Javascript has the radix parameter as the second param that can convert string to numbers based on the given radix So you can do var convert=parseInt("f", 16); //16 var convert2=parseInt("af", 16); //175 What I don't understand is your usage of "z" as an example. Maybe...

matlab,math,equation,bisection

You almost have it correct. The bisection method requires that you need to check the sign of f(xl)f(xc). You are only checking for f(xc). As such, you just need to modify your code with two lines: Add one line to compute f(xl) Modify your if statement to check the sign...

python,python-2.7,parsing,equation

a minimal working example (+,-,*,/,** binary and unary operations and function call implemented) the priority of operation are set with parenthesis a little bit more than the functionality for the example given is done from __future__ import print_function import ast def transform(eq,functions): class EqVisitor(ast.NodeVisitor): def visit_BinOp(self,node): #generate("=>BinOp") generate("(") self.visit(node.left) self.visit(node.op)...

math,integer,equation,linear,diophantine

existence Bezout's identity tells you indeed that with the greatest common divisor (gcd) d of a and b, we have : i) d is the smallest positive integer that can be written as ax + by, and ii) every integer of the form ax + by is a multiple of...

ios,uilabel,calculator,equation

Track the user input by appending the operations to an NSArray. If the user taps the '+' button, add an NSString to the array of @"+", if they tap on "-", add an @"-" to the array. From here you can generate an concatenated NSString of all the operations to...

Setting Exactly (in point size) the line spacing was the problem (this parameter is in Paragraph under Line Spacing in Word), the issue was not related to the fraction being inside a cell or not.

compiler-errors,latex,equation,multicol

The error tells you that you cannot use multline in mathmode (which is entered when you use an equation block). The multline environment already implies mathmode. When I remove the equation block it works. Remember you have to add a \\ to actually use multiple lines in your equation. Resulting...

i = 0 while i < x: finalprice = list_number_1[i] * list_number_2[i] i += 1 i is list index. while i < x means, that loop will keep going until i will no longer be less than x list_number_1[i] * list_number_2[i] means: "i" element of first list multiple by "i"...

My best guess is you are using integer division from all the .size() methods which will result in 0 if the answer is less than 1. Cast your results of .size() to float or double

c++,function,void,equation,quadratic

When you declare a function like void add_nmbr(int a, int b, int c) you are passing parameters by value which means you pass a copy of value into the function. You can change the value inside add_nmbr for a but that value stays inside the function. In you case, the...

letsimp applies only to "*" expressions. You could try subst.

If you want to add the upvotes and downvotes you would do this - $newTotal = $row['voteup'] + $row['votedown']; $str.="<p>" . $newTotal ."</p>"; ...