Questions tagged [simplification]
249 questions
2
votes
1 answer
Sympy absolute value and arguments of complex symbols
In doing symbolic math with Sympy I encountered the following problem:
from sympy import *
txx, tyx, txy, tyy, tp, tn = symbols('t_xx t_yx t_xy t_yy t_p t_n', complex=True)
#define a complex symbol
tp = txx-I*tyx
Abs(tp), arg(tp)
#will just return…

Phyinmi
- 450
- 7
- 15
2
votes
4 answers
Need help simplifying my php table
I am relatively new to php and have a feeling that I am going the long way round when displaying data from mysql.
I have a table a I want to show a few fields from my database.
How would I achieve this without having to echo every bit of the…

user342391
- 7,569
- 23
- 66
- 88
2
votes
1 answer
How to insert a subexpression into a larger expression in Mathematica?
I have the following expression:
A = (-(e + p) pe v +
v ((1 + pe) u^2 + pe v^2) \[Rho])/(-(e + p) pe u +
u (-prho + (1 + pe) u^2 + pe v^2) \[Rho]);
and I want to insert the following sub-expression in the above expression:
H = (e +…

john
- 41
- 1
- 7
2
votes
1 answer
How to efficiently get 10% of random numbers, then 10% of remaining 90 etc untill all points allocated
This is what I want to do :
I have 300 000 points.
I want 10% of the points.
I then want 10% of the remaining 90% of points.
I then want 10% of the remaining 81% of points
I then want 10% of the remaining 73% of points
etc until i'm finished with…

West1234
- 189
- 14
2
votes
1 answer
More efficient loops thru unique values in R
I am relatively new to R and all its wisdom and I am trying to be more efficient with my script. I am using a loop to simulate how an animal moves among different sites. The problem that I have is that when I increase the number of sites or change…

user1626688
- 1,583
- 4
- 18
- 27
2
votes
2 answers
Simplifying Javascript when having similar functions
I've finally pieced together some code that works for my question here. However, it appears pretty long as I've created separate functions for when a page with a certain hash is refreshed and when that same page is accessed via clicking the…

Clarice
- 41
- 5
1
vote
1 answer
Simplify (1/x)^a / x^2 in sympy
A long operation with sympy yielded the expression (1/x)^a / x^2, which one would normally write as x^(-2-a). What is the right sequence of sympy operations that I can apply to arrive to the simplified form?
I have tried the following, and none of…

Carlos Pinzón
- 1,286
- 2
- 15
- 24
1
vote
1 answer
Isabelle: [simp] leading to an infinite loop
I am trying to solve the simple lemma "add m (Suc n) = add n (Suc m)" by induction over m.
I tried solving the last remaining subgoal after applying auto by another lemma, howerver if i use the simplification rule on that auxiliary lemma it leads to…

helppls
- 13
- 2
1
vote
2 answers
Simplifying Typescript If statements
i am relative new to typescript (coming from java) and i have currently the following problem:
Given: String with a length of 3, it can only contain the charts '0', '1' and '2'. Each of them are representing a different state. Lets assume here the…

behzad k.
- 49
- 7
1
vote
1 answer
Printing numbers without exponential notation in Maxima
I have trouble with WordMat, when calculating with Maxima, which didn't occur before, but started recently. When i calculate something that either results in x00000 or 0,0000x i get the result returned as its scientific expression, IE x*10^5 or…

SensiF
- 11
- 2
1
vote
1 answer
A simple way to write logic and pass values between IFs
Is there an easier way to do this logical?
It is used often and each time I have the impression that it is unnecessary.
if (x != y)
x = y;
In more time-consuming methods, you have to use variables so as not to recalculate them every time.
I think…

Walczak Jakub
- 92
- 1
- 10
1
vote
2 answers
Template simplification
In one of my projects, I have the following class template hierarchy :
template
class filter;
template // Specialization when no parent filter is needed
class…

ereOn
- 53,676
- 39
- 161
- 238
1
vote
1 answer
Import simplification doesn't work on Mac M1: Symbol not found. Expected in: flat namespace
I have been trying to install simplification in a miniforge environment on a Mac M1 Big Sur but was not able to do so. I get the following error while importing from simplification.cutil import simplify_coords_vwp -
Traceback (most recent call…

Akash Yadav
- 11
- 1
1
vote
3 answers
Simplifying PHP forms that pre-populate with dabase data and error check, so actively overwrite with $_POST data
Ok, so this is a common scenario.
You have an html form that involves editing information. The original information comes from the database. When you post the form, it may not save the information immediately, because something may need fixing…

Kzqai
- 22,588
- 25
- 105
- 137
1
vote
0 answers
Run EditNTS in Google Collab... ValueError: unsupported pickle protocol: 5
I am trying to run a Text Simplification algorithm called EditNTS. I got it to run successfully locally on my machine by removing the cuda() method. However I am trying to run it on google Collab so I can take advantage of the GPU. However I am…

joey
- 115
- 8