plot2d of romberg-integrating functions?
- Subject: plot2d of romberg-integrating functions?
- From: Gloeckner, Robert
- Date: Wed, 14 Dec 2005 23:56:55 +0100
Hello,
how can i plot functions which do romberg-integrals?
h(x) := 3 * x;
h1(x) := integrate(h(xx), xx, 0, x); /* not possible in my case */
h2(x) := romberg(h(xx), xx, 0, x); /* i need this for my functions */
plot2d(h1(x), [x, 0, 10]); /* works */
plot2d(h2(x), [x, 0, 10]); /* does not work */
how can i plot h2(x)?
i need to do romberg-integrating, because the functions i use do not
give results if i do integrate(...) (i do not know why either, maxima
always asks me about (fancy) terms being +-0) - they are listed at the
end of the posting.
thanks for hints.
Robert Gloeckner
--
Dipl.-Phys. Robert Gloeckner
Research Assistant
Deutsches Kunststoff-Institut DKI
German Institute for Polymers
Department of Technology
Schlossgartenstr. 6
D-64289 Darmstadt, Germany
phone +49(0)6151 - 16 6516
fax +49(0)6151 - 29 2855
http://www.DKI-online.de
GnuPG-Key: 1024D/9A0A2D72
////////////////////////////////////////////////////////////////////////
////////
/* heat capacity */
MC(T, _p) := 0.468;
cp_amorph(T) := cp_a1 + cp_a2 * T;
cp_cryst(T) := cp_c1 + cp_c2 * T;
cp_semi(T, _p) := MC(T, _p) * cp_cryst(T) + (1 - MC(T, _p)) *
cp_amorph(T);
eq5_4(T, _p) := MGF * cp_GF + (1 - MGF) * cp_semi(T, MC(T, _p));
/* specific volume */
B_cryst(T) := v_cryst_4 * exp( -v_cryst_5 * T);
v_cryst_0(T) := v_cryst_1 + v_cryst_2 * T + v_cryst_3 * T * T;
v_cryst(T, _p) := v_cryst_0(T) * (1 - C_c * log(1 + (_p / B_cryst(T)
) ) );
B_amorph(T) := v_amorph_3 * exp( -v_amorph_4 * T);
v_amorph_0(T) := v_amorph_1 + v_amorph_2 * T;
v_amorph(T, _p) := v_amorph_0(T) * (1 - C_c * log(1 + (_p /
B_amorph(T) ) ) );
v_semi(T, _p) := MC(T, _p) * v_cryst(T, _p) + (1 - MC(T, _p)) *
v_amorph(T, _p);
v(T, _p) := MGF * vGF + (1 - MGF) * v_semi(T, _p);
/* heat conduction */
lamda_cryst(T, _p) := lamda_cryst_1;
lamda_amorph(T, _p) := lamda_amorph_1 + lamda_amorph_2 * _p +
(lamda_amorph_3 + lamda_amorph_4 * _p) * T;
V_C(T, _p) := MC(T, _p) * v_cryst(T) / v_semi(T, _p);
V_GF(T, _p) := MGF * vGF / v_semi(T, _p);
lamda_semi(T, _p) := 1 / ( ( V_C(T, _p) / lamda_cryst(T, _p) )
+ ( ( 1 - V_C(T, _p) ) / lamda_amorph(T, _p) ) );
lamda(T, _p) := 1 / ( (V_GF(T, _p) / lamda_GF) + ( ( 1
- V_GF(T, _p) ) / lamda_semi(T, _p) ) );
/* growing rate dNdt */
eq4_7(T, _p) := ((AN) / (sqrt(2 * %pi * (BN^2)))) * (exp( (-(T -
TC)^2) / (2 * (BN^2)) ) );
/* growing rate 2 */
Tmp(_p) := T0m + _p * am;
Tgp(_p) := T0g + _p * ag;
f(T) := (2 * T) / (Tmp(p) + T);
eq4_12a(T, _p) := (2 * T) / (Tmp(_p) + T);
eq4_12(T, _p) := (Kg) / (eq4_12a(T, _p) * T * (Tmp(_p) -
T));
eq4_11(T, _p) := ( C * (Tmp(_p)^2) ) / ( (T^2) * (Tmp(_p)
- T) );
eq4_10(T, _p) := (Cd * (Tmp(_p)^2) ) / ( (T^2) * (Tmp(_p)
- T) );
eq4_9(T, _p) := (C1) / (R * (C2 + T - Tgp(_p)));
eq4_8__4_9_4_11(T, _p) := G0 * exp(-eq4_9(T, _p) - eq4_11(T, _p) );
/* Vogel-Fulcher */
eq4_8__4_10_4_11(T, _p) := G0 * exp(-eq4_10(T, _p) - eq4_11(T, _p) );
/* Arrhenius */
eq4_8__4_9_4_12(T, _p) := G0 * exp(-eq4_9(T, _p) - eq4_12(T, _p) );
/* Hoffmann-Lauritzen */
T_Min : 20 ;
T_Max : 170 ;
p_Min : 1;
p_Max : 220;
G(T) := float(eq4_8__4_9_4_12(T, p_Min));
A(T) := float(eq4_7(T, p_Min));
Q1(TT) := romberg( G(T), T, T_Min, TT);