Items tagged with linear

Hello! 

For the last couple of days I've been trying really hard to solve the linear PDE 

dR/dt = -dRdH/dqdp + dRdH/(dpdq) . Where R is a function R(t,q(t),p(t)) and H is the hamiltonian H=  p^2/2 +q^2 +2*q .

(dH/dp= p and dH/dq= -2q-2), q and p depends on the time t, and I'm supposed to solve the PDE and then plot the gaussian distribution (2D). 

I tried doing this:

pde := diff(R(t, q1(t), p1(t)), t) = -(diff(R(t, q(t), p(t)), q(t)))*p(t)+(diff(R(t, q(t), p(t)), p(t)))*(-2*q(t)-2)

But pdsolve(pde) gives me:  "Error, (in pdsolve/info) the name of the indeterminate function must be given". 

When I change q(t) to q and p(t) to p I get:

R(t, q, p) = _F1(p^2-2*q^2-4*q, -(1/2)*ln(sqrt(2)*q+p+sqrt(2))*sqrt(2)+t)

And then I'm lost. How do I solve this PDE in maple? 

Thankful for any help 

 

 

The following program hangs on the last command and a hard restart is required. The computation of a 2 x 2 matrix times a 2-vector is not that hard. Any ideas as to what is happening?

Another question: if v is a vector that depends on x and y say why does
>solve(v=0,{x,y})
not work?

It should only take a few lines of code to change v=0 to the system {components of v = 0}

Hi, so I have few problems here. I need to;

Create a MxN Matrix/Lattice, where N and M can be any positive integer, that contains a random selection of -1/1s at each entry.

Need to sum every entry, then multiply by -1 to find “H”.

Need to multiply each neighbour to find its bond energy, so if it’s the same you get 1 else -1, but only its direct neighbours once, so if it was a 2x2 matrix there would be only 4 values and then sum them.

I don’t seem to be able to set up the code so that it does it for any size matrix, as I only know how to write it out basic for a 2x2. Also, not so important, but I wanted to know if could create a loop that would find every iteration of possible setups i.e. for a 2x1 you can have 1.1, -1.1, 1.-1, -1.-1. And then give the solutions outlined earlier for each of the the possibilities [There being 2MxN ]

Cheers in advance.

 

 

 

I have tried to solve a matrix with the function "LinearSolve" as seen in the picture, but instead of solving it just gives me back the operation i wrote (3). My which is to solve an equation system a quick as possible - have a templet fill in the matrix and press enter. I thought this "LinearSolve" function was the easiest way of doing. I know that I can right click and choose the function, but I want it as a command.

 

Any solutions on how to use the "LinearSolve" command to solve an equation system?

 

Hello Everyone,

May I ask you about this  "Error,   (in pdsolve/numeric/process_PDEs)  number of dependent variables and number of PDE must be the same". Does anyone have idea about solving linear instability equation (flow inside pipe, oscillating flow) ?

Thank you,

 

 

 

Hi,
I am solving large systems of linear equations (mod 2) which are of this form ,
systems:= {0 = f[[1, 4]]-f[[1, 3]], 0 = f[[1, 5]]-f[[1, 3]], 0 = f[[1, 5]]-f[[1, 4]], 0 = f[[1, 6]]-f[[1, 3]], 0 = f[[1, 6]]-f[[1, 4]], 0 = f[[1, 6]]-f[[1, 5]], 0 = f[[1, 7]]-f[[1, 3]], 0 = f[[1, 7]]-f[[1, 4]], 0 = f[[1, 7]]-f[[1, 5]], 0 = f[[1, 7]]-f[[1, 6]], 0 = f[[2, 4]]-f[[1, 3]], 0 = f[[2, 5]]-f[[1, 3]], 0 = f[[2, 5]]-f[[1, 4]], 0 = f[[2, 6]]-f[[1, 3]], 0 = f[[2, 6]]-f[[1, 4]], 0 = f[[2, 6]]-f[[1, 5]], 0 = f[[2, 6]]-f[[2, 4]], 0 = f[[2, 6]]-f[[2, 5]], 0 = f[[2, 7]]-f[[1, 3]], 0 = f[[2, 7]]-f[[1, 4]], 0 = f[[2, 7]]-f[[1, 5]], 0 = f[[2, 7]]-f[[1, 6]], 0 = f[[2, 7]]-f[[2, 4]], 0 = f[[2, 7]]-f[[2, 5]], 0 = f[[3, 1]]-f[[1, 4]], 0 = f[[3, 1]]-f[[1, 5]], 0 = f[[3, 1]]-f[[1, 6]], 0 = f[[3, 1]]-f[[2, 7]], 0 = f[[3, 5]]-f[[1, 4]], 0 = f[[3, 5]]-f[[1, 5]], 0 = f[[3, 5]]-f[[2, 4]], 0 = f[[3, 5]]-f[[2, 5]], 0 = f[[3, 6]]-f[[1, 3]], 0 = f[[3, 6]]-f[[1, 4]], 0 = f[[3, 6]]-f[[1, 5]], 0 = f[[3, 6]]-f[[1, 6]], 0 = f[[3, 6]]-f[[2,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7]], 1 = f[[6, 3]]-f[[4, 7]], 1 = f[[6, 4]]-f[[4, 7]], 1 = f[[7, 1]]-f[[3, 7]], 1 = f[[7, 1]]-f[[4, 7]], 1 = f[[7, 1]]-f[[5, 7]], 1 = f[[7, 2]]-f[[4, 7]], 1 = f[[7, 3]]-f[[5, 7]], 1 = f[[7, 4]]-f[[5, 7]]};


