Unanswered Questions

This page lists MaplePrimes questions that have not yet received an answer

I am a new user of Maple. Could anyone help me to know how to call a Maple function/procedure from a Matlab program with a simple example? And conversely, how to call a Matlab function from Maple.

Say we solve numerically and ODE using Maple. Say ode1:= { diff(Q(x),x)= Q(x)/3x , Q(1)=1 }

The solution is a procedure so now suppose we have another ODE where the solution appears.Say  ode2:= { diff(f(x),x)= Q(x)*x , f(1)=4}.

To extract the solution of the first ODE I set sol1:=dsolve(ode1,numeric) and Q:=proc(x) local s: return rhs(sol(x)[2]): end proc:

But now I got an error message when I trying sol2:=dsolve(ode2,numeric).

Is it possible to use a procedure in the definition of the ODE one wants to solve?

 

Rewrite the code that counts the number of primes less than using an if-then statement.  Implement    your code where j goes from 2 to 15.

j:=1;
                               1
for i from 2 to 10
while ithprime(j)<2^i do
j:=j+1
end:
print(2^i,primes=j-1):
                        2048, primes = 9

I need to edit this code to satisfy a IF then Statement. can any one help me out?

\

regards "Geordi"

In doing multiple linear regression with Statistics:-LinearFit, how do I get or compute the values commonly called R^2 and R^2[adjusted], also known as the coefficient of determination? I know that residualsumofsquares is part of it. I also need the "total sum of squares" to compute R^2. And how do I modify that to get R^2[adjusted]? These things do not seem to be among the numerous output options to LinearFit. These values (R^2 and R^2[adjusted]) are typically part of the output of other statistics software when doing multiple regression.

I'd also like the p - values for the significance of the individual parameters and the p - value for the global utility---also things that are standardly reported by statistics software.

I am trying to create a procedure that can solve integrals using the Composite Simpson's 3/8 rule. However when I test my procedure against maple's ApproximateInt I am getting the wrong results.

Here is my attempt:

restart;


f:= x -> exp(x)*sin(4*x); # function I am using

simp := proc(a, b, n)
  local h, sum, i, single:
  h := (b-a)/n:
  sum := 0:
  single := (3*h/8) * (f(a) + f(b)): # this is the end points
    for i from a+h by h to b-h do
       sum := sum + (3*h/8) * (3*f(i)):
    end do:
print(evalf(sum + single));
end proc:


simp(0,1,12);
                                                                                0.6224486445
evalf(Student:-Calculus1:-ApproximateInt(f(x), 0..1, method = simpson[3/8], partition=12));

                                                                                0.5323516717

 

As you can see my answer is not very close to the answer given by Maple. I am not sure why my procedure simp is wrong.

If i use expression with function add() it runs normaly, but if I use expression with Threads:-Add (parallel implementation) it causes error "Error, continuation task already created for the current task" or "Kernel connection has been lost"

Expression:

Array(1 .. N,1 .. 1/2*N-NR-1,(i, m) -> evalf(Add(cosArr2[modp(k*i,N)]/kl[k],k = 1 .. NR+m-1)+Add(cosArr2[modp(k*i,N)]*alpha[k],k = NR+m .. 1/2*N)))

 

What am I doing wrong? Can I use two Add in one evalf?

How can I create a new object from a stanrd, defined in a given metric? For example I want to define an object by convolution of two indices of the Christoffel symbols? I cannot even to see components of such object.

Many thans for an explanation

 

Leonid

Hi, there i want to basically plot the graph attached. It is basically the graph y= 2x^2 transformed to y = x^2. I can plot them, but how do they get the arrows showing the transformation and the arrows on the axis. Any help would be appreciated.

Thanks

Composite1:=proc(g,f)
Flist := indets(f): Glist := indets(g): gof:=g:
Subslist1 := [seq( Flist[i]=q, i=1.. nops(Flist))]:
return subs(q=f,subs(Subslist1, gof)): # g(f)
end proc:
#F(g o f) = F(g) o F(f) = F o g o f = (F o g) o (F o f)
Functor := (1/2)*(-y*t2-x*t1-y*t3+sqrt(y^2*t2^2+2*y*t2*x*t1+2*y^2*t2*t3+x^2*t1^2+2*x*t1*y*t3+y^2*t3^2-4*x*t4*y*t9-4*x*t4*y*t8-4*x^2*t4*t7-4*y^2*t5*t9-4*y^2*t5*t8-4*y*t5*x*t7-4*y^2*t6*t9-4*y^2*t6*t8-4*y*t6*x*t7))/(x*t4+y*t5+y*t6);
F1:=x+2;
G1:=3*x+5;
gof:=subs(x=F1, G1);
osys := Composite1(gof, Functor) = Composite1(Composite1(G1, Functor),Composite1(F1, Functor));
sys1 := subs(x=3,subs(y=2, osys));sys2 := subs(x=5,subs(y=1, osys));
sys3 := subs(x=1,subs(y=5, osys));sys4 := subs(x=1,subs(y=2, osys));
sys5 := subs(x=2,subs(y=5, osys));sys6 := subs(x=5,subs(y=2, osys));
sys7 := subs(x=2,subs(y=1, osys));sys8 := subs(x=3,subs(y=5, osys));
sys9 := subs(x=5,subs(y=3, osys));
res:=solve([sys1, sys2, sys3, sys4, sys5, sys6, sys7, sys8, sys9], {t1,t2,t3,t4,t5,t6,t7,t8,t9});
simplify(%);
`~`[lhs](select(evalb, res));

