Questions tagged [equations]
194 questions
0
votes
1 answer
simplify equations/expressions using Javacc/jjtree
I have created a grammar to read a file of equations then created AST nodes for each rule.My question is how can I do simplification or substitute vales on the equations that the parser is able to read correctly. in which stage? before creating AST…

Iman Dz
- 29
- 1
- 2
- 9
0
votes
2 answers
How to write an equation in sql?
I want to implement this equation in sql :
f(x) = f(a) + (f(b)-f(a)) * (x-a)/(b-a)
My input is as following:
What I tried was:
select ((select CosValue from CosineTable where Angle=70) +
((select CosValue from CosineTable where Angle=75)…

user3740504
- 11
- 1
0
votes
1 answer
MATLAB ode45 function 'Too many inputs error'
My function is:
function [tout, yout] = Lorenz (rho, x0)
%define constants
sigma = 10;
beta = 8/3;
%initial conditions
y0 = [x0; 1; 0];
f = @(t, y) [sigma*(y(2)-y(1)); (y(1)*(rho-y(3)))-y(2); (y(1)*y(2)) - (beta*y(3))];
[tout, yout] = ode45(f, [0…

Sriram Iyer
- 3
- 2
0
votes
0 answers
Find the equation to calculate Daily, Weekly, and Monthly rental costs
I have recently taken over a web development project for a local car rental company and need help finding out how to calculate the Daily, Weekly, and Monthly cost of a vehicle.
The previous developer used a plugin that allowed you to create "Pricing…

Kevin Ullyott
- 49
- 1
- 7
0
votes
0 answers
My algorithm doesn't works correctly - Diophantic linear equation
This code try to solve Diophantics linear equation, the form of this equations is Ax + By = C.
This class has two attibutes "a" and "b", and the construct must receive this numbers
public class LongPair {
private long a, b; // the pair of…

grf2018
- 3
- 5
0
votes
4 answers
What's an easy way of doing powers in PHP?
I'm trying to make to make a script to help me with my maths
example equation: y=(4*(x*2)^(2x+4))+4*x^2
For this to work, I just need it to understand that only (x*2) needs to be put to the power of (2x+4), and then to sub that back into the…

Tom
- 1,068
- 2
- 25
- 39
0
votes
1 answer
Value returning null after assigning a value (kindof)?
This is my code, with a few errors (i'll explain later)
RandMath
RandomMath
Click the button below to generate a random equation.
0
votes
2 answers
How can I solve a system of linear equations in Excel
I am having some trouble finding a solution for a system of equations using excel.
The system is of the form Ax=b, with A a matrix and x and b vectors. Obviously, the goal is to find x.
The system does not necessarily have the same number of…

neXus
- 2,005
- 3
- 29
- 53
0
votes
2 answers
How to solve a linear system in Linux shell?
Does anyone know of a Linux command that reads a linear system of equations from its standard input and writes the solution (if exists) in its standard output?
I want to do something like this:
generate_system | solve_system

yassin
- 6,529
- 7
- 34
- 39
0
votes
0 answers
Mathematica Solve returns empty array for many equations
I have this very complicated system of 8 equations with 8 unknowns:
Solve[{qx + vx - B Cos[phibr] == L/2, qy + vy - A Cos[phibe] ==L/2, q_x + v_x + B cos[phi_br] == L/2, qy + vy + A Cos[phibe] == L/2, B w_br Sin[phibr]== v, A wbe Sin[phi_be] == v,…

Hannah
- 165
- 2
- 3
- 13
0
votes
1 answer
Combining 3 for loops into 1 in Matlab
I have this section of code which is working fine but i don't like the way i have implemented those 3 separate for loops. Can anyone suggest to me that how can i merge them together to make it even more efficient and compact ? Thank you
clear…

A Ahmed
- 7
- 6
0
votes
1 answer
in excel if content of one cell is same as another than how carry out another function
Excel question. need formula for the following:
If the text content of one cell is the same as the one below then i want to have another cell populated with an equation that adds 2 other columns. is this possible?

MFC
- 1
- 2
0
votes
0 answers
How to interpolate a vector and work with variables (ode45)?
I'm working with an ODE model the one I have to put a vector in a variable and then solve it, but I have some parameters which depends on some of the equations of the model, like auxiliar functions/equations but I get this error:
Error using…

Ana Olay
- 3
- 2
0
votes
0 answers
problems calculating optimal portfolio weights
I want to use following formula to calculate optimal weights of allocation; w= Er*(λΣ)^(-1).
ER is a vector of excess returns 1 x 3
λ is an constant parameter, let's say it 6.
Σ is a variance-covariance matrix 3 x 3
below ive tried to code this but…
0
votes
2 answers
Swift - Hard to explain, little mathy function
Ok so heres the deal, I'm trying to make a function that checks if the amount of player moves is equal to a number with a factor of 12.
(like 12, 24, 36, and 48 and so on.)
This is what I've got so far:
//Changables
var playerMoves = 0
var…

Peter Larson
- 143
- 4