Info

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

Solving 5 equations (time domain)

3 views (last 30 days)
Ali Moosazadeh
Ali Moosazadeh on 13 Jul 2024
Closed: John D'Errico on 13 Jul 2024
This question was flagged by Torsten

Can some body write a code to solve these equations ? These are kcl equations in a circuits . F1(n)=Cg*((Vi(n)-Vi(n-1))/ts)-Cg*((Vg(n)-Vg(n-1))/ts)+(1/R1)*(Vi(n)-Vs(n)); F2(n)=(Cg)*((Vg(n)+Vg(n-2)-2*Vg(n-1))/ts^2)-Cg*((Vi(n)+Vi(n-2)-2*Vi(n-1))/ts^2)+(1/Lg)*(Vg(n)-Vgg)+(1/L1)*(Vg(n)-Vgs(n)); F3(n)=(Cgs(n)+C1)*((Vgs(n)+Vgs(n-2)-2*Vgs(n-1))/ts^2)+(1/L1)*(Vgs(n)-Vg(n))+((Cgs(n)-Cgs(n-1))/ts)*((Vgs(n)-Vgs(n-1))/ts); F4(n)=(1/Ld)*(Vds(n)-Vdd)+(Cd)*((Vds(n)+Vds(n-2)-2*Vds(n-1))/ts^2)-(Cd)*((Vo(n)+Vo(n-2)-2*Vo(n-1))/ts^2)+((Ids(n)-Ids(n-1))/ts); F5(n)=Cd*((Vo(n)-Vo(n-1))/(ts))+(Vds(n)-Vds(n-1))/ts;

  2 Comments
Star Strider
Star Strider on 13 Jul 2024
It would likely be best to use the Symbolic Math Toolbox for this. You can then use the matlabFunction function to create a numeric function from the symbolic result.
Walter Roberson
Walter Roberson on 13 Jul 2024
(reposting just the equations)
F1(n)=Cg*((Vi(n)-Vi(n-1))/ts)-Cg*((Vg(n)-Vg(n-1))/ts)+(1/R1)*(Vi(n)-Vs(n));
F2(n)=(Cg)*((Vg(n)+Vg(n-2)-2*Vg(n-1))/ts^2)-Cg*((Vi(n)+Vi(n-2)-2*Vi(n-1))/ts^2)+(1/Lg)*(Vg(n)-Vgg)+(1/L1)*(Vg(n)-Vgs(n));
F3(n)=(Cgs(n)+C1)*((Vgs(n)+Vgs(n-2)-2*Vgs(n-1))/ts^2)+(1/L1)*(Vgs(n)-Vg(n))+((Cgs(n)-Cgs(n-1))/ts)*((Vgs(n)-Vgs(n-1))/ts);
F4(n)=(1/Ld)*(Vds(n)-Vdd)+(Cd)*((Vds(n)+Vds(n-2)-2*Vds(n-1))/ts^2)-(Cd)*((Vo(n)+Vo(n-2)-2*Vo(n-1))/ts^2)+((Ids(n)-Ids(n-1))/ts);
F5(n)=Cd*((Vo(n)-Vo(n-1))/(ts))+(Vds(n)-Vds(n-1))/ts;

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!