MATLAB: How to solve the following equations for vc(t)

equation

I have a equation vc(t) which depends on a function T, Please check the following code
vc==(291*cos((6339586188837495*t)/137438953472)*exp(-(500*t)/47))/1175000 + (368963916190342209*sin((6339586188837495*t)/137438953472)*exp(-(500*t)/47))/343597383680000000 + (1267917237767499*cos((6339586188837495*t)/137438953472)*exp(-(500*t)/47)*((582*cot((6339586188837495*T)/137438953472))/25 – (7*exp((500*T)/47))/(25*sin((6339586188837495*T)/137438953472))))/27487790694400000 – (sin((6339586188837495*t)/137438953472)*exp(-(500*t)/47)*((582*cot((6339586188837495*T)/137438953472))/25 – (7*exp((500*T)/47))/(25*sin((6339586188837495*T)/137438953472))))/94000
and
T=((vc-Vin)/Rc)*Tsw/2*1/(1.5*Il-0.5*Ipo);
How to solve for vc(t)?

Best Answer

Try the following
syms t;
T=((vc-Vin)/Rc)*Tsw/2*1/(1.5*Il-0.5*Ipo);
vc=(291*cos((6339586188837495*t)/137438953472)*exp(-(500*t)/47))/1175000 + (368963916190342209*sin((6339586188837495*t)/137438953472)*exp(-(500*t)/47))/343597383680000000 + (1267917237767499*cos((6339586188837495*t)/137438953472)*exp(-(500*t)/47)*((582*cot((6339586188837495*T)/137438953472))/25 - (7*exp((500*T)/47))/(25*sin((6339586188837495*T)/137438953472))))/27487790694400000 - (sin((6339586188837495*t)/137438953472)*exp(-(500*t)/47)*((582*cot((6339586188837495*T)/137438953472))/25 - (7*exp((500*T)/47))/(25*sin((6339586188837495*T)/137438953472))))/94000;
answer=vpasolve(vc);
Keep in mind not to use == operator to assign an equation to a variable.
And also define the value of T before defining the variable vc.
All the best