Message Boards Message Boards

0
|
6025 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

replacing a ratio

Posted 9 years ago

hi, I have an expression that contains a lot of parameters. among these parameters, a have (a/b) and i would like to replace it with one term (w). is there a command in mathematica that i can use it to replace it? thanks.

POSTED BY: djouaher zo
3 Replies
In[1]:= (3 + a/b) /. a -> b*w

Out[1]= 3 + w
POSTED BY: Frank Kampas

If you have

In[275]:= (a + (a/b)^2) /. a -> b*w

Out[275]= b w + w^2

But if you add another /. b*w -> a

In[267]:= (a + (a/b)^2) /. a -> b*w /. b*w -> a

Out[267]= a + w^2

Eric

POSTED BY: Eric Johnstone

That's because it can't match b*w to w^2 but:

In[1]:= (a + (a/b)^2) /. a -> b*w /. w -> a/b

Out[1]= a + a^2/b^2
POSTED BY: Kay Herbert
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract