How to draw the function relationship graph between two or three variables, where these variables are solved by a system of equations.
27 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
% 定义符号变量 VL=20;
syms tc t2 Q_out Vco Vcn VL
%参数关系
L=100e-9;
C=50e-6;
Z=sqrt(L/C);
omega=1/sqrt(L*C);
VH=24;
Io=4;
T=2*pi*sqrt(L*C);
% 第一个方程
eqn1 = Io*(tc + t2 + T/2) - Q_out;
% 第二个方程
eqn2 = Vco - (VL + 1/2 * Q_out/C);
% 第三个方程
eqn3 = Vcn - (VL - 1/2 * Q_out/C);
% 第四个方程
eqn4 = 1/2 * tc^2 * (VH - Vcn)/Z * (2*pi/T) - (VL/VH) * Q_out;
% 第五个方程
eqn5 = t2/tc - (VH - Vcn)/Vco;
In this program, there are five equations and six variables. The one-to-one relationship between \(t_c\) and \(V_L\) can be solved, that is, given a \(V_L\), the only \(t_c\) that meets the conditions can be solved. \(t_c\) is a very short time quantity, so only positive values are taken. Then how can I draw the function relationship between \(t_c\) and \(V_L\)? Because there is no obvious functional relationship between the two. On this basis, if \(Z\) is introduced, resulting in 7 variables and 5 equations, how to draw the three-dimensional function image of \(V_L\) changing with \(t_c\) and \(Z\)?
0 commentaires
Réponses (2)
John D'Errico
le 14 Nov 2024 à 12:54
Modifié(e) : John D'Errico
le 14 Nov 2024 à 12:55
Not everything you might want to do has an answer. You ask to "draw" the relationship between variables. (For a fairly vaguely specified problem, where you talk about adding a new unspecified equation, so I assume you are asking about how one might solve a general problem.)
I'm not sure if by this you mean to plot something, or merely to be able to write down some simple formula. In either case, this is often an impossible problem to solve. And sometimes, provably impossible. Why do I say impossible? Moderately large systems of nonlinear equations tend to be reducible to smaller systems of equations, but of higher polynomial order.
In your case, you have polynomial-like things, but with square roots sprinkled about. So if we eliminate one variable, then the equations that remain get more complicated, with higher (and often fractional) powers.
Why is this a problem? You may have learned about the old proof that polynomials of degree higher than 4 will generally have no algebraic solution. Yes, there are some trivial cases where this is not true. But for the general non-constant coefficient polynomial of degree 5 or higher, there will be no solutions possible. EVER. It goes back to Abel-Ruffini, so long before any of us reading this were born.
The point is, if your problem reduces in some way to solving for the solution of a general, non-constant coefficient, degree 5 or higher polynomial, then nothing you will ask to do has a solution. As much as you want it to have a solution, you will hit a brick wall. Again, that need not always be the case. because sometimes you will be able to find a pretty trick to reduce things. That is why mathematicians get paid the big bucks. (Yeah, right. Ok, maybe better mathematicians than me.) But you are asking for a general approach on how to solve a very generic problem. And that general scheme does not exist, that will apply to any general problem.
Torsten
le 14 Nov 2024 à 12:54
Modifié(e) : Torsten
le 14 Nov 2024 à 13:25
Here are the three possible solutions for VL given tc.
% 定义符号变量 VL=20;
syms tc t2 Q_out Vco Vcn VL
%参数关系
L=100e-9;
C=50e-6;
Z=sqrt(L/C);
omega=1/sqrt(L*C);
VH=24;
Io=4;
T=2*pi*sqrt(L*C);
% 第一个方程
eqn1 = Io*(tc + t2 + T/2) - Q_out == 0;
% 第二个方程
eqn2 = Vco - (VL + 1/2 * Q_out/C) == 0;
% 第三个方程
eqn3 = Vcn - (VL - 1/2 * Q_out/C) == 0;
% 第四个方程
eqn4 = 1/2 * tc^2 * (VH - Vcn)/Z * (2*pi/T) - (VL/VH) * Q_out == 0;
% 第五个方程
eqn5 = t2/tc - (VH - Vcn)/Vco == 0;
S = solve([eqn1,eqn2,eqn3,eqn4,eqn5],[VL t2 Q_out Vco Vcn],'MaxDegree',3)
%Example: Compute VL for tc = 1
format long
VL_num = double(subs(S.VL,tc,1))
VL_num = VL_num(abs(imag(VL_num))<1e-8);
VL_num = real(VL_num);
VL_num = VL_num(VL_num >= 0 & VL_num <= 24)
0 commentaires
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!