Items tagged with equations equations Tagged Items Feed

Dear all;

Please how can I plot the error between the two function.


Hi all

In matlab software we have a command namely fmincon which minimizes any linear/nonlinear algebric equations subject to linear/nonlinear constraints.

Now my question is that: what is the same command in maple?or how can we minimize linear/nonlinear function subject to linear/nonlinear constraints in maple?

thanks a lot

Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

I was required to purchase Maple 17 for my upcoming Calculus III course, and until now, I have been using my TI-Nspire CAS CX for all of my CAS needs.  I am going through various tutorials/labs in an effort to learn how to use the Maple 17 Software. As a part of this process, I am attempting to solve a system of equations and was told to use the following command:


in order to receive the answer 



Instead, I have received the following error message, which has no help attached to it through the help page.

solve({2*x+3*y = 7, 5*x+8*y = 9}, {x, y});
Warning, solving for expressions other than names or functions is not recommended.

I am hoping this has something to do with Mac vs. Windows software, and that it has a simple solution.  I would greatly appreciate any guidance!

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...

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;
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;

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, can I get some help with this?

The question is:

Consider the following IVP for a mass of m = 2 kg attached to a spring with a spring constant k = 9 N/m. The spring mass system is in a medium with damping constant b.

2y" + by' + 9y = 0

y(0) = 0, D(y)(0) = -3 


It then asks find three values b1, b2, b3 where b1 is underdamped, b2 is critical, b3 is over. 

I set b1 as 1, b2 as sqt 72, b3 as 9. 


Then it asks to find the quasi period. 

I can't get my quasi period right. My answer is 2pi/ sqrt (4.5).


Any help?  

b := 1;

h := 1;

A := b*h;

E := 210*10^9;

qr := 100;

Dp := (1/12)*E*b*h^3;

R := 20;

teta := 3;

sys1 := {(E.A+Dp/R^2)*(diff(u(t), `$`(t, 2))) = -E*A*(diff(w(t), t))/R+Dp*(diff(w(t), `$`(t, 3)))/R, -Dp*(diff(w(t), `$`(t, 4))) = E*A*(diff(u(t), t))/R-Dp*(diff(u(t), `$`(t, 3)))/R+E*A/R-100};



{u(t) = (1/4801)*_C3*(-1+sqrt(4801))^(3/2)*exp(-(1/20)*sqrt(-1+sqrt(4801))*t)-(1/4801)*_C4*(-1+sqrt(4801))^(3/2)*exp((1/20)*sqrt(-1+sqrt(4801))*t)-(1/4801*I)*_C5*(1+sqrt(4801))^(3/2)*exp(-(1/20*I)*sqrt(1+sqrt(4801))*t)-(1/4801)*_C6*(-1+sqrt(4801))^(3/2)*exp((1/20)*sqrt(-1+sqrt(4801))*t)+(1/4801)*_C3*sqrt(-1+sqrt(4801))*exp(-(1/20)*sqrt(-1+sqrt(4801))*t)-(1/4801)*_C4*sqrt(-1+sqrt(4801))*exp((1/20)*sqrt(-1+sqrt(4801))*t)+(1/4801*I)*_C5*sqrt(1+sqrt(4801))*exp(-(1/20*I)*sqrt(1+sqrt(4801))*t)-(1/4801)*_C6*sqrt(-1+sqrt(4801))*exp((1/20)*sqrt(-1+sqrt(4801))*t)-(104999999/105000000)*t+_C1, w(t) = _C2+_C3*exp(-(1/20)*sqrt(-1+sqrt(4801))*t)+_C4*exp((1/20)*sqrt(-1+sqrt(4801))*t)+_C5*exp(-(1/20*I)*sqrt(1+sqrt(4801))*t)+_C6*exp((1/20)*sqrt(-1+sqrt(4801))*t)}


bs := u(0) = 0, (D(u))(0) = 0, w(0) = 0, (D(w))(0) = 0, w(teta) = 0, (D(w))(teta) = 0;

