Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
Finding Galerkin L^2-based Operators for B-spline discretizations

Finding Galerkin L^2-based Operators for B-spline discretizations

Ratings: (0)|Views: 1,067|Likes:
Published by RhysU
How to analytically compute Galerking L^2-based derivative operators using Mathematica. Due to some limitations in Mathematica 7.0.2's BSplineBasis implementation, this requires some tricks...
How to analytically compute Galerking L^2-based derivative operators using Mathematica. Due to some limitations in Mathematica 7.0.2's BSplineBasis implementation, this requires some tricks...

More info:

Published by: RhysU on Apr 01, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/01/2011

pdf

text

original

 
Test data for B-spline operators based on Galerkin
L
2
projection.
Wrap
Mathematica
's B-spline routines so they match the GNU Scientific Library's semantics. Note that
Mathematica
workswith piecewise polynomial degree while the GSL uses piecewise order plus one.
In[1]:=
Knots
k_, b_
:
Join
ConstantArray
First
b
, k
1
, b, ConstantArray
Last
b
, k
1

Lastdof
k_, b_
:
Length
Knots
k, b

k
1
2;Basis
k_, b_
:
BSplineBasis

k
1, Knots
k, b

,
1,
2
&
Provide some sample breakpoints for testing purposes and visualize some different basis orders:
In[4]:=
b
Sort

0, 1, 3
2, 2, 9
8, 3

;
In[5]:=
Plotem 
k_
:
Plot
Table
Basis
k, b

i, x
,
i, 0, Lastdof
k, b

,
x, First
b
, Last
b

, PlotRange
Full, PlotLabel
k
Table
Plotem 
k
,
k, 1, 4

Out[6]=
0.5 1.0 1.5 2.0 2.5 3.00.20.40.60.81.0
1
,
0.20.40.60.81.0
2
,
 
0.5 1.0 1.5 2.0 2.5 3.00.5 1.0 1.5 2.0 2.5 3.00.20.40.60.81.0
3
,
0.5 1.0 1.5 2.0 2.5 3.00.20.40.60.81.0
4
Compute the Galerkin
L
2
-based mass matrices for the above bases:
In[7]:=
MassMatrix
k_, b_
:
Module

B
Basis
k, b
, n
Lastdof
k, b
, Table
Integrate
B
i, x
B
j, x
,
x, First
b
, Last
b

,
i, 0, n
,
j, 0, n

;
In[8]:=
MassMatrix
1, b

MatrixForm MassMatrix
2, b

MatrixForm MassMatrix
3, b

MatrixForm MassMatrix
4, b

MatrixForm 
2
 
BsplineGalerkinL2Operators.nb 

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->