Questions tagged [equation-solving]

763 questions
1
vote
0 answers

Solving systems of symbolic equations between two block matrices in sympy?

Assume that I have two symbolic block matrices, below called N and M. Each entry of the block matrices corresponds to the other, so that we should have (analytically) N.blocks[0,0] = M.blocks[0,0]. Is it possible to solve the resulting system of…
J.Galt
  • 529
  • 3
  • 15
1
vote
1 answer

What is the best way to construct, and then solve quickly a system of linear equations in Python?

Suppose I have a big system of linear equations: X_1*a_11 + X_2*a_21 + ... + X_n*a_n1 = b_1 . . . X_1*a_1m + X_2*a_2m + ... + X_n*anm = b_m The dimensions n and m are fixed (are not symbolic). I can find and plug the values of each coefficient…
1
vote
1 answer

is there a way to perform multi-objective analysis with pygad module?

I'm trying to solve a system of equations using genetic algorithm (using python 3.x). is there a way to perform multi-objective analysis using the PyGAD module or an approach that increases accuracy of the GA output?
1
vote
2 answers

System of equations in python symbolically

I want to solve this system symbolically but it didn't work. where did I make the mistake? and how can I solve it? import numpy as np from sympy import symbols,Matrix Y, C, I0, G0, a, b = symbols('Y, C, I_0, G_0, a, b') npA = np.array(([1, -1], [-b,…
Tatanik501
  • 159
  • 10
1
vote
1 answer

Equating differential equations in python

I want to equate those differential equations. I know I can solve them easily in the paper but I want to know how to do it in Python: from sympy import symbols, Eq, solve P = Function("P") Q = Symbol('Q') Q_d = Symbol("Q_d") Q_s = Symbol("Q_s") t =…
1
vote
2 answers

Finding roots to equation using a modulo-divided numpy.poly1d in python

I've created a polynomial object using numpy.poly1d and some arbitrary coefficients (a,b,c) so that I can find the roots of the equation ax^2 + bx + c = y0 at a given y0. In principle, that can be done fairly easily by calling the method root of the…
Robert.D
  • 11
  • 1
1
vote
2 answers

How to recall the same function until it become true in Python

I need to build a python code for the following equation. As I understood this equation has only 4 iterations and until it becomes true need to recall the function again. But when recalling the function the value which use to store the number of…
Haree.H
  • 53
  • 7
1
vote
0 answers

Using sagemath to solve equations

I'm new to SageMath and I'm trying to see how complicated are the problems Sage can provide solutions to. So I tried to see whether Sage could solve identifiability problems. If we have a normal model, it's known that the model is identifiable,…
1
vote
0 answers

TradingView RSI Formula - What am I doing wrong? | Java

I'm trying to make the exact rsi formula TradingView uses but in Java. Not looking for a spoonfed answer, but a point in the right direction would be much appreciated! Here's what I have, but the results do not line up: (periods.length=15,…
NotArchon
  • 125
  • 1
  • 6
1
vote
1 answer

How to find the optimal value in a function to get the best result?

This is an example of a bigger data, but imagine I have a DataFrame like this: import pandas as pd from sklearn.metrics import r2_score df = pd.DataFrame({'x':[0.04, 0.08, 0.09, 0.07, 0.07], 'y':[0.67, 0.46, 0.41, 0.43,…
user026
  • 638
  • 4
  • 14
1
vote
1 answer

How to numerically solve for the scaling factor in the "hanging cable problem"

A math question relating to the "hanging cable problem" in which a cable hangs from two poles in the form of a catenary. There are solutions for the sag and distance between poles given the length of the cable but my problem is different; given…
jenswirf
  • 7,087
  • 11
  • 45
  • 65
1
vote
2 answers

Nsolve will not solve

I am trying to create a surface plot based on temperatures. I need to feed in a hot and cold temperature to a function that solves a system of equations for our "z-axis" value. The function works fine until I set it to some variable. The system…
Alyxed15
  • 11
  • 2
1
vote
0 answers

BBsolve for non-linear equation solving does not print results

I have the issue with the function BBsolve and dfsane, that I have a successful convergence, but I don't get the results (par is not printed, only: successful convergence), when trying to solve the following nonlinear equation system. Any help would…
Wengritzky
  • 11
  • 1
1
vote
0 answers

Why does Sage not solve this system of (linear) equations, but then it does after some manual substitutions?

I have a system of equations in which there are two unknowns. Originally (the system is derived from the analysis of an electrical circuit) I have four equations with four unknowns, but two of them (irc1 and ire) are linear combinations of the…
Pedro Lobo
  • 11
  • 2
1
vote
1 answer

Solve System of Equations with Python Sympy

I am trying to solve a system of two equations in Python using Sympy. This is bit trickier than a standard problem because it includes a summation in both equations, where both equations are found by taking the derivative of the negative…
njalex22
  • 367
  • 1
  • 4
  • 13