MaplePrimes Questions

Help!!

Why do the first two of the following 4 examples not work in Maple 15?

subs(m=21,`mod`(m, 4));
subs(m=21,m mod(4));
                               21
                               21
`mod`(21, 4);
21 mod(4);

                               1
                               1
Is there a (simple) workaround?

Thanks.

Hi:
i have two functions(f(x)&g(x)),i calculated values this functions with numerical method(dsolve,numeric),
now i will plot the f(x)-g(x) for 0<x<1,how do this work?

Can someone help me to solve system of equations please. I have a system of 8 complex valued equations, with 8 unknowns: _C1,_C2........_C8

Equation system looks like:

eq_system:={ -3.248046797 10 _C1 + 1.773373463 10 _C2 + (2.182313824 10 - 9.987524076 10 I) _C3 + 1.773373463 10 _C4 = -7.389056097 10 _C2- 7.389056097 10 _C4+ (4.161468365 10 + 9.092974265 10 I)_C3,

............}  its only 1st equation, others are similar.

It looks rather simple though I am not able to solve it with solve or fsolve commands. What I'm doing wrong?

solve(eq_system,{_C1,_C2,_C3,_C4,_C5,_C6,_C7,_C8});

Hello! I wrote a program in Maple but it doesn't work. It crashes with the following error: "Error, (in r_nach_1[3]) too many levels of recursion". I am a newbie in Maple and don't know how to solve this problem. A part of my program that causes the error is given below. Many thanks!

maple.mws


restart;
t1F := 20: A11 := 2.5*10^(-3): c1 := 4*10^2: ss1 := 0.5*10^(-2):
pI1 := 0.4*10^(-1): r1max := 0.6*10^(-2): procent:=0.2:
A12 := procent*A11: B1:=-1: alpha:=0.000001:

beta1:=0.5: r_nach_1[1]:=0: r_nach_1[2]:=0.2*10^(-2):


iter_psi_c1_1:=proc(t) 0 end proc: iter_psi_c2_1:=proc(t) 0 end proc:
s1[1]:=proc(t) 0 end proc:



for i from 1 to 2 do

_p11 := evalf(dsolve({
diff(p1(t), t) = A11*(p1(t)-'s1'[i](t))+B1*(r_nach_1[i+1](t)-r_nach_1[i](t))+A12*(p1(t)-'s1'[i](t))^2+ss1,
p1(0) = pI1}, numeric,method = dverk78, abserr = 1.*10^(-8), relerr = 1.*10^(-8),optimize,output = listprocedure, known=[s1[i],iter_psi_c1_1,iter_psi_c2_1])):

p1F := rhs(_p11(t1F)[2]):
s1[i+1] := subs(_p11, p1(t)):

q11 := evalf(dsolve({diff(q1(t), t) = c1*r_nach_1[i+1](t), q1(0) = 0},numeric,range=0..t1F,known=[iter_psi_c1_1,iter_psi_c2_1])):

q1F := rhs(q11(t1F)[2]):


F[i]:= beta1*q1F;

_psi_c1_1 :=
evalf(dsolve({
diff(psi_c1_1(t), t) = A11+2*A12*('s1'[i+1](t)-'s1'[i](t))*psi_c1_1(t), psi_c1_1(t1F) =  -1+beta1},numeric,method = dverk78, abserr = 1.*10^(-8), relerr = 1.*10^(-8),optimize,known=[s1[i],s1[i+1]],output=listprocedure)):

_psi_c2_1 :=evalf(dsolve({
diff(psi_c2_1(t), t) = 0, psi_c2_1(t1F) =  -beta1},numeric,output=listprocedure)):
iter_psi_c1_1 := op([2,2],_psi_c1_1):
iter_psi_c2_1 := op([2,2],_psi_c2_1):

r_nach_1[i+2] := t-> r_nach_1[i+1](t) +  alpha*(B1*(iter_psi_c1_1(t)) + (c1*iter_psi_c2_1(t))):

_p11 := evalf(dsolve({
diff(p1(t), t) = A11*(p1(t)-'s1'[i+1](t))+B1*(r_nach_1[i+2](t)-r_nach_1[i+1](t))+A12*(p1(t)-'s1'[i+1](t))^2+ss1,
p1(0) = pI1}, numeric,method = dverk78, abserr = 1.*10^(-8), relerr = 1.*10^(-8),optimize, output = listprocedure, known=[s1[i+1],iter_psi_c1_1,iter_psi_c2_1])):

