Info

This question is closed. Reopen it to edit or answer.

Trying to evaluate a symbolic function using multiple subs / returned symbolic function with not all subs applied.

1 view (last 30 days)
Here is my code guys. Kind of stumped been at it for a while.
syms Cb kT k x a v t;
forcingFxn = (.5*k/kT*(v*t-x));
Uleft = (Cb/kT)*(2*x^2/a^2 -2/3)+ forcingFxn;
Uright = (-Cb/kT)*(x/a-1)^2+forcingFxn;
product = Uleft*Uright;
dUl = diff(Uleft);
dUr = diff(Uright);
%%Integral of this product
integral = int(product,t);
finalExpressionForRt = exp(-integral);
substituted = subs(finalExpressionForRt,{t,x,Cb,k,kT,a,v},{1,0,40,2,4,1,1});
disp(substituted);
---------------------
Displays this when run...
1/exp((8*Cb^2 - 5*Cb*k*v + k^2*v^2)/(12*kT^2))
Why are t,x,a being substituted while Cb,Kt,k and v are not???
Thanks for the help,
Dan
  1 Comment
bym
bym on 30 Nov 2012
Edited: bym on 30 Nov 2012
what are you expecting to be the result for 'substituted' ?
using your code I get
substituted =
8.7653e-029

Answers (0)

Community Treasure Hunt

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

Start Hunting!