Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi, in attached code pauldaas_05.mw, the procedure 'aFshear' and 'aFmoment' must be called within procedure ´aF0011´.

The procedures ´aF0011´, 'aFshear', 'aFmoment' build the matrixes R, C1 and C2 respectively.

Unfortunately ('aFshear' and 'aFmoment') gives 'Error, invalid left hand side in assignment'.

It is strange that ´aF0011´ can call them separately ('aFshear' or 'aFmoment') but not both ('aFshear' and 'aFmoment').

Maybe there should be an 'unassign' statement for 'L'  somewhere. I tried that but without result.

Is there anyone who can help me.

 

 

restart:
with(linalg):
L:=Vector[row]([''RA'',''MA'',''thetaA'',''yA'',''RB'',''MB'',''thetaB'',''yB'']):
R:=Matrix(0,8,0):
C1:=Matrix(0,10,0):
C2:=Matrix(0,10,0):


aF0011:=proc(nr,a,l,F,EI)
local B,RA,MA,thetaA,yA,RB,MB,thetaB,yB,aF;
global R;
R:=extend(R,1,0,0);
B[RA]:=0;
B[MA]:=0;
B[thetaA]:=F*(l-a)^2/(2*EI);
B[yA]:=-F*(a^3-3*a*l^2+2*l^3)/(6*EI);
B[RB]:=F;
B[MB]:=-F*(l-a);
B[thetaB]:=0;
B[yB]:=0;
B:=Matrix( [seq(B[i],i in [RA,MA,thetaA,yA,RB,MB,thetaB,yB])]);
copyinto(B,R,nr,1);
aFshear(nr,R);   #nested procedure
aFmoment(nr,R);  #nested procedure
end:

aFshear:=proc(nr,R)
local i,c;
global C1;
C1:=extend(C1,1,0,0);
R:=convert(R,Matrix);
zip(assign,L,R[nr,..]);
c[0]:=RA;
c[1]:=0;
c[2]:=0;
c[3]:=0;
c[4]:=-F;
c[5]:=0;
c[6]:=0;
c[7]:=0;
c[8]:=0;
c[9]:=0;
c:=Matrix([seq(c[i],i in [0,1,2,3,4,5,6,7,8,9])]);
copyinto(c,C1,nr,1);
end proc:

aFmoment:=proc(nr,R)
local i,c;
global C2;
C2:=extend(C2,1,0,0);
R:=convert(R,Matrix);
zip(assign,L,R[nr,..]);
c[0]:=MA;
c[1]:=RA;
c[2]:=0;
c[3]:=0;
c[4]:=0;
c[5]:=-F;
c[6]:=0;
c[7]:=0;
c[8]:=0;
c[9]:=0;
c:=Matrix([seq(c[i],i in [0,1,2,3,4,5,6,7,8,9])]);
copyinto(c,C2,nr,1);
end proc:

aF0011(1,a__1,l,F__1,EI):
aF0011(2,a__2,l,F__2,EI):
aF0011(3,a__3,l,F__3,EI):
R:=convert(R,Matrix);
C1:=convert(C1,Matrix);
C2:=convert(C2,Matrix);

l:=8000:
F__1:=15000:
F__2:=20000:
F__3:=35000:
a__1:=2000:
a__2:=2000:
a__3:=6000:
EI:=2E+5*2.49E+7:
R;
C1;
C2;

I have a system of ODEs with parameters, p[i], and variables, x[i].

f := [
-p[1]*x[1]^2+x[2],
-2*p[1]^2*x[1]^3+2*p[1]*x[1]*x[2]+x[1]+1
];

associated with the innitial conditions:
[x[1](0) = p[2], x[2](0) = p[3]].

I have sets of parameters that i am interested in

[p[1] = 1, p[2] = 2, p[3] = 3]
[p[1] = 2, p[2] = 2, p[3] = 7]
[p[1] = 3, p[2] = 2, p[3] = 11]
[p[1] = 4, p[2] = 2, p[3] = 15]
[p[1] = 5, p[2] = 2, p[3] = 19]
[p[1] = 6, p[2] = 2, p[3] = 23]
and so on.


The solutions for these equations appear to be anisotropic scalings of each other.

i.e.

/xh[1]\ =/1 0\ /x[1]\      
\xh[2]/   \0 q/ \x[2]/

where x is the variable for one parameter vector and xh is the variable for another; and q is a nuimber I am interesting in working out (and think may be p[1]).

how do you work out q?

[this is in fact a complicated way of asking when I numerically integrate an ODE on maple how do i get access to the sequence of numbers in the result]

Hi,

It might be a very basic question, but I am having trouble with the substitution of multiplication of symbols.  I have a equation in the format of     N*x*y-x*y+f(x,y)=0, and I need to substitute xy=1 in this equation without interferring in f(x,y).

When I am using subs commnad in maple, it is not recognizing xy nad giving me the same equation.

