Subs Result Still Has Symbolic Variable In It
5 views (last 30 days)
Show older comments

So as you can see from the result from the console, I am attempting to substitute all the symbolic variables in the symbolic expression tauB(1) with values. But the result of this substitution still has one of the symbolic variables that I substituted for in it? Not sure why this is or how to fix it. tauB(1) is a bit of a length expression but I'll post it here anyway.
>> tauB(1)
ans =
- (4115149222386437697*rpm1^5)/12980742146337069071326240823050240000000 + (21808513960237945171*rpm1^4)/792281625142643375935439503360000000 - (21217777204886075429*rpm1^3)/24178516392292583494123520000000 + (10349500888931238881*rpm1^2)/737869762948382064640000000 - (29738775089977568461*rpm1)/360287970189639680000000 + (4115149222386437697*rpm2^5)/12980742146337069071326240823050240000000 - (21808513960237945171*rpm2^4)/792281625142643375935439503360000000 + (21217777204886075429*rpm2^3)/24178516392292583494123520000000 - (10349500888931238881*rpm2^2)/737869762948382064640000000 + (29738775089977568461*rpm2)/360287970189639680000000 + (4115149222386437697*rpm3^5)/12980742146337069071326240823050240000000 - (21808513960237945171*rpm3^4)/792281625142643375935439503360000000 + (21217777204886075429*rpm3^3)/24178516392292583494123520000000 - (10349500888931238881*rpm3^2)/737869762948382064640000000 + (29738775089977568461*rpm3)/360287970189639680000000 - (4115149222386437697*rpm4^5)/12980742146337069071326240823050240000000 + (21808513960237945171*rpm4^4)/792281625142643375935439503360000000 - (21217777204886075429*rpm4^3)/24178516392292583494123520000000 + (10349500888931238881*rpm4^2)/737869762948382064640000000 - (29738775089977568461*rpm4)/360287970189639680000000 + w_kp
Any idea how to fix the subs command to get it to truly substitute for all symbolic vars?
1 Comment
Walter Roberson
on 10 Dec 2018
Please attach tauB(1) in the form of a .mat so we can test.
When I use the expression you posted, rpm3 and rpm4 cancel out, leaving an expression with only rpm1, rpm2, and w_kp
Please also check to see whether rpm1, rpm2, rpm3, rpm4, or w_kp have been assigned values in the workspace that are different than their names. For example if after building tauB you had done
syms x; w_kp = x
then at the time of the subs(), w_kp would have content that named a different variable, but tauB would have the original w_kp in it.
Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!