Solving 54 linear equations

3 visualizzazioni (ultimi 30 giorni)
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?.

Risposta accettata

Pier Giorgio Petrolini
Pier Giorgio Petrolini il 24 Nov 2020
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

Più risposte (0)

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by