#include <SyFi.h>
Go to the source code of this file.
Functions | |
int | main () |
|
Definition at line 5 of file legendre.cpp. References Rectangle::integrate(), legendre(), nsd, and x. 00005 { 00006 int order = 2; 00007 int nsd = 2; 00008 00009 ex polynom_space = legendre(order,nsd, "a"); 00010 cout <<"polynom_space "<<polynom_space<<endl; 00011 00012 ex p = polynom_space.op(0); 00013 cout <<"polynom p = "<<p<<endl; 00014 00015 ex dpdx = diff(p,x); 00016 cout <<"dpdx = "<<dpdx<<endl; 00017 00018 ex p0 = lst(-1,-1); 00019 ex p1 = lst(1,1); 00020 00021 Rectangle rectangle(p0,p1) ; 00022 ex basis = polynom_space.op(2); 00023 for (int i=0; i< basis.nops(); i++) { 00024 cout <<"i "<<i<<endl; 00025 ex integrand = p*basis.op(i); 00026 ex ai = rectangle.integrate(integrand); 00027 cout <<"ai "<<ai<<endl; 00028 } 00029 }
|