MaplePrimes Questions

Search Questions:

Latest Questions Latest Questions Feed

Hello everyone,

 

I am working on a program in Maple and got stuck in exchanging limits for integrals. For example, if I have an expression of following type.

Eq:=4*Int(f(x), x=0..1/3)+Int(x*f(x), x=0..2/3);

I want to convert it in to an expression of form

4*Int(f(x),x=0..x)-4*Int(y,x=1/3..x)+ Int(x*f(x), x=0..x)- Int(x*f(x), x=2/3..x)


In short, I want to split both the integral at x but flip in limits in the second integral. I tried as follows which did not work

applyrule(Int(f::anything,y=c::numeric..d::numeric)=Int(f,y=c..x)-Int(f,y=c..x), Eq)

Please, help me!

Thank you for your time.

How do i proceed to solve two differential equations?

Two equations two unknowns is easy to solve in polynomial algebraic equations. Example: x+y=5; x-y=3; The solution is x=4; y=1 by adding the equations we arrive at.

The two equations are second order differential equations with two variables say temperature T (x,y) and velocity c(x,y). Assume any simple equation (one dimensional as well i.e. T(x) and c(x) which you can demonstrate with ease, I have not formulated the exact equations and boundary conditions yet for SI Engine simulation.

Thanks for comments, suggestions and answers expected eagerly.

Ramakrishnan

Dear all,

I have a question regarding the computation speed of Maple. I'm doing some numerical work with Maple and when I'm not using the build in Maple routines, but write my one routines to solve e.g. a system of partial differential equations using a finite differencing method, it takes Maple sometimes up to two hours to finish the computation. I also noticed that Maple is only using around 30% of my CPU. I know it's more efficient to do numerical work with C++ or other programming languages (at least that's what most people I know are using) but do any of you know some ways to improve the computation speed of Maple or to make it use more of my CPU to do the calculations faster?

Hey people,

 

I am trying to get the following code to run, but it keeps returning an error about too many arguments

 

restart:with(plots):with(PDEtools):
alpha_const := 0.5:gamma_const := 2.5: D1 := 0.05: D2 := 0.002:
A := diff_table(a(x,t)):B := diff_table(b(x,t)):
Selkov[1] := A[t] = 1 - A[]*B[]^(gamma_const) + D1*A[x,x]:
Selkov[2] := B[t] = alpha_const * ( A[]*B[]^(gamma_const) - B[]) + D2 * B[x,x]:

bc[1] := D[1](a)(0,t)=0: bc[2] := D[1](b)(0,t)=0: bc[3] := D[1](a)(4*Pi,t) = 0: bc[4]:=D[1](b)(4*Pi,t)=0:

ic[1] := eval(A[],t=0)=a_0:ic[2] := eval(B[],t=0)=b_0:
case1 := eval(ic,[a_0=1,b_0=1]):
case2 := eval(ic, [a_0=piecewise((x<2*Pi+1) and (x>2*Pi-1), 0.99, 1), b_0=piecewise((x<2*Pi+1) and (x>2*Pi-1), 0.99, 1)]):

Case1Default := pdsolve({Selkov[1],Selkov[2]},{bc[1],bc[2],bc[3],bc[4],case1[1],case1[2]},numerical);


Error, (in pdsolve/sys) too many arguments; some or all of the following are wrong: [{a(x, t), b(x, t)}, {a(x, 0) = 1, b(x, 0) = 1, (D[1](a))(0, t) = 0, (D[1](a))(4*Pi, t) = 0, (D[1](b))(0, t) = 0, (D[1](b))(4*Pi, t) = 0}, numerical]

 

My code worked just earlier today, and now it wont. If i try to run pdsolve({Selkov[1],Selkov[2]}) it says that there is an error with general case of floats. 

 

You help is greatly appreciated!

Hi,

I tried to use the Finance package and got:

with(Finance):
Warning, some commands in the Finance package may not work on this platform
Y := ItoProcess(1.0, mu, sigma, x, t);

Error, (in Finance:-ItoProcess) external linking: error loading external library finance.dll: The specified module could not be found.

 

Is it me or my pc that is causing this?

Thank you.

Murray

Hey all,

as a newbie to Maple I would likt to solve the electrical circuit, which is attached to this post. From the theory one can derive the following 6 equations:

