mapj

183 Reputation

9 Badges

16 years, 239 days

MaplePrimes Activity


These are replies submitted by mapj

@Carl Love 

 

Many thanks for the solution. Your knowledge of Maple commands is amazing.

@Carl Love 

 

Thanks for your offer. Here's an example

z1 := c1 + c2*x + c3*x^2 + c4*x*y + c5*y^2;

z2 := c6 + c7*x + c8*x^2 + c9*x*y + c10*y^2;

z3 := c11 + c12*x + c13*x^2 + c14*x*y + c15*y^2;

vars:={c||(1..15)};

e1 := diff(z1,x,x) + diff(z3,x,y) = 0;

e2 := diff(z2,y,y) + diff(z3,x,y) = 0;

sys := map(coeffs,lhs~({e1,e2}),{x,y}) =~ 0;

print(sys);

Sol:= solve(sys, vars);

 

 

@nm 

Your solution works great thanks.

As a followup question, suppose the P equations are generated from Q unknowns eg in terms of powers of x and y

Z1 = c1 + c2*x + c3*y + c4*x^2 + c5*x*y ... (say up to c10)
Z2 = c11 + c12*x + c13*y + c14*x^2 + c15*x*y ... (say up to c29)
Z3 = C30 + c31*x ...

Once the solution of the c's are found is there an easy way to extract out and print all the individual nonzero Z solutions? Eg if the solution is (c1 = c1, c15 = c15, c14 = 3*c1, c2 = 2*c15, c31 = -5*c1+4*c15, all other c's zero), the two nonzero solutions to print out are

Z1 = 1, Z2 = 3*x^2, Z3 = -5*x
Z1 = 2*x, Z2 = x*y, Z3 = 4*x

The number of nonzero solution sets needs to be calculated before printing or as part of the printing loop.

Thanks.

Simplysupportbeam.mw

@OffshoreEngineer 

As attached Maple can produce a high accuracy solution to your equations as given. If you feel the results are wrong then it suggests to me that your original formulation is wrong. Can you give us the theory?

Why can't the second derivative be nonzero at x=0? Your boundary conditions don't specify a value of this at x=0, so if it's supposed to be zero you should specify this as a boundary condition.

Simplysupportbeam.mw

@OffshoreEngineer 

As attached Maple can produce a high accuracy solution to your equations as given. If you feel the results are wrong then it suggests to me that your original formulation is wrong. Can you give us the theory?

Why can't the second derivative be nonzero at x=0? Your boundary conditions don't specify a value of this at x=0, so if it's supposed to be zero you should specify this as a boundary condition.

@OffshoreEngineer 

You are using the default Digits = 10 which doesn't seem enough for this problem.  I used

Digits:=15; # you can increase this if you need more accuracy

tol:=1e-6; # adjust to improve accuracy

sol := dsolve({sys}, type = numeric, output = listprocedure, abserr = tol, maxmesh = 1000);

and it seems ok. You had quotes around maxmesh which I think is wrong. 1000 should be more than enough divisions.

@OffshoreEngineer 

You are using the default Digits = 10 which doesn't seem enough for this problem.  I used

Digits:=15; # you can increase this if you need more accuracy

tol:=1e-6; # adjust to improve accuracy

sol := dsolve({sys}, type = numeric, output = listprocedure, abserr = tol, maxmesh = 1000);

and it seems ok. You had quotes around maxmesh which I think is wrong. 1000 should be more than enough divisions.

Thanks acer.

Thanks acer.

Thanks jakubi - that's what I wanted.

Thanks jakubi - that's what I wanted.

Sorry Robert - meant to type

c1*diff(y1(x,y),x) + c2*diff(y2(x,y),y) = r1 (1)
c3*diff(y1(x,y),y) + c4*diff(y2(x,y),x) = r2 (2)
 

 

 

Sorry Robert - meant to type

c1*diff(y1(x,y),x) + c2*diff(y2(x,y),y) = r1 (1)
c3*diff(y1(x,y),y) + c4*diff(y2(x,y),x) = r2 (2)
 

 

 

I'll try autocompile once I get everything working. At this stage, speed is not an issue.

Thanks for all your help.

Thanks Acer. I found the problem. I added the line

define_external(WATCOM);
 

at the top of the Maple program above and adjusted the path and environment variables so the Watcom compiler works properly. The setvars.bat file in the watcom directory needs to be changed so that INCLUDE is set as

SET INCLUDE=C:\watcom-1.3\H;C:\watcom-1.3\H\NT;C:\watcom-1.3\maple13\include
 

to pick up the Maple headers.

With these changes and running the setvars batch file to set things up, the simple test above works.

1 2 3 4 5 Page 4 of 5