Items tagged with float

Feed

Hi everyone, 

I often get the error 'cannot save points as a float matrix' while I'm trying to plot with the spacecurve command.

loodl2 is a 4 component vector, loodl2c is the 3 component variant.

loodl2:=T1.<loodl,1>: loodl2c:=<loodl2[1], loodl2[2], loodl2[3]>
loodlpl:=spacecurve(loodl2c, k=-10..10, color=red):

also with this syntax:
loodl2c:=loodl2[1..3]

and this syntax:

l2c1:= 2*k: l2c2:=0, l2c3:=8-k:
spacecurve([l2c1, l2c2, l2c3], k=-10..10, color=red):
Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

It will only plot if I do this:
loodl2c:=<2*k, 0, 8-k>
Can someone help me?
 

Is there a simple command to generate decimal numbers in a given range? 

For example, I wish to obtain a randomly generated number between, say ... -0.5 and 0.5.

 

Can someone answer why i get Float(undefined) while computing integral

Here is my example

NULL

restart

with(plots):

NULL

alpha0 := .3;

.3

(1)

R := .1;

.1

(2)

sigma := 636;

636

(3)

Kfc := 101;

101

(4)

Ksc := 9;

9

(5)

E := 2*10^5;

200000

(6)

`&delta;th` := 2*10^(-7);

1/5000000

(7)

`&delta;c` := 0.8e-1*10^(-3);

0.8000000000e-4

(8)

p := 400;

400

(9)

`l&delta;z` := 12.1*10^(-3);

0.1210000000e-1

(10)

lKz := 20.3*10^(-3);

0.2030000000e-1

(11)

eta := 10^(-5);

1/100000

(12)

l0 := 0;

0

(13)

xi := p/sigma;

100/159

(14)

KImax := evalf(p*sqrt(Pi*l));

708.9815404*l^(1/2)

(15)

``

`N&delta;` := evalf(E*sigma*(int((-xi^2+1)*(-KImax^2+Kfc^2)/((KImax^2-Ksc^2)*((-R^4+1)*(KImax^2+Ksc^2)+eta*E*sigma)), l = l0 .. `l&delta;z`))/alpha0);

Float(undefined)

(16)

``

NULL

NULL

NULL

NULL

NULL

``

``

``

``

``

NULL

NULL


 

Download N.mw

Thanks in advance

hi.

please help me for remover this problem.

''''

-Float(infinity)*signum((5.*A3*A1-24.*A2^2)*A1/A2^2)''''

ReducedCantiler.mw
 

restart

f := -(2/3)*eta^3+(1/2)*eta^2+eta; -1; g := -eta^2+1; -1; h := -eta^2+1; 1; F := proc (eta) options operator, arrow; A1*f end proc; 1; G := proc (eta) options operator, arrow; A2*g end proc; 1; H := proc (eta) options operator, arrow; A3*h end proc

proc (eta) options operator, arrow; A3*h end proc

(1)

Q1 := diff(F(eta), eta, eta, eta)+.5*H(eta)*((diff(F(eta), eta))^2+F(eta)*(diff(F(eta), eta, eta)))/G(eta)^2+2*(diff(G(eta), eta))*(diff(F(eta), eta, eta))/G(eta)-(diff(H(eta), eta))*(diff(F(eta), eta, eta))/H(eta); 1; Q2 := diff(G(eta), eta, eta)+H(eta)*((diff(F(eta), eta))*G(eta)+.5*F(eta)*(diff(eta, eta)))/G(eta)^2+2*(diff(G(eta), eta))^2/G(eta)-((diff(H(eta), eta))*(diff(H(eta), eta)))/H(eta)+(diff(F(eta), eta, eta))^2-(H(eta)/G(eta))^2; 1; Q3 := diff(H(eta), eta, eta)+(.5*1.3)*H(eta)*(5*(diff(F(eta), eta))*H(eta)+F(eta)*(diff(H(eta), eta)))/G(eta)^2+2*(diff(G(eta), eta))*(diff(H(eta), eta))/G(eta)-(diff(H(eta), eta))^2/H(eta)+(1.3*1.44)*H(eta)*(diff(F(eta), eta, eta))/G(eta)-(1.3*1.92)*(H(eta)/G(eta))^3

