Items tagged with condition condition Tagged Items Feed

I'm trying to solve this system of ODEs by Laplace transform. 

> de1 := d^2*y(t)/dt^2 = y(t)+3*x(t)

> de2 := d^2*x(t)/dt^2 = 4*y(t)-4*exp(t)

with initial conditions 

> ICs := y(0) = 2, (D(y))(0) = 3, x(0) = 1, (D(x))(0) = 2

 

Using 

> deqns := de1, de2

and

> var := y(t), x(t)

 

I need to solve it for both y(t) and x(t), I have tried this by:

> dsolve({ICs, deqns}, var, method = laplace)

And

> dsolve({ICs, deqns}, y(t), method = laplace)

> dsolve({ICs, deqns}, x(t), method = laplace)

 

However I get this error message:

Error, (in dsolve/process_input) invalid initial condition

 

Any help is appreciated

I'm taking my first steps with maple and pdsolve, trying to run the example in the maplesoft support page:

http://www.maplesoft.com/support/help/Maple/view.aspx?path=examples/pdsolve_boundaryconditions

which reads

>
> restart; with(PDEtools);
> U := diff_table(u(x, t));
>

and I get a solution that is different from the web page, and when i run

Im using maple 13. Any tips about what's wrong?

 

regards

Hello everyone,

I'm trying to do some fitting using NonlinearFit, for the coefficients I know in advance, that they have to fulfill a condition (a+b>c+1). I couldn't find a way to make Maple take this condition into consideration while fitting my data. I tried to use Parameterrange to make the difference a+b-c+1 positive, this works for linear conditions like mine but leads to computational difficulties and errors like "no improved point could be found".

Thanks in advance,

Sören

hi

 

please help me :

 

 

restart; eq := diff(T(x, y), x) = a*(diff(T(x, y), `$`(y, 2)))/u(y); u := proc (y) options operator, arrow; (-1)*1.218493440*10^11*y^2+4.244913600*10^6*y+0.33e-1 end proc; eq; ICs := (D[1](T))(x, 0) = 1000, (D[1](T))(x, 0.25e-4) = 2000, T(0, y) = 0; T_sol := pdsolve({ICs, eq}, T(x, y)); T_sol

diff(T(x, y), x) = a*(diff(diff(T(x, y), y), y))/u(y)

 

proc (y) options operator, arrow; (-1)*1.218493440*100000000000*(y^2)+4.244913600*1000000*y+0.33e-1 end proc

 

diff(T(x, y), x) = a*(diff(diff(T(x, y), y), y))/(-0.1218493440e12*y^2+4244913.600*y+0.33e-1)

 

(D[1](T))(x, 0) = 1000, (D[1](T))(x, 0.25e-4) = 2000, T(0, y) = 0

 

Error, (in PDEtools:-Library:-NormalizeBoundaryConditions) unable to isolate the functions {T(0, y), (D[1](T))(x, 0), (D[1](T))(x, 0.25e-4)} in the given boundary conditions {T(0, y) = 0, (D[1](T))(x, 0) = 1000, (D[1](T))(x, 0.25e-4) = 2000}

 

T_sol

(1)

NULL

``

BC1 = diff(T(x, 0), y)=1000

BC2 = diff(T(x, 0.000025), y)=2000

IC = T(0,y)=0

where :

u(y)=-1.218493440*10^11*y^2+4.244913600*10^6*y+0.033

Download PDE_Sol.mw

How can I solve this problem on Maple?
Can anyone help me please ... I wrote another post before but I can not solve the problem.

lambda is an experimental parameter. I have this initial condition n(x,0)=0.4, c(x,0)=0.

Thanks to everyone

Dear Maple Users,

I'm beginner in Maple.

I have this system of Pde:

with lambda experimental parameter and n,c,v dependent variables. I write this on Maple but I read on internet that the solution "float(undefined)" is an error.

I will insert this initial condition: c(x,0)=0,n(x,0)=0.4

Thanks everybody

Level: Idiot (Me)

I have a matrix of 3 columns and lots of rows M

  • First column is latitude in degrees
  • Second column is longitude in degrees
  • Third column is data

So I set lambda:=M(..,1) and phi_g:=M(..,2) giving me two column vectors.

