How can I solve a linear equation with multiple variables in MATLAB?

  • Context: Graduate 
  • Thread starter Thread starter Ramona79
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around solving a linear equation with multiple variables in MATLAB, specifically in the context of evaluating unknown coefficients in a mathematical model involving Gauss-Chebyshev quadrature. Participants explore the formulation of the problem and seek assistance with MATLAB code to implement their approach.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Homework-related

Main Points Raised

  • One participant presents a function involving Gauss-Chebyshev quadrature and seeks to solve it using MATLAB, describing the mathematical formulation in detail.
  • Another participant elaborates on the integral representation of the function and the relationships between the coefficients and the roots of Chebyshev polynomials.
  • There is a focus on the need to evaluate unknown coefficients \( a_j \) based on given values of \( F(t_k) \) and \( U_{j-1}(t_k) \), leading to a system of linear equations.
  • Multiple participants express the need for MATLAB code to solve the linear equation system, indicating a desire for practical implementation guidance.

Areas of Agreement / Disagreement

Participants generally agree on the formulation of the problem and the need to solve for the coefficients in MATLAB, but there is no consensus on the specific code or methods to use for implementation.

Contextual Notes

The discussion includes complex mathematical relationships and assumptions that may not be fully resolved, particularly regarding the integration and the properties of the Chebyshev polynomials.

Ramona79
Messages
1
Reaction score
0
Hello everyone,

I have a question:
I want to solve and plot the following function with Gauss-Chebyshev quadrature using Mathematica code:

$$F(t_k)=\frac{1}{N}\sum_{i=1}^N\left[\sum_{j=1}^m a_jT_j(s_i)\right]\frac{1}{s_i-t_k}$$
wehre
$$s_i=\cos (\pi \frac{2i-1}{2N})\quad \quad i=1...N$$
$$t_k=\cos (\pi \frac{k}{N})\quad \quad i=1...N-1$$

on a quick answer I am very grateful

thank you
 
Physics news on Phys.org
F(t)=\int_ \! (\frac{1}{\sqrt{1-s^{2} } } \frac{Phi(s)}{t-s} ) \, ds

(integrals are from -1 to +1)
this equation may be solved by the Gauss-Chebyshev integration formulae:
assume that Phi(s) can be appoximated by the fallowing truncated series:

Phi(s)= \sum\limits_{j=1}^m a_{j}T_{j}(s)

so that the integral now reads

\sum\limits_{j=1}^m a_{j} \int_ \! (\frac{1}{\sqrt{1-s^{2} } } )(\frac{T_{j}(s) }{t-s} ) \, ds |t|<1
and my task is to evaluate the unknown coefficients a_{j} . The integral may be evaluated through the relation :

for j=0 :

\int_\! (\frac{1}{\sqrt{1-s^{2} } } )(\frac{T_{j}(s) }{t-s} ) \, ds = 0

for j>0 :

\int_ \! (\frac{1}{\sqrt{1-s^{2} } } )(\frac{T_{j}(s) }{t-s} ) \, ds = U_{j-1}(t)

so that

F(t)=\sum\limits_{j=1}^m a_{j} U_{j-1}(t)

we next note the fallowing relation :

for j=0
\frac{1}{N}\sum\limits_{i=1}^N \frac{T_{j}(s_{i}) }{s_{i}-t_{k}) } = 0
for 0<j<N :

\frac{1}{N}\sum\limits_{i=1}^N \frac{T_{j}(s_{i}) }{s_{i}-t_{k}) } = U_{j-1}(t_{k} )

where the points are the N roots of T_{N}(s) and the points t_{k} are the N-1 roots of U_{N-1}(t) .

It follows that

F(t_{k})=\sum\limits_{j=1}^m a_{j} U_{j-1}(t_{k})=\frac{\pi }{N} \sum\limits_{i=1}^N [ \sum\limits_{j=1}^m a_{j} T_{j}(s_{i}) ] \frac{1}{s_{i} -t_{k} } = \frac{\pi }{N} \sum\limits_{i=1}^N \frac{Phi(s_{i} )}{s_{i} -t_{k} }

where the integration points are:

s_{i} = \cos(\pi \frac{2i-1}{2N}) i=1...N


t_{k} = \cos(\pi \frac{k}{N}) i=1...N-1


the weights (\frac{\pi }{N} ) .

für das Gleichungssystem mit mehreren variablen

