Having trouble solving system of equations
1 回表示 (過去 30 日間)
古いコメントを表示
Hello,
I am trying to have MATLAB solve the following equaitions for C1 and C2 - I thought i could simply use 'solve()' for this but i'm getting a structure response and i need actua results (i would hope real number response) how would it better done? Thanks!
Thanks:
code i'm using:
clear all
close all
clc
syms c1 c2
solve(c1==18*c1-1200+((4.8195*10^-8)*(((0.3*c1+c2)^4)-18^4)),c1==(20*c2-500)/-0.95,c1,c2)
0 件のコメント
回答 (2 件)
Star Strider
2019 年 2 月 18 日
Use the correct syntax for solve, and use the vpa function to get numeric results:
syms c1 c2
[C1,C2] = solve(c1==18*c1-1200+((4.8195*10^-8)*(((0.3*c1+c2)^4)-18^4)),c1==(20*c2-500)/-0.95, [c1,c2]);
C1v = vpa(C1, 7)
C2v = vpa(C2, 7)
producing:
C1v =
70.579
2057.393 - 3835.412i
2057.393 + 3835.412i
-4581.405
C2v =
21.6475
- 72.72618 + 182.1821i
- 72.72617 - 182.1821i
242.6167
The solved constants retain their full internal precision.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Equation Solving についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!