-2*A3+.65*A3*(5*A1*(-2*eta^2+eta+1)*A3*(-eta^2+1)-2*A1*(-(2/3)*eta^3+(1/2)*eta^2+eta)*A3*eta)/((-eta^2+1)*A2^2)+4*A3*eta^2/(-eta^2+1)+1.872*A3*A1*(-4*eta+1)/A2-2.496*A3^3/A2^3

(2)

Eq1 := int(Q1*f, eta = 0 .. 1);

-0.2600000000e-1*A3*(24.*A1*A2^2-65.*A1*A2*A3+64.*A3^2)/A2^3

(3)

sol := solve({Eq1 = 0, Eq2 = 0, Eq3 = 0}, {A1, A2, A3}); J := min(select(`>`, sol, 0))

Error, invalid input: `>` expects 2 arguments, but received 1

 

A11 := evalf(simplify(sol[1, 1])); A22 := evalf(simplify(sol[1, 2])); A33 := evalf(simplify(sol[1, 3]))

Error, invalid subscript selector

 

``


 

Download ReducedCantiler.mw

 

Hi guys,

I run my code and after a point all the numerical values are followed by a dot. Why is that? Also the symbolic variables have a 1. before them.

Thanks a lot!

I'm trying to plot the lines that are based on eigenvectors of the matrix. (Functions r1(t),r2(t), q(t) are defined earlier. I can upload file if necessary)

with(LinearAlgebra):
x1:=t->-r1(t)*cos(Pi/2-q(t)/2):
y1:=t->-r1(t)*sin(Pi/2-q(t)/2):
z1:=t->0:
x2:=t->r2(t)*cos(Pi/2-q(t)/2):
y2:=t->-r2(t)*sin(Pi/2-q(t)/2):
z2:=t->0:
Ixx:=t->m*(y1(t)^2+z1(t)^2)+m*(y2(t)^2+z2(t)^2):
Iyy:=t->m*(x1(t)^2+z1(t)^2)+m*(x2(t)^2+z2(t)^2):
Izz:=t->m*(x1(t)^2+y1(t)^2)+m*(x2(t)^2+y2(t)^2):
Ixy:=t->-m*x1(t)*y1(t)-m*x2(t)*y2(t):
Ixz:=t->-m*x1(t)*z1(t)-m*x2(t)*z2(t):
Iyz:=t->-m*y1(t)*z1(t)-m*y2(t)*z2(t):

InertiaTensor:=t-><<Ixx(t),Ixy(t),Ixz(t)>|<Ixy(t),Iyy(t),Iyz(t)>|<Ixz(t),Iyz(t),Izz(t)>>:

 Here I define the matrix as a function of time. 

EV:=t->Eigenvectors(InertiaTensor(t));
V1:=t->Column(Re(EV(t)[2]),1);
V2:=t->Column(Re(EV(t)[2]),2);

Producing two eigenvectors also as functions of time.

InertiaAxis1 := t->plot(x, V1(t)[2]*x/V1(t)[1], x = -2 .. 2);
InertiaAxis2 := t->plot(x, V2(t)[2]*x/V2(t)[1], x = -2 .. 2);

InertiaAxis1(1);

And here I've got an error:

Error, (in plot) unexpected options: [-HFloat(7.378655652881484e-6)*x, x = -2 .. 2]

I tried to set "datatype=float"-option in plot function, to evaluate the coefficient by eval-function, it wouldn't help. What does this error mean exactly? 

I would like compute the vertices of the convex hull of finitely many points in some \mathbb{R}^{n}, where the coordinates of these points could be rational numbers or irrational numbers like \sqrt{2}.

