Capacitor Voltage calculation from current

4 visualizzazioni (ultimi 30 giorni)
Abu Sufyan
Abu Sufyan il 13 Lug 2021
Risposto: Walter Roberson il 13 Lug 2021
Ia1 and Ia2 is input from simulink model
C = 15e-6
Ic= Ia1-Ia2;
Vc1 = @(C, Ic) (1/C)*(Ic);
Vca = integral(Vc1,0,1);
Error:
Error in grid (line 12)
Vca = integral(Vc1,0,1);

Risposte (1)

Walter Roberson
Walter Roberson il 13 Lug 2021
The first parameter to integral() must be a function handle that expects one input. You are passing a function handle that expects two inputs.
You have assigned C as a constant value so it would seem to make the most sense to use
Vc1 = @(Ic) (1/C)*Ic;
However, you do not need to do a numeric integration to solve that, as it is simple case of constant*x:
integral of Ic/C for Ic = 0 to 1 is Ic^2/(2*C) from 0 to 1 which is 1/(2*C) - 0/(2*C) which is 1/(2*C)
.. though you said Ia1 and Ia2 are inputs. If your integral is over C then the integral would be Ic*(log(upperbound)-log(lowerbound)) which would be Ic*(log(1)-log(0)) which would be Ic*(0-(-infinity)) which would be Ic*infinity which would be sign(Ic)*infinity

Categorie

Scopri di più su Simscape Electrical in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by