MaplePrimes Questions

Dear all;

Please give me few minutes to correct the output of this procedure.Many thinks. 
We will solve the waves equations: diff(f(x,y,t),t$2)=c^2*( diff(f(x,y,t),x$2) +diff(f(x,y,t),y$2));  where (x,y,t) in [0,1]*[0,1]*[0,T] using finite difference.  With Initial boundary conditions: [u(0,y,t)=u(1,y,t)=0],   [u(x,0,t)=u(x,1,t)=0],  [u(x,y,0)=f(x,y),   diff(u(x,y,0),t)=g(x,y)]... The code is done and perfect but....The output of this procedure is Nothing. How can I plot the solution...

f:=(x,y)->x*(x-1)*y*(y-1);
g:=(x,y)->0;
analytical_sol:=proc(dx,dy,dt,Tf)
local Ft, Fx,Fy,x,y, c1,c2,c,j,k,i,u;
Ft := floor(Tf/dt)+1;
Fx := floor(1/dx)+1;
Fy := floor(1/dy)+1;
x:=[seq(0..1,dx)]:
y:=[seq(0..1,dy)]:
c1 := (c*dt/dx)^2;
c2 := (c*dt/dy)^2;
#Initial position
for j from  1 to Fx do  
   for k from 1 to Fy do
  u[j,k,1] := f(-dx + j*dx, -dy + k*dy) -dt*g(-dx+j*dx, -dy + k*dy);
   u[j,k,2] := f(-dx + j*dx, -dy +k*dy);
end do;
end do;

# Boundary values j=1
for i from  1 to Ft +1 do
      for k from 1 to Fy do
         u[1,k,i] := 0;
      end do;
      for k from 1 to Fy do
         u[Fx,k,i] := 0;
      end do;

     for j from 1 to Fx do
         u[j,1,i] := 0;
      end do;
   
   for j from 1 to Fx do
         u[j,Fy,i] := 0;
      end do;
end do;

for i from 3 to Ft + 1 do
  for j from 2 to Fx-1 do
    for k from 2 to Fy-1 do
u[j, k, i] := 2*u[j,k,i-1] - u[j,k,i-2] + c1*(u[j+1,k,i-1]-2*u[j,k,i-1]+u[j-1,k,i-1]) + c2*(u[j,k+1,i-1] - 2*u[j, k, i-1] + u[j,k-1, i-1]);
end do;
end do;
end do;
return Matrix([seq([seq([seq(u[i,j,k],i=1..Fx)],j=1..Fy)],k=1..Ft)]):
end proc:

## Try the test
f:=(x, y) -> x (x - 1) y (y - 1)
g:=(x, y) -> 0;
analytical_sol(0.1,0.1,0.1,2);
                      

Hi:

i have a problem,every body can help me?

my equations:

 

Hello,

As a means of encoding information, I'm working with nested array objects (I had originally used lists, but they became too large and Maple suggested that I use arrays). The nesting should be at most four deep, but the nested arrays can have varying lengths. In order to work with the arrays, I have a series of procedures that manipulate a given array and update the existing array object to contain the result. The issue that I have is that one of my procedures needs to simultaneously use both the original array and a modified version of the array, but once the modification is performed, the original version no longer exists.

