Multivariate fitting of linear equation
古いコメントを表示
I want to do multivariable fitting for the following linear equation
P = K * T
Where:
P is matix of known and controlled variable
T is matix of known, measured variable
K is the matrix of unknown coefficients
P is 4x1 matrix
P = [P1; P2; P3; P4]
K is 4X6 matrix
K = [K1_1 K1_2 K1_3 K1_4 K1_5 K1_6;
K2_1 K2_2 K2_3 K2_4 K2_5 K2_6;
K3_1 K3_2 K3_3 K3_4 K3_5 K3_6;
K4_1 K4_2 K4_3 K4_4 K4_5 K4_6]
T is 6x1 matrix
T = [T1; T2; T3; T4; T5; T6]
I have readings at multiple values of P (aprox 68) and similarly (aprox 68) reading for T at each P value.
How can I do this?
回答 (1 件)
Bruno Luong
2023 年 9 月 10 日
Your system is underdetermined system, there is only 4 equations for 6 unknowns.
There exists not only one solution but infinite solutions (difference belong to a vectorial space of dimension at least 2).
To pick one solution you can do
T_A = lsqminnorm(K, P)
or
T_B = K\P
Any vector of the form
N = null(K)
T_A + N * x % or T_B + N * x
where x is an arbitrary vector of size (size(N,2),1) will be solution of your problem
2 件のコメント
Muhammad Hassan
2023 年 9 月 13 日
移動済み: Bruno Luong
2023 年 9 月 13 日
T=rand(5,1);
P=rand(4,1)
K=T'.*(P./(T'*T));
K*T
カテゴリ
ヘルプ センター および File Exchange で Mathematics and Optimization についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!