Maxima

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 10

Pagina 734 campo en anillo.

f(x):=x/(x^2+1)^(3/2)$
plot2d([f(x)],[x,-4,4]);
solve(diff(f(x)));

Fuerza ejercida por un sistema de cargas:


pag 701-702. Ejemplo 21.4

(k:8.987e9,q1:25e-9,q2:10e-9,q0:20e-9);
f10(x):=k*q1*q0/x^2$
f20(x):=-k*q2*q0/(x-2)^2$
f(x):=f10(x)+f20(x)$

plot con tres cargas


plot2d([f(x)],[x,-1,15],[y,-0.5e-6,0.1e-6]);

Ahora imaginamos que en cero tenemos una carga del 15e-9C.


q3:15e-9;
f11(x):=k*q3*q0/x^2$
Ploteamos.-
plot2d([f(x),f11(x)],[x,-1,15],[y,-0.5e-6,0.1e-6]);

Ejercicio 21.9

(k:8.987e9,q1:1e-9,a:0.1)
f23(x):=k*q*a*x*4/(x^2-a^2)^2$
plot2d([f23(x)],[x,-3,3],[y,-100,200]);

caso de x>a
H(x):=if x>a then f23(x);
plot2d([H(x)],[x,-3,3],[y,-100,200]);

(%i30) k = 8.987e9;
(%o30) k = 8.987E+9
(%i31) (k:8.987e9,q1:25e-9,q2:10e-9,q0:20e-9);
(%o31) 2.0E-8
(%i32) k;
(%o32) 8.987E+9
(%i33) q1;
(%o33) 2.5E-8
(%i34) f10(x):=k*q1*q2/x^2$
(%i35) f20(x):=k*q2*q0/(x-2)^2$
incorrect syntax: Too many )'s
20(x):=k*q2*q0/x-20)
^
(%i35) f20(x):=-k*q2*q0/(x-2)^2$
(%i36) f10(x):=k*q1*q2/x^2$
(%i37) f20(x):=-k*q2*q0/(x-2)^2$
(%i38) f(x):=f10(x)+f(20)$
(%i39) plot2d([f(x)],[x,-4,4]);
Maxima encountered a Lisp error:

Condition in MACSYMA-TOP-LEVEL [or a callee]: INTERNAL-SIMPLE-ERROR: Bind stack


overflow.
Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
(%i40) f(2);

(%i1) (k:8.987e9,q1:25e-9,q2:10e-9,q0:20e-9);
(%o1) f10(x):=k*q1*q2/x^2$ 2.0E-8
(%i2) f10(x):=k*q1*q0/x^2$
(%i3) f20(x):=-k*q2*q0/(x-2)^2$
(%i4) f(x):=f10(x)+f20(3)$
(%i5) f(2);
Maxima encountered a Lisp error:

Condition in MACSYMA-TOP-LEVEL [or a callee]: INTERNAL-SIMPLE-ERROR: Bind stack


