Doing a symbolic Comparison of Coefficients for arbitrary length of coefficients
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
FBBVC
am 7 Mär. 2020
Beantwortet: Walter Roberson
am 7 Mär. 2020
Hello Folks,
I need to do a comparison of coefficients with an arbitray number of coeeficients. For example, Imagine the following PDE:
with an initial function:
. Inserting this into the PDE, derivate and solving
yields a very long equation with different variations of sin/cos. Now here comes the question: How can I do (symbolic) comparison of coefficients, such that I get the following equations (only exemplary):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275749/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275750/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275751/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275752/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275753/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275754/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275755/image.png)
After receiving the equations, I want to transfer them into a system of equations. I read something about determining the coefficients by matlab itself, but I guess it is a problem that the number of coefficients
depend on the length of my initial function. Is there any possibility to do this?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275756/image.png)
Thanks in advance!
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 7 Mär. 2020
You can subs() a variable for the expression cos(n*t) and then you can use coeffs() to extract the coefficients that it is multiplied by.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Boundary Conditions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!