MaplePrimes Questions

Search Questions:

Latest Questions Latest Questions Feed

<p>Hey,</p>
<p> </p>
<p>How do I set up a loop that resets if a certain condition is met? </p>
<p>I have set up a loop that pulls and runs an external process. However, if certain conditions are met, I wish the loop to reset from the beginning and take the last output from the process as the new input.</p>
<p> </p>
<p>Example:</p>
<p>for i from 1 to 10 do</p>
<p>     tester:=baseset[i]:</p>
<p>     tester:=process(tester)[1]:</p>
<p>     check:=process(tester)[2]:</p>

Hi all,

 

I am after some advice on how to extract a value from a proc.

 

below is the system of ODE's im trying to solve, however i get this error which i cannot get round, can anyone help?

 

At the moment I'm trying to find the smallest difference between two things (of form E[i] i goes from 1 to n)  and input them in a list. To do this I need to use nested loops but I'm not sure of the best kind/way to do this. I have been experimenting with for and if loops so far

for instance, this is my most recent effort.
 

for i from 2 to n do;

a := abs(E[i]-E[1]);

for j from 2 to n do;

if i <> j then ;

b := abs(E[i]-E[j]);

end if;

if b < a then a := b end if;

end do;

<p>Hello</p>
<p>I am trying to assign equations:</p>
<p><img src="http://img121.imageshack.us/img121/9821/assign.jpg" alt="" /></p>
<p>But i get the invalid arguments error. What is the problem?</p>
<p>Thank you</p>

How can I use algorithmic variables in multiple parts of a multipart question? We used to do it like in the Tips & Techniques document http://www.maplesoft.com/tacontent/view.aspx?SID=5390. Now, the variables from the question algorithm seem hidden from the parts.

When I create the multipart question through the question editor, I get the following script:

mode=Multipart@
name=Multipart@

 

I attach the relevant file but in essence I have a function which includes a term sin(x+a+b) where x is the variable and ‘a’ and ‘b’ are constants, symbolic integration and solving then follow.

I may have stumbled upon a loop quirk

for m from 1 to 5 do
  m;
end do;

From this program

S1:=unapply(u*FresnelS(u)+((1/Pi)*cos((1/2)*Pi*u^2))-(1/Pi),u);

C1:=unapply(u*FresnelC(u)-((1/Pi)*sin((1/2)*Pi*u^2)),u);

R1:=1;

u1:=evalf(sqrt(0.4));

E1:=evalf(Pi*R1*S1(u1)+R1);

D1:=evalf(Pi*R1*C1(u1)+1);

a:=evalf(Pi*R1*(u1));

with(plottools);

with(plots);

c1 := circle([D1,0], R1);

display(c1);

plot([a*FresnelC(u),a*FresnelS(u),u=0..u1]);

p1:=plots[display](plot([1+a*FresnelC(u),a*FresnelS(u)-E1,u=0..u1]),c1,scaling=constrained);

h := Array(1..2^16,datatype=float[8], storage=rectangular, order = C_order) # of hfarray
x:= Read(clarinet): # of Array
ArrayTools[Copy](x,h):

First, I have the following object:

H := Array(1..2^16,datatype=float[8], storage=rectangular, Order = C_order).

Now, I try to find out which type it has:

whattype(H),

and it only tells me 'Array', but it's fare more than that: datatype=float[8], storage=rectangular etc. etc.

If I'd change a setting in this array and try to store it into the original, Maple would give me a type clash error.

But how to find out these types?

Hi,

I would like to know how to pass my list of initial conditions "a" in to my solutions via some form of index to generate plots for each of my initial conditions. I have indexed in the code but need some form of related calling procedure.

 

Thanks in advance.

 

>restart;

> eq:=diff(y(x),x,x)+y(x)^2*x^2=x^2;


> a:=[-0.6,-0.4,2.4,3.4];


> ics[1]:=y(0)=0,D(y)(0)=a[1];


> sol[1]:=dsolve({eq,ics[1]},numeric);

in a loop, how can i instruct maple to skip the loop if a condition is met?

example

for m from 1 to 10 do

for n from 2 to 11 do

if m=n, skip

else carry on with code

end do

end do

so that if m=n=4, maple will skip it to do m=4, n=5

 

thanks

lovinash

Hi, all, Is there a way to extract all the variables in a list of polynomials? For example: L:=[2*a*b,x^2+y,d*y^2]; I want to get [a,b,x,y,d]. The order of variables does not matter. Thanks Gepo
Hi, all, I have known how to compute Groebner basis over galois field. For example, the following example is to compute Groebner basis over GF(2^3): alias(alpha=RootOf(Z^3+Z+1)); F := {alpha*x*y+alpha^2+1, alpha^2*x^2-1}; G := Groebner[Basis](F, plex(x,y), characteristic=2); But now I have a doubt. If I give one more "alias", is the Groebner basis still computed over GF(2^3)? For example: alias(alpha=RootOf(Z^3+Z+1)); alias(beta=RootOf(u^2+u+1)); F := {alpha*x*y+alpha^2+1, alpha^2*x^2-1,alpha^2*beta+x*y}; G := Groebner[Basis](F, plex(x,y), characteristic=2);
First 791 792 793 794 795 796 797 Last Page 793 of 1192