MaplePrimes Questions

Hello there,

 

Suppose I have a parametric experssion like   P(ε)=1+ε+ε23 where ε is very small. How can I get P(ε)≈1+ε or P(ε)≈1+ε+ε2

 

Thanks

I would like to remove from a table, the index that verifies some constraint.

For example :

restart:
a := table([1=c, 2=g, 3=y]);

for k in [indices(a, `nolist`)] do
  if is(k, even) then
    a[k] := 'a[k]':
  end if:
end do:

# This does not work as expected 
eval(a);


I have found this workaround 

b := map(u -> if `not`(is(u, even)) then u=a[u] end if, [indices(a, `nolist`)]);
eval(b);

But is there a way to force Maple to evaluate k to 2 before it "unevaluate"  'a[k]' ?

 

I would like to know , what is the command that i able to carry out (simple one) such that I able to shaded the region between y=x^2 and y-axis from y= 0 to y=4.

Hi all

If I have an expression:

B := int(A(x), x = -infinity .. infinity)

How can I use a statement to extract A(x) when A(x) is quite complecated during calculation. thanks

" there were problems during the loading process. your worksheet may be incomplete"

I have seen some other people having this problem, I have tried to erase the bad characters myself but I can't seem to do it right. Can someone pleeeease help me? :(

 

https://drive.google.com/file/d/0B5FKHYOiyQ0jMk9XNzBYU3FDbzQ/view?usp=sharing

Hello.

int(floor(x^2), x = 0 .. 2) = 6 , but it should be 1.85374.

 

 

Bug_in_integrate(floor_and_ceil).mw

Mariusz Iwaniuk

 

With the following equation

eqn:=y=1/2+(1/2)*erf((1/2)*sqrt(2)*(x-mu)/sigma)-exp(-lambda*(x-mu)+(1/2)*lambda^2*sigma^2+ln(1/2-(1/2)*erf((1/2)*sqrt(2)*(lambda^2*sigma^2-lambda*(x-mu))/(lambda*sigma))));

and with

x:=solve(eqn,x) assuming sigma > 0, lambda > 0;

I got the following solution

x := -(1/2)*(-lambda^2*sigma^2-2*lambda*mu+2*RootOf(-exp(_Z)*erf((1/4)*sqrt(2)*(lambda^2*sigma^2+2*_Z)/(lambda*sigma))+exp(_Z)+erf((1/4)*sqrt(2)*(-lambda^2*sigma^2+2*_Z)/(lambda*sigma))+2*y-1))/lambda;

In order to get rid of RootOf I gave the command:

allvalues(%);

However, RootOf did not disappear. How should I proceed? 

 

hi

if possible to convert matlab file in to maple fie program??convert_to_maple_program.txt

thanks

 

hi...how i can gain result for solve three equations,in which term '' Root of'' dont appear?

thanks

root.mw

restart; Q1 := aa*(y-x)

aa*(y-x)

(1)

Q2 := -ll*x*z+bb*x

-ll*x*z+bb*x

(2)

 

-ll*x*z+bb*x

(3)

Q3 := -cc*z+hh*x*x+kk*y*y

hh*x^2+kk*y^2-cc*z

(4)

SOLL := solve({Q1, Q2, Q3}, {x, y, z})

{x = 0, y = 0, z = 0}, {x = RootOf((hh*ll+kk*ll)*_Z^2-bb*cc), y = RootOf((hh*ll+kk*ll)*_Z^2-bb*cc), z = bb/ll}

(5)

``

 

Download root.mw

Hi all

How can I realize the following code in maple:

 EquCon := K[4]*(diff(W(x), x, x, x, x))-omega^2*W(x)

EquConFour := subs((1/2)*(int(W(kappa)*exp^(-J*kappa*x), kappa = -infinity .. infinity))/Pi, EquControl)

 

Thanks~

 

if you want a random interger between 0 and 100

what will be the command?

For implicitplot of say (cos(\theta))^2, I had to use 'factor' in the options for the plot so that it considers cos(theta) also while plotting. But I couldn't do the same in implicitplot3d. How can I achieve this plotting of all factors of a function for implicitplot3d?

this is the matlab is it possible to rewrite it in simple maple code

J = rand()+1e-10;

function [M, num, E] = ising(N,J)

B = 0;

M = []; % The total magnetic field of the system

E = []; % The total energy of the system

randTol = 0.1; % The tolerance, dampens the spin flip process

% First we generate a random initial configuration

spin = (-1).^(round(rand(N)));

% Then we let the system evolve for a fixed number of steps

for i=1:1000,

% Calculating the total spin of neighbouring cells

neighbours = circshift(spin, [ 0 1]) + ...

circshift(spin, [ 0 -1]) + ...

circshift(spin, [ 1 0]) + ...

circshift(spin, [-1 0]);

% Calculate the change in energy of flipping a spin

DeltaE = 2 * (J*(spin .* neighbours) + B*spin);

% Calculate the transition probabilities

p_trans = exp(-DeltaE);

% Decide which transitions will occur

transitions = (rand(N) < p_trans ).*(rand(N) < randTol) * -2 + 1;

% Perform the transitions

spin = spin .* transitions;

% Sum up our variables of interest

M = sum(sum(spin));

E = -sum(sum(DeltaE))/2; % Divide by two because of double counting

% Display the current state of the system (optional)

image((spin+1)*128);

xlabel(sprintf('J = %0.2f, M = %0.2f, E = %0.2f', J, M/N^2, E/N^2));

set(gca,'YTickLabel',[],'XTickLabel',[]);

axis square; colormap bone; drawnow;

end

% Count the number of clusters of 'spin up' states

[L, num] = bwlabel(spin == 1, 4);

############################# 

For people new to Maple, an easy way to learn how to code may be Tutor Syntax, that is the technique of generating code by selecting everything in a Tutor dialog Maple Command window and then copying it to a current session.

The code can then be edited to tailor it to user’s needs. A problem with this technique is the copied syntax contains many single quotes (‘ ‘). The single quotes, which are usually not needed if the program in current session is short and specific, increase the difficulty when editing copied syntax. The attached file (mby2.mw) shows a method which removes the single quotes by using the SubstitueAll command in the StringTools package. One drawback: any strings inside the original syntax (e.g., “#78000E”) must be removed before the syntax can be converted to a string.

Is there a better way to generate code from Tutor dialog so it can be edited (without single quotes) in user’s current session?

mby2.mw

First 1118 1119 1120 1121 1122 1123 1124 Last Page 1120 of 2428