MaplePrimes Questions


How to solve a system of partial equations with boundary conditions.I used this formula

restart;
sys_Pde := diff(V(x, t), x, x) = 0, diff(T(x, t), x, x) = 0;
          
BC := eval(diff(V(x, t), x), x = 1) = 0, eval(V(x, t), x = 0) = 1+cos(w*t), eval(T(x, t), x = 0) = 0, eval(T(x, t), x = 1) = 1;
pdsolve({sys_Pde});
   {T(x, t) = _F1(t) x + _F2(t), V(x, t) = _F3(t) x + _F4(t)}
pdsolve({BC, sys_Pde});


Error, (in PDEtools:-ToJet) found functions to be rewritten in jet notation, {V(1, t)}, having different dependency than the indicated in [V(x, t)]

 

I

have the following function phi(x,y) which depends on two unknown functions F1 and F2 which are differentiable.

Phi(x,y)=y sin(x y) + F1(y) + y^2 F2(x y)

Note that F1 and F2 are obtained by hand when I solve a partial differential equation

I would like to find  phi(x,y)  that satisfies phi=1 and diff(phi(x,y),y)=1-x^2*cos(x^2) on line y=x

 

constraint.mw

Thanks for your help

 

Hi, given the function f(t)=t^2. Determine the Fourier coefficients a_0, a_1 and b_1 for f(t). Plot the graphs for f(t) and also plot the graphs for the Fourier sum F(t) with N=1 in the same coordinate system. Let the t-axis go from 0 to 2*Pi.

Can someone help with this?

Thanks

I have a system of linear equations with a fixed number of equations, but the stracture of the system varies in T. I have solved the system for a fixed T and have to run for each value of T, which is quite boaring. I want to solve the system by a single run for multiple T values using a for loop. When I tried with the code, I got the following error.

Error, (in LinearAlgebra:-GenerateMatrix) invalid subscript selector


t.mw

L:=[1,2,0,4]:
s := sum(1/L[i], i=1..nops(L));

Error, (in limit/mrv/limsimpl) too many levels of recursion

So, this error cannot be caught by try

try    # bug
  s := sum(1/L[i], i=1..nops(L));
  catch:  s:=infinity
end try;

Error, (in limit/mrv/limsimpl) too many levels of recursion

Strangely, for L:=[1, 2, 0.0, 4]  it's OK.

Everything works with add instead of sum, but this is another thing.

 

  I want list all  diameter-2  Nonisomorphismgraphs  of order n . I use the following code, but its running speed  is slow with  order of graph gradually increasing . (for example,n=10)
 Are there other ways to Improve it? 
restart:
with(GraphTheory):
Graphs_data:=[NonIsomorphicGraphs(4,restrictto =[connected], output = graphs, outputform =graph)]:
Diameter_select:=select[flatten](t->Diameter(t)=2,Graphs_data):
DrawGraph(Diameter_select,size=[50,50]);

  By the way,  Why doesn't size=[50,50] work ?

 
                       
                   
               
               
           
           
               
                   
                 

Hi,

How can find the range of  the parameter k, such that f(x)=b ( for a given b in the set of real number R) we have a unique solution of the equation f(x)=b 

 

Many thanks for your help

Hello,

I'm trying to solve a system of ODE in a model of infectious disease. But, unfortunately, when I try to plot the curves, I get the following error message: Error, (in fproc) unable to store '-1.*HFloat(0.0)[1]' when datatype=float[8]. The code is here

