# Items tagged with equationsequations Tagged Items Feed

### How do I solve this system of PDEs in Maple?...

February 13 2014
1 3

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!

### Efficient method of repeatedly solving equations?...

February 11 2014
0 3

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)):
od:
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

### 6 equations , 6 unknowns?...

January 06 2014
0 1

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)}}

### How would I code the transfer matrix method?...

December 13 2013
0 0

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.

### How to solve this system of equations with Maple?...

December 12 2013
1 4

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.

### complicated simultaneous equations ...

December 08 2013
2 3

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

f:=r*(8 - 2*x^2);
g:=subs(x=f,f):
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.

### nonlinear equations with newoton newton...

December 03 2013
1 6

hi guys i want to solve this equation with maple please help me

eq[1]:=0.223569c_1+2.35589c_2*c_1^2+0.002356c_1*c_2^2;

eq[2]:=1.277899c_1*c_3-2.350023c_2*c_3^2+7.5856c_3*c_2^2;

eq[3]:=3.225989c_1^2+-2.35589c_3*c_1^2-7.28356c_3*c_2^3;

i want solve those equations with newton method

### simplify equations...

November 30 2013
1 7

I am using maple (version 12) for the first time.  I want equations of x and y ( in terms of a) from these two given equations. The equations I got are very complex, how to simplify these equations?

Equation#1 is:

Equation#2 is:

From Equation#1, i find "y"

Now i put y in Equation#2

and from that euation, i can get x

but these equations are very complex..

I simply want to find the equations of x and y..
How to simplify it?

### Perimeter and area of a triangle are integer numbe...

November 26 2013
1 6

In geom3d. I want to find the vertices A(x1,y1,z1), B(x2,y2,z2), where x1, y1, z1, x2, y2, z2 are integer numbers so that the triangle OAB  (O is origin) and perimeter and area are integer numbers. I tried

> resrart:

N:=5:

L:=[]:

for x1 from -N to N do

for y1 from x1 to N do

for z1 from y1 to N do

for x2 from -N to N do

for y2 from -N to N do

for z2 from -N to N do

a:=sqrt(x1^2+y1^2+z1^2):b:=sqrt(x2^2+y2^2+z2^2):c:=sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2):

p:=(a+b+c)/2:

S:=sqrt(p*(p-a)*(p-b)*(p-c)):

if type(2*p, integer) and type(S, posint)

then L:=[op(L), [[0, 0, 0], [x1, y1, z1], [x2, y2, z2]]]: fi:

od: od: od: od: od: od:

nops(L);

But my computer runs too long. I can not receive the result. How to get the answer?

If I the length of the side are 6, 25, 29. I tried

DirectSearch:-SolveEquations([(x2-x1)^2+(y2-y1)^2+(z2-z1)^2 = 6^2, (x3-x2)^2+(y3-y2)^2+(z3-z2)^2 = 25^2,  (x3-x1)^2+(y3-y1)^2+(z3-z1)^2 = 29^2], {abs(x1) <= 30, abs(x2) <= 20, abs(x3) <= 20, abs(y1) <= 20, abs(y2) <= 20, abs(y3) <= 20, abs(z1) <= 20,abs(z2) <= 20, abs(z3) <= 20}, assume = integer, AllSolutions, solutions = 1);

### changing coordinates and implicitplot...

November 25 2013
1 3

I used implitplot to plot solutions to some (tricky) equations in 2 variables, of the form implicitplot([f(x,y)=0]).  Now I have a (tricky) change of parameterization G:R^2->R^2 of the form G(x,y)=(g(x,y),h(x,y)). I'd like to plot the image of the solution set of f(x,y)=0 under the map G. Of course, if I could invert G I'd implicitplot           G^(-1)(f(x,y))=0, but the functions I have dont lend themselves to this.

Presumably MAPLE stores the points it plots somewhere, and I should be able to apply G to this set of points. But I don't know how to approach this. Anybody know?

### Simplified expression difference should be equal ...

November 23 2013
1 5

eq1:=
(1/4)*D^2*Pi-(1/4)*D^2*arccos((-D+2*h)/D)-(1/2)*sqrt(h)*sqrt(D-h)*D+h^(3/2)*sqrt
(D-h);

eq2 :=
-(1/2)*sqrt(h)*sqrt(D-h)*D+h^(3/2)*sqrt(D-h)+(1/4)*D^2*arcsin((-D+2*h)/D)+(1/8)*
D^2*Pi;

These equations are the same. yet simplify(eq1-eq2,trig);
<>0
The Mathematica COMMAND FullSimplify[..] gets zero.

### Solving of 4 differential equations simulateously...

November 18 2013
0 2

Hi everyone,

I am a new user of maple and i want to know the procedures to follow when solving 4 differential equations simultaneously.

e.g

ds/dt=Λ0-βcSI/N-μS

dL/dt=Λ1+βcSI/N-μ1L+ΑcIT/N

dI/dt=kL-μ2I

dT/dt=r1L+r2I-ΑcIT/N-μT

Any help will be highly appreciated. Regards

### Solving for coefficients of polynomial equations...

November 02 2013
1 12

Suppose I have a set of P polynomial equations in terms of N variables which are the coefficients of the equations. The equations are generated by the main program and are not known beforehand.

Example (P = 2):

e1 := c1 + 2*c2 + (c3+3*c4)*x*y + (c5+c6)*y^2 +(c8-2)*y^3*x^2 = 0;
e2 := (c4 + 2*c5 + c7)*x + (c9+ 2*c3+5*c4)*x^2 + (2*c7+5*c5+c6)*y^2*x^3 =0;

Because e1 and e2 must be zero for all x and y this implies that all the coefficients must be zero:

c1 + 2*c2 = 0
c3+3*c4 = 0 etc

This gives M linear equations in terms of N unknowns with N > M.

Given the P equations is there a way to automatically set up the M equations and solve for the N unknowns? In some cases it is possible that there are specific values of some of the c's eg c8 = 2 otherwise some of the c's will be expressed in terms of the other c's eg c1 = - 2*c2.

Thanks.

### how to apply dsolve to set of diff. equations in M...

October 29 2013
6 12

Suppose one sets a system of differental equations in vector form, say 2 ODE's, like this:

restart;
with(LinearAlgebra):
ode:=Vector([diff(x(t),t),diff(y(t),t)])=Vector([2*x(t)+y(t),3*y(t)-x(t)]);

Then to solve these, what would be an easy way to do it, without having to rewrite them again manually as a set, as what one would normally do. Clearly one needs to map dsolve, and also convert the vectors to a set somewhere? I am not able to get the syntax right.

Is there an easy way to automatically convert/rewrite the above to

ode2:= diff(x(t),t)=2*x(t)+y(t)  ,   diff(y(t),t)=3*y(t)-x(t);

so that I can just do

dsolve({ode2},{x(t),y(t)});

Or, a way to map dsolve directly into the first from as shown?( the Vector = Vector form).

### Is there anyone interested in the algorithm to red...

October 15 2013 Maple 15
1
15

Himmelblau.mw

On the basis of Dragнilev method…

Is there anyone interested in the algorithm to reduce the distance between the points of the given constraints? The algorithm is adapted for use in R ^ n. This is an example of its work on the surface:
f = - (x1 ^ 2 x2-.3) ^ 2 - (x1 x2 ^ 2-.7) ^ 2 - 5;

Approximate description of the algorithm in pictures.

 4 5 6 7 8 9 10 Last Page 6 of 54
﻿