(A)  u[smooth](t) = -(int(i[smooth](tau), tau = 0 .. t))/C[smooth]-u[smooth](0)

(B) u[smooth](t) = R[komp]*i[komp]

(C) u[ckomp](t) = (int(i[load](tau), tau = 0 .. t))/C[komp]-(-u[ckomp](0))

(D) u[loadt](t) = R[load]*i[load]

(E) u[smooth](t) = u[ckomp](t)-u[load](t)

(F) i[komp](t) = i[smooth](t)-i[load](t)

My aim is tio get either the voltage u[load](t) or the current i[load](t). Beside all parameter values I know the inital voltages at the capacities, called u[smooth](t=0) and u[ckomp](t=0). Both values are not zero in general!!!!

Do you have any idea how I can solve this with Maple? First I habe tried to solve this with "solve()" but get a solution with "solve()", I need to derive the equations to get rid of the integrals. But through the derivation my initial condictions vanish, too.
I have attached my Maple worrksheet as well: igl.mwigl.mw

BR

 Sebastian

P.S.: Here is the circuit:

 

 

There are quite a few useful resources, like TAs and documents in the startup page, however, I can only access them by clicking the links. Where are those files located on the disk? (Mac OSX)

Hi

I want to plot this equation to obtain 5 curves, then the maximum point  of eath curves link together.

But I can not plot this equation;anybody can help me?

restart; Eq := x-(r+3.1*10^7*exp(-11616/(1.98*T)))/(3.1*10^7*exp(-11616/(1.98*T))+1.8*10^18*exp(-29691/(1.98*T))) = 0; R := [0, 0.1e-2, 0.1e-1, .1, 1.6]; plots[implicitplot]([seq(eval(Eq, r = R[i]), i = 1 .. nops(R))], T = 0 .. 500, x = 0 .. 2, color = [red, blue, green, yellow, black], gridrefine = 5)

 

 

 

If I have some data, how would I determine the best normal distribution fit?

Hi:

I would like to slightly modify the "Explore" command -- I find it extremely useful, but the layout often doesn't work well for me (my typical use case is say 12 plots with ~10 parameters that vary). The problem is that the default alignment the columns of the table that contains a matrix of plots is "Center" and my plots don't fit on the screen properly (no matter how I play with sizes, placement, etc) and I would like it to be "Left" aligned --- aligning things manually (via right click) after the explore command is executed is possible, but painful, given that I often change my code.

... bottom line is that I would like to be able to re-define the "Explore" command.

I tried doing so by first calling:
showstat(Explore);

... then removing all the numbers, renaming the proc to sat MyExplore, declaring it (i.e. so maple understands it) and for now using that instead of the old Explore in my program (with no actual code changes for now). The problem is that I get the following error:

Error, (in DocumentTools:-Layout:-Table) number of Column arguments, 3, exceeds total column span, 1, computed from Rows' Cells

I think, somehow maybe showstat is not showing the full thing? or maybe it is part of a more complicated module? or maybe by removing the numbers the formatting got screwed up (i was careful here)?

So my question:

How would I define my own function "MyExplore" that (for now) contains exactly the same code and functionality as the built-in "Explore"?

thanks!

Hi Clever guys,
I am sorry if I asked for too much, but I am really in a big problem, I had a family problem and I didn't attend most of the lectures, and now I have to hand in an assignment before easter hollydays, and to be honest with you, I don't know from where to start, I know I will have to understand this stuff, but now I don't have enough time to do the assignment, so if anyone can help me, please please, for you guys it will maybe take 20min to do it, i ll need days and days and in the end it will be all wrong. I am going to try to do the other questions, there are 5 questions :(  
Please help me , I am really not a very bad student that just want to copie, but if nobody does this for me this time I will fell, please do this question for me please.. maybe you will say start it and then ask to check if it is correct, I am really trying my best, please.

that is one question:


By integrating a third order Newton Gregory Polynomial, derive Simpson’s

three eights rule given by

∫ f(x)dx (from x0 to x3 ) =3/8*ℎ(y0 + 3y1 + 3y2 + y3)

(b) Find the order of accuracy of Simpson’s rule and Simpson’s three eights rule.

(c) Write procedures to evaluate

∫ f(x)dx   (from x0 to xn) to a given number of decimal places using

i) Simpson’s rule.