I have been using msolve as follows; msolve(systems,2);  which returns NULL if there is no solution. This however takes a lot of my computer memory and also take a lot of time since the equations are very many.  I decided to try LinearSolve, but it doesn't give me any solutions even for the ones that I know that the solutions exist. My code was writen as follows:

systems:=as above..

vars := [f[[1, 3]], f[[1, 4]], f[[1, 5]], f[[1, 6]], f[[1, 7]], f[[2, 4]], f[[2, 5]], f[[2, 6]], f[[2, 7]], f[[3, 1]], f[[3, 5]], f[[3, 6]], f[[3, 7]], f[[4, 1]], f[[4, 2]], f[[4, 6]], f[[4, 7]], f[[5, 1]], f[[5, 2]], f[[5, 3]], f[[5, 7]], f[[6, 1]], f[[6, 2]], f[[6, 3]], f[[6, 4]], f[[7, 1]], f[[7, 2]], f[[7, 3]], f[[7, 4]]];

A,b:=GenerateMatrix(systems,var):
LinearSolve(A,b) mod 2;
what I'm I doing wrong? How can I make this fast and in such a way that the solution is computed without taking too much memory?

I also understand that LinearSolve returns the following when there is no solution, "Error, (in LinearAlgebra:-LinearSolve) inconsistent system
", in my case, if there is no solution, I don't want that error to be printed, but I want some variable (call it x) to be printed if a solution is found.

Any help is appreciated.

Vic.

Trying to solve this IVP of the SHO  (second order linear costant-coefficient).

Everything works fine until I come to the solving even after using dsolve with initial conditions (even using the differential operator D in the initial conditions)  , the answer still contains _C1, an unknown constant.

The full worksheet is below.  The code for dsolve is:

sol3 := dsolve(subs(par1, {de1, D(x)*0 = 0, x(0) = 1}), x(t));

 

Hoping you can help with a solution.

 

 

 

 

Hello Dear!

I want to solve the system of linear equation but facing some problem please see the attachmen. I am waiting your positive response 

1_(1).mw

Hi,

 

I am trying to solve a simple system of the form AX=0, where A is a N*N matrix, X is an N*1 vector (and the right-hand side of the equation is an N*1 vector of zeros, I apologize for the inexact notation). The difficulty comes from the fact that the values of A are parameterized by 2*N parameters (that I will write as the 2*N vector P), and I would like to get a solution in the form X=f(P).

 

One solution is to try to use LinearAlgebra[LinearSolve], but it only returns the trivial solution X=0, which I am not interested in.

Another solution is to compute analytically the Moore-Penrose pseudoinverse Ag of A, as the general solution is of the form

(I - Ag A)f ;

where f is a vector of free parameters. However, even for a small matrix size (N=4), Maple is still computing after 3 hours on my (fairly powerful) machine, and it is taking more and more memory over time. As the results are polynomial/rational equations in the parameters P, I was actually expecting Maple to be more powerful than other softwares, but for this particular problem, Matlab's symbolic toolbox (muPAD) gives quick solutions until N=6. I need, in the end, to solve additional polynomial/rational equations that are derived from the solutions X=f(P), where Matlab fails. This is why I would really like to be able to solve the above-mentioned problem AX=0 with Maple in order to try to solve the subsequent step of the problem (polynomial system) with Maple.

 

Any suggestions on how to do this would be highly appreciated! Thank you very much for your time and help.

 

Laureline

Hello..  I want to know if there is anny command to show the matrix of linear system.  I recently entred a 64 equations and i solved it by command solve,  but i want to show the matrix of system..  So plz. Help 

I have an equation eq := diff(y(x), x$3)+3*diff(y(x), x$2)+12*y(x);

dsolve(eq, y(x)); gave me a general solution.

