I have an issue with this code, I am trying to figure out a,b,c,d
syms a b c d
equation1=2*(c*a-c)==(-.650034*a);
equation2=2*(c*b+(1.95*d))==.0271656*b;
equation3=(.6*d)+(3.3*b)==1;
equation4=(.6*c)+(3.3*a)==3.564;
sol=solve(equation1,equation2,equation3,equation4)
sol = struct with fields:
a: [2×1 sym] b: [2×1 sym] c: [2×1 sym] d: [2×1 sym]

3 件のコメント

Cris LaPierre
Cris LaPierre 2022 年 3 月 2 日
What is the issue?
Kaouter Essakkat
Kaouter Essakkat 2022 年 3 月 2 日
I need exact values for a,b,c,d and i get (2*1 sym). My answer needs to be an exact value between 0 and 1, am I using the wrong function or setting it up uncorrectly?
Cris LaPierre
Cris LaPierre 2022 年 3 月 2 日
It appears there are 2 possible solutions to the equations. A quick check of the results shows that neither solution contains a result where all values are between 0 and 1, though.

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

 採用された回答

Torsten
Torsten 2022 年 3 月 2 日
編集済み: Torsten 2022 年 3 月 2 日

0 投票

syms a b c d
equation1=2*(c*a-c)==(-.650034*a);
equation2=2*(c*b+(1.95*d))==.0271656*b;
equation3=(.6*d)+(3.3*b)==1;
equation4=(.6*c)+(3.3*a)==3.564;
sol=solve(equation1,equation2,equation3,equation4);
sol{1}.a
Brace indexing is not supported for variables of this type.
sol{1}.b
sol{1}.c
sol{1}.d
sol{2}.a
sol{2}.b
sol{2}.c
sol{2}.d

4 件のコメント

Kaouter Essakkat
Kaouter Essakkat 2022 年 3 月 2 日
I get this:
Brace indexing is not supported for variables of this type.
Error in untitled2 (line 7)
sol{1}.a
Torsten
Torsten 2022 年 3 月 2 日
I get
a1 = 1.3224, b1 = 0.2692, c1 = -1.3332, d1 = 0.1859
a2 = 0.8167, b2 = 0.3498, c2 = 1.4481, d2 = -0.2574
Rachel Ong
Rachel Ong 2022 年 3 月 11 日
What is the maximum number of variables that dsolve can do ? I have a sytstem of equations but it doesnt seem to be working?
Torsten
Torsten 2022 年 3 月 11 日
dsolve or solve ?
Anyway: In principle no limit for both solvers.

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

その他の回答 (0 件)

カテゴリ

製品

リリース

R2020a

タグ

質問済み:

2022 年 3 月 2 日

コメント済み:

2022 年 3 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by