I know that PolyhedralSets[ConvexHull] is a direct command, however it does not support irrational numbers. But if I transform all coordinates into floating point numbers, for some rational numbers the rounding error would be large enough to affect the result. For example, after the transform some collinear points are no longer collinear.

Thanks!

 

 

 

Dear all

I have such an expression in the file (test.mw). Obviously it is not a simple form. 10should be cancelled both in denominator and nominator. I have applied the function simplify(). However, it doesn't work.  I hope someone can do me a favor. That will help me a lot. Thanks

Hey

I have a simple question. 

In maple - when working with Ohm's Law.

Maple know how to calculate with e, but how can I show the result

I have calculated the following calculation:

(2e-4)/2

Maple returns the result:0.0001000000000

How do I maple show the result as 1e-4?

 

It took me a while to figure out what was causing this unusual sort result;

I loaded the MTM package because I want to convert numbers to integers for indexing. This sort result seem like it could be a bug.

Sort a List of Floats

NULL

with(MTM):

NULL

x := [1/3, 0, 4] = [1/3, 0, 4]``

``

sort(x) = [0, 1/3, 4]``

NULL

f_x_MTM := [seq(convert([x[n], n], float), n = 1 .. 3)] = [[.3333333333, 1.], [0., 2.], [4., 3.]]NULL

sort(f_x_MTM) = [[.3333333333, 1.], [0., 2.], [4., 3.]]NULL

NULL

unwith(MTM):

f_x := [seq(convert([x[n], n], float), n = 1 .. 3)] = [[.3333333333, 1.], [0., 2.], [4., 3.]]

NULL

sort(f_x) = [[0., 2.], [.3333333333, 1.], [4., 3.]]

``

 

Download MTMsort.mw

how_do_i_get_floating_point_answer.mw

 solve({-(1/3)*(eta+5)/(eta-3) = 3*eta/(-2+eta)})

{eta = 6/5-(1/5)*61^(1/2)}, {eta = 6/5+(1/5)*61^(1/2)}

(1)

I want the answer

eta := 6/5-(1/5)*61^.5

-.362049935

(2)

what is the command i should use? Please help. Thanks.

``

 

Download how_do_i_get_floating_point_answer.mw

Ramakrishnan V

rukmini_ramki@hotmail.com

1.

assume there are 3 real number or floating number a, b, c

how to find the w and phi in 

a = sin(w*t1 + phi)

b = sin(w*t2 + phi)

c = sin(w*t3 + phi)

where w and phi are the same in above 3 equations, only different in t1, t2, t3

 

2.

same as above , how to find w, apha and beta in below if there are a, b, c

a = alpha*cos(w*t) + beta*sin(w*t)

b = alpha*cos(w*t) + beta*sin(w*t)

c = alpha*cos(w*t) + beta*sin(w*t)

Maple 15

eq:=1/2*x^(1/2) + 1/13*x^(1/3) + 1/26*x^(45/37);
evalf(eq);

The exponents are still fractions.  I want to have floating point exponents.


0.5*x^0.500000 + 0.07692307692*x^0.333333 + 0.03846153846*x^1.216216216

How do I do this?

 

Tom Dean

Hello,

Good day.

How to avoid float(undefined) for v3, v4,v5 in this problem.

Thank you in advance.

Try_for_Second_Grade_Fluid.mw

To me the following behavior of solve is surprising:

restart;
solve(f(0.5)=7,f(0.5)); #Output NULL
solve(f(1/2)=7,f(1/2)); #Output as expected 7

Debugging solve suggested to me that the following might work
solve(f(0.5)=7,f(1/2));
and indeed it did (outout the float 7.).
This behavior seems to have started in Maple 10. I checked Maple V,R3 and several other old versions including Maple 9.5. All behaved as I would have expected. MapleV,R3 gave the float 7. in the first case, the other the integer 7.
I take this to be a bug and shall file an SCR.
Any comments?




1 2 Page 1 of 2