Ultimately, my issue boils down to this: is there a clean (or messy, I'm not picky) way to duplicate an array so that there are two copies of the array in memory? Just writting Array2 := Array1 just creates another pointer to the same array in memory from what I can tell, so that doesn't work. There is a function copy, but it doesn't seem to work on nested arrays. 

For example, running the following does not modify Array2.

Array1 := Array([Array([1, 2]), Array([3, 4])]);
Array2 := Array([Array([1, 2]), Array([5, 6])]);
copy(Array1, Array2);

Indeed, neither does

Array1 := Array([Array([1, 2]), Array([3, 4])]);
Array2 := Array([Array([1, 2]), Array([5, 6])]);
copy(Array1(2), Array2(2));

Unfortunately, the latter case would seem to mean that I can't just write a procedure to recurse through my layers of arrays and copy piecewise either.

Thanks in advance for any help.



Can anybody tell me what I'm doing wrong?
Or does anybody have some tips for things like this? (Things like this occur often)

Stephan

Hello,

Anyone can help me with the problem ?

I want to solve b1..b50

> restart; with(plots); with(LinearAlgebra); with(Statistics);
> m0 := proc (t) options operator, arrow; 1-exp((-1)*t*.5) end proc;
t -> 1 - exp((-1) t 0.5)
> m := proc (t) options operator, arrow; (1/(1+exp(-t+5))-0.67e-2)*1.0067 end proc;
/ 1 \
t -> |--------------- - 0.0067| 1.0067
\1 + exp(-t + 5) /
> n[max] := 10; delt := .2; n := n[max]/delt;
10
0.2
50.00000000
> T := Vector(50);
> b := vector(50); evalm(b);

> for i from 2 to n do T[i] := T[i-1]+delt end do;
> fun := proc (t) options operator, arrow; add(b[i]*m0(t-T[i]), i = 1 .. n) end proc;
> fun(t);
> fu := vector(50);

> for x to 49 do fu[x] := fun(x*delt) = m(x*delt) end do;
> s := solve({fu[1 .. 50]}, {b[1 .. 50]});

 

 

Thanks,

gerst

Hello,

sometimes I observe extreme delays when simply entering a variable name like fooBar; right after starting a Maple session. This happens when the current directory contains a file with that name, because Maple automatically loads this file.

For example, if I create an empty file fooBar.m and start a Maple session,

> fooBar;
Error, `./fooBar.m` is an incorrect or outdated .m file

raises an error. More often however, I have some huge Maple files in the working directory and whenever I use (by chance) a variable name in the Maple session that matches a filename, Maple tries to load the corresponding file.

Is there a documentation of this behaviour and a possibility to stop this automatic loading of files?

Thanks,

Erik

When trying to solve a set of partial differential equations, I always get the following error. I don't know what it means. Can somebody help me?

 

Hi, 

I have an expression F that has an addend which is a definite integral,-(int(del_u0(x)*(diff(N_xx(x), x)), x = 0 .. L)), and addends that are not, all the rest of them.

How can I create an expression that is the integrated addend only without the other ones?

In other words, how do i separate the integral term from the rest of them?

F := -(int(del_u0(x)*(diff(N_xx(x), x)), x = 0 .. L))+del_u0(L)*N_xx(L)-del_u0(0)*N_xx(0)+ibp2+ibp3

Thanks!

Shai

 

I need to write a procedure that takes an integer N and a boolean function F as in14 as arguments, returns nothing, and plots a square N × N lattice of points, coloring the points (i, j) with F (i, j) true in red and the other ones blue. 

Thank you in advance. Any help with this would be apreciated. 

I've got a very complicated integral, generated by Maple (15), of the form:

Z:=a*Int(f(x),x=0..1);

I need to do some manipulations on the integrand.  So, I perform the following:

f(x)=GetIntegrand(Z);

f1:=perform operations on f(x)...etc

Z1:=a*Int(f1,x=0..1);

The trouble arises because sometimes Maple writes Z as shown above, and sometimes it writes it as:

Z:=-a*Int(-f(x),x=0..1);

and you can run the program twice in a row and you will get either form, randomly. So, sometimes Z1 will be wrong by a minus sign because you can't predict whether the minus sign is going to be embedded or not.

I've been complaining about this Maple property for years, to deaf ears within MapleSoft who insist it is not an issue, and it has been the subject of long discussions on this site that go nowhere.

So, the question becomes - how do I reliably extract the expression "a" from the expression for "Z" and how do I test whether it has a minus sign embedded within it, or explicitly showing.

This can drive you crazy if you are trying to do a calculation or write a program that always works.

write down the mapple procedure that finds the shape operator plus
gauss and primative curvatores and determines the surface characteristic
of a parametically given surface

 

best regards, ty

Dear All, I need your help to plot the numerical solution. many thanks.

The variable t in [0,T], x in [0,1], b in [0,2].

Difference finie for waves equation is :

pde:=diff(u(x, y,t), t$2) = c^2*(diff(u(x, y,t),x$2)+diff(u(x,y,t),y$2));

i: according to x, j according to y, and k according to t.

u[i,j,k+1]=2*u[i,j,k]-u[i,j,k-1]+(c*dt/dx)^2*(u[i-1,j,k]-2*u[i,j,k]+u[i+1,j,k])+ (c*dt/dy)^2*(u[i,j-1,k]-2*u[i,j,k]+u[i,j+1,k])

 

Boundary condition: u(t=0)=1, diff(u(x,y,t),t=0)=0, and the normal derivative on the boundary of Omega =0.

How can solve this problem and plot the numerical solution.

 

 

 

Using the two images from the branched question I tried to calculate the offset of the two images.  But it is too cumbersome and slow, can someone figure out a faster way?

Here's what I did,

I created both jpg images into a single row vector and then into an Array.  I then used a for loop with CircularShift to cycle one array and subtract it from the other.  I then took the absolute value and added all the values in the array and stored that value in another array.  The smallest value would indicate the highest probable position that both images have lined up.

Something like...

with(ArrayTools):

a:=convert(convert(img1,vector),Array)  #after img1 is padded to 184x184 from Markyan Hirnyk's answer
b:=convert(convert(img2,vector),Array)

for i from 1 to 100 do
  aa:=abs(CircularShift(a,i)-b):
  bb[i]:=add(k,k=aa):
end do:
min(convert(convert(bb,array),Array))


The problem is 100 shifts takes a long time, let alone go through the full image.  Is there a faster way to accomplish this?

Hi

As i asked at title; i want to determine natural frequency of a single or multi degree of freedom vibration system using MapleSim. but i can't and i don't know how i can do it. can every one help me plz?؟؟؟

Say I have a 3x3 matrix with real entries (like 3.4) and want to compute, say, A^(11). How can I do it and only have 5 digits in the output? I set Digits:=5; and used MatrixPower -- but got 10 digits, which is way too many for the classroom presentation.

First 1451 1452 1453 1454 1455 1456 1457 Last Page 1453 of 2434