Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 357 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

You need all three initial conditions to solve the system numerically. You have three first-order derivatives, so you need three conditions. So there's no point in using a loop. Simply use

Sol:= dsolve({sys, ics[]},{T1(t),T2(t),T3(t)}, numeric);

Here's a first attempt. This does not deal with punctuation marks, capitalization, unusual characters that may be considered letters in other alphabets, or aposthropes.

LCS:= module()
local
     X, Y, # lists of words
     C, # Array of counts
     
    ModuleApply:= proc(S1,S2)
        X:= StringTools:-Split(S1);
        Y:= StringTools:-Split(S2);
        LCSLength();
        backtrack(nops(X), nops(Y))
    end proc,

    LCSLength:= proc()
        local m:= nops(X), n:= nops(Y), i, j;
        C:= Array(0..m, 0..n, datatype= integer[2]);
        for i to m do
            for j to n do
                C[i,j]:= `if`(X[i]=Y[j], C[i-1,j-1]+1, max(C[i,j-1], C[i-1,j]))
            end do
        end do
    end proc,

    backtrack:= proc(i::nonnegint, j::nonnegint)
        if i=0 or j=0 then [][]
        elif X[i]=Y[j] then cat(thisproc(i-1,j-1), " ", X[i])
        elif C[i,j-1] > C[i-1,j] then thisproc(i,j-1)
        else thisproc(i-1,j)
        end if
    end proc
;
end module:

S1:=
"die einkommen der landwirte sind fuer die abgeordneten ein
buch mit sieben siegeln um dem abzuhelfen muessen dringend alle
subventionsgesetze verbessert werden":
S2:=
"die steuern auf vermoegen und einkommen sollten nach meinung
der abgeordneten nachdruecklich erhoben werden dazu muessen die
kontrollbefugnisse der finanzbehoerden dringend verbessert werden":

LCS(S1,S2);

" die einkommen der abgeordneten muessen dringend verbessert werden"

Whatever Maple commands that you would ordinarily use to solve the system will still work when you use complex numbers.

To help you enter the system, begin with

restart;
interface(imaginaryunit= j);
with(LinearAlgebra):

Remember to work in radians instead of degrees. You can, of course, convert the final answers to degrees at the end of the computation. To facilitate the entry of degrees, define

d:= Pi/180;

and then enter degree quantities as, for example,

150*d

Beginning your computation:

V:= < 150*d, 0 >:
A:= < 13-j*14, -(12-j*16); 27+j*16, -(26+j*13) >:
Determinant(A);

A^(-1);

If myFunction is a polynomial (or a polynomial of functions), then use simplify with side relations. See ?simplify,siderels . Example:

Horrible:= a^2+b^2+c^2:
simplify(Horrible, {a^2+b^2 = myFunction});

I don't know what you mean by A. A more-detailed example would help.

This Answer is to address your issues with the display of processor usage and memory usage at the bottom of the Maple window.

Use a process monitor external to Maple such as Windows Task Manager on Windows. This will give you closer-to-real-time information on processor and memory usage. The ticker at the bottom of the Maple window only updates when garbage is collected. Garbage is only collected when a certain amount has piled up or you force it with gc(). Your Maple code may still be processing, but if it is not generating any significant amount of garbage, then there will be no updates at the bottom of the window. You will see the processor usage in the external process monitor.

When you do a restart, the memory is released immediately. You can also see this on an external monitor. But it won't show on the Maple screen until a garbage collection is done. You tried to force a garbage collection with 

restart; gc():

However, this is erronenous. The restart command should always be in its own execution group. See the eighth paragraph at ?restart .

 

Here's your formula in Maple. Note that the angle phi is measured in degrees.

Fi:= proc(phi)
local p:= phi*Pi/180, b:= 0.081819221, sb:= b*sin(p);
     7915.7*log10(tan((Pi/4+p/2)*((1-sb)/(1+sb))^(b/2)))
end proc;

I think that the numeric integration is getting hung up trying to achieve high accuracy, which you don't need for a plot. I changed the last two lines of your code to

dpp:= Int(Re(dpdx), x= 0..1, digits= 4, method= _d01ajc):
dpp2:= eval(dpp, K= -0.1);
plot(dpp2, Q= -1..1, axes= box,color= [blue]);

and I got the plot in under ten seconds. Not necessarily all of the changes that I made are necessary for getting a fast plot.

The evalm command has been obsolete for over a decade and has been deprecated for years. If you show the code that you are trying to use, I can update it.

Here is my implementation of Rodrigues's formula. K is the axis of rotation.

restart:
Rodrigues:= proc(K::Vector(3),v::Vector(3),theta::algebraic)
local
     k:= LinearAlgebra:-Normalize(K,2),
     kx:= < < 0, k[3], -k[2] > | < -k[3], 0, k[1] > | < k[2], -k[1], 0> >
;
     v + kx.v*sin(theta) + (kx^2).v*(1-cos(theta))
end proc:
           
R:= unapply(Rodrigues(<1,1,1>, <1,1,0>, t), t):
plots:-spacecurve(R(t), t= -Pi..Pi);

 

Your system is autonomous, and it is only differentiated with respect to the first variable. It is thus equivalent to a system of ODEs. The ODEs can be easily solved.

sys:= {eq||(1..3)}:
sysA:= subs([a*t= NULL, a^2*t= NULL], evalf(sys)):
dsolve(sysA, convert_to_exact= false);

I don't know how to procede from this point. It is not even clear to me that there is any way to procede.

Use convert(%, StandardFunctions) followed by simplify(%) to obtain

which is equivalent to the desired form that you posted.

 

Here's a procedure to generate it for an arbitrary Vector or list of xs.

B:= proc(X::{Vector,list})
local n:= numelems(X);
     LinearAlgebra:-Determinant(
          Matrix(
               n,
               (i,j)-> `if`(j < i, -1, binomial(n-i,j-i)*X[j-i+1]),
               shape= Hessenberg[upper]
          )
      )
end proc:

B(Vector(4, symbol= x));

 

dsolve({diff(y(x),x)=x*y(x)^2, y(1)=2});

taylor(rhs(%), x=1);

 

Here's an idea to deal with this with a modicum of generality:

restart:
Int(1/x^n, x= 10..100);

A:= value(%):
piecewise(seq([n = d, limit(A, n= d)][], d= discont(A,n)), A);

Are you just interested in real roots? Looking at plot([tan(x/2), tanh(x/2)]) it is clear that there is exactly one real root for every period of tan(x/2). So there is exactly one real root in each interval (2*k-1)*Pi..(2*k+1)*Pi for any integer k. Once you decide on the interval, the root can be found with fsolve:

fsolve(eq, x= 5*Pi..7*Pi);

20.42035225

If you want the complex roots, let me know. It's not as easy to analyze.

I added the plot of the arc, c2, to your two plots, and specified that it be filled.

c1:= plottools:-circle([0, 0], 1, color = red):
c2:= plot([cos(t), sin(t), t= -arccos(1/2)..arccos(1/2)], filled):
p2:= plots:-implicitplot(x = 1/2, x = -2 .. 2, y = -1 .. 1.1, colour = blue, linestyle = 1, thickness = 2);
plots:-display([c1, c2, p2]);

First 305 306 307 308 309 310 311 Last Page 307 of 395