Skip to main content
23 votes
Accepted

Finding the number of odd quintinomial coefficients

Use PolynomialMod: ...
Carl Woll's user avatar
  • 131k
19 votes
Accepted

Out of memory when computing a coefficient of a large symmetric polynomial

Split it into 3 steps to get result immediately. ...
Akku14's user avatar
  • 17.3k
14 votes

How to extract all the coefficients of a homogeneous polynomial

Using an undocumented function: ...
11 votes

Generate coefficient array from general formula of linear equation system

Partial ND It's possible to again extract all this weight data and stuff in the higher dimensional cases using effectively the same procedure as for the 1D: ...
b3m2a1's user avatar
  • 46.9k
10 votes

Finding the number of odd quintinomial coefficients

A slower but still useful approach employs ListCorrelate. ...
bbgodfrey's user avatar
  • 61.8k
10 votes

Out of memory when computing a coefficient of a large symmetric polynomial

To get the coefficient of $b^\beta c^\gamma d^\delta$, for $\beta=12$, $\gamma=8$, $\delta=6$, we take advantage of the fact that the coefficients $(poly)^n$ are computed by the ...
Michael E2's user avatar
  • 238k
9 votes
Accepted

Solve PDE with complicated coefficient non-linearity

I think the OP is trying to demonstrate hysteresis. WhenEvent has an example of an on-off controller, which is an example of a bistable system. Unfortunately, my understanding is, that an event must ...
Tim Laska's user avatar
  • 16.4k
9 votes

How to extract coefficients and powers from expressions with non integer powers?

Clear["Global`*"]; expr = 3 - 2 x + 7 x^2.1 + x^2.4 - 5 x^3; Transpose[{Exponent[#, x], # /. x -> 1}] & /@ List @@ expr {{0, 3}, {1, -2}, {2.1, 7....
Syed's user avatar
  • 55.7k
8 votes

How to locate a list within a list?

It really depends on how fast you need it and how many elements your list will have. Let's assume the worst: list = Range[1000000]; contain = {1, 2, 3, 4, 5, 6}; ...
halirutan's user avatar
  • 113k
8 votes
Accepted

Extract system of linear equations from the linearly independent vectors

This can be done using CoefficientRules: ...
Lukas Lang's user avatar
  • 34.2k
7 votes
Accepted

Solving for coefficients in a polynominal

Solve[ CoefficientList[(56 - 85689 x)^2 - 3136, x] == CoefficientList[-2 a b x + b^2 x^2, x], {a, b}] ...
ulvi's user avatar
  • 1,808
7 votes

How to locate a list within a list?

...
kglr's user avatar
  • 398k
7 votes

Solve PDE with complicated coefficient non-linearity

I do not see what the problem is. ...
Alex Trounev's user avatar
  • 45.8k
7 votes

Finding polynomial coefficients returns Tag Plus is Protected

The reason you get the error message is that you are using the single equals sign, which is an assignment operator. The double equals sign (==) is used for arithmetic comparisons. In addition to the ...
LouisB's user avatar
  • 12.6k
7 votes

How to extract coefficients and powers from expressions with non integer powers?

You may use pattern matching to achieve what you want: ...
Daniel Huber's user avatar
  • 53.2k
7 votes

How to extract coefficients and powers from expressions with non integer powers?

ce = Apply[List/*Map[List]/*ReplaceAll[a_. x^b_. :> Splice @ {b, a}]/*PadLeft]; ce[3 - 2 x + 7 x^2.1 + x^2.4 - 5 x^3] ...
kglr's user avatar
  • 398k
6 votes
Accepted

How to locate a list within a list?

We may use pattern matching: f[a_, {ss__}] := MatchQ[a, {___, ss, ___}] Testing: ...
Mr.Wizard's user avatar
  • 272k
6 votes

Extracting coefficients from sum

Update: In version 9, there is System`ReduceUtilsDump`MonomialCoefficients which (when Transposed) gives the desired result. <...
kglr's user avatar
  • 398k
6 votes
Accepted

Extracting coefficients from sum

You can use a combination of MonomialList and FactorTermsList. MonomialList gives a list of ...
Carl Woll's user avatar
  • 131k
6 votes
Accepted

How to factor all coefficients of a multivariable into prime factors

You could create a factoredForm wrapper that formats integers as desired: ...
Carl Woll's user avatar
  • 131k
6 votes
Accepted

Collect Fourier series terms

is this what you are asking? exp=3Cos[x]+5Cos[2x]+12Cos[3x]; Coefficient[exp,Cos[x #]]&/@Range@3 {3, 5, 12}
ZaMoC's user avatar
  • 6,727
6 votes
Accepted

Partial and semipartial correlation

Mathematica has a PartialCorrelation function but that is for time series data. However by following the information in Partial and semipartial correlation you can ...
JimB's user avatar
  • 41.9k
6 votes

Plotting of a polynomial function via two approaches

You cannot use both $a$ and $1/a$ in CoefficientList. Let's take a more simple example, which throws an error message together with a nonsensical result: ...
Domen's user avatar
  • 27.3k
6 votes
Accepted

Extracting the constant term

Try this: Total[Map[If[Total[Grad[#, Variables[expr]]] === 0, #, Nothing] &, MonomialList[expr]]] (*-(1/4)*) In general, when there are no subscripts, we ...
E. Chan-López's user avatar
6 votes

How to extract coefficients and powers from expressions with non integer powers?

coefList = List @@ # /. #2 -> 1 &; expList = Exponent[##, List] &; expCoefList = Transpose @* Through @* {expList, coefList} Examples: ...
kglr's user avatar
  • 398k
5 votes
Accepted

Coefficients of Knuth's "Convolution Polynomials"

As Michael notes, deleting the stray brackets will make it work. A better method, however, would be to use SolveAlways[]: ...
5 votes

Extracting coefficients from exponential function

Try to use the TreeForm function to visualize and the Part function to get the parameters. For example, here is your expression: ...
Alexei Boulbitch's user avatar
5 votes
Accepted

LogitModelFit function

The short answer Both Mathematica and R are asked to fit 3 parameters associated with the nominal variable: intercept, xA, and xB. But there's a linear dependency among those three parameters and ...
JimB's user avatar
  • 41.9k
5 votes
Accepted

Given $ax^2+bxy+cy^2+dx+ey+f$, what is the best way to get {a,b,c,d,e,f}?

CoefficientArrays come to mind, but it needs some tweaking. The below solutions work for polynomials of order $2$. Demonstration ...
corey979's user avatar
  • 24k
5 votes

Given $ax^2+bxy+cy^2+dx+ey+f$, what is the best way to get {a,b,c,d,e,f}?

You can also use CoefficientList as follows: ...
kglr's user avatar
  • 398k

Only top scored, non community-wiki answers of a minimum length are eligible