Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Unable to simplify to float approximation

I have been struggling with an integration. When I tried symbolic integral, the sage didn't give any answer and stopped working. And then it gave errors for various numerical integral commands. Could you please let me know what the problem is and how to fix it is the code I used. I'm sorry for this long code. but It was necessary.

sage::var('T1, T2, T3, T4, T5, T6, T7, T8, r, r_0, r_2, r_a, r_s,theta_a, phi_a, theta_c, theta, phi, A'); sage::r_a=2; sage::theta_a=pi/2; sage: phi_a=0; sage: r_s=vector([r, theta, phi]); sage: r_0=vector([r_a, theta_a, phi_a]); sage: T1=vector ([sin(theta)cos(phi), sin(theta)sin(phi), cos(theta)]); sage: T2=vector ([cos(theta)cos(phi), cos(theta)sin(phi), -sin(theta)]); sage::T3=vector ([-sin(phi), cos(phi), 0]); sage::T5=vector ([sin(theta_a)cos(phi_a), sin(theta_a)sin(phi_a), cos(theta_a)]); sage::T6=vector ([cos(theta_a)cos(phi_a), cos(theta_a)sin(phi_a), -sin(theta_a)]); sage::T7=vector ([-sin(phi_a), cos(phi_a), 0]);

sage::var('L_s, SA_0, SA_1, SA_2, theta_h, I_0, I, rho, I_1, Phi_0, Phi_1, Phi_2, E_v') ; sage::L_s=20; sage::I_0=2.4; sage::theta_h= 2pi/45 ; sage::Phi_0=I_0SA_0 ; sage::Phi_0; sage::T4=matrix ([T1, T2, T3]); sage::T8=matrix ([T5, T6, T7]); sage::(r_sT4)(r_0T8); sage::A=((r_sT4)(r_0T8)); sage::theta_c=arccos(A/(rr_a)); sage::r_2=sqrt(r^2+r_a^2-2rr_acos(theta_c)); sage::Phi_0 ; sage::Phi_0*(1-exp(-r/L_s));

sage::f=diff(Phi_0(1-exp(-r/L_s)), r); f sage::plot (f, xmin=0, xmax=20, ymin=0, ymax=0.01) ; sage::rho=1/(SA_0r^2)f; rho; SA_0; f; sage::y=rho/(r_2)^2r^2*sin(theta)^2;

sage::numerical_integral(lambda phi: numerical_integral(lambda theta: numerical_integral(lambda r: y, 0,5)[0], 0, pi)[1], 0, pi)

Unable to simplify to float approximation

I have been struggling with an integration. When I tried symbolic integral, the sage didn't give any answer and stopped working. And then it gave errors for various numerical integral commands. Could you please let me know what the problem is and how to fix it is the code I used. I'm sorry for this long code. but It was necessary.

sage::var('T1, T2, T3, T4, T5, T6, T7, T8, r, r_0, r_2, r_a, r_s,theta_a, phi_a, theta_c, theta, phi, A'); sage::r_a=2; sage::theta_a=pi/2; sage: sage:: phi_a=0; sage: sage:: r_s=vector([r, theta, phi]); sage: sage:: r_0=vector([r_a, theta_a, phi_a]); sage: sage:: T1=vector ([sin(theta)cos(phi), sin(theta)sin(phi), cos(theta)]); sage: sage:: T2=vector ([cos(theta)cos(phi), cos(theta)sin(phi), -sin(theta)]); sage::T3=vector ([-sin(phi), cos(phi), 0]); sage::T5=vector ([sin(theta_a)cos(phi_a), sin(theta_a)sin(phi_a), cos(theta_a)]); sage::T6=vector ([cos(theta_a)cos(phi_a), cos(theta_a)sin(phi_a), -sin(theta_a)]); sage::T7=vector ([-sin(phi_a), cos(phi_a), 0]);

sage::var('L_s, SA_0, SA_1, SA_2, theta_h, I_0, I, rho, I_1, Phi_0, Phi_1, Phi_2, E_v') ; sage::L_s=20; sage::I_0=2.4; sage::theta_h= 2pi/45 ; sage::Phi_0=I_0SA_0 ; sage::Phi_0; sage::T4=matrix ([T1, T2, T3]); sage::T8=matrix ([T5, T6, T7]); sage::(r_sT4)(r_0T8); sage::A=((r_sT4)(r_0T8)); sage::theta_c=arccos(A/(rr_a)); sage::r_2=sqrt(r^2+r_a^2-2rr_acos(theta_c)); sage::Phi_0 ; sage::Phi_0*(1-exp(-r/L_s));

