Items tagged with equations equations Tagged Items Feed

This is better explained with simple example. Suppose I have these 2 equations

a:='a';b:='b';x:='x';
eqs:=[3*a+4*b = 3*x, 5*a+7*b = 7*x];

What I want is to solve for (a/x) and (b/x) from the above, and not for "a" and "b".

Currently, I do this manually as follows. First divide both equations by 'x' to obtain the ratio. I had to do this manually as writing eqs/x gave expression which was hard to work with for what I want to do. I could not simplify it for what I wanted. So I typed this

eqs2:=[3*(a/x)+4*(b/x)=3,5*(a/x)+7*(b/x)=7];   %manually typed !

Now used algsubs to replace (a/x) by new variable z1, and replace (b/x) by new variable z2, then solve for z1,z2 (btw, I had to do algsubs one at a time. (need to look at this later, but not impotant)

algsubs(a/x=z1,eqs2);
algsubs(b/x=z2,%);
solve(%,{z1,z2});

       {z1=-7,z2=6}

Is there a way or function(s) to automate this. The hard part is telling Maple to use the ratio as new variable starting from set of equations.

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:

>solve({2*x+3*y=7,5*x+8*y=9},{x,y}); 

in order to receive the answer 

{y=-17,x=29}.

 

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

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

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?  

hi all.
i have a system of ODE's including 9 set of coupled OED's . 

i have  converted second deravaties to dd2 , in other words : diff(a[i](t),t,t)=dd2[i](t) . i =1..9 :

and i have set these 9 equations in form of vibrational equations such :  (M.V22)[i]+(K(t).V(t))[i]+P(t)[i] = eq[i] , where M is coefficient Matrix of second  derivatives , V22 is Vector of second derivaties , for example V22[1] = diff(a[1](t),t,t) , and  P(t) is the numeric part of equations ( they are pure number and do not contain any symbolic function ) and K(t).V(t) is the remaining part of equations such that : (K(t).V(t))[i] = eq[i] - (M.V22)[i] - P(t)[i]  , and V(t) are vector of a[i](t)'s which V(t)[1] = a[1](t) ,

i have used step by step time integration method (of an ebook which i have attachted that part of ebook here), when i set time step of solving process to h=0.01 , i can solve this system up to time one second or more, but when i choose h=0.001 or smaller, the answer diverges after 350 steps . i do not know whether the problem is in my ODS system, or maple can not handle this ?the answer about the time t=0.3 are the same in both steps, but after that, the one with stpe time h=0.001 diverges. my friend has solved this in mathematica without any problem, could any body help me ?! it is urgent for me to solve this problem,thnx everybody.


ebook.pdf  step_=_0.001.mw  step_=_0.01.mw 

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

dsolve(sys1);

#THİS GAVE ME THE RESULTS LİKE THAT:

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

#SO THERE ARE 6 UNKOWN(C1...C6) SO I NEED 6 CONDITION. MY BOUNDRY CONDITIONS:

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.

Thanks

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.

JJ

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

 

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.

 

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