Items tagged with float float Tagged Items Feed

I wrote a procedure which rounds floats to a specified precision. I would like to apply it to a Matrix/List/Array/Vector that contains non-numeric cells as well as floats. I'm stuck at the type-checking stage.


# Round0 works on floats and lists and Matrices of floats:
restart;
Round0 := proc(x,n::integer:=1)
   parse~(sprintf~(cat("%.",n,"f"),x));
end proc:

Round0(1.23456789);
1.2

Round0([1.23456789,9.87654321],2);
[1.23, 9.88]

Hi, was wondering if any of you could help me, when I try and find the real part of a function to plot, I get a float(undefined) error, however by just using evalf if gives gives me the real and comlex parts.

zetaroots.mw

The function i want to find realy parts for is f(x).

 

Thanks,

Matt

Dear Readers,

Given an expression for e.g. x^n+ y^3.5, how to extract the symbolic/floating point exponent, I tried with degree method but it fails whenvever there is symbolic or floating point exponent. Is there any alternative ?

 

Thanks,

 

Regards, Satya

Hello every one,

I am gettting this error "unable to store HFloat", while solving a system of ODES numerically.

restart:

eq1:=n*(-diff(f(eta),eta$2))^(n-1)*diff(f(eta),eta$3)+(2*n/(n+1))*f(eta)*diff(f(eta),eta$2)

-diff(f(eta),eta$1)^2-M*diff(f(eta),eta$1)+M*epsilon+epsilon^2+lambda*f1(eta)=0;

eq2:=diff(f1(eta),eta$2)+P*(2*n/(n+1))*(f(eta)*diff(f1(eta),eta$1))=0;

bc:=f(0)=0,D(f)(0)=1,D(f1)(0)=1,D(f)(N)=epsilon,f1(N)=0;

Matlab to Maple...

November 03 2012 AliKhan 10

Dear All

I trying to solve the following in MAPLE, the code works fine in MATLAB but I am not sure why it doesn't give me values in MAPLE

n:=3: alpha_p:=1: p:=2: mu0:=4*Pi*1e-7: Br:=1.12:

A1:=unapply(sin((n*p+1)*alpha_p*Pi/(2*p))/((n*p+1)*alpha_p*Pi/(2*p)),n):

A2:=unapply(sin((n*p-1)*alpha_p*Pi/(2*p))/((n*p-1)*alpha_p*Pi/(2*p)),n):

M1:=unapply((Br/mu0)*alpha_p*(A1(n)+A2(n)),n):

M2:=unapply((Br/mu0)*alpha_p*(A1(n)-A2(n)),n):

I have been using random numbers in other applications than Maple. Usually there is a function, which will give a pseudo random real number between 0 and 1. When I looked for it in Maple I got quite confused, because there are a lot of different options here - obviously because Maple can deliver random numbers/objects in many ways, even following a certain distrubution. I found out it doesn't work by just using rand(), since it is always starting with the same value. Then I found the command randomize(...

consider:

assume(k[f1]>0,k[f2]>0,k[f2]>k[f1],h_bar>0,m>0);
 
h_bar:=1.0545e-34;m:=0.10938e-31;n[0]=1e28;


> eq1:=n=(k[f1]^3+k[f2]^3)/6/Pi^2;

> eq2:=e*V=h_bar^2/2/m*(k[f2]^2-k[f1]^2);

> solve({eq1,eq2},{k[f1],k[f2]});

in the final command i get a very messy numerical&symbolic results like

{k[f1] = 1016612041.*
(-1.*RootOf(9456017282782496601177464289*n^2*Pi^4...
Page 1 of 1