I really appreciate help in this matter.

Thanks in advance

Regards

Sunit

Dear Users!

Hope you are doing well. Below is the code to solve system of equations

restart;M:=3;
u[0, 0] := tau[1]-2*tau[2]+3*tau[3] = 1;
u[0, 1] := tau[1]-tau[3] = 1/2;
u[0, 2] := tau[1]+2*tau[2]+3*tau[3] = 2;
SOL[0] := fsolve({seq(`$`(u[0, l1], l1 = 0 .. M-1))});

the solutions SOL[0] := {tau[1] = .7500000000, tau[2] = .2500000000, tau[3] = .2500000000}
I want to define a vector of order M*1 having the solution of of tau's like that

[.7500000000  .2500000000  .2500000000]

I'm waiting for you positive response. Thanks in advance.
Special request to:
@acer @Carl Love @Kitonum @Preben Alsholm

I need to set up in Maple the following binary operation $*$:

where $Q$ can be chosen to be a specific function (linear, polynomial, exponential or any other elementary function) of its input, while $\phi$ is kept the way it is (just "some function of $u$").

The main purpose of this Maple exercise is to check associativity of operation $*$ for various choices of $Q$.
Without $\phi$ (or $\phi$ being an identity map), I think I could check the associativity of $*$ with basic Maple syntax.  But keeping $\phi$ unknown makes it confusing.  Any advice on how to introduce this operation in Maple?
How to study this ellipse with LinearAlgebra without "geometry" eq := -185173378616457/6178315520000*x+86813215770519/24713262080000*(y^2)+126906272070543/24713262080000*(x^2)+256107247454961/6178315520000+(2514994832007/950510080000*x)*y-9123740375967/6178315520000*y = 0 Axis ? foci ? ...Thank you

Hello;
Anyone can guide to make the code of this expression

 

Based on the equation at here https://www.mapleprimes.com/questions/209660-Problem-With-RealDomainsolve

I tried solve the equation (x-1)*sqrt(x^2 - 4)=0 in Real domain. My code
restart;
RealDomain:-solve((x-1)*sqrt(x^2-4) = 0, x);


I got there solutions are 1, 2, -2.  I think, If we solve the given in RealDomain, we only get two solutions -2 and 2.

My question is: How many solutions are there in the equation (x-1)*sqrt(x^2 - 4)=0 by RealDomain:-solve?

Two pictures by using Mathematica.

Hi,
I would like to trace periodic functions. I saw that this was possible with the old 'FourierSeries' package with the "Rept" command. How to reproduce the same thing in the Maple 19 environment? Thank you

fs_examples.mw

I am trying to get the exponential Fourier series versiion  with C_n seperate and it appears this package https://www.maplesoft.com/applications/view.aspx?SID=4857&view=html seems to do this

While I'm not particular to this package https://www.maplesoft.com/applications/view.aspx?SID=4857&view=html I cannot get it to work. It could be that FourierSeries is not built into maple in which case only the worksheet appears to be availble on the link above with no application in which case it should be removed.

If not an alternative would do. For example I got this https://www.maplesoft.com/applications/view.aspx?SID=33406 to work but I cannot get it in  format like Khanshan's package see example output (1.7).

1. y''(x)+10y(x)=99sin(x), y(0)=1, y'(0)=11 in the interval [0,100]

the exact solution is y(x)=cos(10x)+sin(10x)+sin(x)

 

2. y'=z, y(0)=1

    z'=-y(x)+x, z(0)=2

    the exact solutions are y(x)=cos(x)+sin(x)+x, z(x)=cos(x)-sin(10x)+1

 

Hello all, 

I know this question is a little bit of stretch but is there any way to shuffle terms in an equation set, making those equations written in a standard form?

For example, here are three equations:

eq1:=(L1/n12 + n12*L2)*diff(i2(t), t) + L1*diff(i3(t), t)/n13 = -v1(t) - R1*i3(t)/n13 - R1*i2(t)/n12 + n12*v2(t) - n12*R2*i2(t);

eq2:=L1*diff(i2(t), t)/n12 + (L1/n13 + n13*L3)*diff(i3(t), t) = -v1(t) - R1*i3(t)/n13 - R1*i2(t)/n12 + n13*v3(t) - n13*R3*i3(t);

eq3:=-L2*diff(i2(t), t) + L1*diff(i1(t), t)/n12 = -v2(t) + R2*i2(t) + v1(t)/n12 - R1*i1(t)/n12;

In this equation set, it can be inferred that 'i1(t)', 'i2(t)' and 'i3(t)' would be the state variables and 'v1(t)', 'v2(t)' and 'v3(t)' are external input variables. 

Then, probably the set can be rewritten in the state space equation form, i.e., diff(X) = A*X + B*U, where X is the state variables vector and U is a vector of external input variables. 

Is there any chance to make Maple to rewrite the equations in this way?