p1F := rhs(_p11(t1F)[2]):

s1[i+2] := subs(_p11, p1(t)):

q11 := evalf(dsolve({diff(q1(t), t) = c1*r_nach_1[i+2](t), q1(0) = 0},numeric,range=0..t1F,known=[iter_psi_c1_1,iter_psi_c2_1])):

q1F := rhs(q11(t1F)[2]):

F[i+1]:= beta1*q1F;


od:
Error, (in r_nach_1[3]) too many levels of recursion

Is it possible to generate a list of values for a function in the form of an ordered pair, like

a cartesian plane, i.e. ( x, f(x) )? And how can I plot a graph with this output?

thanks in advance.

f:=piecewise(x>0,1+x,x=0,2,x<0,1+x^2)

in my work i must use some parts of this piecewise function.

But i don't know how can i call the part that i will use.

How can i do that ?

Thanks for help

 

Hi:

i will seprate coefficients of a,a^2,a^3 and this coefficients equivalent zero(0) in EQ below,how can i do this?

EQ:= 3.522088319*10^(-10)*a^2*q21(T)+3.522088319*10^(-10)*a^3*q22(T)-6.094634327*10^(-16)*a*q41(T)-6.094634327*10^(-16)*a^2*q42(T)+6.094634327*10^(-16)*a*q51(T)+6.094634327*10^(-16)*a^2*q52(T)-1.106493792*10^(-9)*a*q11(T)-1.106493792*10^(-9)*a^2*q12(T)+2.429209785*10^(-24)*a^2*(diff(q21(T), T, T))+2.429209785*10^(-24)*a^3*(diff(q22(T), T, T)) = 0

I have a table of data arranged in the following columns: Year, Jan, Feb, Mar,..,Dec in Excel or csv

I would like to import this data into a time series in Maple so I can plot the result.

What is the simplest way of doing this?

 

Hi,

I have a mistake in these lines but I d'ont know the exact error. There is no numeric value of g(1,1)=4???????????????  Thanks for your help.

restart;
vvv:=n^2+3*m;  
g:=(n,m)->vvv;
g(1,1);  No display of the value 4
                               

Hi,

I have these lines in my code, the function alpha:=(m,n,1)->...... is defined in the last line of the code below, but when I want to calculate alpah(1,1,1), there is no numeric value. Why????  Many thinks

 

 restart:
with(LinearAlgebra):
with(plots):
with(PDEtools):
with(IntegrationTools):
interface(rtablesize=20):
d:=1: N:=2: a:=1: h:=a/N:
Kernel(x,y):=ln(abs(x-y)):

 eq2:=int(Kernel(x,y)*phi(y),y=-a..a)=sum(int(Kernel(x,y)*phi(y),y=n*h..(n+d)*h),n=-N..N-d):

Approximate the integral
eq3:=phi->int(Kernel(x,y)*phi(y),y=n*h..(n+d)*h)=add(beta[i,n]*phi((n+i-1)*h),i=1..d+1):
eq4:=int(Kernel(x,y)*phi(y),y=n*h..(n+d)*h)=add(alpha[m,n,i]*phi((n+i-1)*h),i=1..d+1):

Compute the coefficients  beta[i]

Vct_basis:=[seq(x^i,i=0..d+1)]:
fct:=[seq(unapply(Vct_basis[i],x),i=1..d+2)]:


sys:=[seq(eq3(fct[i]),i=1..d+1)]:
x:=m*h:
w := [seq(beta[i,n],i=1..d+1)]:
M,b := GenerateMatrix(sys,w):

M1:=-M: V:=-b:

Vect_beta:=(M1)^(-1).V:# Vect_beta is a vector.

beta[1]:=Vect_beta[1]:  
alpha1:=(n,m)->beta[1];
(n, m) -> beta[1]
alpaha(1,1);
                                alpaha(1, 1)  ??????????????????? No numeric result


Hi all,

Command collect can view a expression a as a general polynomial in specific indeterminate x with the calling sequence:

collect(a, x, form, func)

where form and func are optional arguments.

 

Then, I encountered a form like this:

