Rouben Rostamian

MaplePrimes Activity


These are replies submitted by Rouben Rostamian

What you have described is quite specialized and I certainly don't have the necessary knowledge to construct a mathematical model of it.  If you have constructed a mathematical model and your difficulty is in its implementation in Maple, then post your worksheet and point out where Maple help is needed.

 

 

You will need to be more specific.  Plotting this function over 0..1000 is instantaneous:

plot(sin(t/100), t=0..1000);

 

@nm In Linux, Maple is launched from a script file in Maple's installation directory.  The script file processes command-line options and sets some environment variables before launching the binary executable.

I must have learned about the "–standalone" option from browsing that script file because the option does not seem to be documented anywhere.  Perhaps that's because it's specific to Linux?  I don't know.  There are some other useful undocumented options there.  The "–j" option, for instance, may be used to increase the Java heap memory allocation size which is sometimes necessary when doing extensive graphics.

 

I don't know about Windows, but in Linux the command-line option "–standalone" starts an independent Maple process.  There ought to be something equivalent in Windows.

 

I know how to solve that problem but I would rather not do your homework for you.

I will be happy to show you how to do it in Maple if you show me how you would go about solving it by hand.

 

@Mo_Jalal To plot u(x,1) we do:
pdsol:-plot(u, t=1);

To obtain solution values, we define U:
U := pdsol:-value(u);
Then U(0.8, 0.2) returns
            [x = 0.8, t = 0.2, u = 0.161382120212466312]
There are a lot of other ways.  Have a look at the help page on pdsolve,numerc.

As you have suspected, those initial conditions are totally wrong.  To pose a proper set of initial and boundary conditions, you need to provide more information about the problem that these equations are supposed to model.  Here I will provide one set of plausible assumptions but these may be entirely different from what you really need.

The main trick here is the introduction of the new variables u_t, u_tt, etc., which converts your original 3rd order system to a first order system.

restart;

sys:={diff(u(x,t),x)+alpha*diff(v(x,t),t,t)+beta*v(x,t)*(u(x,t)^2+v(x,t)^2)+epsilon*diff(u(x,t),t,t,t)+6*(u(x,t)^2+v(x,t)^2)*diff(u(x,t),t)+6*u(x,t)*(u(x,t)*diff(u(x,t),t) +v(x,t)*diff(v(x,t),t))=0,-diff(v(x,t),x)+alpha*diff(u(x,t),t,t)+beta*u(x,t)*(u(x,t)^2+v(x,t)^2)-epsilon*diff(v(x,t),t,t,t)-6*(u(x,t)^2+v(x,t)^2)*diff(v(x,t),t)-6*v(x,t)*(u(x,t)*diff(u(x,t),t) +v(x,t)*diff(v(x,t),t))=0};

{diff(u(x, t), x)+alpha*(diff(diff(v(x, t), t), t))+beta*v(x, t)*(u(x, t)^2+v(x, t)^2)+epsilon*(diff(diff(diff(u(x, t), t), t), t))+6*(u(x, t)^2+v(x, t)^2)*(diff(u(x, t), t))+6*u(x, t)*(u(x, t)*(diff(u(x, t), t))+v(x, t)*(diff(v(x, t), t))) = 0, -(diff(v(x, t), x))+alpha*(diff(diff(u(x, t), t), t))+beta*u(x, t)*(u(x, t)^2+v(x, t)^2)-epsilon*(diff(diff(diff(v(x, t), t), t), t))-6*(u(x, t)^2+v(x, t)^2)*(diff(v(x, t), t))-6*v(x, t)*(u(x, t)*(diff(u(x, t), t))+v(x, t)*(diff(v(x, t), t))) = 0}

eq1 := diff(u(x,t),t) = u__t(x,t);
eq2 := diff(u__t(x,t),t) = u__tt(x,t);
eq3 := diff(v(x,t),t) = v__t(x,t);
eq4 := diff(v__t(x,t),t) = v__tt(x,t);

diff(u(x, t), t) = u__t(x, t)

diff(u__t(x, t), t) = u__tt(x, t)

diff(v(x, t), t) = v__t(x, t)

diff(v__t(x, t), t) = v__tt(x, t)

Substitute the above into the system:

sys_tmp := subs(eq1, eq2, eq3, eq4, sys);

{diff(u(x, t), x)+alpha*v__tt(x, t)+beta*v(x, t)*(u(x, t)^2+v(x, t)^2)+epsilon*(diff(u__tt(x, t), t))+6*(u(x, t)^2+v(x, t)^2)*u__t(x, t)+6*u(x, t)*(u(x, t)*u__t(x, t)+v(x, t)*v__t(x, t)) = 0, -(diff(v(x, t), x))+alpha*u__tt(x, t)+beta*u(x, t)*(u(x, t)^2+v(x, t)^2)-epsilon*(diff(v__tt(x, t), t))-6*(u(x, t)^2+v(x, t)^2)*v__t(x, t)-6*v(x, t)*(u(x, t)*u__t(x, t)+v(x, t)*v__t(x, t)) = 0}