> r := dsolve({bs, sys1});
Error, (in dsolve) invalid arguments; expected an equation, or a set or list of them, received: {{-17500000000*(diff(diff(diff(diff(w(t), t), t), t), t)) = 10500000000*(diff(u(t), t))-875000000*(diff(diff(diff(u(t), t), t), t))+10499999900, 210043750000*(diff(diff(u(t), t), t)) = -10500000000*(diff(w(t), t))+875000000*(diff(diff(diff(w(t), t), t), t))}}

I tried to change the equations row. But ı dont understand where something wrong.I tried so many times. May u please find where ıt is wrong? 


Could someone show me how to solve the following equations for real x, y and z.


x^2 + 2yz^2 = 0,

y^2  - 3xz = 0, 

1/3*x*y^2 + 2*y*z^3 = 0,

-1/3*y^4 - 6yz^4 = 0.


Hello Maple users friends,

I have two lines in the space (x,y,z) described by the equations in L1 and L2:


L1:= {4*x + 3*y + z = 0, x + y - z - 15 = 0}:

L2:={12*x + 5*y + 7*z -13 = 0, 9*x + y -3*z - 5 = 0}:

I would like the get the parametric (with z=t) equations P1 and P2 of the two lines..

I see the "form" of such parametric equations P1 and P2 using "solve"

solve(L1, {x, y}); solve(L2, {x,y});


but I do not know how to use those values to get my parametric equations P1 and P2 to continue with additional computation (area, volume etc).

Thanks for your attention and help.


Hi there,

I'm quite new to Maple so please forgive me! I have a system of partial differential equations I'm trying to solve in Maple as such below 


df/dt = f(1-f) - f * h

dg/dt = g(1-g) * Gradient(1-f * gradient(g))

dh/dt = (g - h) + Laplacian(h),

