How to enforce a certain symbolic expression to appear in Equation

1 次查看(过去 30 天)
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.

回答(1 个)

Dyuman Joshi
Dyuman Joshi 2023-7-19
编辑:Dyuman Joshi 2023-7-19
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 = 

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by