フィルターのクリア

Solve non-linear systems of equations to create matrix of coeffients and solve variable

1 回表示 (過去 30 日間)
Benjamin
Benjamin 2022 年 12 月 3 日
コメント済み: Torsten 2022 年 12 月 3 日
This is the function I am attempting to use to answer part 1 I am not sure how to find the answer to 1 and 2
syms x
eqn1=16*x^1+32*x^2+33*x^3+13*x^4==91;
eqn2=5*x^1+11*x^2+10*x^3+x^4==16;
eqn3=9*x^1+7*x^2+6*x^3+12*x^4==5;
eqn4=34*x^1+14*x^2+15*x^3+x^4==43;
eqns=[eqn1;eqn2;eqn3;eqn4]
[A]=equationsToMatrix(eqns)
  1 件のコメント
Steven Lord
Steven Lord 2022 年 12 月 3 日
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the free MATLAB Onramp tutorial to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.

サインインしてコメントする。

回答 (1 件)

Stephan
Stephan 2022 年 12 月 3 日
If i assume, that you have a linear system, because i think, that x1...x4 does not mean x^1...x^4 then you are nearly there:
syms x [4 1]
eqn1=16*x(1)+32*x(2)+33*x(3)+13*x(4)==91;
eqn2=5*x(1)+11*x(2)+10*x(3)+x(4)==16;
eqn3=9*x(1)+7*x(2)+6*x(3)+12*x(4)==5;
eqn4=34*x(1)+14*x(2)+15*x(3)+x(4)==43;
eqns=[eqn1;eqn2;eqn3;eqn4]
eqns = 
equationsToMatrix has an addtional output argument:
[A,b]=equationsToMatrix(eqns)
A = 
b = 
You should check if this is really a nonlinear system you have given.
  2 件のコメント
Benjamin
Benjamin 2022 年 12 月 3 日
Based on question 3, I believe it is x^1 NOT x1 since it ask to solve the equals for x
Torsten
Torsten 2022 年 12 月 3 日
Yes: x = [x(1); x(2) ;x(3); x(4)], a 4x1 vector.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDynamic System Models についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by