Solving 54 linear equations

3 次查看(过去 30 天)
Hello, I am trying to solve 54 linear equations for the source panel method in Aerodynamics. I am using a for loop. These equations contain a symbolic variable lambda (the solution should be 54 lambdas of different values.
I tried using solve and vpasolve but it is taking a lot of time to compute. What should I do?.

采纳的回答

Pier Giorgio Petrolini
Hello, you can use the strong point of MATLAB that is operating with arrays.
I'm not sure I understand the probem you're facing but, it can be just one of the following two scenarios:
CASE 1) You're dealing with 54 equations, the unknown is just lambda for each of them.
You can rewrite your equations in form of arrays as it follows:
A*x = b ==> x = b./A, where "A" is a column vector constituted of constans, "x" is a column vector containing your lambda values and finally, "b" is the column vector of known terms.
CASE 2) You're dealing with a system of 54 equations.
It's quite the same but, in this case "A" is a 54 x 54 Matrix (see link below to understand how to compute it).
You can solve the system in taht way: x = b\A.
In both cases you don't need to use symbolic variables, this method is much faster.
You can find a reference at the following link: https://en.wikipedia.org/wiki/System_of_linear_equations
I hope it helps. Kind Regards,
PGP

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by