restart;
with(plots);
Q := 1000; a := .9; b := 0.8e-3; mu := 0.247e-2; k := .2; y := 0.2e-1; e := .5; g := .5; T := 8; n := 100;
sigma[1] := 0.5e-1; sigma[2] := 0.9e-1; alpha[1] := 0.52e-2; alpha[2] := 0.52e-2; delta[1] := .8; delta[2] := .904; delta[3] := .8; c[1] := 50; c[2] := 250; c[3] := 50; w[1] := 140; w[2] := 130; w[3] := 150; w[4] := 160;
u[1] := min(max(0, z), 1); z := (a*i[p](t)*(i[p](t)+i[pm](t))*(lambda[4](t)-lambda[3](t))+a*s(t)*(i[p](t)+i[pm](t))*(lambda[1](t)-lambda[2](t)))/(n.w[1]); u[2] := min(max(0, c), 1); c := (b*(i[m](t)+i[pm](t))*s(t)*(lambda[3](t)-lambda[1](t))+b*(i[m](t)+i[pm](t))*i[p](t)*(lambda[4](t)-lambda[2](t)))/(n.w[2]); u[3] := min(max(0, j), 1); j := (i[p](t)*lambda[2](t)+i[pm](t)*(lambda[4](t)-lambda[7](t))-(i[p](t)+i[pm](t))*lambda[5](t))/w[3]; u[4] := min(max(0, o), 1); o := (i[m](t)*lambda[3](t)-i[pm](t)*(lambda[4](t)-lambda[7](t))-(i[m](t)+i[pm](t))*lambda[6](t))/w[4]; u[2] := 0; u[3] := 0;
;
sys := diff(s(t), t) = Q+delta[1]*r[p](t)+delta[2]*r[m](t)+delta[3]*r[pm](t)-(a*(1-u[1])*(i[p](t)+i[pm](t))/n+b*(1-u[2])*(i[m](t)+i[pm](t))/n+mu)*s(t), diff(i[p](t), t) = (1-u[1])*a*(i[p](t)+i[pm](t))*s(t)/n-(1-u[2])*b*(i[m](t)+i[pm](t))*i[p](t)/n-(sigma[1]+u[3])*i[p](t)-(alpha[1]+mu)*i[p](t), diff(i[m](t), t) = (1-u[2])*b*(i[m](t)+i[pm](t))*s(t)/n-(1-u[1])*a*(i[p](t)+i[pm](t))*i[m](t)/n-(sigma[2]+u[4])*i[m](t)-(alpha[2]+mu)*i[m](t), diff(i[pm](t), t) = (1-u[2])*b*(i[m](t)+i[pm](t))*i[p](t)/n+(1-u[1])*a*(i[p](t)+i[pm](t))*i[m](t)/n-(y+u[3]+u[4])*i[pm](t)-(alpha[1]+alpha[2]+mu)*i[pm](t), diff(r[p](t), t) = (sigma[1]+u[3])*i[p](t)+(e*y+u[3])*i[pm](t)-(delta[1]+mu)*r[p](t), diff(r[m](t), t) = (sigma[2]+u[4])*i[m](t)+(y*g*(1-e)+u[4])*i[pm](t)-(delta[2]+mu)*r[m](t), diff(r[pm](t), t) = (y*(1-g)*(1-e)+u[3]+u[4])*i[pm](t)-(delta[3]+mu)*r[pm](t), diff(lambda[1](t), t) = lambda[1](t)*(a*(1-u[1])*(i[p](t)+i[pm](t))/n+b*(1-u[2])*(i[m](t)+i[pm](t))/n+mu)-lambda[2](t)*(1-u[1])*a*(i[p](t)+i[pm](t))/n-lambda[3](t)*(1-u[2])*b*(i[m](t)+i[pm](t))/n, diff(lambda[2](t), t) = -c[1]+lambda[1](t)*(1-u[1])*a*s(t)/n-lambda[2](t)*((1-u[1])*a*s(t)/n+b*(1-u[2])*(i[m](t)+i[pm](t))/n+sigma[1]+u[3]+alpha[1]+mu)-lambda[4](t)*(b*(1-u[2])*(i[m](t)+i[pm](t))/n+(1-u[1])*a*i[m](t)/n)-lambda[5](t)*(sigma[1]+u[3]), diff(lambda[3](t), t) = -c[2]+lambda[1](t)*(1-u[2])*b*s(t)/n+lambda[2](t)*(1-u[2])*b*i[p](t)/n-lambda[3](t)*(u[4]+alpha[2]+sigma[2]+a*(1-u[1])*(i[p](t)+i[pm](t))/n-(1-u[2])*b*s(t)/n)-lambda[4](t)*((1-u[2])*b*i[p](t)/n+a*(1-u[1])*(i[p](t)+i[pm](t))/n)-lambda[6](t)*(sigma[2]+u[4]), diff(lambda[4](t), t) = -c[3]+lambda[1](t)*((1-u[1])*a*s(t)/n+(1-u[2])*b*s(t)/n)-lambda[2](t)*((1-u[2])*b*i[p](t)/n+(1-u[1])*a*s(t)/n)-lambda[2](t)*((1-u[2])*a*i[m](t)/n+b*(1-u[1])*s(t)/n)-lambda[4](t)*(y+u[3]+u[4]+alpha[1]+alpha[2]+mu-(1-u[2])*b*i[p](t)/n-b*(1-u[1])*i[m](t)/n)-lambda[5](t)*(e*y+u[3])-lambda[6](t)*(y*g*(1-e)+u[4])-lambda[7](t)*(y*(1-g)*(1-e)+u[3]+u[4]), diff(lambda[5](t), t) = -lambda[1](t)*delta[1]+lambda[5](t)*(delta[1]+mu), diff(lambda[6](t), t) = -lambda[1](t)*delta[2]+lambda[6](t)*(delta[2]+mu), diff(lambda[7](t), t) = -lambda[1](t)*delta[3]+lambda[7](t)*(delta[3]+mu), i[p](0) = 300, i[m](0) = 200, i[pm](0) = 150, r[p](0) = 200, r[m](0) = 150, r[pm](0) = 150, s(0) = 1000, lambda[1](T) = 0, lambda[2](T) = 0, lambda[3](T) = 0, lambda[4](T) = 0, lambda[5](T) = 0, lambda[6](T) = 0, lambda[7](T) = 0;
p1 := dsolve({sys}, type = numeric, method = bvp[midrich], abserr = 0.1e-5, maxmesh = 2400);
Error, (in fproc) unable to store '-1.*HFloat(0.0)[1]' when datatype=float[8]
p2o := odeplot(p1, [t, i[p](t)], 0 .. 3, numpoints = 100, labels = ["Time (Months)", " Population"], labeldirections = [horizontal, vertical], style = line, color = green, axes = boxed);
 