sage::f=diff(Phi_0(1-exp(-r/L_s)), r); f sage::plot (f, xmin=0, xmax=20, ymin=0, ymax=0.01) ; sage::rho=1/(SA_0r^2)f; rho; SA_0; f; sage::y=rho/(r_2)^2r^2*sin(theta)^2;

sage::numerical_integral(lambda phi: numerical_integral(lambda theta: numerical_integral(lambda r: y, 0,5)[0], 0, pi)[1], 0, pi)

Unable to simplify to float approximation

I have been struggling with an integration. When I tried symbolic integral, the sage didn't give any answer and stopped working. And then it gave errors for various numerical integral commands. Could you please let me know what the problem is and how to fix it is the code I used. I'm sorry for this long code. but It was necessary.

sage::var('T1, var('T1, T2, T3, T4, T5, T6, T7, T8, r, r_0, r_2, r_a, r_s,theta_a, phi_a, theta_c, theta, phi, A'); sage::r_a=2; sage::theta_a=pi/2; sage:: phi_a=0; sage:: A');

r_a=2;

theta_a=pi/2;

phi_a=0;

r_s=vector([r, theta, phi]); sage:: phi]);

r_0=vector([r_a, theta_a, phi_a]); sage:: phi_a]);

T1=vector ([sin(theta)cos(phi), sin(theta)sin(phi), cos(theta)]); sage:: cos(theta)]);

T2=vector ([cos(theta)cos(phi), cos(theta)sin(phi), -sin(theta)]); sage::T3=vector -sin(theta)]);

T3=vector ([-sin(phi), cos(phi), 0]); sage::T5=vector 0]);

T5=vector ([sin(theta_a)cos(phi_a), sin(theta_a)sin(phi_a), cos(theta_a)]); sage::T6=vector cos(theta_a)]);

T6=vector ([cos(theta_a)cos(phi_a), cos(theta_a)sin(phi_a), -sin(theta_a)]); sage::T7=vector -sin(theta_a)]);

T7=vector ([-sin(phi_a), cos(phi_a), 0]);

sage::var('L_s, var('L_s, SA_0, SA_1, SA_2, theta_h, I_0, I, rho, I_1, Phi_0, Phi_1, Phi_2, E_v') ; sage::L_s=20; sage::I_0=2.4; sage::theta_h= 2pi/45 ; sage::Phi_0=I_0SA_0 ; sage::Phi_0; sage::T4=matrix ;

L_s=20;

I_0=2.4;

theta_h= 2*pi/45;

Phi_0=I_0*SA_0;

Phi_0;

T4=matrix ([T1, T2, T3]); sage::T8=matrix T3]);

T8=matrix ([T5, T6, T7]); sage::(r_sT7]);

