MaplePrimes Questions

Hi, I would like to solve this nonlinear problem :

 

with :

I use the NLPSolve command and i get this error : Error, (in Optimization:-NLPSolve) integer variables are not accepted.

Can you help me ?

 

 

 

 

Hi users:

i will solve the system of equations with laplace method in maple,every body can help me?

EQ1:= -1.383117237*10^(-9)*q2(T)+4.345190953*10^(-9)*q1(T)+3.643814673*10^(-17)*(diff(q1(T), T, T)) = 0
EQ2 := 3.522088316*10^(-10)*q2(T)-1.106493791*10^(-9)*q1(T)-6.094634321*10^(-16)*q4(T)+6.094634321*10^(-16)*q5(T)+2.429209782*10^(-24)*(diff(q2(T), T, T)) = 0
EQ3 := 1.378642186*10^(-8)*q3(T)+4.570975739*10^(-12)*q4(T)+4.570975739*10^(-12)*q5(T)+3.643814673*10^(-17)*(diff(q3(T), T, T)) = 0
EQ4 := .6366197720-.5208074999*(diff(q5(T), T))-0.5140163994e-5*q4(T)-4.092794921*q5(T)+.7896341498*(diff(q3(T), T))-.5208074999*(diff(q4(T), T)) = 0
EQ5 := .3183098860-1.041615857*q4(T)+3.088010748*q5(T)-0.6580284584e-4*(diff(q2(T), T))-0.8680125003e-1*(diff(q4(T), T))+0.8680125003e-1*(diff(q5(T), T)) = 0


with initial conditions:

q1(0) = 0, q2(0) = 0, q3(0) = 0, q4(0) = 0, q5(0) = 0, (D(q1))(0) = 0, (D(q2))(0) = 0, (D(q3))(0) = 0

Hi,

I solve laplace equation in a square. All the lines of my code is okay.

Please just look to the last part of my code titled procedure:

