Rouben Rostamian

MaplePrimes Activity

These are replies submitted by Rouben Rostamian

@raj2018 See if this answers your questions.


Eq := 1-1/(w**2-3*sigma*k**2)-deltab*mu/((w-k*u0b)**2-3*mu*deltab*sigmab*k**2)+A/k**2=0;

1-1/(-3*k^2*sigma+w^2)-deltab*mu/((-k*u0b+w)^2-3*mu*deltab*sigmab*k^2)+A/k^2 = 0

params1:=[sigma=0.7, mu=1/1860, u0b=0.05, deltab=0.001, sigmab=1,

[sigma = .7, mu = 1/1860, u0b = 0.5e-1, deltab = 0.1e-2, sigmab = 1, A = 2.936507936]


1-1/(-2.1*k^2+w^2)-0.5376344086e-6/((-0.5e-1*k+w)^2-0.1612903226e-5*k^2)+2.936507936/k^2 = 0

Let k/w = Q.   The equation changes to:

subs(w=Q*k, Eq1):
eqq := simplify(expand(%*k^2));

k^2-1/(-2.1+Q^2)-0.5376344086e-6/(0.2498387097e-2-.10*Q+Q^2)+2.936507936 = 0

You are interested in small values of k  (k = 0.1e-1 .. .5).   That's small in comparison

with the additive 2.936507936.  So just drop the k^2 and keep what is left:

my_eq := subs(k=0, eqq);

2.936507936-1/(-2.1+Q^2)-0.5376344086e-6/(0.2498387097e-2-.10*Q+Q^2) = 0

Thus, we are left with an equation for Q with no other variables.  Solve for Q:

sol := solve(my_eq);

0.4866942961e-1, 0.5133056934e-1, 1.562222957, -1.562222956

We get four solutions for Q.  But Q = k/w, therefore we get four lines

lines := seq(k = sol[i]*w, i=1..4);

k = 0.4866942961e-1*w, k = 0.5133056934e-1*w, k = 1.562222957*w, k = -1.562222956*w

plot(rhs~([lines]), w=0..0.1, labels=[w,k]);

That looks like three lines but actually there are four.  The first two lines are

very close to each other and appear as one line.  To see them individually,

restrict the vertical range:

plot(rhs~([lines]), w=0..0.1, labels=[w,k], view=-0.01..0.01);



@jalal The animations, as you have envisioned them, do convery some information in the cases of the sin and tan functions, but they are not practical in the cases of the cos and cot functions.  That's because sin and tan measure vertical distances in the trigonometric circle, but cos and cot correspond to horizontal distances and cannot be animated in the same way.

What your students should learn (and remember forever!) is where sin, cos, tan, and cot appear relative to the trigonometric circle.  They already know about the sin and cos.  Here is what tan and cot look like:

I don't see a pedagogical value to the aninated versions.  They may look cute, but they tend to obfuscate rather than illuminate.  I would avoid them.



I don't see an option for that.  I have often wished that there was one.

@acer Thanks for the further elaboration.  It looks like InertForm:-Display works better than Typesetting:-Typesett in the following example.



expr := 1 + x^2;






@acer Thanks for pointing to the Typeset and EV exports of Typesetting (both undocumented).  These can come handy in some situations and it's good to have them in one's toolbox.

@acer You wrote "I prefer the technique of using, Typsetting:-Typeset".  I am unable to find a help page on Typsetting:-Typeset.  Can you tell me where it is documented?

I see that you have a system of three first order differential equations in three unknowns.  The system involves eight unspecified coefficients aS, mu1, mu4, etc.  No initial conditions are specified.

You specify data which is a collection of four lists of four numbers each.  It's not clear how data is meant to be related to the system of differential equations.

I cannot make sense of the rest of the worksheet.  To get any help, you should explain in words, as I have done above, what it is that you want to achieve.

@Dkunb The next step still depends on what you want to do with rho_1 and rho_2.  Suppose you have calculated rho_1 and rho_2.  How are you going to use them?

By the way, I don't know the meanings of the superscripts T, *, and †.  I suppose T stands for transpose.  I don't know what the other two mean.

@Dkunb When the size of a result exceeds a set limit, Maple calculates but does not display it because displaying such large expressions would be generally useless to anyone.  It is possible to raise or completely eliminate the limiting ceiling through Maple's configuration options, but I don't see a point in doing that under the circumstances.

Based on what we see in the toy example, we expect your dsol to be a list of the form
     [ z[0,1(t)=...,  z[0,2](t)=...,  z[1,1](t)=..., z[1,2](t)=... ]
To see what your z[0,1(t) looks like, do
subs(dsol, z[0,1](t));

You will see that z[0,1(t) is a HUGE expression involving things like RootOf(_Z^4, ...).  That's because you are solving a linear system of four first order differential equations.  The characteristic polynomial of such a system is a 4th degree polynomial whose roots do not have nicely presentable forms.  (It was just lucky that things worked out neatly for the toy problem.) Things get worse as you increase the size of n.   The prudent thing to do then is to solve the system numerically.  Maple can do that, but how you would organize the code depends on what you want to do with the result.

So, to go any further, let's ask the question:  Suppose you have obtained the solution Z(t).  What are you going to do with it?

@acer Thanks for checking.  Mine was done in Maple 2023. 

One way of making the code work in Maple 2021 is to load the Physics package as you have noted.  A better solution is to change the definition of the IC to

IC := eval(Z, t=0) =
	Array(0..n-1, 0..n-1, (i,j) -> `if`(i=j,1,0));

which will work in Maple 2021 without loading the Physics package.

@Dkunb What kind of object is Z(t) in dz?  Is it a scalar, a vector, a matrix?  The expression you have for dz makes no sense under any of those interpreations.  Perhaps you have something else in mind?

I am fond of following Polya's advice which in effect says if you don't know how to solve a problem, do a simpler one first.  In your case, can you just drop all those messy preliminaries?  Just make up a simple example, such as:

de := diff( < z[1](t), z[2](t) >, t) = < 1, 2; 3, 4 > . < z[1](t), z[2](t) >;

(Vector(2, {(1) = diff(z[1](t), t), (2) = diff(z[2](t), t)})) = (Vector(2, {(1) = z[1](t)+2*z[2](t), (2) = 3*z[1](t)+4*z[2](t)}))

ic := z[1](0) = 1, z[2](0) = 2;

z[1](0) = 1, z[2](0) = 2

I am not saying that this is a suitable example since I have no idea what you have in mind for your dz.  Change that example to make it similar, in essence, to your dz.  Add extra complications only after you get that cartoon model to work.

How do you expect to solve a differential equation numerically when some of the parameters have no numerical values?  Do:

indets(eq1, name);

to see what eq1 depends on.  Maple responds with:
        {M, N, m, mu, n, nu, t, KroneckerDelta[m, n], KroneckerDelta[mu, nu]}

Furthermore, it looks like the purpose of your zint array is to supply initial conditions to the differential equation.  But the initial conditions should like like z(m,nu,0)=something.  Yours doesn't do that.

I suggest forgetting about the array for the moment. That's the least of your problems.  Just solve one of your differential equations.  Once you figure out how that works, only then you will worry about the array.

@C_R I still don't see what your ultimate goal is.  Are you hoping to get an explicit solution to that differential equation in in terms elementary functions?  I assume that you already know that the pendulum equation does not have a solution in terms of elementary functions.  So what is it that you are looking for?

You have asked quite a few questions in MaplePrimes involving differential equations but it appears that you still don't know how to express a derivative in Maple.  The expression dy/dx is definitely not how one does that.

For practice, calculate the derivative of x2 in Maple.  And if you succeed, then try expressing the derivative of y, where y is an unspecified function of x. If you don't know how to do those things, then it's too soon for you to get involved with differential equations.

@Anthrazit You may simulate a double-headed arrow like this.



A, B := [0, 0], [3,2];

[0, 0], [3, 2]

C := (A+B)/2;

[3/2, 1]

display(arrow(C, [A-C,B-C]), scaling=constrained);


3 4 5 6 7 8 9 Last Page 5 of 91