MaplePrimes Questions

I have this system

eq1 := diff(x(t), t)-(1/6)*(6*x(t)^3*y(t)+(2*y(t)^2-2)*x(t)^2+3*y(t)*(z(t)-2)*x(t)-2*y(t)^2+2)*sqrt(3) = 0;
                         
eq2 := diff(y(t), t)-(1/6)*(y(t)-1)*sqrt(3)*(y(t)+1)*(6*x(t)^2+2*y(t)*x(t)+3*z(t)-2) = 0;
                                    
eq3 := diff(z(t), t)-(1/3)*z(t)*sqrt(3)*(6*y(t)*x(t)^2+2*x(t)*y(t)^2+3*z(t)*y(t)-2*x(t)-3*y(t)) = 0;

I solved it numerically using these ics

ics := x(0) = -0.01, y(0) = .99, z(0) = 0.01

sol1 := dsolve({ics, op(syst)}, {x(t), y(t), z(t)}, type = numeric, output = listprocedure)

I need to use the x(t), y(t), z(t) as follows
  X :=  eval(x(t), sol1)
  Y :=  eval(y(t), sol1)

Z :=  eval(z(t), sol1)

to solve the following system for P(t), Q(t), R(t) numerically 
eq4 := diff(R(t), t)-P(t)*Z-(-2*(-Y^2+2)*X/sqrt(3)+sqrt(3)*(-2*X^2+Z+4/3)*Y)*R(t) = 0;
eq5 := diff(Q(t), t)-(2/3)*R(t)+2*((1/3)*Y+X)*P(t)/sqrt(3)-(-2*(-Y^2+2)*X/sqrt(3)+2*sqrt(3)*(X^2-(1/2)*Z-2/3)*X)*Q(t) = 0;
eq6 := diff(P(t), t)+(1/2)*R(t)+2*sqrt(3)*X*Q(t)+(2*(-Y^2+2)*X/sqrt(3)+sqrt(3)*(-2*X^2+Z+1)*Y)*P(t) = 0;

Any help please? 

Hey Guys, 

I have to solve multiple system of equations under some restrictions given as inequalities. Sometimes solve is not able to find the result in houres so I tryd to break the problem in half. So in the first step I just want to solve my 8 polynomial equations with 8 variables and in a second step I want so take the solutions, bring them together with the set of inequalities and solve it again. Since also some sets of equations are to hard for the simple solve command I got the advice from people of this plattform to try PolynomialSystem with the diffrent engines. However I have the feeling they make misstakes and now Im not sure If I can trust my results. 

Attached you can find a file with an example. In the beginning I solve equations and restrictions together and there is a solutions. Then I tryd to solve only the equations with PolynomialSystem and the the four known engines and the eniges traditional and backsolve dont find the solution which as we saw before exist. When a soultions holds under restrictions it should always appear if I omit the restirctions. When I use the enige triade and groebner then the right solution is there. 
However in some other cases it feels the other way round.
So to me it looks like no matter which engine I take, I can never 100% trust my results. Did I something wrong? Whats the reason for those mistakes? Furthermore backsolve gives me 7 solutions, but solutions 2 and 7 are the same. I also recognized, that there is a diffrence between putting in the variable vars as a list or a set. What happens, if I dont specify which engine should be used?

I am happy about any advice. Thank you in advance.

Regards

Felix

restart; equations := {-y*(m-p) = 0, ((-x-y+1)*k+x)*n+s*y-t = 0, (k-x-y)*t-k*p+y = 0, (-m+n+y)*x+m-1 = 0, -(x+y-1)*(p-t)*k+(-x-y+1)*t+x*p = 0, y^2+(-m-1)*y+1+x*(p-1) = 0, (-x-y+1)*t+(-m+1)*x+y*n+m-1 = 0, -k*n+s*x = 0}; restrictions := {0 < k, 0 < m, 0 < s, 0 < x, 0 < y, 0 < n+(t-1)*p, 0 < (m*y-1)*n+(1-p)*(m*x-m+1), 0 < (m*x-m-t+1)*p+m*y*(t-n), 1 < x+y, k < 1, m < 1, s < t, t < 1}; vars := indets(equations); evalf(solve(`union`(equations, restrictions), vars)); Sol_w := SolveTools:-PolynomialSystem(equations, vars); Sol_traditional := SolveTools:-PolynomialSystem(equations, vars, engine = traditional); nops([Sol_traditional]); Sol_backsolve := SolveTools:-PolynomialSystem(equations, vars, engine = backsolve); nops([Sol_backsolve]); Sol_triade_1 := SolveTools:-PolynomialSystem(equations, vars, engine = triade); nops([Sol_triade_1]); Sol_groebner := SolveTools:-PolynomialSystem(equations, vars, engine = groebner); nops([Sol_groebner])

