Items tagged with solution solution Tagged Items Feed

Hi,

I have

Let

A:= sum(a[n]*phi(n)+b[n+1]*phi(n+2),n=0..N);

Please, I need to write this sum, using only phi(n), how can I use maple to get the solution.

Thank you very much for any idea.

 

 

 

 

 

 

 

What is the weak solution integral equation for 

du(x)/dx2 -(1+x2 ) u(x)-1=0

Dear all,

I need your help.

I compute the exact solution u(x,y,t) os PDE.
My code : PDEs.mw

I would like to plot the exact solution of my PDE.

My method work well but  when I put a:=1; b:=1; In the next lines there is no change, always I have a and b in my equation.

If i fix the time, "t=1 or 2 " for example; In the last lines i plot( u(x,y,2)); but doesn't work also.

Then animation in "t" how....

Thanks for your help.

 

 

 

 

I have a procedure which give an approximate solution for ode.

This our procedure

RKadaptivestepsize := proc (f, a, b, epsilon, N).

It's working ( afther some 3 mistake found by a member in Mapleprime).

Then I would like to compute the error between exact and approximate.

RKadaptivestepsize: compute the approximate solution

analyticsol: analytic solution

 

## here, I compute the error
for N from 2 by 2 to 500 do
dataerror:= N->evalf(abs(RKadaptivestepsize(f,0,1,epsilon,N)[1+N][2]-(eval(analyticsol, x = 1))));
##  sequence of data error
data[error] := [seq([N, dataerror(N)], N = 2 .. 500, 2)]:
if  data[error][k][2]<=epsilon then   
printf("%a  is the number of steps required using 3-step Runge Kutta Method to achieve an  eroor of 1e-6 .", k)
break ;
end if;   
end do;
end do;

But its gives an error.: Error, reserved word `error` unexpected

Have any one an idea.

 

Is it possible to find all the solutions of the equation

abs(tan(x)*tan(2*x)*tan(3*x))+abs(tan(x)+tan(2*x)) = tan(3*x)

which belong to the interval 0..Pi with Maple?

 

 

Hi, the title isn't great as I didn't know how to describe this really. I need to solve the following equation for b:

y = (1-exp(-x*b))/(1-exp(-50*b))

When I put a value for y in, this is fine and fsolve gives me a numeric real solution. However, even when using RealDomain, it does not give me a real solution if I leave y as it is, and instead gives a 'RootOf' solution, which I don't really understand. This is the same whether using solve or isolate:

b=-(1/50)RootOf(_Zx-50ln(-y+ye^(_Z)+1))

I have the values of x and y for multiple data points and can put them in an nx1 matrix. Is there a way to replace x and y with matrices (with real numbers in) and solve for each set of points for b (ie there would be n values of b)? Obviously I could go through and put in each value of x and y but this would take ages, so was just wondering if there's a quick way to do this.

I have tried by simply putting matrices instead of the letter but get the error:

