#include <SyFi.h>
#include <ginac/ginac.h>
Go to the source code of this file.
Functions | |
void | check_integral (ex &f) |
int | main () |
|
Definition at line 7 of file integral_ex1.cpp.
|
|
Definition at line 10 of file integral_ex1.cpp. References LagrangeFE::compute_basis_functions(), ReferenceLine::integrate(), LagrangeFE::N(), LagrangeFE::set(), and x. 00010 { 00011 ReferenceLine line; 00012 LagrangeFE fe; 00013 fe.set(line); 00014 fe.set(3); 00015 fe.compute_basis_functions(); 00016 symbol a("a"); 00017 ex integrand = fe.N(0)*pow(fe.N(1),-1.0); 00018 ex integrand2 = collect_common_factors(integrand); 00019 // cout <<csrc<<endl; 00020 cout <<integrand2<<endl; 00021 cout <<integrand<<endl; 00022 ex integral1 = line.integrate(integrand2); 00023 cout <<integral1<<endl; 00024 cout <<integral1.eval_integ()<<endl; 00025 cout <<"numeric "<<endl; 00026 cout <<integral1.evalf()<<endl; 00027 cout <<integrand.op(0)<<endl; 00028 00029 ex f = pow((x+1),a); 00030 ex intf = integral(x,0,1,f).eval_integ(); 00031 cout <<intf<<endl; 00032 00033 00034 00035 }
|