F(t_{k})=\sum\limits_{j=1}^m a_{j} U_{j-1}(t_{k}).

wo

F(t_{k}) und U_{j-1}(t_{k}) bekannt

und

a_{j} unbekannt.

wie kann ich bitte dieses Gleichungssystem

a_{j} = U_{j-1}(t_{k}) \ F(t_{k})

in MatLAB lösen.

mir fehlt Code.
 
ohhh pardon,
i rewrite it
 
F(t)=∫([itex]\frac{1}{\sqrt{1-s^2}}(\frac{\phi(s)}{t-s})ds[/itex]

(integrals are from -1 to +1)
this equation may be solved by the Gauss-Chebyshev integration formulae:
assume that Phi(s) can be appoximated by the fallowing truncated series:

[itex]\phi(s) = Ʃ^{m}_{j=1} a_{j} T_{j}(s)[/itex]

so that the integral now reads

Ʃ[itex]^{m}_{j=1}[/itex] [itex]a_{j}[/itex]∫([itex]\frac{1}{\sqrt{1-s^2}}(\frac{T_{j}(s)}{t-s})ds[/itex] ; -1<t<+1

and my task is to evaluate the unknown coefficients [itex]a_{j}[/itex] . The integral may be evaluated through the relation :

for j=0 :
∫([itex]\frac{1}{\sqrt{1-s^2}}(\frac{T_{j}(s)}{t-s})ds[/itex] = 0

for j>0 :
∫([itex]\frac{1}{\sqrt{1-s^2}}(\frac{T_{j}(s)}{t-s})ds[/itex] = [itex]U_{j-1}(t)[/itex]

so that

F(t)=[itex]\sum^{m}_{j=1}[/itex] [itex]a_{j}[/itex] [itex]U_{j-1}(t)[/itex]

we next note the fallowing relation :

for j=0

[itex]\frac{1}{N}[/itex] [itex]\Sigma^{i=1}_{N}[/itex] ([itex]\frac{T_{j}(s_{i})}{t_{k}-s_{i}}[/itex]) = 0

for 0<j<N :

[itex]\frac{1}{N}[/itex] [itex]\Sigma^{i=1}_{N}[/itex] ([itex]\frac{T_{j}(s_{i})}{t_{k}-s_{i}}[/itex]) = [itex]U_{j-1}(t)[/itex]


where the points [itex]s_{i}[/itex] are the N roots of [itex]T_{N}(s)[/itex] and the points [itex]t_{k}[/itex] are the N-1 roots of [itex]U_{N-1}(t)[/itex] . It follows that

F([itex]t_{k}[/itex]) = [itex]\sum^{m}_{j=1}[/itex] [itex]a_{j}[/itex] [itex]U_{j-1}(t_{k})[/itex] = [itex]\frac{\pi}{N} Ʃ^{N}_{i=1} [\Sigma^{m}_{j=1} a_{j} T_{j}(s_{i}) ]\frac{1}{s_{i}-t_{k}} = \frac{\pi}{N}\Sigma^{N}_{i=1} \frac{\phi (s_{i})}{s_{i}-t_{k}}[/itex]


where the integration points are:

[itex]s_{i} = cos(\pi \frac{2i-1}{2N})[/itex] i=1...N


[itex]t_{k} = cos(\pi \frac{k}{N})[/itex] k=1...N-1

the weights ([itex]\frac{\pi}{N}[/itex])

Note that the integration has been reduced to the sum and weights ([itex]\frac{\pi}{N}[/itex]) and the integration points [itex]s_{i}[/itex] are the same as used as in the standard Gaussian quadrature formula.


Let's have a look at :


F([itex]t_{k}[/itex]) = [itex]\sum^{m}_{j=1}[/itex] [itex]a_{j}[/itex] [itex]U_{j-1}(t_{k})[/itex]

We assume that F([itex]t_{k}[/itex]) and [itex]U_{j-1}(t_{k})[/itex] are given. That leads to m equations in case there are m different [itex]t_{k}[/itex]. It's our task to evaluate the unknown coefficients [itex]a_{j}[/itex].

Therefor i must solve a linear equation m multiple variables ( the unknown coefficients [itex]a_{j}[/itex] ) in MatLAB .

can you help me to solve it in MatLAB.
i need a code in matlab.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 0 ·
Replies
0
Views
4K
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
7
Views
2K
Replies
6
Views
3K