Skip to main content

All Questions

2 votes
2 answers
89 views

Formal substitution of exponential factors in an expression

Assume that we have some complex algebraic expression, like Exp[(a t + b s)/w] ( t Exp[ q t] w + q Exp[q s] Exp[-2 s] + a^2 Exp[3 s] + s t + 1 ) Now, this is just ...
Quillo's user avatar
  • 143
0 votes
0 answers
96 views

How to rearrange terms in an expression to a particular form (e.g. A/w-> A*(1/w)

I have a huge expression for which the numerators are a big mess, involving numbers, variables, formal sums and unevaluted function, let's call the numerators Ai, with i=1,2,...n This "beast"...
Noam's user avatar
  • 1
0 votes
0 answers
68 views

How can I use a replacement rule as part of a simplification?

I am using Mathematica to symbolically calculate the likelihood for a simple linear regression model. As part of this I want to substitute ...
user avatar
0 votes
2 answers
60 views

Replace small expressions in larger expressions?

How can I replace small expressions in larger expressions? Simple example Replace[a^2 + b^2 + 2*a*b + x, (a + b)^2 -> c] I want to get ...
granular_bastard's user avatar
2 votes
1 answer
72 views

How to get the result in terms of a previously defined expression?

Say I have a vector X[n_] := Table[Subscript[x, i], {i, 1, n}] and a matrix of connections: ...
Girardi's user avatar
  • 214
1 vote
2 answers
72 views

Substituting values from an association thread into a table of expressions

I have asked a question here. Yet I am trying to do the same procedure with AssociationThread Suppose I have the following function which is a normal distribution: <...
Wiliam's user avatar
  • 3,096
5 votes
1 answer
87 views

Substituting elements of lists into an expression

Suppose I have the following lists, as = {1, 2, 3, 4}; bs = {10, 20, 30, 40}; and the following expression: ...
Wiliam's user avatar
  • 3,096
5 votes
2 answers
306 views

Replace a randomly chosen part of an expression

Given an arbitrary Mathematica expression, how can I choose a random part of the expression and replace it with another symbol of my choosing? For example, given $a x^3 +2y\cos(x)- \tanh(x^{y+3})/(x^...
flinty's user avatar
  • 25.6k
2 votes
1 answer
83 views

Replace a family of coefficients by a function in a sum

I would like to do something very simple, i.e. replace the coefficients in a sum by a function: c[1] + c[2] + c[3] /. {c[s] -> (s + 1)/(2 (2 s + 1))} ...
Pxx's user avatar
  • 711
0 votes
0 answers
43 views

Expanding complex expression and replacing variables in the result

When I'm finished expanding my expression I would like the result to be expressed again in terms of the original variables (like α, S1, T1, T2). I've tried replace, ...
ASPVL's user avatar
  • 11
2 votes
0 answers
60 views

How to do an arbitrary expression growth in Mathematica?

I want to write a function that can be used to grow an expression from a seed or another existing expression based on part specification. ...
user13892's user avatar
  • 9,523
0 votes
1 answer
139 views

Making substitution to an expressions with a list of numerical data [closed]

Suppose I have an expression similar to this: y=23.23*(h[x]^2)*(D[h[x],x])*(D[h[x],{x,3}])/(13.2+Cos[0.245x]) The actual expression is a lot more complicated, but ...
Physicist's user avatar
  • 987
4 votes
4 answers
170 views

ReplaceList doesn't apply rules down to subparts

Somewhat related to a previous question, I'm experimenting with ReplaceList to get the list of all possible transformations we can obtain by applying a rule to an expression. But I don't manage to ...
Sylvain Leroux's user avatar
2 votes
0 answers
140 views

General rule to rewrite function and argument into a new symbol

I am trying to convert Mathematica output into equations I can plug into C. I am presently trying to convert expressions of the form Derivative[1,0,0][f][t,x,y] ...
physics_researcher's user avatar
1 vote
2 answers
230 views

Suppress arguments in output for pretty print

I would like to define a rule that suppress any arguments of a function for visibility. I tried: rule = f_[x__] -> f While this works well with individual ...
Patrick.B's user avatar
  • 1,523

15 30 50 per page