overflow.

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
(%i6) f10(1);
(%o6) 2.246749999999999E-6
(%i7) f20(1);
(%o7) - 1.7974E-6
(%i8) f(x):=f10(x)+f20(3)$
(%i9) plot2d([f(x)],[x,-1,1]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o9) [/home/vcebas/maxout.gnuplot_pipes]
(%i10) plot2d([f(x)],[x,-1,1]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o10) [/home/vcebas/maxout.gnuplot_pipes]
(%i11) f10(x):=k*q1*q0/x^2$
(%i12) f20(x):=-k*q2*q0/(x-2)^2$
(%i13) f(x):=f10(x)+f20(x)$
(%i14) plot2d([f(x)],[x,-1,1]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o14) [/home/vcebas/maxout.gnuplot_pipes]
(%i15) f(x):=(1/x^2)-(1/(x-2)^2)$
(%i16) plot2d([f(x)],[x,0,18]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o16) [/home/vcebas/maxout.gnuplot_pipes]
(%i17) f10(x):=(k*q1*q0/x^2)$
(%i18) f20(x):=(-k*q2*q0/(x-2)^2)$
(%i19) f(x):=f10(x)+f20(x)$
(%i20) plot2d([f(x)],[x,-1,1]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o20) [/home/vcebas/maxout.gnuplot_pipes]
(%i21) f10(x):=(k*q1*q0/x^2)$
(%i22) f20(x):=(-k*q2*q0/(x-2)^2)$
(%i23) f(x):=f10(x)+f20(x)$
(%i24) plot2d([f(x)],[x,0,5]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o24) [/home/vcebas/maxout.gnuplot_pipes]
(%i25) plot2d([f(x)],[x,1.9,2.1]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o25) [/home/vcebas/maxout.gnuplot_pipes]
(%i26) plot2d([f(x)],[x,1.99,2.11]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o26) [/home/vcebas/maxout.gnuplot_pipes]
(%i27) plot2d([f(x)],[x,1.99,2.11], logy));
(%o27) [/home/vcebas/maxout.gnuplot_pipes]
(%i28) plot2d([f(x)],[x,1.99,2.11],logy));
incorrect syntax: Too many )'s
x,1.99,2.11],Spacelogy))
^
(%i28) plot2d([f(x)],[x,1.99,2.11],logy);
incorrect syntax: Too many )'s
[x,1.99,2.11],logy))
^
(%i28) plot2d([f(x)],[x,1.99,2.11],logy);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o28) [/home/vcebas/maxout.gnuplot_pipes]
(%i29) plot2d([f(x)],[x,1.99,2.11],logy);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o29) [/home/vcebas/maxout.gnuplot_pipes]
(%i30) plot2d([f(x)],[x,1.99,2.11],logy);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o30) [/home/vcebas/maxout.gnuplot_pipes]
(%i31) plot2d([f(x)],[x,1.99,2.11],logy);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o31) [/home/vcebas/maxout.gnuplot_pipes]
(%i32) plot2d([f(x)],[x,1.99,2.11],[ytics, o,1, 0.1, -0.5]);
(%o32) [/home/vcebas/maxout.gnuplot_pipes]
(%i33) plot2d([f(x)],[x,1.99,2.11],[ytics, 0.1, 0.1, -0.5]);
Wrong number of arguments for plot option "ytics". Expecting 3 but found 4.
-- an error. To debug this try: debugmode(true);
(%i34) plot2d([f(x)],[x,1.99,2.11],[ytics, 0.1, 0.1, -0.5]);
(%o34) [/home/vcebas/maxout.gnuplot_pipes]
(%i35) plot2d([f(x)],[x,1.99,2.11],[box, false], grid2d,
[yx_ratio, 1], [axes, solid], [xtics, -2, 4, 2],
[ytics, 2, 2, 6], [label, ["x", 2.9, -0.3],
["x^2-1", 0.1, 8]], [title, "A parabola"])$);
(%o35) [/home/vcebas/maxout.gnuplot_pipes]
(%i36) plot2d([f(x)],[x,1.99,2.11],[box, false], grid2d,
[yx_ratio, 1], [axes, solid], [xtics, -2, 4, 2],
[ytics, 2, 2, 6], [label, ["x", 2.9, -0.3],
["x^2-1", 0.1, 8]], [title, "A parabola"])$);
incorrect syntax: Illegal use of delimiter )
)
^
plot2d([f(x)],[x,1.99,2.11]);
(%o37) [/home/vcebas/maxout.gnuplot_pipes]
(%i38) plot2d([f(x)],[x,1.99,6],[y,-0.5,0.1]);
plotting: range must be of the form [variable, min, max]; found: [y,0.1,-5]
-- an error. To debug this try: debugmode(true);
(%i39) plot2d([f(x)],[x,0,6],[y,-0.5,0.1]);
plot2d: some values were clipped.
(%o39) [/home/vcebas/maxout.gnuplot_pipes]
(%i40) plot2d([f(x)],[x,2,6],[y,-0.5,0.1]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o40) [/home/vcebas/maxout.gnuplot_pipes]
(%i41) plot2d([f(x)],[x,1.999,6],[y,-0.5,0.1]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o41) [/home/vcebas/maxout.gnuplot_pipes]
(%i42) plot2d([f10(x)],[x,1.999,6],[y,-0.5,0.1]);
plot2d: some values were clipped.
(%o42) [/home/vcebas/maxout.gnuplot_pipes]
(%i43) plot2d([f10(x)],[x,-1,6],[y,-0.5,0.1]);
(%o43) [/home/vcebas/maxout.gnuplot_pipes]
(%i44) plot2d([f1(x)],[x,-1,6],[y,-0.5,0.1]);
plot2d: some values were clipped.
(%o44) [/home/vcebas/maxout.gnuplot_pipes]
(%i45) plot2d([f(x)],[x,-1,6],[y,-0.5,0.1]);
plot2d: expression evaluates to non-numeric value everywhere in plotting range.
plot2d: nothing to plot.
(%o45) false
(%i46) plot2d([f(x)],[x,-1,6],[y,-0.05,0.01]);
plot2d: some values were clipped.
(%o46) [/home/vcebas/maxout.gnuplot_pipes]
(%i47) plot2d([f(x)],[x,-1,6],[y,-0.005,0.001]);
plot2d: some values were clipped.
(%o47) [/home/vcebas/maxout.gnuplot_pipes]
(%i48) plot2d([f(x)],[x,-1,6],[y,-0.0005,0.0001]);
plot2d: some values were clipped.
(%o48) [/home/vcebas/maxout.gnuplot_pipes]
(%i49) plot2d([f(x)],[x,-1,6],[y,-0.00005,0.00001]);
plot2d: some values were clipped.
(%o49) [/home/vcebas/maxout.gnuplot_pipes]
(%i50) plot2d([f(x)],[x,-1,6],[y,-0.0000005,0.0000001]);
plot2d: some values were clipped.
(%o50) [/home/vcebas/maxout.gnuplot_pipes]
(%i51) plot2d([f(x)],[x,-1,15],[y,-0.0000005,0.0000001]);
plot2d: some values were clipped.
(%o51) [/home/vcebas/maxout.gnuplot_pipes]
(%i52) plot2d([f(x)],[x,-1,15],[y,-0.5e-8,0.1e-8]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o52) [/home/vcebas/maxout.gnuplot_pipes]
(%i53) plot2d([f(x)],[x,-1,15],[y,-0.5e-6,0.1e-6]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o53) [/home/vcebas/maxout.gnuplot_pipes]
(%i54) plot2d([f(x)],[x,-1,15],[y,-0.5e-6,0.1e-6]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o54) [/home/vcebas/maxout.gnuplot_pipes]
(%i55) q1:15e-9;
(%o55) 1.5E-8
(%i56) plot2d([f(x10)],[x,-1,15],[y,-0.5e-6,0.1e-6]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o56) [/home/vcebas/maxout.gnuplot_pipes]
(%i57) plot2d([f(x10)],[x,-1,15],[y,-0.5e-6,0.1e-6]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o57) [/home/vcebas/maxout.gnuplot_pipes]
(%i58) q0;
(%o58) 1.0E-8
(%i59) q1;
(%o59) 2.0E-8
(%i60) q1;
(%o60) 1.5E-8
(%i61) plot2d([f10(x))],[x,-1,15],[y,-0.5e-6,0.1e-6]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
(%o61) [/home/vcebas/maxout.gnuplot_pipes]
(%i62) plot2d([f10(x)],[x,-1,15],[y,-0.5e-6,0.1e-6]);
incorrect syntax: Missing ]
plot2d([f10(x))
^
(%i62) plot2d([f11(x)],[x,-1,15],[y,-0.5e-6,0.9e-6]);
plot2d: some values were clipped.
(%o62) [/home/vcebas/maxout.gnuplot_pipes]
(%i63) plot2d([f(x),f10(x)],[x,-1,15],[y,-0.5e-6,0.9e-6]);
plot2d: some values were clipped.
(%o63) [/home/vcebas/maxout.gnuplot_pipes]
(%i64) plot2d([f(x),f10(x)],[x,-1,15],[y,-0.5e-6,0.1e-6]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
plot2d: some values were clipped.
(%o64) [/home/vcebas/maxout.gnuplot_pipes]
(%i65) plot2d([f(x),f11(x)],[x,-1,15],[y,-0.5e-6,0.1e-6]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
plot2d: some values were clipped.
(%o65) [/home/vcebas/maxout.gnuplot_pipes]
(%i66) q1:25e-9;
(%o66) 10
(%i67) q3:15e-9;
(%o67) 2.5E-8
(%i68) q3:15e-9;
(%o68) 1.5E-8
(%i69) f11(x):=k*q3*q0/x^2$
(%i70) plot2d([f11(x)],[x,-1,15],[y,-0.5e-6,0.9e-6]);
plot2d: some values were clipped.
(%o70) [/home/vcebas/maxout.gnuplot_pipes]
(%i71) f10(x):=(k*q1*q0/x^2)$
(%i72) plot2d([f(x),f11(x)],[x,-1,15],[y,-0.5e-6,0.1e-6]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
plot2d: some values were clipped.
(%o72) [/home/vcebas/maxout.gnuplot_pipes]
(%i73) f11(x):=k*q3*q0/x^2$
(%i74) f22(x):=1/x^3$
define: in definition of f, found bad argument 22
-- an error. To debug this try: debugmode(true);
(%i75) f22(x):=k*q/(x-a)^2-k*q/(x+a)^2$
(%i76) plot2d([f22(x)],[x,-5,6],[y,-100,200]);
plot2d: some values were clipped.
(%o76) [/home/vcebas/maxout.gnuplot_pipes]
(%i77) plot2d([f22(x)],[x,-5,6],[y,-100,200]);
plot2d: some values were clipped.
(%o77) [/home/vcebas/maxout.gnuplot_pipes]
(%i78) a:0.1;
(%o78) 1
(%i79) f22(x):=k*q/(x-a)^2-k*q/(x+a)^2$
(%i80) q:1e-9;
(%o80) 1
(%i81) f22(x):=(k*q/(x-a)^2)-(k*q/(x+a)^2)$
(%i82) plot2d([f22(x)],[x,-5,6],[y,-100,200]);
plot2d: some values were clipped.
(%o82) [/home/vcebas/maxout.gnuplot_pipes]
(%i83) k;
(%o83) 8.987E+9
(%i84) q
;
(%o84) 1
(%i85) a;
(%o85) 1
(%i86) a:1;
(%o86) 0.1
(%i87) f22(x):=(k*q/(x-a)^2)-(k*q/(x+a)^2)$
(%i88) plot2d([f22(x)],[x,-5,6],[y,-100,200]);
plot2d: some values were clipped.
(%o88) [/home/vcebas/maxout.gnuplot_pipes]
(%i89) f22(2);
(%o89) 4.516052034849028E+8
(%i90) q:1e-9;
(%o90) 1.0E-9
(%i91) f22(x):=(k*q/(x-a)^2)-(k*q/(x+a)^2)$
(%i92) plot2d([f22(x)],[x,-3,3],[y,-100,200]);
plot2d: some values were clipped.
(%o92) [/home/vcebas/maxout.gnuplot_pipes]
(%i93) plot2d([f23(x)],[x,-3,3],[y,-100,200]);
plot2d: some values were clipped.
(%o93) [/home/vcebas/maxout.gnuplot_pipes]
(%i94) f23(x):=k*q*a*x*4/(x^2-a^2)^2$
(%i95) plot2d([f23(x)],[x,-3,3],[y,-100,200]);
plot2d: some values were clipped.
(%o95) [/home/vcebas/maxout.gnuplot_pipes]
(%i96) a:0.1;
(%o96) 1
(%i97) plot2d([f23(x)],[x,-0.3,0.3],[y,-100,200]);
plot2d: some values were clipped.
(%o97) [/home/vcebas/maxout.gnuplot_pipes]
(%i98) f22(x):=(k*q/(x-a)^2)-(k*q/(x+a)^2)$
(%i99) f22(x):=(k*q/(x-a)^2)-(k*q/(x+a)^2)$
(%i100) a:0.1;
(%o100) 0.1
(%i101) plot2d([f23(x)],[x,-0.3,0.3],[y,-100,200]);
plot2d: some values were clipped.
(%o101) [/home/vcebas/maxout.gnuplot_pipes]
(%i102) plot2d([f23(x)],[x,-3,3],[y,-100,200]);
plot2d: some values were clipped.
(%o102) [/home/vcebas/maxout.gnuplot_pipes]
(%i103) f23(x):=k*q*a*x*4/(x^2-a^2)^2$
(%i104) plot2d([f23(x)],[x,-3,3],[y,-100,200]);
plot2d: some values were clipped.
(%o104) [/home/vcebas/maxout.gnuplot_pipes]
(%i105) plot2d([f23(x)],[x,-3,3],[y,-100,200]);
plot2d: some values were clipped.
(%o105) [/home/vcebas/maxout.gnuplot_pipes]
(%i106) f23(x):=k*q*a*x*4/(x^2-a^2)^2$
(%i107) f23(-0.5);
(%o107) 31.20486111111111
(%i108) f23(-0.5);
(%o108) - 31.20486111111111
(%i109) f23(0.5);
(%o109) 31.20486111111111
(%i110) a:1;
(%o110) 1
(%i111) plot2d([f23(x)],[x,-3,3],[y,-100,200]);
plot2d: some values were clipped.
(%o111) [/home/vcebas/maxout.gnuplot_pipes]
(%i112) H(x):=if x>a then f23(x);
(%o112) H(x) := if x > a then f23(x)
(%i113) plot2d([G(x)],[x,-3,3],[y,-100,200]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o113) [/home/vcebas/maxout.gnuplot_pipes]
(%i114) f24(x):=k*q/(x-a)^2-k*q/(x+a)^2$
incorrect syntax: Premature termination of input at ;.
f234(x):;
^
(%i114) f24(x):=k*q/(x-a)^2-k*q/(x+a)^2$
(%i115) G(x):=if x>-a and x<a then f24(x);
(%o115) G(x) := if (x > - a) and (x < a) then f24(x)
(%i116) plot2d([G(x)],[x,-3,3],[y,-100,200]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o116) [/home/vcebas/maxout.gnuplot_pipes]
(%i117) G()

%o110) 1
(%i111) plot2d([f23(x)],[x,-3,3],[y,-100,200]);
plot2d: some values were clipped.
(%o111) [/home/vcebas/maxout.gnuplot_pipes]
(%i112) H(x):=if x>a then f23(x);
(%o112) H(x) := if x > a then f23(x)
(%i113) plot2d([G(x)],[x,-3,3],[y,-100,200]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o113) [/home/vcebas/maxout.gnuplot_pipes]
(%i114) f24(x):=k*q/(x-a)^2-k*q/(x+a)^2$
incorrect syntax: Premature termination of input at ;.
f234(x):;
^
(%i114) f24(x):=(k*q/(x-a)^2)*((x-a)/abs(x-a))-(k*q/(x+a)^2)*((x+a)/(abs(x+a))$
(%i115) G(x):=if x>-a and x<a then f25(x);
(%o115) G(x) := if (x > - a) and (x < a) then f24(x)
(%i116) plot2d([G(x)],[x,-3,3],[y,-100,200]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o116) [/home/vcebas/maxout.gnuplot_pipes]
(%i117) f25(x):=(k*q/(x-a)^2)*((x-a)/abs(x-a))-(k*q/(x+a)^2)*((x+a)/(abs(x+a)))$
incorrect syntax: Missing )
)*((x+a)/(abs(x+a))$
^
(%i117) f25(x):=(k*q/(x-a)^2)*((x-a)/abs(x-a))-(k*q/(x+a)^2)*((x+a)/(abs(x+a)))$
(%i118) G(x):=if x>-a and x<a then f25(x);
(%o118) G(x) := if (x > - a) and (x < a) then f25(x)
(%i119) plot2d([G(x)],[x,-3,3],[y,-100,200]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o119) [/home/vcebas/maxout.gnuplot_pipes]
(%i120) H(x):=if x<-a then f26(x);
(%o120) H(x) := if x < - a then f26(x)
(%i121) f26(x):=-k*q*a*x*4/(x^2-a^2)^2$
(%i122) J(x):=if x<-a then f26(x);
(%o122) J(x) := if - x < - a then f26(x)
(%i123) plot2d([J(x)],[x,-3,3],[y,-100,200]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o123) [/home/vcebas/maxout.gnuplot_pipes]
(%i124) J(x):=if x>-a then f26(x);
(%o124) J(x) := if x < - a then f26(x)
(%i125) plot2d([J(x)],[x,-3,3],[y,-100,200]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o125) [/home/vcebas/maxout.gnuplot_pipes]
(%i126) J(x):=if x<-a then f26(x);
(%o126) J(x) := if x > - a then f26(x)
(%i127) plot2d([J(x)],[x,-3,3],[y,-100,200]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o127) [/home/vcebas/maxout.gnuplot_pipes]
(%i128) J(x):=if x<-a then f26(x);
(%o128) J(x) := if x < - a then f26(x)
(%i129) plot2d([J(x)],[x,-3,3],[y,-100,200]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o129) [/home/vcebas/maxout.gnuplot_pipes]
(%i130) f26(x):=-k*q*a*x*4/(x^2-a^2)^2$
(%i131) J(x):=if x<-a then f26(x);
(%o131) J(x) := if x < - a then f26(x)
(%i132) plot2d([J(x)],[x,-3,3],[y,-100,200]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o132) [/home/vcebas/maxout.gnuplot_pipes]
(%i133) plot2d([J(x),H(x),G(x)],[x,-3,3],[y,-100,200]);
plotting: range must be of the form [variable, min, max]; found:
if x < -1 then f26(x)
-- an error. To debug this try: debugmode(true);
(%i134) plot2d([J(x)],[x,-3,3],[y,-100,200]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o134) [/home/vcebas/maxout.gnuplot_pipes]
(%i135) plot2d([J(x),H(x),G(x)],[x,-3,3],[y,-100,200]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o135) [/home/vcebas/maxout.gnuplot_pipes]
(%i136) plot2d([f23(x)],[x,-3,3],[y,-100,200]);
plot2d: some values were clipped.
(%o136) [/home/vcebas/maxout.gnuplot_pipes]
(%i137) f23(x):=k*q*a*x*4/(x^2-a^2)^2$
(%i138) H(x):=if x>a then f23(x);
(%o138) H(x) := if x > a then f23(x)
(%i139) plot2d([J(x),H(x),G(x)],[x,-3,3],[y,-100,200]);
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
plot2d: expression evaluates to non-numeric value somewhere in plotting range.
plot2d: some values were clipped.
(%o139) [/home/vcebas/maxout.gnuplot_pipes]
(%i140)

Ajuste por minimos cuadrados


(%i1) load (lsquares)$
(%i2) M : matrix ([10,2.3],[20,1.8],[30,1.6],[40,1.5],[50,1,4],[60,1.3],[70,1.2],
[80,1.1],[90,1.08],[100,1.05],[200,0.8]);

matrix: all rows must be the same length.


#0: matrix(rows=[[10,2.3],[20,1.8],[30,1.6],[40,1.5],[50,1,4],[60,1.3],[70,1.2],
[80,1,1],[90,1.08],[100,1.05],[200,0...)
-- an error. To debug this try: debugmode(true);
(%i3) M : matrix ([10,2.3],[20,1.8],[30,1.6],[40,1.5],[50,1.4],[60,1.3],[70,1.2],
[80,1.1],[90,1.08],[100,1.05],[200,0.8]);
matrix: all rows must be the same length.
#0: matrix(rows=[[10,2.3],[20,1.8],[30,1.6],[40,1.5],[50,1,4],[60,1.3],[70,1.2],
[80,1.1],[90,1.08],[100,1.05],[200,0...)
-- an error. To debug this try: debugmode(true);
(%i4) M : matrix ([10,2.3],[20,1.8],[30,1.6],[40,1.5],[50,1.4],[60,1.3],[70,1.2],
[80,1.1],[90,1.08],[100,1.05],[200,0.8]);
[ 10 2.3 ]
[ ]
[ 20 1.8 ]
[ ]
[ 30 1.6 ]
[ ]
[ 40 1.5 ]
[ ]
[ 50 1.4 ]
[ ]
(%o4) [ 60 1.3 ]
[ ]
[ 70 1.2 ]
[ ]
[ 80 1.1 ]
[ ]
[ 90 1.08 ]
[ ]
[ 100 1.05 ]
[ ]
[ 200 0.8 ]
(%i5) lsquares_estimates (
M,[x,y],y=a*x^b,[a,b]);
*************************************************
N= 2 NUMBER OF CORRECTIONS=25
INITIAL VALUES
F= 6.984013536363636D+03 GNORM= 6.954938185937250D+04
*************************************************

I NFN FUNC GNORM STEPLENGTH

1 2 4.295239643731482D-01 3.098439244838224D+00 1.437827300926959D-05


2 8 2.835356498102556D-01 1.441900329825268D+00 1.365000000000000D+03
3 10 2.614624344900035D-01 3.292847702797248D-01 4.649277396977107D-01
4 11 2.594404829436787D-01 2.930086673830013D-01 1.000000000000000D+00
5 12 2.562995379117398D-01 4.394837783735976D-01 1.000000000000000D+00
6 13 2.401654613043937D-01 1.015123621195955D+00 1.000000000000000D+00
7 15 1.158926046915999D-01 2.096218549456736D+00 5.000000000000000D+00
8 16 9.996953811130578D-02 1.112236330788508D-01 1.000000000000000D+00
9 17 8.569729353550737D-02 8.360450699771493D-01 1.000000000000000D+00
10 18 7.946958018854650D-02 1.007263004162653D+00 1.000000000000000D+00
11 19 6.205656997904886D-02 1.144974226204503D+00 1.000000000000000D+00
12 20 3.999545947056838D-02 9.312174633112489D-01 1.000000000000000D+00
13 21 1.793925610313160D-02 3.157602396540022D-01 1.000000000000000D+00
14 22 8.062332433497147D-03 2.382219002760279D-01 1.000000000000000D+00
15 23 3.013689895736005D-03 1.610433818926155D-01 1.000000000000000D+00
16 24 1.458539729776522D-03 3.015552531789967D-02 1.000000000000000D+00
17 25 1.197686596485666D-03 5.354251352412581D-02 1.000000000000000D+00
18 26 1.169718587395668D-03 2.637456407459343D-02 1.000000000000000D+00
19 27 1.163133583527411D-03 1.232432063538523D-04 1.000000000000000D+00

THE MINIMIZATION TERMINATED WITHOUT DETECTING ERRORS.


IFLAG = 0
(%o5) [[a = 5.043087078102694, b = - 0.3383000113939476]]
(%i6)

(a:5.043087078102694, b:-0.3383000113939476);

(x):=a*x^b$

plot2d([f(x),[discrete, [[10,2.3],[20,1.8],[30,1.6],[40,1.5],[50,1.4],[60,1.3],
[70,1.2],[80,1.1],[90,1.08],[100,1.05],[200,0.8]]]],[x,10,200],[y,0.8,2.6])$
(%i22)

You might also like