I want to convert lambda and phi_g to polar coordinates theta and phi

theta:=90-lambda produces "Error, (in rtable/Sum) invalid arguments"

WHY?

I also want to convert phi_g to phi where phi=phi_g when phi_g is 0...180 and phi=phi_g +360 when phi_g <0

How do I create a conditional function like this?

Is it possible to solve piecewise differential equations directly instead of separating the pieces and solving them separately.

like for example if i have a two dimensional function f(t,x) whose dynamics is as follows:

dynamics:= piecewise((t,x) in D1, pde1, pde2); where D1 is some region in (t,x)-plane

now is it possible to solve this system with one pde call numerically?

pde(dynamics, boundary conditions, numeric); doesnot work

restart;
Eq1 := diff(T1(t), t) = (W*Cp*(To-T1(t))+UA*(Ts-T1(t)))/(M*Cp);
Eq2 := diff(T2(t), t) = (W*Cp*(T1(t)-T2(t))+UA*(Ts-T2(t)))/(M*Cp);
Eq3 := diff(T3(t), t) = (W*Cp*(T2(t)-T3(t))+UA*(Ts-T3(t)))/(M*Cp);
sys := Eq1, Eq2, Eq3;

Operational Veriables

W := 100;
UA := 10;
Cp := 2;
M := 1000;
To := 20;
Ts := 250;

Initial Conditions

sys1 := {Eq1, Eq2, Eq3};

nsys := nops(sys1);

ics := {T1(0) = 20, T2(0) = 20, T3(0) = 20};
{T1(0) = 20, T2(0) = 20, T3(0) = 20}
nics := nops(ics);
for i from 1 to nics do Sol ||i:=dsolve({sys1, ics[i]},{T1(t),T2(t),T3(t)},numeric)od;
Error, unable to match delimiters
Typesetting:-mambiguous(Typesetting:-mambiguous( for i from 1 to

nics do Sol verbarverbariAssigndsolvelpar(sys1comma ics(i))

commalcubT1(t)commaT2(t)commaT3(t)rcubcommanumericrparod,

Typesetting:-merror("unable to match delimiters")))

 

im solving 6 ODE which is the equations are unsteady with boundary conditions.. the program can be run when A=0 but when A=0.2 or others value .. its cannot be run... A means for unsteadiness... before this i solve for steady equations.. this is first time i solve for unsteady using maple.. anyone know where i am wrong??? thanks for helping :)

 

restart; with(plots); n := 2; Ec := 2.0; Pr := .72; N := .2; M := .1; l := 1; Nr := 1; y := 1; blt := 2.5; B := .1; a1 := 1; rho := .5

Eq1 := diff(f(eta), eta, eta, eta)+f(eta)*(diff(f(eta), eta, eta))-(diff(f(eta), eta))^2+l*B*H(eta)*(F(eta)-(diff(f(eta), eta)))-M*(diff(f(eta), eta))-A*(diff(f(eta), eta)+.5*eta*(diff(f(eta), eta, eta))) = 0;

diff(diff(diff(f(eta), eta), eta), eta)+f(eta)*(diff(diff(f(eta), eta), eta))-(diff(f(eta), eta))^2+.1*H(eta)*(F(eta)-(diff(f(eta), eta)))-.1*(diff(f(eta), eta))-A*(diff(f(eta), eta)+.5*eta*(diff(diff(f(eta), eta), eta))) = 0

(1)

Eq2 := A*(F(eta)+.5*eta*(diff(F(eta), eta)))+G(eta)*(diff(F(eta), eta))+F(eta)^2+B*(F(eta)-(diff(f(eta), eta))) = 0;

A*(F(eta)+.5*eta*(diff(F(eta), eta)))+G(eta)*(diff(F(eta), eta))+F(eta)^2+.1*F(eta)-.1*(diff(f(eta), eta)) = 0

(2)

Eq3 := .5*A*(G(eta)+.5*eta*(diff(G(eta), eta)))+G(eta)*(diff(G(eta), eta))+B*(f(eta)+G(eta)) = 0;

.5*A*(G(eta)+.5*eta*(diff(G(eta), eta)))+G(eta)*(diff(G(eta), eta))+.1*f(eta)+.1*G(eta) = 0

(3)

