Capacitor Voltage calculation from current

조회 수: 4 (최근 30일)
Abu Sufyan
Abu Sufyan 2021년 7월 13일
답변: Walter Roberson 2021년 7월 13일
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);

답변 (1개)

Walter Roberson
Walter Roberson 2021년 7월 13일
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

카테고리

Help CenterFile Exchange에서 Simscape Electrical에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by