When I run my code without (last funciton f #f := (x,y) -> 0;) see last lines to find "f". It's runing, there is no problem. But when I put add f, there is an error. Many think  for any help.

Procedure
Using the previous suty in section stencil we can write the procedure to solve the Laplace equation in [0,1]*[0,1] with the boundary condition Neumann conditions on the vertical boundary and Dirichlet boundary condition on the horizontal baoundary. In our study we will use the same stepsize h in x and y direction.

PoissonSolve:=proc(N,_f)
local Z,i,h,y,x,sys,w,f,sol,j,u,Data;
# define basic grid parameters
Z := i -> (1/(N+1))*i;
x[0] = Z(0),x[N+1] = Z(N+1),y[0] = Z(0),y[N+1] = Z(N+1);
 h := evalf(Z(1)-Z(0));
# Fix the boundary data and the source matrix
for i from 0 to N+1 do:
    # Neumann boundary condition
     u[N+1,i] :=  u[N,i] ;    
     u[0,i] := u[1,i];
     # Dirichlet boundary condition
     u[i,0] := 0;
     u[i,N+1] := 0;
   od:
   f := Array(0..N+1,0..N+1,[seq([seq(evalf(_f(Z(i),Z(j))),i=0..N+1)],j=0..N+1)],datatype=float);
# Write down the system of equations to solve and solve them
     sys := [seq(seq(Stencil(h,i,j,u,f),i=1..N),j=1..N)];
  w := [seq(seq(u[i,j],i=1..N),j=1..N)];
  sol := LinearSolve(GenerateMatrix(sys,w));
   # parse the solution vector sol back into "matrix" form
   for i from 1 to N do:
     for j from 1 to N do:
        u[i,j] := sol[(j-1)*N+i]:
     od:
   od:
# generate a 3D plot of the solution using the surfdata command
   Data := [seq([seq([Z(i),Z(j),u[i,j]],i=0..N+1)],j=0..N+1)]:
surfdata(Data,axes=boxed,labels=[`x`,`y`,`u(x,y)`],shading=zhue,style=patchcontour);
end proc:



Here is an example of the output when the source function is set to zero
                                 f(x, y) = 0
; i.e., when  reduces down to Laplace's equation:
#f := (x,y) -> 0;
#PoissonSolve(10,f);

 

 

Question8.mw

Hi

I need you to help me in writting procedure with input "r" ( order of derivative) and some coefficients seq(alpha[i],i=1..N).  My code work very well, need only put all the element in procedure with output The Taylor series obtained in last line of my code and the order of error.  I want the procedure return the coefficients beta used in the series and the order of Error  and the coefficients beta[i]

May thinks.

Second_Question.mw

 

I will not modify my previous question: only I add this remark. I tried to write these lines of procedure.
Add_display.mw

I need only to add( if the procedure is true) these lines in my procedure.  These lines gives the degree of error computed in the code, but when I put these lines in the codes, there is an error. Thanks for your help.

Degree := degree(Error,stepsize);
    if (showorder) then:
       print(cat(`This stencil is of order `,Degree));
    fi:
    if (showerror) then:
       print(cat(`This leading order term in the error is `,Error));
    fi:
    convert(D[r$n](f)(vars) = stencil,diff);

 

 

 

Hello my dear friends:

i will obtain value f(4) from below equation:(f is funciton of t)

f[0](t)=a*cos(omega*t)
f[n+1](t)=f[0](t)+(1/omega)*int((omega^2*f[n](tau)-f[n](tau)^3)*sin(omega*(t-tau)),tau=0..t)

THANKS...

Hi:

how obtain value a4 from below equation in maple:

a[0]=1

a[n+2]=a[0]+a[n+1]

I calculate eigenvalues and  eigenvectors of a floating-point square matrix M with the command Eigenvectors(M, output = 'list').  How can I estimate errors of my results?

I have two 6x1 Matrices which are the results of a calculation process in Maple. One with a set of equations and the other one with a set of variables: 

A := [0, f(x6), f(x6), 0, 0, f(x6)];

b := [x1, x2, x3, x4, x5, x6];

I'd like to solve the following system:

for i from 1 to 6 do

eq[i] := A[i] = b[i]:

od;

which is

eq[1] := 0 = x1;

eq[2] := f(x6) = x2;

eq[3] := f(x6) = x3;

...

 

If I type in the eqations manually, and execute "s := solve({eq[1],..,eq[6]},{x1,..,x6})" everything solves fine.

If I use the "for i from..." - structure, and execute "s := solve({eq[1],..,eq[6]},{x1,..,x6})" I get an empty space as solution.

I've tried to convert both matrices into lists, but it doesn't work.

Could it be that Maple doesnt know that x6 has to be the x6 in the function f(x6) ?

Can anyone tell me how to solve this please?

Hi,

I need your help to fix the error in this code.  many thinks
restart:
pde:=diff(u(t,x),t$2)=diff(u(t,x),x$2)-sin(u(t,x)):
f:=x->x^2:
IBC := {u(0,x)=f(x),u(t,-50)=0,D[2](u)(t, 50)=0,D[1](u)(0, x)=-diff(f(x),x)}:

pds := pdsolve(pde, IBC, numeric):

p1 := pds:-plot(t = 0);
p2 := pds:-plot(t = 1/10);
p3 := pds:-plot(t = 1/2);
p4 := pds:-plot(t = 1);
p5 := pds:-plot(t = 2);
plots[display]({p1, p2, p3, p4, p5}, title = `Sine Gordaon at t=0,0.1,0.5,1,2`);

Hi Maple-Prime-ers!

I have a system of equations, containing 18 variables and 13 equations, making this a 5 degree of freedom (DOF) system.  I would like to analytically solve each of the equations in terms of each of these DOFs.  Normally I would use solve(system, dof_variables) to accomplish this, but it doesn't return anything.  Not even [].

I can solve this system by hand.  I've included a hand-solution involving isolate() and subs() in the attached worksheet.  I'm looking to incorporate this in an optimization algorithm with varying system, so I would like an automated way of doing this.

Does anybody have any suggestions to get solve to work as intended?

 

3driversys_FD_BRAKE_ICE_GEN.mw

 

Here is the system I am talking about:

 

 

The free variables are:  {FD_T, FD_W, ICE_T, EM2_T, BRAKE_T}

 

I'm looking for a solution in this form:

 

 

 

 

 

For context, I'm designing a work sheet based around quantum tunneling. Currently I'm looking at the boundary conditions.

What I want to be able to do is to set the expression psi[1] equal to psi[2], but only for the value x = 0. Is this possible? I've tried using if statements, and I've considered converting these expressions into functions for this purpose, but I'm not having much luck. 

Thanks

Blanky

Dear all,

Please, I need help to remplace in the code attached,  addadd(beta[i]*u(x+[i]*h),i=0..N)+Error; 
by add(beta[i]*u(x+alpha[i]*h),i=0..N)+Error;  I see, that we must add a function, alpha, but how.

I think I must modify this rows: but how:

stencil := add(a[ii[i]]*subsop(r=op(r,phi)+ii[i]*stepsize,phi),i=1..N);

Question2.mw

 

Many thinks

Hi,

I need to solve the linear system  AX=F  without using any  Linearalgebra package. 

 

A is a tridiagonal matrix ( band matrix);

X is vector of size n.

F is the right hand side of my equation AX=F.

F: given, A given, Find X???

restart;

A := n-> Matrix(n,scan=band[1,1],[[seq(b[i],i=2..n)], [seq(a[i],i=1..n)],
                [seq(c[i],i=1..n-1)]] ):
X:=n->[seq(x[i],i=1..n)]:
F:=n->[seq(d[i],i=1..n)]:

 

Thanks

R dJ(t)/dt+J(t)/C=f(t)

where f(t) is a driving electromotive force. Use the fourier transform to analyze this equation as follows.

 

 

Find the transfer function G(alpha)  then find g(t) .

 Thanks ....

Hi,

I try to solve this equation using pdsolve but there is no results.
restart:
with(PDEtools):
with(plots):

Eq:=diff(u(t,x), t$2) =diff(u(t,x),x$2)+sin(u(t,x));

pdsolve(Eq);

Thank you for your help.

 

First 1430 1431 1432 1433 1434 1435 1436 Last Page 1432 of 2427