Sponsored links: Algebra eBooks

### Related

##### fortran-plot2d-sin-taylor-tex

f(x):= sin(x);

T1(x):=taylor(f(x), x...

T3(x):=taylor(f(x), x...

Calculate

##### fortran-log-plot2d-taylor

f(x):= log(1+x);

t4(x):=taylor(f(1+x),...

t7(x):=taylor(f(1+x),...

Calculate

##### fortran-plot2d-sin-taylor-tex

f(x):=sin(x);

P1(x):=taylor(f(x), x...

P3(x):=taylor(f(x), x...

Calculate

##### fortran-plot2d-sin-taylor-tex

f(x):= sin(x);

t(x):=taylor(f(x), x,...

fortran(t(x));

Calculate

##### fortran-log-plot2d-taylor-tex

f(x):= log(1+x);

t(x):=taylor(f(x), x,...

fortran(t(x));

Calculate

##### fortran-plot2d-sin-taylor-tex

f(x):= sin(x);

t1(x):=taylor(f(x), x...

t3(x):=taylor(f(x), x...

Calculate

##### fortran-plot2d-sin-taylor-tex

f(x):= sin(x);

T1(x):=taylor(f(x), x...

T3(x):=taylor(f(x), x...

Calculate

##### fortran-log-plot2d-taylor-tex

f(x):= log (1+x);

t4(x):=taylor(f(x), x...

t7(x):=taylor(f(x), x...

Calculate

##### fortran-plot2d-sin-taylor-tex

f(x):= sin(x);

t(x):=taylor(f(x), x,...

fortran(t(x));

Calculate

##### fortran-log-plot2d-taylor-tex

f(x):= log(1+x);

P4(x):=taylor(f(x), x...

P7(x):=taylor(f(x), x...

Calculate

### fortran

Run Example
(%i1)f(x):= log(x+1);
(%o1)                         f(x) := log(x + 1)
(%i2) T4(x):=taylor(f(x), x, 0, 4);
(%o2)                   T4(x) := taylor(f(x), x, 0, 4)
(%i3) T7(x):=taylor(f(x), x, 0, 7);
(%o3)                   T7(x) := taylor(f(x), x, 0, 7)
(%i4) T11(x):=taylor(f(x), x, 0, 11);
(%o4)                  T11(x) := taylor(f(x), x, 0, 11)
(%i5) T16(x):=taylor(f(x), x, 0, 16);
(%o5)                  T16(x) := taylor(f(x), x, 0, 16)
(%i6) fortran(T4(x));
-x**4/4.0E+0+x**3/3.0E+0-x**2/2.0E+0+x
(%o6)                                done
(%i7) fortran(T7(x));
x**7/7.0E+0-x**6/6.0E+0+x**5/5.0E+0-x**4/4.0E+0+x**3/3.0E+0-x**2/2
1   .0E+0+x
(%o7)                                done
(%i8) fortran(T11(x));
x**11/1.1E+1-x**10/1.0E+1+x**9/9.0E+0-x**8/8.0E+0+x**7/7.0E+0-x**6
1   /6.0E+0+x**5/5.0E+0-x**4/4.0E+0+x**3/3.0E+0-x**2/2.0E+0+x
(%o8)                                done
(%i9) fortran(T16(x));
-x**16/1.6E+1+x**15/1.5E+1-x**14/1.4E+1+x**13/1.3E+1-x**12/1.2E+1+
1   x**11/1.1E+1-x**10/1.0E+1+x**9/9.0E+0-x**8/8.0E+0+x**7/7.0E+0-x
2   **6/6.0E+0+x**5/5.0E+0-x**4/4.0E+0+x**3/3.0E+0-x**2/2.0E+0+x
(%o9)                                done
(%i10) tex(T4(x));
$$x-{{x^2}\over{2}}+{{x^3}\over{3}}-{{x^4}\over{4}}+\cdots$$
(%o10)                               false
(%i11) tex(T7(x));
$$x-{{x^2}\over{2}}+{{x^3}\over{3}}-{{x^4}\over{4}}+{{x^5}\over{5}}- {{x^6}\over{6}}+{{x^7}\over{7}}+\cdots$$
(%o11)                               false
(%i12) tex(T11(x));
$$x-{{x^2}\over{2}}+{{x^3}\over{3}}-{{x^4}\over{4}}+{{x^5}\over{5}}- {{x^6}\over{6}}+{{x^7}\over{7}}-{{x^8}\over{8}}+{{x^9}\over{9}}-{{x ^{10}}\over{10}}+{{x^{11}}\over{11}}+\cdots$$
(%o12)                               false
(%i13) tex(T16(x));
$$x-{{x^2}\over{2}}+{{x^3}\over{3}}-{{x^4}\over{4}}+{{x^5}\over{5}}- {{x^6}\over{6}}+{{x^7}\over{7}}-{{x^8}\over{8}}+{{x^9}\over{9}}-{{x ^{10}}\over{10}}+{{x^{11}}\over{11}}-{{x^{12}}\over{12}}+{{x^{13} }\over{13}}-{{x^{14}}\over{14}}+{{x^{15}}\over{15}}-{{x^{16}}\over{ 16}}+\cdots$$
(%o13)                               false
(%i14) plot2d ([f(x),T4(x),T7(x),T11(x),T16(x)],[x, -1.5, 1.5],[y, -4, 2],[legend, "log(1+x)", "y=T4", "y=T7", "y=T11", "y=T16"],[gnuplot_preamble,"set key left"]);
plot
Run Example
mbf:230*p^.48*t^.5*a^(-.13);
0.48  0.5
230 p     t
(%o1)                           --------------
0.13
a
(%i2) mbh:259*p^.48*t^.5*a^(-.13);
0.48  0.5
259 p     t
(%o2)                           --------------
0.13
a
(%i3) fortran(diff(mbf,p)*dp+diff(mbf,t)*dt+diff(mbf,a)*da);
-2.9900000000000002E+1*da*p**4.7999999999999998E-1*t**5.0E-1/a**1.
1   1299999999999999E+0+1.1039999999999999E+2*dp*t**5.0E-1/(a**1.3E
2   -1*p**5.2000000000000002E-1)+1.15E+2*dt*p**4.7999999999999998E-
3   1/(a**1.3E-1*t**5.0E-1)
(%o3)                                done
(%i4) diff(mbh,p)*dp+diff(mbh,t)*dt+diff(mbh,a)*da;
0.48  0.5              0.5             0.48
33.67 da p     t      124.32 dp t      129.5 dt p
(%o4)       - ------------------- + -------------- + --------------
1.13            0.13  0.52        0.13  0.5
a               a     p           a     t
(%i5) 
Run Example
f(x):=exp(x)/cos(x);
exp(x)
(%o1)                           f(x) := ------
cos(x)
(%i2) P4(x):=taylor(f(x), x, 0, 4);
(%o2)                   P4(x) := taylor(f(x), x, 0, 4)
(%i3) P7(x):=taylor(f(x), x, 0, 7);
(%o3)                   P7(x) := taylor(f(x), x, 0, 7)
(%i4) P9(x):=taylor(f(x), x, 0, 9);
(%o4)                   P9(x) := taylor(f(x), x, 0, 9)
(%i5) P14(x):=taylor(f(x), x, 0, 17);
(%o5)                  P14(x) := taylor(f(x), x, 0, 17)
(%i6) fortran(P4(x));
x**4/2.0E+0+2.0E+0*x**3/3.0E+0+x**2+x+1
(%o6)                                done
(%i7) fortran(P7(x));
1.3E+1*x**7/1.05E+2+1.9E+1*x**6/9.0E+1+3.0E+0*x**5/1.0E+1+x**4/2.0
1   E+0+2.0E+0*x**3/3.0E+0+x**2+x+1
(%o7)                                done
(%i8) fortran(P9(x));
1.63E+2*x**9/3.24E+3+3.1E+1*x**8/3.6E+2+1.3E+1*x**7/1.05E+2+1.9E+1
1   *x**6/9.0E+1+3.0E+0*x**5/1.0E+1+x**4/2.0E+0+2.0E+0*x**3/3.0E+0+
2   x**2+x+1
(%o8)                                done
(%i9) fortran(P14(x));
1.886573641E+9*x**17/1.389404016E+12+1.90065457E+8*x**16/8.1729648
1   E+10+8.14939E+5*x**15/2.43243E+8+3.908059E+6*x**14/6.810804E+8+
2   2.4373E+4*x**13/2.9484E+6+3.211E+3*x**12/2.268E+5+1.2721E+4*x**
3   11/6.237E+5+3.961E+3*x**10/1.134E+5+1.63E+2*x**9/3.24E+3+3.1E+1
4   *x**8/3.6E+2+1.3E+1*x**7/1.05E+2+1.9E+1*x**6/9.0E+1+3.0E+0*x**5
5   /1.0E+1+x**4/2.0E+0+2.0E+0*x**3/3.0E+0+x**2+x+1
(%o9)                                done
(%i10) tex(P4(x));
$$1+x+x^2+{{2\,x^3}\over{3}}+{{x^4}\over{2}}+\cdots$$
(%o10)                               false
(%i11) tex(P7(x));
$$1+x+x^2+{{2\,x^3}\over{3}}+{{x^4}\over{2}}+{{3\,x^5}\over{10}}+{{19 \,x^6}\over{90}}+{{13\,x^7}\over{105}}+\cdots$$
(%o11)                               false
(%i12) tex(P9(x));
$$1+x+x^2+{{2\,x^3}\over{3}}+{{x^4}\over{2}}+{{3\,x^5}\over{10}}+{{19 \,x^6}\over{90}}+{{13\,x^7}\over{105}}+{{31\,x^8}\over{360}}+{{163\, x^9}\over{3240}}+\cdots$$
(%o12)                               false
(%i13) tex(P14(x));
$$1+x+x^2+{{2\,x^3}\over{3}}+{{x^4}\over{2}}+{{3\,x^5}\over{10}}+{{19 \,x^6}\over{90}}+{{13\,x^7}\over{105}}+{{31\,x^8}\over{360}}+{{163\, x^9}\over{3240}}+{{3961\,x^{10}}\over{113400}}+{{12721\,x^{11} }\over{623700}}+{{3211\,x^{12}}\over{226800}}+{{24373\,x^{13}}\over{ 2948400}}+{{3908059\,x^{14}}\over{681080400}}+{{814939\,x^{15} }\over{243243000}}+{{190065457\,x^{16}}\over{81729648000}}+{{ 1886573641\,x^{17}}\over{1389404016000}}+\cdots$$
(%o13)                               false
(%i14) plot2d ([P4(x),P7(x),P9(x),P14(x),f(x)], [x, -4, 4], [y, -4, 4],[color, green, blue, black, magenta, red],[legend, "T4", "T7", "T9", "T14", "exp(x)/cos(x)"],[axes,true], [xlabel,"X"] , [ylabel,"Y"]);
plot

Help for Fortran