{-y*(m-p) = 0, ((-x-y+1)*k+x)*n+s*y-t = 0, (k-x-y)*t-k*p+y = 0, (-m+n+y)*x+m-1 = 0, -(x+y-1)*(p-t)*k+(-x-y+1)*t+x*p = 0, y^2+(-m-1)*y+1+x*(p-1) = 0, (-x-y+1)*t+(-m+1)*x+y*n+m-1 = 0, -k*n+s*x = 0}

 

{k, m, n, p, s, t, x, y}

 

{k = 0.536796024e-1, m = .241141717, n = .54019322, p = .241141717, s = 0.35770767e-1, t = .4477103163, x = .8106439941, y = .6370663217}

 

{k = 1, m = m, n = 1, p = 0, s = 1, t = 1, x = 1, y = 0}, {k = 1, m = 1, n = 0, p = 1, s = t, t = t, x = 0, y = 1}, {k = k, m = 1, n = 0, p = 1, s = 1, t = 1, x = 0, y = 1}, {k = 1, m = 1, n = 0, p = 1, s = 0, t = 0, x = x, y = 1}, {k = 1/3, m = -1, n = 3, p = -1, s = 2, t = 2, x = 1/2, y = 0}, {k = 1/3, m = -1, n = 2, p = -1, s = 2/3, t = 2, x = 1, y = -1}, {k = -(1/9)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^4+(2/9)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^3+(16/9)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^2+(1/9)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)-7/9, m = (4/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^4-(20/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^3-(17/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^2+21*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)-28/3, n = (11/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^4-(53/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^3-(55/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^2+(152/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)-61/3,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= 1, m = 1, n = 0, p = 1, s = s, t = s, x = 0, y = 1}, {k = 1/3, m = -1, n = 2, p = -1, s = 2/3, t = 2, x = 1, y = -1}, {k = 1, m = 1, n = 0, p = 1, s = 0, t = 0, x = x, y = 1}

 

6

 

{k = 1, m = m, n = 1, p = 0, s = 1, t = 1, x = 1, y = 0}, {k = 1/3, m = -1, n = 3, p = -1, s = 2, t = 2, x = 1/2, y = 0}, {k = k, m = 1, n = 0, p = 1, s = 1, t = 1, x = 0, y = 1}, {k = 1, m = 1, n = 0, p = 1, s = s, t = s, x = 0, y = 1}, {k = 1/3, m = -1, n = 2, p = -1, s = 2/3, t = 2, x = 1, y = -1}, {k = 1, m = 1, n = 0, p = 1, s = 0, t = 0, x = x, y = 1}, {k = 1/3, m = -1, n = 3, p = -1, s = 2, t = 2, x = 1/2, y = 0}

 

7

 

{k = 1, m = 1, n = 0, p = 1, s = 0, t = 0, x = x, y = 1}, {k = 1, m = m, n = 1, p = 0, s = 1, t = 1, x = 1, y = 0}, {k = k, m = 1, n = 0, p = 1, s = 1, t = 1, x = 0, y = 1}, {k = 1, m = 1, n = 0, p = 1, s = t, t = t, x = 0, y = 1}, {k = -(1/9)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^4+(2/9)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^3+(16/9)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^2+(1/9)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)-7/9, m = (4/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^4-(20/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^3-(17/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^2+21*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)-28/3, n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^4-9*_Z^3+10*_Z^2+6*_Z-5)+4/3, y = RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)}, {k = 1/3, m = -1, n = 2, p = -1, s = 2/3, t = 2, x = 1, y = -1}, {k = 1/3, m = -1, n = 3, p = -1, s = 2, t = 2, x = 1/2, y = 0}

 

7

 

{k = 1, m = m, n = 1, p = 0, s = 1, t = 1, x = 1, y = 0}, {k = 1, m = 1, n = 0, p = 1, s = t, t = t, x = 0, y = 1}, {k = k, m = 1, n = 0, p = 1, s = 1, t = 1, x = 0, y = 1}, {k = 1, m = 1, n = 0, p = 1, s = 0, t = 0, x = x, y = 1}, {k = 1/3, m = -1, n = 3, p = -1, s = 2, t = 2, x = 1/2, y = 0}, {k = 1/3, m = -1, n = 2, p = -1, s = 2/3, t = 2, x = 1, y = -1}, {k = -(1/9)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^4+(2/9)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^3+(16/9)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^2+(1/9)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)-7/9, m = (4/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^4-(20/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^3-(17/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^2+21*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)-28/3, n = (11/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^4-(53/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^3-(55/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^2+(152/3)*RootOf(_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RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^4-4*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^3*(1/3)-8*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^2*(1/3)+7*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)*(1/3)+1/3, x = (1/3)*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^4-4*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^3*(1/3)-8*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)^2*(1/3)+4*RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)*(1/3)+4/3, y = RootOf(_Z^5-4*_Z^4-9*_Z^3+10*_Z^2+6*_Z-5)}))

{k = 0.536796024e-1, m = .241141717, n = .54019322, p = .241141717, s = 0.35770767e-1, t = .4477103163, x = .8106439941, y = .6370663217}, {k = .7943583912, m = 1.011543377, n = .16794280, p = 1.011543377, s = -.463558437, t = -.4040771797, x = -.287788440, y = .8837112597}, {k = -5.038767243, m = 3.694058367, n = 0.9373027e-1, p = 3.694058367, s = .299187114, t = 2.728412223, x = -1.578565716, y = 5.306977937}, {k = .2033642547, m = -26.40026363, n = -63.64948932, p = -26.40026363, s = 17.99511944, t = -2.562622110, x = -.719307867, y = -.8433142428}, {k = 2.542920564, m = -.546480183, n = 1.84762297, p = -.546480183, s = 1.244592174, t = .7905767063, x = 3.775017982, y = -1.984441276}

(2)
 

NULL

Can_I_trust_the_diffrent_eniges_of_Polynomial_Systems.mw

I have a simple question, but don't find a neat solution for it. I have 4 3d Vectors that result in the resulting Vector V5. I now want the unit vector of V5. How do I do it the most efficient way? 

My attempt is in the file attached. I get the error message: "Error, (in rtable/Power) exponentiation operation not defined for Vectors"

Thanks a lot for your help.3d_vector.mw

Assuming I have a sumpro function written in Maple 2016. How can I implement it in C# and what is the process?

Please help me.

sumpro := proc (i) local a, b;

        a := (rand(1 .. 10))(); b := (rand(1 .. 10))();

        print("Sum of ", a, " and ", b, " is ", a+b)

end proc;

save sumpro, "D://Sumpro.m"

sumpro := proc (i) local a, b; a := (rand(1 .. 10))(); b := (rand(1 .. 10))(); print("Sum of ", a, " and ", b, " is ", a+b) end proc:
``

save sumpro, "D://Sumpro.m"

``

Download mapleprime_sumpro_to_c.mw

This text is typed directly into the browser. I can now change the font size to something bigger. I can also change the font from Default to something else.

This text in Calibri 11 was pasted from Word. What do I have to do to change it to MaplePrimes default font (which I have used above)? Selecting default from 

does not work because default is already selected when I put the cursor into the pasted text.

What is the default font type by the way? Can I change it permanetly?

All on Windows 10 and with Firefox.

Hi

If possible, please help me write the steps to solve the following equation.

By setting the coefficients of the same power (Yi) on both sides of equation equal, we solution get

I have some cubic and quartic equations with complex cofficients. Maple 2015 is able to solve these and returns the roots as labelled sets, so I can do things like "plot S[1]". I want to vary some parameters in the coefficients, and see what happens to the roots.
My problem is when I log out and then rerun the code, the labels 1,2,3,(4) are frequently attached to different roots than they were the first time. This is both unexpected and inconvenient. Is there any way to ensure that the same roots are always given the same labels?

[moderator: see also this Question from 2023]

l45 := (x + 7)(x - 1) = (1 + x)^2;
                             "(->)"

Error, (in solve) cannot solve for an unknown function with other operations in its arguments

This is my first time working with plotting data from a matrix. However, with the help of a friends on MaplePrimes, I learned how to plot the data in both Maple and MATLAB. Despite this, I am having trouble with visualization. When I change the delta value, my function experiences vibrations or noise, which is clearly visible in the plot. But when I change delta, I encounter errors with my matrix data. How can I fix this problem? and there is any way for get better visualization by Explore ? also How show this vibration or noise in 2D?

restart;

randomize():

local gamma;

gamma

(1)

currentdir(kernelopts(':-homedir'))

NULL

T3 := (B[1]*(tanh(2*n^2*(delta^2-w)*k*t/((k*n-1)*(k*n+1))+x)-1))^(1/(2*n))*exp(I*(-k*x+w*t+delta*W(t)-delta^2*t))

(B[1]*(tanh(2*n^2*(delta^2-w)*k*t/((k*n-1)*(k*n+1))+x)-1))^((1/2)/n)*exp(I*(-k*x+w*t+delta*W(t)-delta^2*t))

(2)

NULL

params := {B[1]=1,n=2,delta=1,w=1,k=3 };

{delta = 1, k = 3, n = 2, w = 1, B[1] = 1}

(3)

NULL

insert numerical values

solnum :=subs(params, T3);

(tanh(x)-1)^(1/4)*exp(I*(-3*x+W(t)))

(4)

CodeGeneration['Matlab']('(tanh(x)-1)^(1/4)*exp(I*(-3*x+W(t)))')

Warning, the function names {W} are not recognized in the target language

 

cg = ((tanh(x) - 0.1e1) ^ (0.1e1 / 0.4e1)) * exp(i * (-0.3e1 * x + W(t)));

 

N := 100:

use Finance in:
  Wiener := WienerProcess():
  P := PathPlot(Wiener(t), t = 0..10, timesteps = N, replications = 1):
end use:

W__points := plottools:-getdata(P)[1, -1]:
t_grid := convert(W__points[..,1], list):
x_grid := [seq(-2..2, 4/N)]:

T, X := map(mul, [selectremove(has, [op(expand(solnum))], t)])[]:

ST := unapply(eval(T, W(t)=w), w)~(W__points[.., 2]):
SX := evalf(unapply(X, x)~(x_grid)):

STX := Matrix(N$2, (it, ix) -> ST[it]*SX[ix]);

_rtable[36893490640185799852]

(5)

opts := axis[1]=[tickmarks=[seq(k=nprintf("%1.1f", t_grid[k]), k=1..N, 40)]],
        axis[2]=[tickmarks=[seq(k=nprintf("%1.1f", x_grid[k]), k=1..N, 40)]],
        style=surface:

DocumentTools:-Tabulate(
  [
    plots:-matrixplot(Re~(STX), opts),
    plots:-matrixplot(Im~(STX), opts),
plots:-matrixplot(abs~(STX), opts)
  ]
  , width=60
)

"Tabulate"

(6)

MatlabFile := cat(currentdir(), "/ST2.txt"); ExportMatrix(MatlabFile, STX, target = MATLAB, format = rectangular, mode = ascii, format = entries)

421796

(7)

NULL

Download data-analysis.mw

After download MapleFlow 2024.2 "fsolve" return only one solution for a polynom of n-order.

Can I unchain by an hidden order?

A parallelogram is given in the Cartesian coordinate system. If the corner points of the parallelogram are connected to the midpoints of adjacent sides using lines, then the eight connecting lines form an octagon.
It must be proven that its area is one sixth of the parallelogram's area.

is(abs(x)=max(x,-x)) assuming real;

#  FAIL

I wonder if this will work in newer versions of Maple?

These two issues probably came up before, but I can't find where and when searching Maple primes.

So I thought to summarize the issues I see with odetest in one post, in the hope to get clarification on current status on these from the powers who know.

The first issue

The order in which odetest returns the answer. When odetest is called to check the ode and IC, as in 

the_status := odetest(sol,[ode,IC])

One would expect the_status to be a list, where the first entry tells if sol verifies the ode, and the second entry tells if sol verifies IC.

i.e. the order is the same as in the input. right? Since ode is first and IC is second in the input list.

But Maple sometimes mixes the order. See example 1 below. This makes it impossible to determine if the solution verifies the ode or IC,  when one of the entries in the_status is zero and the other is not, since order can be reversed sometimes.

Second issue:

When the solution is implicit, Maple gives invalid odetest result on the IC, unless one rewrites the solution using (lhs-rhs)(sol)=0.

i.e. move everything to the left side of the equation with RHS zero. This happens sometimes and when the solution is implicit.

I have thought this was fixed in current Maple, but it is not.  I remember this came up before, but can't find when and where.

Example 2 below shows an example.

Will these two issues hopefully be fixed in Maple 2025? Sometimes one forgets to rewrite the solution using (lhs-rhs)(sol)=0 and this results in false negative. 

Please see worksheet below. ps. I hope forum manager does not delete this question.

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1838 and is the same as the version installed in this computer, created 2024, December 2, 10:11 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

 

Example 1: order of status from odetest is not same as order of input

 

ode:=1+x*y(x)*(1+y(x)^2*x)*diff(y(x),x) = 0:
IC:=y(1) = 0:
sol:=x = 1/(3*exp(y(x)^2/2) - y(x)^2 - 2);

x = 1/(3*exp((1/2)*y(x)^2)-y(x)^2-2)

#we see that odetest verifies the ode
odetest(sol,ode)

0

#but when adding IC, 0 is now in second entry, instead of first

odetest(sol,[ode,IC])

[(y(x)^4-y(x)^2*y(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))*(D(y))(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))+y(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))^3*(D(y))(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))-6*y(x)^2*exp((1/2)*y(x)^2)+3*exp((1/2)*y(x)^2)*y(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))*(D(y))(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))+4*y(x)^2-2*y(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))*(D(y))(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))+9*exp(y(x)^2)-12*exp((1/2)*y(x)^2)+4)/(y(x)^2-3*exp((1/2)*y(x)^2)+2)^2, 0]