alpha:= (1/2)*(-y*t2-x*t1-y*t3+sqrt(y^2*t2^2+2*y*t2*x*t1+2*y^2*t2*t3+x^2*t1^2+2*x*t1*y*t3+y^2*t3^2-4*x*t4*y*t9-4*x*t4*y*t8-4*x^2*t4*t7-4*y^2*t5*t9-4*y^2*t5*t8-4*y*t5*x*t7-4*y^2*t6*t9-4*y^2*t6*t8-4*y*t6*x*t7))/(x*t4+y*t5+y*t6);
g := -y/x;
f := (-x+sqrt(x^2-x*y-2*y^2))/(2*y+x);
subs(p=f,subs(q=f,subs(x=p,subs(y=q,g))));
g := (1/2)*(-x+sqrt(x^2-4*y*x-4*y^2))/(x+y);
f := x*y;
gof := subs(p=f,subs(q=f,subs(x=p,subs(y=q,g))));
lhsgofoalpha := subs(q= alpha,subs(p=alpha, subs(x=p,subs(y=q,gof))));
foalpha := subs(p= alpha,subs(q=alpha,subs(x=p,subs(y=q,f))));
rhsgofoalpha := subs(x= foalpha,subs(y= foalpha, g));
osys := lhsgofoalpha = rhsgofoalpha;
sys1 := subs(x=3,subs(y=2, osys));
sys2 := subs(x=5,subs(y=1, osys));
sys3 := subs(x=1,subs(y=5, osys));
sys4 := subs(x=1,subs(y=2, osys));
sys5 := subs(x=2,subs(y=5, osys));
sys6 := subs(x=5,subs(y=2, osys));
sys7 := subs(x=2,subs(y=1, osys));
sys8 := subs(x=3,subs(y=5, osys));
sys9 := subs(x=5,subs(y=3, osys));
res:=solve([Re(sys1)=0, Re(sys2) =0, Re(sys3) =0, Re(sys4) =0, Re(sys5) =0, Re(sys6) =0, Re(sys7) =0, Re(sys8) =0, Re(sys9) =0], {t1,t2,t3,t4,t5,t6,t7,t8,t9});

 

Hi! I can't answer the following two simple questions.

1) Why do use different font sizes every other  files created by the attached worksheet?

2) What happens when we uncomment some (all) of the #restart lines, and execute the commands (execution groups)  in the original order? How many files should we get?

 

Update: sorry, I can't see the uploaded worksheet, but here it is as plain text:

#### on Fedora 18 Linux, Maple 17.01:

#restart;


currentdir(kernelopts(homedir)):
currentdir();


#restart;


plotsetup(ps,plotoutput= `sinplot1`, plotoptions = `width=500,height=500, font=[TIMES, BOLD, 16]`);
plot(sin(x), x=-Pi..Pi, title="Output: sinplot1.eps");


#restart;


plotsetup(ps,plotoutput= `sinplot2`, plotoptions = `width=500,height=500`);
plot(sin(x), x=-Pi..Pi, font=[TIMES, BOLD, 16], title="Output: sinplot2.eps");

#### Restart in the same execution group as the plot statements - no output file?

#restart;
plotsetup(ps,plotoutput= `sinplot3`, plotoptions = `width=500,height=500, font=[TIMES, BOLD, 16]`);
plot(sin(x), x=-Pi..Pi, title="Output: sinplot3.eps");


#restart;
plotsetup(ps,plotoutput= `sinplot4`, plotoptions = `width=500,height=500`);
plot(sin(x), x=-Pi..Pi, font=[TIMES, BOLD, 16], title="Output: sinplot4.eps");

Hi,

restart:with(plots):

L1 := (1/2)*(S+sqrt(S^2+4*a*b))/b;

L2 := (1/2)*(S-sqrt(S^2+4*a*b))/b;

solve(L1=L2,S);

         2*sqrt(-a*b), -2*sqrt(-a*b)

solve(L1=L2,a);

             -(1/4)*S^2/b

solve(L1=L2,b);

                -(1/4)*S^2/a

Here is my question. 

Now plotting L1, L2 

a:=1:b:=1: # say

plot({L1,L2},S=0..1);

Is there a way to utilize the conditions which we can get through solve and use it while plotting (not 3d plotting) for any given choice of the values of a, b, S? 

 

 

and  x have range=(0 to 2),the y have range = (2,3),follow when the x=(3 to 4),so the y=(3 to -3) how to implement the title's function 

still the x and y have variability value and variability number

 

i assign 

seta := [x+1, x^2]

setb := [x^3, 2*x+5]

 

does morphism mean that

i use card_prod

to get

(x+1, x^3)

(x+1, 2*x+5)

(x^2, x^3)

(x^2, 2*x+5)

such that i composite each of 4 sets still satisfy F(f o g) = f o g

example

subs(x=x^3, x+1)

(A o C) o Colimit = (B o C) o Colimit

if known A, B, C and framework of Colimit

can it be said colimit?

 

Bonus, what are A,B,C? <- this can be not answered

First 242 243 244 245 246 247 248 Last Page 244 of 334