We put all the equations together and obtain a new system consisting of six first order

equations in the six unknowns"u, v, `u__t `, `v__t `, `u__tt` , `v__tt` ."  This is equivalent to the original

system which consisted of two third order (in "t) "equations.

sys_new := sys_tmp union {eq1, eq2, eq3, eq4};

{diff(u(x, t), x)+alpha*v__tt(x, t)+beta*v(x, t)*(u(x, t)^2+v(x, t)^2)+epsilon*(diff(u__tt(x, t), t))+6*(u(x, t)^2+v(x, t)^2)*u__t(x, t)+6*u(x, t)*(u(x, t)*u__t(x, t)+v(x, t)*v__t(x, t)) = 0, -(diff(v(x, t), x))+alpha*u__tt(x, t)+beta*u(x, t)*(u(x, t)^2+v(x, t)^2)-epsilon*(diff(v__tt(x, t), t))-6*(u(x, t)^2+v(x, t)^2)*v__t(x, t)-6*v(x, t)*(u(x, t)*u__t(x, t)+v(x, t)*v__t(x, t)) = 0, diff(u(x, t), t) = u__t(x, t), diff(u__t(x, t), t) = u__tt(x, t), diff(v(x, t), t) = v__t(x, t), diff(v__t(x, t), t) = v__tt(x, t)}

Here is a plausible choice of initial and boundary conditions to go with the new system:

Boundary conditions:

bc :=
        u(0,t) = 0,
        v(1,t) = 0;

u(0, t) = 0, v(1, t) = 0

Initial conditions:

ic :=
    u(x,0) = x*(1-x),
    v(x,0) = 0,
    u__t(x,0) = 0,
    v__t(x,0) = 0,
    u__tt(x,0) = 0,
    v__tt(x,0) = 0;

u(x, 0) = x*(1-x), v(x, 0) = 0, u__t(x, 0) = 0, v__t(x, 0) = 0, u__tt(x, 0) = 0, v__tt(x, 0) = 0

Solve the system:

pdsol := pdsolve(subs(alpha=1, beta=0.5, epsilon=1.5, sys_new), {ic, bc}, numeric);

_m140508142403584

pdsol:-plot3d(u, t=0..1);

pdsol:-plot3d(v, t=0..1);

The growing oscillations are bad news.  That indicates that the numerical scheme for

solving the system is unstable.  You will need to play with the parameters spacestep

and timestep (read help on pdsolve,numeric) to obtain a proper solution.

 

Download mw.mw

 

@nm Thanks for a very clever workaround.  Your suggestion can be a good general advice for anyone working with such series solutions.

 

@Maple_lover1 There have been many requests for a color bar feature in Maple's 3D graphics but unfortunately there is no native support yet for color bars in Maple.  I am hoping that it will be added some day.

If you search for "color bar" in this website's search box, you will see quite a number of hits and a lot of suggestions on hacking together color bars with the currently available tools.  None of these strike me as aesthetically pleasing or easy to use. 

If you insist on color bars, then I can see a justification in your attempt to convert Maple code to Matlab.

 

Your program refers to PlyTable but as far as I can see, it cannot read its value.  To verify that, print the value of the CurrentAngle within your main loop, as in

for i from 1 to NumberPlies do:
    CurrentAngle := PlyTable1[i,1]:
    printf("i = %d, CurrentAngle = %a\n", i, CurrentAngle);
    ...

 By the way, why do you have a colon after "do"?  Remove it.

A general advice: There is an old saying to the effect that for any problem that you cannot solve, there is a simpler problem that you cannot solve.  Try that one first.

Your current program is too complex to debug. I suspect that you received it from someone else and are trying to modify it.  If that's the case, you will be better off by writing your own version, from the beginning and without bells and whistles.  Start simple.  Do away with widgets that can hide data.  You may make your program fancier later, after you have established a foothold and verified that the plain version works.

 

 

 

@acer The solution is to remove the f(x) := whatever syntax from Maple altogether.  As a help to new users, an attempt to f(x) := whatever should trigger an error message with a text like "did you mean f := x -> whatever?".

 

@acer Thanks for the explanation.  That's indeed an unexpected behavior (a polite way of saying a "bug").  I still don't understand why gamma(1) evaluates to −0.07281584548.  Do you know where that number comes from?

@dearcia Maple is unable to plot the arrows in your original version because the vector field is undefined on the planes x=0, y=0, and u=0.  To avoid the singularity, don't go near those planes. Adjust the plotting region like this:

 x = 0.1 .. 1, y = 0.1 .. 1, u = -1 .. -0.1

@PhD_Wallyson I don't have access to articles 1 and 3.  Send them to me and I will have a look.

@ Oh, I see, this model is a lot more complicated than I would have expected.  I wouldn't be able to devote the necessary time to go into its details.  I hope that someone else in this forum will.

First 31 32 33 34 35 36 37 Last Page 33 of 99