Define relationship between variables in an equation

4 views (last 30 days)
An equation has two variables d and t.
eqn = ((t - 21/2)*(d/2 - (20898604612049288806642049279907*t)/70957580590508366543483568128000 + 471612538725450581/36028797018963968)*(d + (20898604612049288806642049279907*t)/35478790295254183271741784064000 - 471612538725450581/18014398509481984) - ((41181014215700959230589300565923*t)/53218185442881274907612676096000 - 253280971625720775/9007199254740992)*(t/2 - 21/4)*((4992772075141567*t)/9007199254740992 - 104848213577972907/18014398509481984))/((t - 21/2)*(d + (20898604612049288806642049279907*t)/35478790295254183271741784064000 - 471612538725450581/18014398509481984) + (t/2 - 21/4)*((4992772075141567*t)/9007199254740992 - 104848213577972907/18014398509481984)) + (((41181014215700959230589300565923*t)/53218185442881274907612676096000 - 253280971625720775/9007199254740992)*(t/2 - 21/4)*((4992772075141567*t)/9007199254740992 - 104848213577972907/18014398509481984) - (t - 21/2)*(d/2 - (20898604612049288806642049279907*t)/70957580590508366543483568128000 + 471612538725450581/36028797018963968)*(d + (20898604612049288806642049279907*t)/35478790295254183271741784064000 - 471612538725450581/18014398509481984) + 39208413340930135/8796093022208)/((t - 21/2)*(d + (20898604612049288806642049279907*t)/35478790295254183271741784064000 - 471612538725450581/18014398509481984) + (t/2 - 21/4)*((4992772075141567*t)/9007199254740992 - 104848213577972907/18014398509481984) - 5373422634669521/17592186044416) == 0;
and I want to find the relationship between them like d=f(t).
How to define f(t)?

Accepted Answer

Star Strider
Star Strider on 19 Jun 2021
One approach —
syms d t
eqn = ((t - 21/2)*(d/2 - (20898604612049288806642049279907*t)/70957580590508366543483568128000 + 471612538725450581/36028797018963968)*(d + (20898604612049288806642049279907*t)/35478790295254183271741784064000 - 471612538725450581/18014398509481984) - ((41181014215700959230589300565923*t)/53218185442881274907612676096000 - 253280971625720775/9007199254740992)*(t/2 - 21/4)*((4992772075141567*t)/9007199254740992 - 104848213577972907/18014398509481984))/((t - 21/2)*(d + (20898604612049288806642049279907*t)/35478790295254183271741784064000 - 471612538725450581/18014398509481984) + (t/2 - 21/4)*((4992772075141567*t)/9007199254740992 - 104848213577972907/18014398509481984)) + (((41181014215700959230589300565923*t)/53218185442881274907612676096000 - 253280971625720775/9007199254740992)*(t/2 - 21/4)*((4992772075141567*t)/9007199254740992 - 104848213577972907/18014398509481984) - (t - 21/2)*(d/2 - (20898604612049288806642049279907*t)/70957580590508366543483568128000 + 471612538725450581/36028797018963968)*(d + (20898604612049288806642049279907*t)/35478790295254183271741784064000 - 471612538725450581/18014398509481984) + 39208413340930135/8796093022208)/((t - 21/2)*(d + (20898604612049288806642049279907*t)/35478790295254183271741784064000 - 471612538725450581/18014398509481984) + (t/2 - 21/4)*((4992772075141567*t)/9007199254740992 - 104848213577972907/18014398509481984) - 5373422634669521/17592186044416) == 0;
ds = solve(eqn,d);
d(t) = vpa(ds, 5) % Define 'd(t)' As A Function Of 't'
d(t) = 
figure
fplot(d, [-10 45])
grid
xlabel('t')
ylabel('d(t)')
.

More Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!