#SHOULD NOT zero above be in first slot in the list instead of second slot??

 

 

Example 2. We must write the solution using (lhs-rhs)(sol)=0

 

restart;

ode:=1+x*y(x)*(1+y(x)^2*x)*diff(y(x),x) = 0:
IC:=y(1) = 0:
sol:=x = 1/(3*exp(y(x)^2/2) - y(x)^2 - 2);

x = 1/(3*exp((1/2)*y(x)^2)-y(x)^2-2)

odetest((lhs-rhs)(sol)=0,[ode,IC])

[0, 0]

#we see that now it verified both IC and sol

 

 

 

 

Download issues_with_odetest_dec_16_2024.mw

I have a matrix for data analysis that I want to plot. Ideally, I would like to use Maple, but I’m struggling to create a well-designed plot suitable for submission to journals. Because of this, I’m considering transferring the data to Excel or constructing a 3D graph using MATLAB.

My question is: how can I transfer this data to Excel? The data is currently saved as a Notepad file, but I’m unsure how to convert it into an Excel format. I will upload a figure to show the data structure.

also in last runig program give me error which is (Error, (in ExportMatrix) permission denied

Thank you in advance for any help!

restart;

randomize():

local gamma;

gamma

(1)
 

T3 := (B[1]*(tanh(2*n^2*(delta^2-w)*k*t/((k*n-1)*(k*n+1))+x)-1))^(1/(2*n))*exp(I*(-k*x+w*t+delta*W(t)-delta^2*t))

(B[1]*(tanh(2*n^2*(delta^2-w)*k*t/((k*n-1)*(k*n+1))+x)-1))^((1/2)/n)*exp(I*(-k*x+w*t+delta*W(t)-delta^2*t))

(2)

``

params := {B[1]=1,n=2,delta=1,w=1,k=3 };

{delta = 1, k = 3, n = 2, w = 1, B[1] = 1}

(3)

``

insert numerical values

solnum :=subs(params, T3);

(tanh(x)-1)^(1/4)*exp(I*(-3*x+W(t)))

(4)

CodeGeneration['Matlab']('(tanh(x)-1)^(1/4)*exp(I*(-3*x+W(t)))')

Warning, the function names {W} are not recognized in the target language

 

cg = ((tanh(x) - 0.1e1) ^ (0.1e1 / 0.4e1)) * exp(i * (-0.3e1 * x + W(t)));

 

N := 100:

use Finance in:
  Wiener := WienerProcess():
  P := PathPlot(Wiener(t), t = 0..10, timesteps = N, replications = 1):
end use:

W__points := plottools:-getdata(P)[1, -1]:
t_grid := convert(W__points[..,1], list):
x_grid := [seq(-2..2, 4/N)]:

T, X := map(mul, [selectremove(has, [op(expand(solnum))], t)])[]:

ST := unapply(eval(T, W(t)=w), w)~(W__points[.., 2]):
SX := evalf(unapply(X, x)~(x_grid)):

STX := Matrix(N$2, (it, ix) -> ST[it]*SX[ix]);

_rtable[36893489786521178348]

(5)

opts := axis[1]=[tickmarks=[seq(k=nprintf("%1.1f", t_grid[k]), k=1..N, 40)]],
        axis[2]=[tickmarks=[seq(k=nprintf("%1.1f", x_grid[k]), k=1..N, 40)]],
        style=surface:

DocumentTools:-Tabulate(
  [
    plots:-matrixplot(Re~(STX), opts),
    plots:-matrixplot(Im~(STX), opts),
plots:-matrixplot(abs~(STX), opts)
  ]
  , width=60
)

"Tabulate"

(6)

MatlabFile := cat(currentdir(), "/ST2.txt"); ExportMatrix(MatlabFile, STX, target = MATLAB, format = rectangular, mode = ascii, format = entries)

Error, (in ExportMatrix) permission denied

 
 

 

Download data-analysis.mw

Hi!  I am trying to calculate a complex integral.  To double check my work, I directly coded the calculation.  The result is that the two results don't match.  Have I done something wrong?

here is the file

Complex_valued_integrals.mw

First 46 47 48 49 50 51 52 Last Page 48 of 2426