Mac Dude

1576 Reputation

17 Badges

14 years, 80 days

MaplePrimes Activity


These are questions asked by Mac Dude

I have two equations:

and I need to extract the coefficients of x0 and xp0 (to build a matrix; but that is not the issue). So I use coeffs:

coeffs(op(2,X),x0);

coeffs(op(2,XP),x0);

xp0

While I can live with the first result (for X) (not that I like it), the fact that the 2nd one (for XP) has a completely different structure prevents any kind of algorithmic extraction of the coefficients (and the second one of course is 0) for further use. I tried the form of coeffs with a third argument (a name which gets the result assigned) but the same result. This example is a real case, obviously a trivial one and others will be much more involved so I really would like this to work. And yes, I did "collect" before using coeffs (not that it was needed here).

Any ideas out there?

Mac Dude.

I have an expression of the following structure (the real case is much more complicate but this will illustrate):

expr:=(a+q)*A+b*q*B;

I am looking for a way to change only the first occurrence of q. In my specific case, q << a so I can approximate that instance of q with 0. This I cannot do for the second occurrence of q. Note that the trivial subs(a+q=a) does not work for my real case as a is too complicated (meaning that while in principle I can do it, it looks extremely messy and in any case would not be general).

I can probably concoct something using op(#,expr) and has, but I am wondering whether there is an easier and faster way.

TIA,

Mac Dude

An indefinite integral cancels out one differentiation:

int(diff(w(s),s,s),s)=diff(w(s),s);

But for a definite integral Maple does not recognize that:

int(diff(w(s),s,s),s=0..L) = int(diff(w(s),s,s),s=0..L);

What I would have expected is something like:

int(diff(w(s),s,s),s=0..L) = eval(diff(w(s),s),s=L)-eval(diff(w(s),s),s=0);

I cannot get Maple to recognize this even when assuming real or positive.

What I am really after is this: w(s...

I am working with a home-brewed program that evaluates magnetic fields from air-core coils. While I have analytic expressions for the field itself, the code involves numeric integration through regions of the field. It also involves adding up the contributions of several coils.

Speed is becoming an issue. I dearly would like to run some of the integrations (which is where the time is spent) in parallel. The contributions from different coils would trivially parallelize,...

Hi,

I am trying to define a system of units so that I get results in the units I want.

Specifically; I want to use energy in MeV (or eV, if I have to) and masses*c^2 in MeV (or eV) as well. Related, I need ScientificConstants like Planck's h in MeVs etc.

So I say

AddSystem('Accelerator','MeV','meter','second');
UseSystem('Accelerator');

which is accepted. I even get energies converted to MeV if I enter one in a different unit and use

First 14 15 16 17 18 19 20 Page 16 of 23