Thank you in advance. 

 

fyi, there seems to be a problem here. Maple 2019, Physics version 395 on windows 10.

The solution given to this wave PDE by Maple as sum that starts from zero, has "n" in the denominator. When n=0, this gives division by zero.  Is this a bug?

restart;
L:=3: c:=4: h:=1/10: b:=Pi*c/L:
f:=piecewise(0<=x and x<=L/3,3*h/L*x,L/3<x and x<=L,h):
pde := diff(u(x,t),t$2) + b*diff(u(x,t),t) = c^2*diff(u(x,t),x$2):
bc  := u(0,t)=0,D[1](u)(L,t)=0:
ic  := D[2](u)(x,0)=0,u(x,0)=f:
sol:=pdsolve([pde,bc,ic],u(x,t));
subs(n=0,sol)

u(x, t) = Sum(-((3/10)*I)*sin((1/6)*(1+2*n)*Pi*x)*(3^(1/2)*sin((1/3)*Pi*n)+cos((1/3)*Pi*n))*((2*I)*exp((4/3)*t*(I*n^(1/2)*(n+1)^(1/2)-1/2)*Pi)*n^(1/2)*(n+1)^(1/2)+(2*I)*exp(-(4/3)*(I*n^(1/2)*(n+1)^(1/2)+1/2)*t*Pi)*n^(1/2)*(n+1)^(1/2)+exp((4/3)*t*(I*n^(1/2)*(n+1)^(1/2)-1/2)*Pi)-exp(-(4/3)*(I*n^(1/2)*(n+1)^(1/2)+1/2)*t*Pi))/(n^(1/2)*(n+1)^(1/2)*Pi^2*(1+2*n)^2), n = 0 .. infinity)

Error, numeric exception: division by zero

 


 

Download bug_july_11_2019.mw

 

 

Let m, n be two monomials with parametric coefficients. How to decide that two monomials are distinct in the variables?

For example, if m= (a-1)x^2y and b= (a-b)z^2 (where a,b are parameters and x,y,z are variables) then m and n are distinct. Is there any command? 

Thank you in advance.

 

Hello,

I need help to approximate Fn(x,y) and Sn(y) for n>=3 to see the convergence. 

Here is the problem:

I have an integral equation Fn(x, y) defined by

F0(x,y) = 0,

F1(x,y) = (9/8)*(y+1) - (21/8)*( y*exp(-2*x) + exp(-x) )

Fn+1(x,y) = (9/8)*(y+1) - (21/8)*( y*exp(-2*x) + exp(-x) ) + (3/4)*int ( Fn( x-z, 2*y*exp(-z) ), z=0..Un(x) ), where the function Un(x) is defined below.

where I suppose that Fn(x,y) >=0 and y>=0 and x>=0. I am iterating the integral equation and find the zeros Sn(y) solutions of Fn(S(y) , y) = 0. The goal is to show that the sequence Fn(x,y) converges to some F(x,y) and Sn(y) converges to some S(y). We can also plot the curves Sn(y) to show the convergence. Notice that Sn(y) >= 0 is increasing in n and decreasing in y.

What I did :

If n = 0, I solve F1(x,y) = 0 and find analytically x = S1(y) = -ln((1/14)*(-7+sqrt(84*y^2+84*y+49))/y). Notice that F1(x,y) = 0 is quadratic in exp(-x) and then F1(x,y) = 0 is easy to solve. S1(y) is the positive function for y>=0.

If n = 1, we need to solve F2(x,y) = (9/8)*(y+1) -(21/8)*( y*exp(-2*x) + exp(-x) ) + (3/4)*int ( F1( x-z, 2*y*exp(-z) ), z, 0, U1(x) ). The function U1(x) is obtained as follows :

i) We define g( U ) = U + S1( 2*y*exp(-U) )

ii) We find the function U1(x,y) solution of g( U1(x,y) ) = x

 

A generalization of Un(x) is given by

i) Define g( U ) = U + Sn( 2*y*exp(-U) )

ii) Find the function Un(x,y) solution of g( Un(x,y) ) = x

The curve S2(y) :

I find the analytic function F2(x, y), but it is impossible to solve F2(x,y) = 0 and find x = S2(y) analytically. So I choose an interval [0, 10] for y and discretize that interval. Now at each point yi in [0, 10], the function F2(x, yi) depends only on x. I apply the bisection method (dichotomic method) and find the value xi such that F2(xi, yi) = 0. The data (yi, xi) gives the curve S2(y). I plot the data (yi, xi) and (y, S1(y)) in the same curve.

Question:

It is impossible to iterate the process below and find F3(x, y), F4(x,y), etc... because we cannot find U2(x), U3(x), etc... analytically. Any suggestions or helps to plot the curves (y, Sn(y)) for n = 3, 4, etc. to see the convergence ?

Thanks !

First 538 539 540 541 542 543 544 Last Page 540 of 2097