I tried to get a particular solution using dsolve({eq, y(0) = a, y'(0)=0, y"(0) = 0}, y(x));

But I got Error, (in dsolve) not a system with respect to the unknowns [y(x)].

Thank you for any help.

Heather

Does any one know if you can extract the linear graph from a Maple Sim model?  And by linear graph I mean the alternative to a a bond graph, not a type of plot.

I solve a linear system of equations which is rank deficient. Naturally, when Maple solves it symbolically, it chooses some of its variables to use them as a basis to express the solution. 

In a specific problem I'm solving, the basis chosen by Maple is -very- smart, showing a good exploitation of the problem structure. 

I'm curious as to what kind of factorization is used by default, or if there's a lot of by hand "black magic" involved, what are its general characteristics. 

 

Best regards

Claudio

After manually working out answer for problem 4-4 in Mathews & Walker's Mathematical Methods of Physics , I tried to check my solution with maple2015. Briefly the problem involves inputs periodic with period T, being transformed into outputs, through a kernal G.  The net result is that all input frequencies omega periodic in T are multiplied by (omega_0/omega)^2, except for constant frequency which transforms to zero.  The problem asks to evaluate the kernal G.

Maple2015 correctly evaluated the integral for a constant input, a cosine input, and a sine input, but gave undefined when I tried an exponential(i*x) input which is just a linear combination of the two previous inputs.  I found this interesting because the integral is finite, well defined, and only has an absolute function (in the kernal), which may cause Maple problems, as it correctly evaluated integral when I split it into two regions.  Interestingly if instead of working with a period of T, I used 2*pi, and redfined my G function accordingly, Maple evaluated the exp input integral without any problems.  So the problem appears to be with the T variable, but I correctly used assumptions of T>0, and 0<t<T, so I am not sure why it would work correctly when I use T=2*pi, but failed when using a general period T.  Any help would be welcome.

 

 

restart

assume(T > 0)

assume(0 < t and t < T)

about(T)

Originally T, renamed T~:

  Involved in the following expressions with properties
    T-t assumed RealRange(Open(0),infinity)
  is assumed to be: real
  also used in the following assumed objects
  [T-t] assumed RealRange(Open(0),infinity)

 

about(t)

Originally t, renamed t~:

  Involved in the following expressions with properties
    T-t assumed RealRange(Open(0),infinity)
  is assumed to be: RealRange(Open(0),infinity)
  also used in the following assumed objects
  [T-t] assumed RealRange(Open(0),infinity)

 

assume(n::integer, n > 0)

about(n)

Originally n, renamed n~:

  is assumed to be: AndProp(integer,RealRange(1,infinity))

 

G := proc (x) options operator, arrow; (1/2)*omega0^2*T^2*((1/6)*Pi^2-(1/2)*Pi*abs(2*Pi*x/T)+Pi^2*x^2/T^2)/Pi^2 end proc

proc (x) options operator, arrow; (1/2)*omega0^2*T^2*((1/6)*Pi^2-(1/2)*Pi*abs(2*Pi*x/T)+Pi^2*x^2/T^2)/Pi^2 end proc

(1)

(int(G(t-tp), tp = 0 .. T))/T

0

(2)

(int(G(t-tp)*sin(2*Pi*n*tp/T), tp = 0 .. T))/T

(1/2)*T^2*omega0^2*cos(t*Pi*n/T)*sin(t*Pi*n/T)/(Pi^2*n^2)

(3)

(int(G(t-tp)*cos(2*Pi*n*tp/T), tp = 0 .. T))/T

(1/4)*T^2*omega0^2*(2*cos(t*Pi*n/T)^2-1)/(Pi^2*n^2)

(4)

(int(G(t-tp)*exp((I*2)*Pi*n*tp/T), tp = 0 .. T))/T

undefined/T

(5)

(int(G(t-tp)*(cos(2*Pi*n*tp/T)+I*sin(2*Pi*n*tp/T)), tp = 0 .. T))/T

undefined/T

(6)

simplify((int(G(t-tp)*exp((I*2)*Pi*n*tp/T), tp = 0 .. t))/T+(int(G(t-tp)*exp((I*2)*Pi*n*tp/T), tp = t .. T))/T)

(1/4)*omega0^2*exp((2*I)*t*Pi*n/T)*T^2/(Pi^2*n^2)

(7)

assume(0 < t and t < 2*Pi)

G2 := proc (x) options operator, arrow; 2*omega0^2*((1/6)*Pi^2-(1/2)*Pi*abs(x)+(1/4)*x^2) end proc

proc (x) options operator, arrow; 2*omega0^2*((1/6)*Pi^2-(1/2)*Pi*abs(x)+(1/4)*x^2) end proc

(8)

(int(G2(t-tp)*exp(I*n*tp), tp = 0 .. 2*Pi))/(2*Pi)

omega0^2*exp(I*n*t)/n^2

(9)

 

Download MathewsWalkerProblem4-4.mwMathewsWalkerProblem4-4.mw

 

 

I'm trying to solve the differential equation.

Eq := diff(y(x), x, x) = -(x^2+1)*y(x)+K;

dsolve({Eq, y(-1) = 0, y(1) = 0}, y(x));

But this not work very well.

Best Regards,

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