## 7776 Reputation

17 years, 363 days

## Calculations...

 > restart;
 > 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;

 > params1:=[sigma=0.7, mu=1/1860, u0b=0.05, deltab=0.001, sigmab=1, A=(2.9-0.5)/(2.9-1.5)+(6-0.5)/(6-3/2)];

 > Eq1:=eval(Eq,params1);

Let .   The equation changes to:

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

You are interested in small values of   ().   That's small in comparison

with the additive .  So just drop the  and keep what is left:

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

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

 > sol := solve(my_eq);

We get four solutions for .  But , therefore we get four lines

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

 > 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.

## Good question...

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

## Thanks again...

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

 > restart;
 > with(Typesetting):
 > expr := 1 + x^2;

 > InertForm:-Display(sqrt(expr));

 > Typeset(EV(sqrt(expr)));

## Thanks...

@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.

## Typsetting:-Typeset...

@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?

## Clarification needed...

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.

## Further details needed...

@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.

## Length of output exceeds limit of 100000...

@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?

## An alternative...

@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));```

## @Dkunb What kind of object is Z(t) ...

@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) >;

 > ic := 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.

## Where to go from here?...

@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?

## How do you differentiate in Maple?...

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.

 > restart;
 > with(plots):
 > A, B := [0, 0], [3,2];

 > C := (A+B)/2;

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