How to simplify this symbolic equation - nominator and denominator manipulation

2 views (last 30 days)
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.

Accepted Answer

John D'Errico
John D'Errico on 1 May 2021
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.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!