Capacitor Voltage calculation from current
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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);
0 comentarios
Respuestas (1)
Walter Roberson
el 13 de Jul. de 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
0 comentarios
Ver también
Categorías
Más información sobre Simscape Electrical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!