(r_sT4)(r_0T8); sage::A=((r_s(r_0*T8);

A=((r_sT4)(r_0T8)); sage::theta_c=arccos(A/(rr_a)); sage::r_2=sqrt(r^2+r_a^2-2(r_0*T8));

theta_c=arccos(A/(r*r_a));

r_2=sqrt(r^2+r_a^2-2rr_acos(theta_c)); sage::Phi_0 ; sage::Phi_0*(1-exp(-r/L_s));

sage::f=diff(Phi_0(1-exp(-r/L_s)), r_a*cos(theta_c));

Phi_0 ;

Phi_0*(1-exp(-r/L_s));

f=diff(Phi_0*(1-exp(-r/L_s)), r); f sage::plot f

plot (f, xmin=0, xmax=20, ymin=0, ymax=0.01) ; sage::rho=1/(SA_0;

rho=1/(SA_0r^2)f; rho; SA_0; f; sage::y=rho/(r_2)^2r^2*sin(theta)^2;

sage::numerical_integral(lambda f;

y=rho/(r_2)^2r^2sin(theta)^2;

numerical_integral(lambda phi: numerical_integral(lambda theta: numerical_integral(lambda r: y, 0,5)[0], 0, pi)[1], 0, pi)

Unable to simplify to float approximation

I have been struggling with an integration. When I tried symbolic integral, the sage didn't give any answer and stopped working. And then it gave errors for various numerical integral commands. Could you please let me know what the problem is and how to fix it is the code I used. I'm sorry for this long code. but It was necessary.

var('T1, T2, T3, T4, T5, T6, T7, T8, r, r_0, r_2, r_a, r_s,theta_a, phi_a, theta_c, theta, phi, A');

r_a=2;

theta_a=pi/2;

phi_a=0;

r_s=vector([r, theta, phi]);

r_0=vector([r_a, theta_a, phi_a]);

T1=vector ([sin(theta)cos(phi), sin(theta)sin(phi), cos(theta)]);

T2=vector ([cos(theta)cos(phi), cos(theta)sin(phi), -sin(theta)]);

T3=vector ([-sin(phi), cos(phi), 0]);

T5=vector ([sin(theta_a)cos(phi_a), sin(theta_a)sin(phi_a), cos(theta_a)]);

T6=vector ([cos(theta_a)cos(phi_a), cos(theta_a)sin(phi_a), -sin(theta_a)]);

T7=vector ([-sin(phi_a), cos(phi_a), 0]);

var('L_s, SA_0, SA_1, SA_2, theta_h, I_0, I, rho, I_1, Phi_0, Phi_1, Phi_2, E_v') ;

L_s=20;

I_0=2.4;

theta_h= 2*pi/45;

Phi_0=I_0*SA_0;

Phi_0;

T4=matrix ([T1, T2, T3]);

T8=matrix ([T5, T6, T7]);

(r_sT4)(r_0*T8);

A=((r_sT4)(r_0*T8));

theta_c=arccos(A/(r*r_a));

r_2=sqrt(r^2+r_a^2-2rr_a*cos(theta_c));

Phi_0 ;

Phi_0*(1-exp(-r/L_s));

f=diff(Phi_0*(1-exp(-r/L_s)), r); f

plot (f, xmin=0, xmax=20, ymin=0, ymax=0.01) ;

rho=1/(SA_0r^2)f; rho; SA_0; f;

y=rho/(r_2)^2r^2sin(theta)^2;

numerical_integral(lambda phi: numerical_integral(lambda theta: numerical_integral(lambda r: y, 0,5)[0], 0, pi)[1], 0, pi)

click to hide/show revision 5
No.5 Revision

Unable to simplify to float approximation

I have been struggling with an integration. When I tried symbolic integral, the sage didn't give any answer and stopped working. And then it gave errors for various numerical integral commands. Could you please let me know what the problem is and how to fix it is the code I used. I'm sorry for this long code. but It was necessary.

var('T1, T2, T3, T4, T5, T6, T7, T8, r, r_0, r_2, r_a, r_s,theta_a, phi_a, theta_c, theta, phi, A');

r_a=2;

theta_a=pi/2;

phi_a=0;

A'); r_a=2; theta_a=pi/2; phi_a=0; r_s=vector([r, theta, phi]);

phi]); r_0=vector([r_a, theta_a, phi_a]);

phi_a]); T1=vector ([sin(theta)cos(phi), sin(theta)sin(phi), cos(theta)]);

([sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta)]); T2=vector ([cos(theta)cos(phi), cos(theta)sin(phi), -sin(theta)]);

([cos(theta)*cos(phi), cos(theta)*sin(phi), -sin(theta)]); T3=vector ([-sin(phi), cos(phi), 0]);

0]); T5=vector ([sin(theta_a)cos(phi_a), sin(theta_a)sin(phi_a), cos(theta_a)]);

([sin(theta_a)*cos(phi_a), sin(theta_a)*sin(phi_a), cos(theta_a)]); T6=vector ([cos(theta_a)cos(phi_a), cos(theta_a)sin(phi_a), -sin(theta_a)]);

([cos(theta_a)*cos(phi_a), cos(theta_a)*sin(phi_a), -sin(theta_a)]); T7=vector ([-sin(phi_a), cos(phi_a), 0]);

0]); var('L_s, SA_0, SA_1, SA_2, theta_h, I_0, I, rho, I_1, Phi_0, Phi_1, Phi_2, E_v') ;

L_s=20;

; L_s=20; I_0=2.4;

theta_h= 2*pi/45;

Phi_0=I_0*SA_0;

Phi_0;

Phi_0; T4=matrix ([T1, T2, T3]);

T3]); T8=matrix ([T5, T6, T7]);

(r_sT4)(r_0*T8);

A=((r_sT4)(r_0*T8));

theta_c=arccos(A/(r*r_a));

r_2=sqrt(r^2+r_a^2-2rr_a*cos(theta_c));

T7]); (r_s*T4)*(r_0*T8); A=((r_s*T4)*(r_0*T8)); theta_c=arccos(A/(r*r_a)); r_2=sqrt(r^2+r_a^2-2*r*r_a*cos(theta_c)); Phi_0 ;

Phi_0*(1-exp(-r/L_s));

; Phi_0*(1-exp(-r/L_s)); f=diff(Phi_0*(1-exp(-r/L_s)), r); f

f plot (f, xmin=0, xmax=20, ymin=0, ymax=0.01) ;

rho=1/(SA_0r^2)f; ; rho=1/(SA_0*r^2)*f; rho; SA_0; f;

y=rho/(r_2)^2r^2sin(theta)^2;

f; y=rho/(r_2)^2*r^2*sin(theta)^2; numerical_integral(lambda phi: numerical_integral(lambda theta: numerical_integral(lambda r: y, 0,5)[0], 0, pi)[1], 0, pi)

pi)