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

  • Thread starter Thread starter Ramona79
  • Start date Start date
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)=∫(\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) = Ʃ^{m}_{j=1} a_{j} T_{j}(s)

so that the integral now reads

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

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

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

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

so that

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

we next note the fallowing relation :

for j=0

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

for 0<j<N :

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


where the points s_{i} 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^{m}_{j=1} a_{j} U_{j-1}(t_{k}) = \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}}


where the integration points are:

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


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

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

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


Let's have a look at :


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

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

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

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