Need help to form equations
2 次查看(过去 30 天)
显示 更早的评论
Hello all
I want to form the equations through the matlab commands,I have the matrix of constants....Can anyone guide how can I form the equations. Example equations
1) a1v1^2-a2v2-a3v3^2-a4v4=0
2) a3v3^2-a4v4-a1v1=0
3) a1v1+a4v4-a3v3^2=0
4) a2v2+a1v1+a3v3-a4v4=0
where a's are constant and I have a matrix for a and I have to find v's.
I want to use them in fsolve.
please guide!!!
Regards
0 个评论
采纳的回答
David Sanchez
2014-6-6
a = rand(1,4); % your a matrix
syms v1 v2 v3 v4
S = solve( a(1)*v1^2-a(2)*v2-a(3)*v3^2-a(4)*v4==0,...
a(3)*v3^2-a(4)*v4-a(1)*v1==0,...
a(1)*v1+a(4)*v4-a(3)*v3^2==0,...
a(2)*v2+a(1)*v1+a(3)*v3-a(4)*v4==0)
S =
v1: [4x1 sym]
v2: [4x1 sym]
v3: [4x1 sym]
v4: [4x1 sym]
To display the solutions, access the elements of the structure array S
S.v1
ans =
0
0.76082746713182598996024745838092
- 0.38041373356591299498012372919046 - 0.65889591443313132581875790778993*i
- 0.38041373356591299498012372919046 + 0.65889591443313132581875790778993*i
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Particle & Nuclear Physics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!