Eq4 := G(eta)*(diff(H(eta), eta))+H(eta)*(diff(G(eta), eta))+F(eta)*H(eta) = 0;

G(eta)*(diff(H(eta), eta))+H(eta)*(diff(G(eta), eta))+F(eta)*H(eta) = 0

(4)

Eq5 := (1+Nr)*(diff(theta(eta), eta, eta))+Pr*((diff(theta(eta), eta))*f(eta)-2*(diff(f(eta), eta))*theta(eta))+N*Pr*a1*(theta1(eta)-theta(eta))/rho+N*Pr*Ec*B*(F(eta)-(diff(f(eta), eta)))^2/rho+Pr*Ec*(diff(f(eta), eta))^2-.5*A*Pr*(4*theta(eta)+eta*(diff(theta(eta), eta))) = 0;

2*(diff(diff(theta(eta), eta), eta))+.72*(diff(theta(eta), eta))*f(eta)-1.44*(diff(f(eta), eta))*theta(eta)+.2880000000*theta1(eta)-.2880000000*theta(eta)+0.5760000000e-1*(F(eta)-(diff(f(eta), eta)))^2+1.440*(diff(f(eta), eta))^2-.360*A*(4*theta(eta)+eta*(diff(theta(eta), eta))) = 0

(5)

Eq6 := 2*F(eta)*theta1(eta)+G(eta)*(diff(theta1(eta), eta))+a1*y*(theta1(eta)-theta(eta))+.5*A*(4*theta1(eta)+eta*(diff(theta1(eta), eta))) = 0;

2*F(eta)*theta1(eta)+G(eta)*(diff(theta1(eta), eta))+theta1(eta)-theta(eta)+.5*A*(4*theta1(eta)+eta*(diff(theta1(eta), eta))) = 0

(6)

bcs1 := f(0) = 0, (D(f))(0) = 1, (D(f))(blt) = 0, F(blt) = 0, G(blt) = -f(blt), H(blt) = n, theta(0) = 1, theta(blt) = 0, theta1(blt) = 0;

f(0) = 0, (D(f))(0) = 1, (D(f))(2.5) = 0, F(2.5) = 0, G(2.5) = -f(2.5), H(2.5) = 2, theta(0) = 1, theta(2.5) = 0, theta1(2.5) = 0

(7)

L := [0., .2, .5];

[0., .2, .5]

(8)

for k to 3 do R := dsolve(eval({Eq1, Eq2, Eq3, Eq4, Eq5, Eq6, bcs1}, A = L[k]), [f(eta), F(eta), G(eta), H(eta), theta(eta), theta1(eta)], numeric, output = listprocedure); Y || k := rhs(R[3]); YP || k := rhs(R[5]); YR || k := rhs(R[6]); YQ || k := rhs(R[7]); YA || k := rhs(R[9]); YB || k := rhs(R[8]) end do

Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging

 

P1 := plot([Y || (1 .. 3)], 0 .. 10, labels = [eta, (D(f))(eta)])

P2 := plot([YP || (1 .. 3)], 0 .. 10, labels = [eta, F(eta)])

plots:-display([P1, P2])

Error, (in plots:-display) expecting plot structures but received: [P1, P2]

 

``

 

Download unsteadyManjunatha.mw

Hi,

Please I need help in this subject. I would like to compare the numerical solution obtained by finite difference and pdsolve/numeric.

The equation considred is  diffusion Equation using Forward-time centered-space (FTCS) stencil
The code work well with Dirichlet boundary condition, but I want to let  x=-1  Dirichlet boundary condition but on x=1, we put a Neumann condition likeeval( diff(u(t,x),x),x=1)=1. Thank you very much to put the necessary in the attached code the changment.      
Many thinks.

Change_boundary_condition_in_procedure.mw    

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

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

im solving 4 ODe with boundary conditions.. i got this error Error, (in dsolve/numeric/bvp/convertsys) too few boundary conditions: expected 8, got 7


i want to find initial condition for F(0),G(0), H(0) and thetap(0) which is are missing in this problem.. then i facing this error Error, (in dsolve/numeric/bvp) Newton iteration is not converging



Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/hydronew2.mw .

Download hydronew2.mw

1 2 3 Page 1 of 3