Calculate multivariable equation with Matlab

조회 수: 1 (최근 30일)
Daniel
Daniel 2023년 5월 14일
답변: Catalytic 2023년 5월 14일
I am trying to calculate the voltage of a circuit with an ADC, the problem is that I am seeing that the voltage reading has to be done from a function and that it depends on the current of the circuit, I arrived at the following equations for 0A, 0.4 A and 1.1A:
0A: 0.10680454x - 7.6688459
0.4A: 0.10669344x - 13.84042838
1.1A: 0.10652463x - 24.9126498
How can I put this together into an equation with two variables One for the voltage reading and one for the amperage.
Thank you so much!
Here is a plot of how the amperaje affects the votlage reading

답변 (1개)

Catalytic
Catalytic 2023년 5월 14일
You need some sort of model for the line slopes and intercepts as a function of the amperage. There are infinitely many that can be proposed. For example -
x0=[0,0.4,1.1];
y0=[0.10680454 0.10680454 0.10652463;
7.6688459 13.84042838 24.9126498];
voltage=@(A,x) voltageFcn(A,x, x0,y0);
function v=voltageFcn(A,x, x0,y0)
p=spline(x0,y0,A);
v=p(1)*x+p(2);
end

카테고리

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

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by