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

  • Thread starter Ramona79
  • Start date
In summary, the conversation discusses the use of Gauss-Chebyshev quadrature to solve and plot a function with a specific integral form in Mathematica code. The conversation also mentions the use of a truncated series to approximate the function and the need to solve a linear equation with multiple variables in MatLAB.
  • #1
Ramona79
1
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
  • #2
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.
 
  • #3
ohhh pardon,
i rewrite it
 
  • #4
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.
 

1. What is Gauss-Chebyshev Quadrature?

Gauss-Chebyshev Quadrature is a numerical integration method used to approximate the definite integral of a function. It uses a weighted sum of function values at specific points to calculate the integral with high accuracy.

2. How is Gauss-Chebyshev Quadrature different from other integration methods?

Gauss-Chebyshev Quadrature is different from other integration methods because it uses specific points, called Chebyshev nodes, to calculate the integral. These points are chosen to minimize the error and provide a more accurate result compared to other numerical integration methods.

3. What types of functions can be integrated using Gauss-Chebyshev Quadrature?

Gauss-Chebyshev Quadrature can be used to integrate any continuous function over a finite interval. It is particularly useful for integrating functions with oscillatory behavior or singularities.

4. How many function evaluations are needed in Gauss-Chebyshev Quadrature?

The number of function evaluations in Gauss-Chebyshev Quadrature depends on the number of Chebyshev nodes used. Generally, the number of function evaluations is equal to the number of nodes, which can be chosen according to the desired accuracy.

5. What are some applications of Gauss-Chebyshev Quadrature?

Gauss-Chebyshev Quadrature has various applications in numerical analysis, physics, and engineering. It is commonly used to calculate definite integrals in complex mathematical models, such as in quantum mechanics and signal processing. It is also used in scientific computing to solve differential equations and perform numerical simulations.

Similar threads

Replies
8
Views
1K
Replies
2
Views
1K
Replies
4
Views
954
  • Topology and Analysis
Replies
4
Views
276
  • Advanced Physics Homework Help
Replies
1
Views
829
  • Differential Equations
Replies
7
Views
391
Replies
8
Views
2K
Replies
5
Views
1K
Replies
2
Views
531
  • Differential Equations
Replies
1
Views
770
Back
Top