collect(a, x, normal)

 

I'm not sure what does normal means in this case and cannot find the related information from Maple Help.

Does anyone know this? I'd appreciate any help on this topic.

Thanks a lot :)

(Sorry to not offer the worksheet file due to a private issue)

I'm trying to interpolate values using spline (data,x,degrees=2).

So I'm setting curvefit:=spline(data,x,degrees=2);

fsolve(curvefit=4,x);

However, I'm trying to solve this over a range of values in matrix M:=1..2000;

I'm sifting through the online documentation, but I can't find a proper way to do this. Ideally, i'd want to store the results as a seperate matrix.

It's been a while since I touched Maple. Just picked it up again to do some stat work, and I'm feeling a bit out of my element having been to accustomed to things like Matl.... (I mean the software that shall not be named).

Is there a way to convert a single array/matrix into multiple arrays?

 Scenario:

1 1
2 7
3 8
4 9
5 10
6 14
7 20

It's easy just to copy and past this as a single element within a worksheet. However, I want to get it so that it's formated like data = [[1,1],[2,7],[3,8],etc...]

Is there a way to reformat into individual elements once everything is in one large array? I'm basically copy and pasting a huge mess of cells from Excel and am looking to see if there's a simplier solution than manual data entry.

Hi,

I have an error how can I fix the error. Thank you.

Matrix_Fred:=proc(N,d,lambda)
local Kernel,K,Fredholm,phi,MatA,eq2,eq3,eq4,Vct_basis,fct,sys,M,b,M1,Vect_beta,W,i,beta,alpha,eq5,eq6,x,Subs1,Fredholm_stencil,Stencil,w,V,sys1,sys2,Subs2,sys3,Sol_phi;
Fredholm:=phi(x)=f(x)+lambda*int(Kernel(x,y)*phi(y),y=-a..a);
Kernel:=(x,y)->ln(abs(x-y));
eq2:=int(Kernel(x,y)*phi(y),y=-a..a)=sum(int(Kernel(x,y)*phi(y),y=n*h..(n+d)*h),n=-N..N-d);
eq3:=phi->int(Kernel(x,y)*phi(y),y=n*h..(n+d)*h)=add(beta[i,n]*phi((n+i-1)*h),i=1..d+1);
eq4:=int(Kernel(x,y)*phi(y),y=n*h..(n+d)*h)=add(alpha[m,n,i]*phi((n+i-1)*h),i=1..d+1);
Vct_basis:=[seq(x^i,i=0..d+1)];
fct:=[seq(unapply('Vct_basis[i]','x'),i=1..d+2)];
sys:=[seq(eq3(fct[i]),i=1..d+1)];
w := [seq(beta[i,n],i=1..d+1)];
M,b := GenerateMatrix(sys,w);
M1:=-M; V:=-b;
Vect_beta:=(M1)^(-1).V;
for i from 1 to d+1 do
beta[i,n]:=Vect_beta[i];  
end do;
x:=m*h;
for i from 1 to d+1 do
alpha[m,n,i]:=unapply(beta[i,n],n,m);
end do;
eq5:=lhs(eq2)=sum(rhs(eq4), n=-N..N-d);
eq6:=subs(x=m*h,subs(lhs(eq5)=rhs(eq5) ,Fredholm)):
Subs1 :=[seq(phi(m*h)=phi[m], m=-N..N)];
Fredholm_stencil:=subs(Subs1,eq6):
Stencil[1] := unapply(Fredholm_stencil,m,lambda,phi,f);
sys1 := [seq(Stencil[1](m,lambda,phi,f),m=-N..N)]:
sys2:=subs(Subs1,sys1):
Subs2:=[seq(f(m*h)=f[m], m=-N..N)]:
sys3:=subs(Subs2,sys2):
Sol_phi := [seq(phi[i],i=-N..N)]; # The unknown vector must be computed.
MatA := GenerateMatrix(convert(sys3,list),Sol_phi)[1];
return MatA;
end proc:




d:=1; N:=2; lambda:=3/Pi;
Matrix_Fred(N,d,lambda);
                                      1
                                      2
                                     3
                                     --
                                     Pi
Error, (in rtable/Power) singular matrix

First 1432 1433 1434 1435 1436 1437 1438 Last Page 1434 of 2434