Can anyone help me please? I read some related problems here, but couldnt find a solution yet.

Thanks for your time

Best regards

hye, can someone help me to solve nonlinear schrodinger equation using maple? i attach with document

solution_nonlinear.pdf

  Hello: 
     We know The FindMaximalElement(L) function returns the largest element of the list L .
   My questions is  How do I find the second largest element in a list and its index?  
     Since there are so many lists to consider , Algorithmic Complexity may be as low as possible.
     More generally, we want to find the third-largest  element and so on.
     For instance, Given a list [3,2,3,6,8], we want to get 6 and 4 , since 6 is the  second largest element and 4 is its index. 
    Thank you in advance for your help.
  Licheng

 

Did someone already made a Pointplot3d for a Principal Components Analysis with projections for some data points on the eigenvectors?

I like this example very much:

http://www.joyofdata.de/public/pca-3d/

but I want to add projections on the three eigenvectors for some data points. I think it has to do something with the dot product, but I do not know how to do it in Maple. 

Hopefully someone already did this and is willing to share it.

kind regards,

Harry

 

I'm new to Maple, and want to know what is the simpliest way to create additional electrical units like MVA and MVAr?

 

On the segment x ∈ [0,10] plot the numerical solution of the equation y '+ y = 2xsiny, satisfying the initial condition y (0) = 1.
What is wrong here? My solution:

I want to write a procedure called Resistance which calculates and displays the equivalent resistance to three resistors R1, R2 and R3

If the resistances are connected in series then Rser = R1 + R2 + R3

If the resistances are connected in parallel then (R1 * R2 * R3) / (R1 * R2 + R1 * R3 + R2 * R3) and after that, I must write an algorithm which I will test this resistance but it does not work please help me
 

"Resistance:=proc(R1,R2,R3) local Rser,Rpar,R; if(R=Rser)then Rser:=R1+R2+R3;   elif(R=Rpar)jthen Rpar:=(R1*R2*R3)/((R1*R2+R1*R3++R2*R3));  end if;  end proc;"

Error, unable to parse

"Resistance:=proc(R1,R2,R3) local Rser,Rpar,R; if(R=Rser)then Rser:=R1+R2+R3;   elif(R=Rpar) jthen Rpar:=(R1*R2*R3)/(R1*R2+R1*R3++R2*R3);  end if;  end proc;"

 

R1 := readstat(entrer*la*valeur*de*R1); R2 := readstat(entret*la*valeur*de*R2); R3 := readstat(entrer*la*valeur*de*R3); Resistance(R1, R2, R3); printf("la valeur en serie est:%f", Rser); printf("la valeur parallele est:%f", Rpar)

``


 

Download RESISTANCE.mw

Hello

I'm using the package DifferentialGeometry with Maple 2019. I have 2 questions whose answer I've not found in the Help section:

a) If I have a 2-form omega with d(omega)=0, how can I obtain the 1-form alpha such that d(alpha) = omega?

b) if alpha is a 1-form and X a vector field, how can I calculate alpha(X)?

Thanks Nicola

First 9 10 11 12 13 14 15 Last Page 11 of 1744