Items tagged with for for Tagged Items Feed

q2.mw

Hi!

I have a question on result storage of for loop.  The program in attached.

The program is relative complex, it is not necessary to look part 1.

The question is in part 2.

The result I proposed is:

r=([17400,12500],[13900])

but, the real result of r is:

r=table([1.0=[1.0,17400,12500],2.0=[2.0,13900],()=[]])

what should I do to modify the program?

Hi, I am trying to the following. When my DizLambda value is 0, I would like it to show "a" and if it is not 0 but smaller than 1.5 to show "9", otherwiese, it it is not 0 and bigger than 1.5, to show its original value. How do I do that please in its own matrix position?

restart:
with(LinearAlgebra):
interface(rtablesize=infinity):
node:=9:
Lambda:=DiagonalMatrix([3,6,4,2,5,2,3,5,3,7,4,7,4,6,8,9,2,1]):
dizLambda:=Matrix(node*2):
for i from 1 to (node*2-1) do

 

Hi, I have a 18x18 matrix called Lambda.

I'm trying to get NewLambda which consist of "(Lambda(1,1)-Lambda(2,2))/2", "(Lambda(2,2)-Lambda(3,3))/2", ....,"(Lambda(17,17)-Lambda(18,18))/2".

Here is what I wrote :

for i from 1 to 17 do
for j from 2 to 18 do
NewLambda:=((Lambda(i,i)-Lambda(j,j))/2;
end do
end do

But it doesn't show me the NewLambda. Please help. Thanks

piecewise and for-loop

March 26 2012 by gph_mix 5 Maple 15

Hi

How can I use loop-varible in a definition of piecewise function? For example, when I do:

for k to 5 do

f[k] := x -> piecewise(x > 0, k, 0);

end do;

f[3](1);

f[2](1);

 

I get:

f[3](1) = 6

f[2](1) = 6

program is:
for t from 10 by 2 to 100 do h := solve({x*y*z = 6*t^3, x-y-z = 0, x+y+z = 6*t}, {x, y, z}); A[(t-8)*(1/2)...

Hi all,

A while ago, I had asked a question relating to calling to an MapleSim .msim simulation within maple .mw worksheet. (Thank you Acer! :) I got it working but then another issue just popped up...The basic structure is as follows:

********************************************************************

A := MapleSim:-LinkModel('filename' = "TriplePendulum_WORKS_v2.msim")

for z from 1 to 50 do

     initialize_variables;

I've set up part of my procedure to calculate the values of i from 1 to 15 using for loops.  I only need the values from 1 to 15, but a later part of my procedure if failing because it says it cannot evaluate the value for i=16.  How do I tell Maple that i>=16 doesn't matter/do nothing for i>= 16?

Hi everybody,

I have just started to learn using maple and now I have a trouble.

I thought programming was similar to C language, and I tried to write this simple code:

> restart:
> a := 2;
   b := 5;
>
> for i from 1 by 1 to 4 do
   if a = b then 
        print('before'); 
        plot(x^2, x = -2 .. 2); 
        print('later')
   end if; 

I need to create an ellipse and an ellipsoid (ellipse in 3D) through code. How would I be able to do this? Can someone please give me an example for each?

 

Also, I will need to create a line for an ellipse and a plane for an ellipsoid that intersect. Would I be able to find the intersecting points? Would I be able to find the function for the curve line that is created when a plane intersects an ellipsoid? Also, how would I find the surface area and volume...

my problem is probably that maple assigns everywhere possible the whole expression (cause its analytical)

How do i get it to calculate a float and save it as such?

e.g.

interfaceenergy:=5.

sig:=200.*10^6

Temp:=fsolve(xi_M[Temp,sig,interfaceenergy)=0.5,T, T=100..400])

whattype(Temp) ---> function

...this is part of a nested loop (2) so after some time of calculating maple says

"Error unable to store.... and then...

Hi, everyboyd I wan to draw a vertical line at theta:=Pi  for any function.

How can i do it.

Amr

Ive tried this for hours and can't get it to work. Any help would be greatly appreciated. I need to 

find a 10 significant figure approximation to the 10th derivative of

evaluated at x = -2.

Ive tried using this maple command:

evalf(subs(x=-2,diff((sin((x^2...

Hi

I entered this code :

> printlevel := 2:

> for i to 3 do for j to 3 do i*j end do end do;

but it does not show the result

what should I do?

thx

Regards,

I have a very large equation which has an arctan(x,y). I need to be able to extract the arguments x,y and assign them in some variables.

I have tried the solution given here.

Unfortunately, that solution only works for constants, not equations.

For example, if I use the proc given in there with arctan(10,11) it works. But if I use something like arctan...

I'm running a for loop to find a numerical solution to a linear system of equations.

x1:=1

x2:=2

x3:=3

for i from 0 to 10 by 1 do

y1:= f(x2,x3);     <-------------- these are functions of variables solved using the initial approximations above.

y2:= f(x1,x3);

y3:= f(x1,x2);

x1:=y1;    <-------------- Reassignment statements

x2:=y2;

x3:=y3;

end do;

1 2 Page 1 of 2