Skip to main content
edited tags
Link
added 4 characters in body; edited tags
Source Link

I'm looking for a way to extract a list of variables from an expression, for example with an input like:

Leff= (mc dm^2 + mc/12*(h^2 + 3 R^2) + ma da^2 + ma/12 La^2)/(mc dm + ma da)

I want this output:

{mc, dm, ma, da, La, h, R}.

The built-in Mathematica function Variables can do this, but it doesn't work with more complex expressions containing trascendental functions. Any help would be very appreciated.

I'm looking for a way to extract a list of variables from an expression, for example with an input like:

Leff= (mc dm^2 + mc/12*(h^2 + 3 R^2) + ma da^2 + ma/12 La^2)/(mc dm + ma da)

I want this output:

{mc, dm, ma, da, La, h, R}.

The built-in Mathematica function Variables can do this but doesn't work with more complex expressions containing trascendental functions. Any help would be very appreciated.

I'm looking for a way to extract a list of variables from an expression, for example with an input like:

Leff= (mc dm^2 + mc/12*(h^2 + 3 R^2) + ma da^2 + ma/12 La^2)/(mc dm + ma da)

I want this output:

{mc, dm, ma, da, La, h, R}.

The built-in Mathematica function Variables can do this, but it doesn't work with more complex expressions containing trascendental functions. Any help would be very appreciated.

Tweeted twitter.com/#!/StackMma/status/311969710692524032
added 12 characters in body; edited tags; edited title
Source Link
rm -rf
  • 89.3k
  • 21
  • 297
  • 480

Extracting variables from an expression

I'm looking for a way to extract a list of variables from an expression, for example with an input like:

Leff= (mc dm^2 + mc/12*(h^2 + 3 R^2) + ma da^2 + ma/12 La^2)/(mc dm + ma da)

Leff= (mc dm^2 + mc/12*(h^2 + 3 R^2) + ma da^2 + ma/12 La^2)/(mc dm + ma da)

I want this output: {mc, dm, ma, da, La, h, R}.

{mc, dm, ma, da, La, h, R}.

The built-in mathematicaMathematica function "Variables"Variables can do this but doesn't work with more complex expressions containing trascendental functions, any. Any help would be very appreciated.

Extracting variables

I'm looking for a way to extract a list of variables from an expression, for example with an input like:

Leff= (mc dm^2 + mc/12*(h^2 + 3 R^2) + ma da^2 + ma/12 La^2)/(mc dm + ma da)

I want this output: {mc, dm, ma, da, La, h, R}.

The built-in mathematica function "Variables" can do this but doesn't work with more complex expressions containing trascendental functions, any help would be very appreciated.

Extracting variables from an expression

I'm looking for a way to extract a list of variables from an expression, for example with an input like:

Leff= (mc dm^2 + mc/12*(h^2 + 3 R^2) + ma da^2 + ma/12 La^2)/(mc dm + ma da)

I want this output:

{mc, dm, ma, da, La, h, R}.

The built-in Mathematica function Variables can do this but doesn't work with more complex expressions containing trascendental functions. Any help would be very appreciated.

Source Link
John
  • 700
  • 8
  • 13
Loading