ii) Simpson’s three eights rule.

The data to be input should be

i) The function f(x).

ii) x0 and xn .

iii) the number of decimal place accuracy required for the solution.

The output should comprise

 i) The number of strips used.

 ii) the value if the integral.





thank you very much 

Hi,

 

Lets say we have some expression like

0.5* t^5 * r^-1 *V

 

is there some way in maple to determine the power of the variable t ?

My goal is to realize a procedure [lets call it PowerOfT() ]  , so that

 

PowerOfT( 0.5* t^5 * r^-1 *V) = 5

 

Thank you very much for your help.

 

 

I want to translate my maple code with matrice multiplication  to C code. But the command  "Multiply" cannot be translated. So I want to edit the function translation by myself. I use "AddFunction" command to create a new function  "Multiply" and want to specify its corresponding C code.

 


f := proc ()
local x,y;
x := Matrix([[1, 2], [3, 4]]);
y := Matrix([[1,3],[4,2]]);
Multiply(x, y);
NULL;
end proc;

LanguageDefinition:-Define("NewC", extend = "C", AddFunction("Multiply", [Matrix,Matrix]::Matrix,
proc (X, Y)
local a,b;
a := 2;
b := convert(a, string);
Printer:-Print("Mmultiply(", X);
Printer:-Print(",", Y, ")"); Printer:-Print("\n");
Printer:-Print("from", b, "to");
Printer:-Print(",", Y, "do") end proc, numeric = double));
Translate(f, language = "NewC")

 

But when I run it, the "Multiply" function cannot be translated.  The result is:

 

Warning, type signature [CodeGeneration:-Names:-ArrayType(integer,CodeGeneration:-Names:-ArrayRanges(1 .. 2,1 .. 2),CodeGeneration:-Names:-ArrayOptions()), CodeGeneration:-Names:-ArrayType(integer,CodeGeneration:-Names:-ArrayRanges(1 .. 2,1 .. 2),CodeGeneration:-Names:-ArrayOptions())] for function Multiply is not recognized
void f (void)
{
  int x[2][2];
  int y[2][2];
  x[0][0] = 1;
  x[0][1] = 2;
  x[1][0] = 3;
  x[1][1] = 4;
  y[0][0] = 1;
  y[0][1] = 3;
  y[1][0] = 4;
  y[1][1] = 2;
  Multiply(x, y);
  ;
}

I don't know why "Multiply(x,y)" cannot be translated.

If I put two "Multiply(x, y)" in the procedure, like this:


f := proc ()
local x,y;

Multiply(x, y);
x := Matrix([[1, 2], [3, 4]]);
y := Matrix([[1,3],[4,2]]);
Multiply(x, y);
NULL;
end proc;

LanguageDefinition:-Define("NewC", extend = "C", AddFunction("Multiply", [Matrix,Matrix]::Matrix,
proc (X, Y)
local a;
a := 2;
b := convert(a, string);
Printer:-Print("Mmultiply(", X);
Printer:-Print(",", Y, ")"); Printer:-Print("\n");
Printer:-Print("from", b, "to");
Printer:-Print(",", Y, "do") end proc, numeric = double));
Translate(f, language = "NewC")

THe result is:

Warning, cannot resolve types, reassigning x's type
Warning, cannot resolve types, reassigning y's type
Error, (in CodeGeneration:-IssueError) type 'Matrix' cannot be translated to target language

I don't know why type 'Matrix' cannot be translated.

 

 

how to customize/invert the foreground/background color scheme in Maple?

 

The black on white is killing my eyes and also wasting energy, white on black is much better on the eyes and conserves energy (pixel brightness), imho

 

thanks in advance!

 

 

I want to draw plots with big numbers in axes

but when I change font sizes it dont work

please help me

Thanks

restart;
eta := 3:
beta := t[1]*(H-t[1])/H^2:
for i from 5 to 10 do H := i:
PL[i] := plot((t[1]^4+2*eta*beta*(2-beta)*H^4+eta^2*(H-t[1])^4)/(eta*(H-t[1])+t[1]), t[1] = 0 .. H, y = 0 .. 3000, color = black, axesfont = [Font(14), Font(14)], size = [560, 500]) end do:
with(plots): display({seq(PL[j], j = 5 .. 10)})

 

2 3 4 5 6 7 8 Last Page 4 of 1136