litun

80 Reputation

5 Badges

6 years, 289 days

MaplePrimes Activity


These are replies submitted by litun

@Markiyan Hirnyk Here I have denoted d/dt {dF(t)} by dF and dF(t) was written instead of dF dt. 

restart; with(LinearAlgebra)

``

NULL

dF := -.525*exp(-7*t)+2.625*exp(-3*t)+.8*exp(-4*t)

-.525*exp(-7*t)+2.625*exp(-3*t)+.8*exp(-4*t)

(1)

``

NULL

e3 := `<,>`(1, 1, 1); E := proc (m) options operator, arrow; IdentityMatrix(m) end proc; beta := `<|>`(.1, .6, .3); S := `<|>`(`<,>`(-3, 1, 1), `<,>`(1, -5, 2), `<,>`(0, 2, -4)); S0 := -S.e3

beta := Vector[row](3, {(1) = .1, (2) = .6, (3) = .3})

 

S := Matrix(3, 3, {(1, 1) = -3, (1, 2) = 1, (1, 3) = 0, (2, 1) = 1, (2, 2) = -5, (2, 3) = 2, (3, 1) = 1, (3, 2) = 2, (3, 3) = -4})

 

S0 := Vector(3, {(1) = 2, (2) = 2, (3) = 1})

(2)

NULL

NULL

Z := `<|>`(x, y, z)

Z := Vector[row](3, {(1) = x, (2) = y, (3) = z})

(3)

ME := MatrixFunction(S+S0.Z, exp(t), t)

``

MEint := ME*(int(dF, t = 0 .. infinity))

``

Temp := fsolve(Equate(Z, beta.MEint))

{x = .1296853934-0.2874595325e-10*I, y = 0.9612770589e-1-0.2187483892e-10*I, z = 0.8996444123e-1-0.2022754781e-10*I}

(4)

assign(Temp)

Z

Vector[row]([x, y, z])

(5)

MEtest := MatrixExponential(S+S0.Z, t)*dF

beta.map(proc (c) options operator, arrow; int(c, t = 0 .. infinity) end proc, MEtest)

Vector[row]([.169346294590000-0.859024305330000e-11*I, .319089156366000-0.626232025790000e-11*I, .235764277699000-0.575715541450000e-11*I])

(6)

NULL

NULL

NULL

 

Download correctedex_1.mw

 

@Markiyan Hirnyk

I have checked the correctedex.mw code and the solution (value of Z) doesn't satisfy the equation

 

 

 

Please check the code I have attached.

restart; with(LinearAlgebra)

NULL

``

dF := -.525*exp(-7*t)+2.625*exp(-3*t)+.8*exp(-4*t);

-.525*exp(-7*t)+2.625*exp(-3*t)+.8*exp(-4*t)

(1)

NULL

``

e3 := `<,>`(1, 1, 1); E := proc (m) options operator, arrow; IdentityMatrix(m) end proc; beta := `<|>`(.1, .6, .3); S := `<|>`(`<,>`(-3, 1, 1), `<,>`(1, -5, 2), `<,>`(0, 2, -4)); S0 := -S.e3

beta := Vector[row](3, {(1) = .1, (2) = .6, (3) = .3})

 

S := Matrix(3, 3, {(1, 1) = -3, (1, 2) = 1, (1, 3) = 0, (2, 1) = 1, (2, 2) = -5, (2, 3) = 2, (3, 1) = 1, (3, 2) = 2, (3, 3) = -4})

 

S0 := Vector(3, {(1) = 2, (2) = 2, (3) = 1})

(2)

``

Z := `<|>`(x, y, z)

Z := Vector[row](3, {(1) = x, (2) = y, (3) = z})

(3)

ME := MatrixFunction(S+Typesetting:-delayDotProduct(S0, Z), exp(t), t):

NULL

MEint := ME*(int(dF, t = 0 .. infinity)):

NULL

Temp := fsolve(Equate(Z, Typesetting:-delayDotProduct(beta, MEint)));

{x = .1296853934-0.2874595325e-10*I, y = 0.9612770589e-1-0.2187483892e-10*I, z = 0.8996444123e-1-0.2022754781e-10*I}

(4)

assign(Temp);

Z

Vector[row]([x, y, z])

(5)

MEtest := MatrixExponential(S+Typesetting:-delayDotProduct(S0, Z), t)*dF:

beta.map(proc (c) options operator, arrow; int(c, t = 0 .. infinity) end proc, MEtest)

Vector[row]([.169346294590000-0.859024305330000e-11*I, .319089156366000-0.626232025790000e-11*I, .235764277699000-0.575715541450000e-11*I])

(6)

``

``

``


Download correctedex_1.mw

@Markiyan Hirnyk Thank you very much

@Carl Love 

I have attached the maple program where fnormal fails to do the cancellation of factors.

checking.mw

@Carl Love 

I used fnormal to cancel nonzero factors only.

I want to cancel the zero factors, but I don't know how to do that?

e.g., I want to cancel R(x)=x f(x)/(x-4.94866427965495204 10^(-101)) g(x)

as 4.94866427965495204 10^(-101) is approximately equal to 0. I want to cancel the factor x with (x-4.94866427965495204 10^(-101)).

I think, I am clear to you now?

@Markiyan Hirnyk  it works fine

 

@Markiyan Hirnyk  I forgot to give braces at proper places. My question was a rational function whose numerator consists of 17 factors and the denominator consists of 18 factor between which 9 factors are matching up to 10 digits. I want to get the 10 factors cancelled automatically by the code.

@Markiyan Hirnyk  My R(s) contains 17 factors in the numerator and 18 factors in the denominator, out of 9 factors are to be cancelled as they match upto 10 digits. 

@Kitonum if i want to write the code only for the product of linear factors missing an intermediate factor

i.e. (s-a_1)(s-a_3)(s-a_4)(s-a_5)...(s-a_100) then what to write

@ecterrab Can you please give a working example with maple code for that.

 

@Adri van der Meer why ''i to 10 " not "i from 1 to 10" or some different number.

 

@Carl Love I am getting that sum by manual addition. Can you please rewrite my program correctly to get that sum. Also can we give a restriction to the number of roots satisfying the condition that component sum is a constant.

restart; with(LinearAlgebra); with(inttrans); with(RootFinding); with(PolynomialTools); with(powseries);
Digits := 10;
10
Bstar := 3.60/(12.0+s)+14.00/(20.0+s);
3.60 14.00
-------- + --------
12.0 + s 20.0 + s
Nrot := [-23.8279785337007-4.37234259951331*I, -23.8279785337007+4.37234259951331*I, -13.8480664440518, -12.2635728941426-2.65264168833545*I, -12.2635728941426+2.65264168833545*I, -4.24998018723859];
[-23.8279785337007 - 4.37234259951331 I,

-23.8279785337007 + 4.37234259951331 I, -13.8480664440518,

-12.2635728941426 - 2.65264168833545 I,

-12.2635728941426 + 2.65264168833545 I, -4.24998018723859]
rfw := unapply(product(-Bstar*gm[i]+1, i = 1 .. 6), s);
for i to 6 do b[i] := rfw(Nrot[i]) end do;
solve({b[1] = 0, b[2] = 0, b[3] = 0, b[4] = 0, b[5] = 0, b[6] = 0}, {gm[1], gm[2], gm[3], gm[4], gm[5], gm[6]});
Warning, returning only the first 100 solutions, increase _MaxSols to see more solutions

questn.mw       

please see the attachment above for a specific example.

 

why my upload file is not visible

 

1 2 3 Page 2 of 3