How to simplify this symbolic equation - nominator and denominator manipulation

4 ビュー (過去 30 日間)
Hi,
I am solving well known equation:
syms c t tau
eq1 = (c*t)^2 == (c*tau)^2+(v*t)^2
solvedeq1=simplify((solve(eq1, t)))
solvedeq1(1)
Now the standard way of giving the answer is:
How do I manipulate MATLAB to give me this final form? I have tried randomly to apply all possible symbolic commands.
Thank you for your time.

採用された回答

John D'Errico
John D'Errico 2021 年 5 月 1 日
I never did understand why people worry about making a symbolic tool give a result in a mathematically identical form, that happens to look as you want to write it. Can you spend an hour figuring out how to produce a form that looks as you want? Probably. Why?
You want to solve this essentially in a non-dimensional form for v. So write the equation by dividing by c^2. We will use the transformation u = v/c.
syms c t tau v u
eq1 = (t)^2 == (tau)^2+(u*t)^2
eq1 = 
solvedeq1=simplify((solve(eq1, t)))
solvedeq1 = 
solvedeq1(2)
ans = 
Having done that, now undo the transformation, but do NOT use symplify which may screw things up.
subs(solvedeq1(2),u,v/c)
ans = 
Note that I had to use solvedeq1(2) to give the positive solution.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by