where f,g,h are functions of space and time (i.e. f(x,y,z,t)). I guess my first question is - is this possible in Maple to evaluate? (I'm currently unsure on ICs as I'm figuring it out from the model - it's a model for cancer growth I'm trying to evaluate but have a rough idea of what I'd use).

If it is possible, can you please share how I'd write this? Everytime I've tried I seem to be failing to define anything properly, so your expertise would be greatly appreciated!

Hi Maple Prime-ers!

I have a question about efficiency.  I have a set of algebraic equations with some polynomials, that I would like to solve at different points.  I've tried using a for-loop and a map-loop.  Here is a example:


n:=10000;  #Number of solving points
eq1:={b = ''a^2'', c = b^3/2, d = c^(1/2)*4 + b^2}; #Equation to solve

a := convert([seq(i,i=1..n)],Vector);  #timesteps

ans := Vector[column](n)

## Try solving in a for-next loop
t1 := time():
for q from 1 to n do
ans(q):=solve(subs({'a' = a(q)},eq1)):
t2 := time() - t1;

## try solving in a map loop
t1s := time():
ans_s := map(q->solve(subs({'a' = a(q)},eq1)),a);
t2s := time() - t1s;

On my computer (2.2Ghz, 2 cores), these both take 115s to solve.  Using Map over For-Next did not speed up computational speed.  

The problem I wish to tackle has 12 equations, invovles 5th order polynomials, and n ~= 300000.  Solving this set of equations takes 2-3 hours.

Anyone know a more efficient method?  Thanks for reading :D


I am trying to solve a set of equations for a Fluid dynamics problem and I cannot get a result...Any ideas why?

rho := 1.184;
nu := 1.562*10^(-5);
ID := .15;
L := 24.5;
Kl := 12.69;
Ho := 50.52;
a := 2.1*10^(-5);
E := 0.1e-2; alpha := 1.05;

sys := {Re = ID*V/nu, hl = (f*L/ID+Kl)*V^2/(2*9.81), Vflow = (1/4)*Pi*ID^2*V, Hrequired = alpha*V^2/(2*9.81)+hl, Hrequired = -a*Vflow^2+Ho, 1/sqrt(f) = -1.8*log[10](6.9/Re+(E/(3.7))^1.11)};

solve(sys*{Re, V, f, hl, Vflow, Hrequired});
Error, (in unknown) invalid input: Utilities:-SetEquations expects its 2nd argument, equations, to be of type set({boolean, algebraic, relation}), but received {{Re = (9603072983/1000000)*V, hl = (5096839959/100000000000)*((1633333333/10000000)*f+1269/100)*V^2, Vflow = (9/1600)*Pi*V, Hrequired = (5351681957/100000000000)*V^2+hl, Hrequired = -(21/1000000)*Vflow^2+1263/25, 1/f^(1/2) = -(9/5)*ln((69/10)/Re+27367561/250000000000)/ln(10)}}


I have theoretically 3(could eventually be more) layers with an incident wave with a wave equation for that wave.

It refracts into the 2nd layer from the first and now has a 2nd wave equation, then from the 2nd into the 3rd layer with a 3rd wave equation.

All the wave equations are of the form, Psi(z) = A_1psi_1(z) + B_1psi_2(z); this is just a general solution where psi_1&2 are linearly independant solutions that make up the general equation above and A_1 and B_1 are constant coefficients that would be A_2,B_2 and A_3,B_3 for the 2nd and 3rd layers respectively.

Transfer matrix method gives A_1,B_1 in terms of A_2,B_2(as it transfers from layer 1 to 2 they equate under boundary conditions so you can solve the simultaneous equations for results). You create a matrix of these results and multiply it with the respective matrix of the 2nd layer to 3rd layer to give you the overall transfer matrix from one side of the system to the other.

I think something to do with transfer function but not sure how to use it or set up the problem. 

Thanks in advance for any pointers.


I am trying to solve a system of equations with Maple 16, but it keeps returning an error message. I have the following very simple code:


assume(lambda > 0);
assume(kappa > 0);
assume(omega > 0);

assume(a >= 0);
assume(alpha, 'real');
assume(b >= 0);
assume(beta, 'real');
assume(m >= 0);
assume(mu, 'real');
assume(n >= 0);
assume(nu, 'real');
assume(t >= 0);
assume(tau, 'real');
assume(p >= 0);
assume(psi, 'real');
assume(d >= 0);
assume(delta, 'real');
assume(r >= 0);
assume(rho, 'real');
assume(x >= 0);
assume(xi, 'real');

solve({d^2*lambda^2+r^2*kappa^2+(x^2-1)*omega^2 = 0, (a^2-1)*lambda^2+m^2*kappa^2+t^2*omega^2 = 0, a*exp(-I*alpha)*b*exp(I*beta)*lambda^2+m*exp(-I*mu)*n*exp(I*nu)*kappa^2+t*exp(-I*tau)*p*exp(I*psi)*omega^2 = 0, a*exp(-I*alpha)*d*exp(I*delta)*lambda^2+m*exp(-I*mu)*r*exp(I*rho)*kappa^2+t*exp(-I*tau)*x*exp(I*xi)*omega^2 = 0, b*exp(-I*beta)*d*exp(I*delta)*lambda^2+n*exp(-I*nu)*r*exp(I*rho)*kappa^2+p*exp(-I*psi)*x*exp(I*xi)*omega^2 = 0}, {a, b, d, m, mu, n, nu, p, psi, r, rho, t, tau, x, xi, alpha, beta, delta}, useassumptions, maxsols = 10)



When this piece of code is executed, I receive the following error message:


Error, (in Engine:-Tarjan) invalid input: subs received {0 <= x_8, 0 <= x_10, 0 <= x_12}, which is not valid for its 1st argument


What does this mean? How can I find solutions to this system of equations? (I know that there exists at least one solution, and I am figuring out whether there exist more.)

Any help would be greatly appreciated.


Hi, i am trying to solve the equations denoted eq1 and eq2 for x and r.

f:=r*(8 - 2*x^2);
eq1:= g-x:
eq2:= expand(diff(g,x) + 1):

I am having a bit of trouble as these simultaneous equations have many solutions and using the command solve, just basically crashes maple. I just want the commands that would give the positive set of solutions only, ie. excluding all complex and negative solutions. 

Thanks in advance.


1 2 3 4 5 6 7 Last Page 2 of 51