Error, invalid input: exp expects its 1st argument, x, to be of type algebraic, but received Vector(50, {(1) = -50*b, (2) = -49*b,...

Thanks for your time

James

Hi,

I have an ode like this

ODE:=(diff(T(x), x, x))+P*(S+a*(1-exp(-L*x))/L)*(diff(T(x), x))=0;

bcs:=T(0)=1,T(infinit)=0;

where P, S, L a, are all constants.

let assume that 

z=P/L^2*exp(-L*x);

subing z into the ode, we can have

ode1:=diff(T(z), z$2)+(1+z*a-P)*(diff(T(z), z)) = 0;

bcs1:=T(P/L^2)=1,T(0)=0;

Is it possible to find a closed form solution (T(x) in a compact form)?

Hi all

I have following program to solve time delay system...

the solution is good by choosing r:=11... but for r greater than 11(e.g r=20) the system take about4-5 minute to do and then it says:"" K2:=simplify(inverse(K1)):Error, (in minor) object too large""
and for plotting says:""     Warning, unable to evaluate 1 of the 2 functions to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct""

i don't know what is the problem?

any one can help me???

best wishes

 

> restart:
> with(plots):
> with(linalg):
> with(LinearAlgebra):
> L:=1:
> r:=20:
> tau:=0.3:
> #definition of exact solution
>
> T1 := piecewise(t<0,0,t>=0 and t<0.3,1+t^2,t>=0.3 and t<0.6,(691/1000)+(109/100)*t+(7/10)*t^2+(1/3)*t^3,0.6<=t and t<0.9,(4409/5000)+(209/500)*t+(69/50)*t^2+(2/15)*t^3+(1/12)*t^4,0.9<=t and t<1,(1500917/2000000)+(35107/40000)*t+(1617/2000)*t^2+(87/200)*t^3+(1/120)*t^4+(1/60)*t^5):
> plot(T1,t=0..1,numpoints=10000,discont = true):
> g:=t^2:
> a[0]:=evalf((1/L)*Int(g,t=0..L)):
> for i1 from 1 to r do
> a[i1]:=evalf((2/L)*Int(g*cos(2*i1*Pi*t/L),t=0..L)):
> od:
> for j1 from 1 to r do
> b[j1]:=evalf((2/L)*Int(g*sin(2*j1*Pi*t/L),t=0..L)):
> od:
> X00:=matrix([[a[0]]]);
> X10:=matrix(1,r,0):
> for j from 1 to r do
> X10[1,j]:=a[j]:
> od:
>
> X20:=matrix(1,r,0):
> for j from 1 to r do
> X20[1,j]:=b[j]:
> od:

X00 := [0.3333333333]

> X00:=blockmatrix(1,3,[X00,X10,X20]):
>
>
>
> Z:=linalg[matrix](2*r+1,2*r+1):
> Z[1,1]:=tau:
> for iz from 2 to r+1 do
> Z[iz,1]:=(L/(2*(iz-1)*Pi))*sin(2*(iz-1)*Pi*tau/L):
> od:
> for iz from r+2 to 2*r+1 do
> Z[iz,1]:=(L/(2*(iz-1-r)*Pi))*(1-cos(2*(iz-1-r)*Pi*tau/L)):
> od:
> for jz from 2 to 2*r+1 do
> for iz from 1 to 2*r+1 do
> Z[iz,jz]:=0;
> od:
> od: 
> Dtau00:=matrix([[1]]):
> Dtau01:=matrix(1,r,0):
> Dtau02:=matrix(1,r,0):
> Dtau10:=matrix(r,1,0):
> Dtau20:=matrix(r,1,0):
>
> Dtau1:=linalg[matrix](r,r):
> for i from 1 to r do
> for j from 1 to r do
> Dtau1[i,i]:=cos(2*(i)*Pi*tau/L):
> if i<>j then Dtau1[i,j]:=0 fi:
> od:
> od:
>
> Dtau2:=linalg[matrix](r,r):
> for i from 1 to r do
> for j from 1 to r do
> Dtau2[i,i]:=sin(2*(i)*Pi*tau/L):
> if i<>j then Dtau2[i,j]:=0 fi:
> od:
> od:
>
> Dtau3:=linalg[matrix](r,r):
> for i from 1 to r do
> for j from 1 to r do
> Dtau3[i,i]:=-sin(2*(i)*Pi*tau/L):
> if i<>j then Dtau3[i,j]:=0 fi:
> od:
> od:
>
> Dtau4:=linalg[matrix](r,r):
> for i from 1 to r do
> for j from 1 to r do
> Dtau4[i,i]:=cos(2*(i)*Pi*tau/L):
> if i<>j then Dtau4[i,j]:=0 fi:
> od:
> od:
>
> Dtau:=blockmatrix(3,3,[Dtau00,Dtau01,Dtau02,Dtau10,Dtau1,Dtau2,Dtau20,Dtau3,Dtau4]):
>
> P00:=matrix([[L/2]]):
> P01:=matrix(1,r,0):
>
> P02:=matrix(1,r,0):
> for j from 1 to r do
> P02[1,j]:=-L/(j*Pi):
> od:
>
> P10:=matrix(r,1,0):
>
> P20:=matrix(r,1,0):
> for i from 1 to r do
> P20[i,1]:=L/(2*i*Pi):
> od:
>
>
> P1:=linalg[matrix](r,r):
> for i from 1 to r do
> for j from 1 to r do
> P1[i,j]:=0
> od;
> od;
> P2:=linalg[matrix](r,r):
> for i from 1 to r do
> for j from 1 to r do
> P2[i,i]:=L/(2*i*Pi):
> if i<>j then P2[i,j]:=0 fi:
> od:
> od:
>
> P3:=linalg[matrix](r,r):
> for i from 1 to r do
> for j from 1 to r do
> P3[i,i]:=-L/(2*i*Pi):
> if i<>j then P3[i,j]:=0 fi:
> od:
> od:
>
> P4:=linalg[matrix](r,r):
> for i from 1 to r do
> for j from 1 to r do
> P4[i,j]:=0:
> od:
> od:
>
> P:=blockmatrix(3,3,[P00,P01,P02,P10,P1,P2,P20,P3,P4]):
> I1:=Matrix(2*r+1,shape=identity):
> K1:=simplify(evalm(I1-Dtau&*P+Dtau&*Z)):
> K2:=simplify(inverse(K1)):
Error, (in minor) object too large

>
> X0:=matrix(1,2*r+1,0):
> X0[1,1]:=1:
> for j from 2 to 2*r+1 do
> X0[1,j]:=0:
> od:
>
> X:=simplify(evalm(evalm((X0+X00))&*K2)):
>
> for h from 1 to r do
> f1(h):=cos(2*h*Pi*t/L):
> od:

> for k from 1 to r do
> f2(k):=sin(2*k*Pi*t/L):
> od:
> XP:=X[1,1]+evalf(sum(X[1,l+1]*f1(l)+X[1,r+l+1]*f2(l),l=1..r )):
> plot({XP,T1},t=0..1);
Warning, unable to evaluate 1 of the 2 functions to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

 

restart;

diffeq := diff(w(r), `$`(r, 1))+2*beta*(diff(w(r), `$`(r, 1)))^3-(1/2)*S*(r-m^2/r) = 0;

con := w(1) = 1;

ODE := {con, diffeq};

sol := dsolve(ODE, w(r), type = numeric);

 

How can i have numerical solution of the above differential equation with corresponding boundary condition?

 

hello,

I'm trying to solve the equation of a form like,

diff(eta(tau), tau, tau)+(8/(4*tau^2+1)-32/(4*tau^2+1)^2)*eta(tau) = 0,

when I'm doing solve DE, I get a solution as:=

eta(tau) = _C1*sqrt(4*tau^2+1)*LegendreP((1/2*I)*sqrt(7)-1/2, I*sqrt(7), (2*I)*tau)+_C2*sqrt(4*tau^2+1)*LegendreQ((1/2*I)*sqrt(7)-1/2, I*sqrt(7), (2*I)*tau

which is combination of Legendre Polynomials with imaginary arguments,May I change this form,

How can I plot this solution on real plane, as this is imaginary,

Is the only option remaining NUMERIC PLOT??

Hi MaplePrimers,

I'm trying to solve a system of algebraic equations using 'solve' [float].  I'd prefer to use 'solve' over 'fsolve', as 'solve' solves my system in about 0.05s, whereas fsolve takes about 5 seconds.  I need to solve the system repeatedly at a different points, so time is important.  I don't know why there is such a large difference in time ... 

I have a few piecewise functions of order 3 to 5.  It solves fine with the other (piecewise) equations, but adding one piecewise function which gives me an error while trying to solve:

Error, (in RootOf) _Z occurs but is not the dependent variable.

I think this is due to solve finding multiple solutions.  Is there a way to limit solve to only real solutions?

Thanks in advance!

Hi everyone,

I have been  trying to solve a coupled system of 2 differencial equations, 1 PDEs with 1 ODE.

The code is below.

> restart;

> with(linalg):with(plots):
> PDE:=[diff(x(z,t),t)=(a/Pe)*diff(x(z,t),z$2)-a*diff(x(z,t),z)-(1-epsilon)/epsilon*3*Bi*(x(z,t)-1)/(1-Bi*(1-1/ksi(z,t)))]:
> a=2:Pe=3:Bi=5:epsilon=0.85:

> ODE := [diff(ksi(z,t),t) = (b*Bi*x(z,t)-1)/ksi(z,t)^2/(1-Bi*(1-1/ksi(z,t)))]:
> IC1:=c(z,0)=0:
> IC2:=ksi(z,0)=1:
> bc2:=diff(x(z,t),z):
> bc1:=x(z,t)-1/pe*diff(x(z,t),z):
> N:=10:
> L:=1:
> dyduf:=1/2*(-x[2](t)-3*x[0](t)+4*x[1](t))/h:
> dydub:=1/2*(-x[N-1](t)+3*x[N+1](t)+4*x[N](t))/h:
> dydu:=1/2/h*(x[m+1](t)-x[m-1](t)):
> d2ydu2:=1/h^2*(x[m-1](t)-2*x[m](t)+x[m+1](t)):
> bc1:=subs(diff(x(z,t),z)=dyduf,x(z,t)=x[0](t),z=1,bc1):
> bc2:=subs(x(z,t)-1/pe*diff(x(z,t),z)=dydub,x(z,t)=x[N+1](t),t=0,bc2):
> eq[0]:=bc1:
> eq[N+1]:=bc2:
> eq[m]:=subs(diff(x(z,t),z$2)=d2ydu2,diff(x(z,t),z)=dydu,diff(x(z,t),t)=dydu,x(z,t)=x[m](t),z=m*h,PDE):
> for i from 1 to N do eq[i]:=subs (m=i,eq[m]);od:
> x[0](t):=(solve(eq[0],x[0](t)));

> x[N+1](t):=solve(eq[N+1],x[N+1](t));

> for i from 1 to N do eq[i]:=eval(eq[i]);od:
> eqs:=[seq((eq[i]),i=1..N)]:
> Y:=[seq(x[i](t),i=1..N)];

> A:=genmatrix(eqs,Y,'B1'):
Error, (in linalg:-genmatrix) equations are not linear

> evalm(B1);

[B1[1], B1[2], B1[3], B1[4], B1[5], B1[6], B1[7], B1[8], B1[9],

B1[10]]

> B:=matrix(N,1):for i to N do B[i,1]:=B1[i]:od:evalm(B);

> h:=eval(L/(N+1));

 

> A:=map(eval,A);

 

> if N > 10 then A:=map(evalf,A);end:
> evalm(A);

 

> mat:=exponential(A,t);
Error, (in linalg:-matfunc) input must be a matrix

> mat:=map(evalf,mat):
> Y0:=matrix(N,1):for i from 1 to N do
> Y0[i,1]:=evalf(subs(x=i*h,rhs(IC)));od:evalm(Y0);
Error, invalid input: rhs received IC, which is not valid for its 1st argument, expr

 

> s1:=evalm(Y0+inverse(A)&*b):
Error, (in linalg:-inverse) expecting a matrix

> Y:=evalm(mat&*s1-inverse(A)&*b):
Error, (in linalg:-inverse) expecting a matrix

> Y:=map(simplify,Y):
> Digits:=5;

Digits := 5

> for i from 1 to N do x[i](t):=evalf((Y[i,1]));od:
Error, invalid subscript selector

> for i from 0 to N+1 do x[i](t):=eval(x[i](t));od;

 

> setcolors(["Red", "Blue", "LimeGreen", "Goldenrod", "maroon",
> "DarkTurquoise", "coral", "aquamarine", "magenta", "khaki", "sienna",
> "orange", "yellow", "gray"]);

["Red", "LimeGreen", "Goldenrod", "Blue", "MediumOrchid",

"DarkTurquoise"]

> pp:=plot([seq(x[i](t),i=0..N+1)],t=0..10,thickness=4);pt:=textplot([[0.28,0.15,typeset("Follow the arrow: ",x[0],"(t), ..., ",
> x[N+1],"(t).")]]):
Warning, unable to evaluate the functions to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct


pp := PLOT(THICKNESS(4), AXESLABELS(t, ""),

VIEW(0. .. 10., DEFAULT))

> display([pp,pt,arw],title="Figure 5.13",axes=boxed,labels=[t,"x"]);
Error, (in plots:-display) expecting plot structures but received: [arw]

 

In advance, thanks for the time of reading it!

Regards

Ozlem

Hi, i'm trying to solve the simultaneous equations,

a[1]:=2*x^2 + 3*x^2 + x*y - x^2 + x;

a[2]:=3*y^2 + 4*x^2 - y;

eval(y,fsolve({a[1],a[2]},{x,y}));
0.

Even though y can be 0 it can also be 1/3 and two other complex numbers.

How do you get fsolve to show all four y solutions.

Secondly, how would i get maple to just to show the positive y solution ie. 1/3 only.

Using the fsolve commmand how does one solve for just the positive solutions and remove the dublicate values?

Thanks

1 2 3 4 5 6 7 Page 1 of 7