Clear Filters
Clear Filters

How to enforce a certain symbolic expression to appear in Equation

1 view (last 30 days)
I have the following symbolic equation:
syms go u W d f
f = ((0.65*W)/go);
Fcc_1 = (2*5^(1/2)*d*go^2*(- (go^2*(u - 1)^2*W)/20 + W^3/8000)*(-(W^2/400 + ...
(u - 1)^2*go^2)/(W*go*(- 1 + u)))^(1/2))/(W*pi*(go^2*(u - 1)^2 + W^2/400)^2);
However, in the final equation (Fcc_1) I only want the variables 'u', 'd', and 'f' to appear. How can I enforce 'f' to be substituted accordingly?
Note that f is 0.65*W/go.

Answers (1)

Dyuman Joshi
Dyuman Joshi on 19 Jul 2023
Edited: Dyuman Joshi on 19 Jul 2023
syms go u W d f
%relation of f with W, go
rel = ((0.65*W)/go)-f==0;
%Obtain W in terms of f and go (you can also get go in terms of f and W)
term = solve(rel,W)
term = 
Fcc_1 = (2*5^(1/2)*d*go^2*(- (go^2*(u - 1)^2*W)/20 + W^3/8000)*(-(W^2/400 + ...
(u - 1)^2*go^2)/(W*go*(- 1 + u)))^(1/2))/(W*pi*(go^2*(u - 1)^2 + W^2/400)^2);
%Substitute the term in place of W in the main expression
out = subs(Fcc_1,W,term)
out = 
%Simplify the output
out = simplify(out)
out = 

Categories

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

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!