MaplePrimes Questions

Hello maple users,

I have 2 functions and each functions has 8 variables. I run a matlab code and get outputs for different values of these variables. I assumed 3 of them as constant because the combinations are too many. Anyway, I plot the results and I can see that one function is much better than the other. But I need to compare these functions mathematically. I need to show some proofs. Has anyone any idea what should I do? I wrote the functions on maple and take derivative with respect to one variable and try to see the reaction of the functions to that variable. i am confused.

 

Thanks

 

The details of the tasks are explained in the maple file attached but the aim is essentially to model the carbon cycle using first order diff eqs. I'm slightly confused as to how to exactly set up the equations for part a) and b). I've set up the required constants for the equations and the initial conditions as follows: 

#### initial conditions
atmos(0):=750;
bios(0):=600;
soil(0):=1500;


##### coefficients for rate of change
terrPhoto:=110/atmos(0);
terrResp:=110/bios(0);
plantDeath:=55/bios(0);
plantDecay:=55/soil(0);

and one of the equations as :

Diff(atmos(t),t):=terrPhoto*atmos(t); 

but I've been told that I would have to accommodate the direction of flow of carbon in the rates and also reconsider how many equations I would need.  hwk16.mw

I thought there is a way to set j as the imaginaryunit with a scope larger than the current file. There is a startup script or something ?

Anyone have a quick answer (other than no : ) ?

 

Thanks, cheers !!

what should I do with this error:

"the specified procedure could not be found"

"the Kernel loader cannot find maple engine library,maple.........."

This error appears at the beginning of  use ! 

I've created compiled and executed Fortran 77 code, and then created a .dll file - using g77, for calling as external function in MAPLE 18. I have received the following : Error loading external library. Details are below. Can anyone explain what is going wrong?

Below is the history the steps I have taken:

Here is the contenct of my FORTAN source code file: test2.for 

PROGRAM MAIN
REAL x,y, mult
x = 4.0
y = 3.0
OUT = mult(y,x)
WRITE(UNIT=*,FMT=11) OUT,x,y
11 FORMAT(1X,3E12.4)
END


function mult( a, b )
REAL a,b, mult
mult = a*b
END

The compile, execute and shared library creation steps are as follows  (using g77):

g77 -v -Wall -c -malign-double test2.for
g77 -v "test2.for" -o "test2" 
..execution ran successfully. Creation of dll:

g77 -s -o "test2.dll" "test2.for"

...this executed successfully

Defining as external function in MAPLE:
fmult := define_external('mult', LIB = "S:/MRBwork/IT/Fortran/projects/MAPLE - Fortran/CERN primes/test2.dll", FORTRAN, 'a'::(float[4]), 'b'::(float[4]), RETURN::(float[4]))

... but received following error.

Error, external linking: error loading external library S:/MRBwork/IT/Fortran/projects/MAPLE - Fortran/CERN primes/test2.dll: @�b%

Can someone take and look at the above and explain what may be causing the erroo ion the loading the .dll file?

Melvin

 

When I export to latex a matrix  <<a|b>,<c|d>>, the latex uses \begin[ and \end]

\left[ \begin {array}{cc} a&b\\ \noalign{\medskip}c&d\end {array} \right]
Is there a way to make Maple use () parenthesis instead of []? The screen display is not important for me in Maple, but I'd the latex to use () instead.  It will be nice if there is way to configure this. I looked but could not find an option.

 

hello guys , i have a metric and i want to find its non-zero components of ricci tensor but i have problem with writing the metric and maple gave me error.

 

non_zero_components_of_ricci_tensor.mw

Hello

I have some problem with " For loop". If i add more then one expression the, i recieve an error. Could you please help me to solve it? I have attached my file. Thank you.


restart 

with(ImageTools):NULL

with(FileTools):NULLNULL

Input Section

 

``

filelocation := "C:\\Users\\Mohammad\\Desktop\\ExerciseII\\1.jpg":

k := 3:``

 

zimage := Read(filelocation):

 

zwidth := Width(zimage):``

kernell := VectorCalculus:-`+`(VectorCalculus:-`*`(2, k), 1):NULLNULL

kerneld := `~`[`*`](Array(1 .. kernell, 1 .. kernell, 1), 1/kernell^2):

imheight := Height(zimage):NULL

imwidth := Width(zimage):````

Width(zimage, lower):

Width(zimage, upper):

View(zimage):NULL

new1zpic := Convolution(zimage, kerneld):

View(new1zpic)NULL``

aa := zimage(1 .. (), 1 .. (), 1):

bb := zimage(1 .. (), 1 .. (), 2):

cc := zimage(1 .. (), 1 .. (), 3):NULL

subimage := Matrix(VectorCalculus:-`+`(VectorCalculus:-`*`(2, k), 1), VectorCalculus:-`+`(VectorCalculus:-`*`(2, k), 1), 0):

newaa := aa:

"for i from k+1 to (RowDimension(aa)-k-1) do     for j from k+1 to (ColumnDimension(aa)-k-1) do     subimage:=aa(i-k..i+k,j-k..j+k).~kerneld     newaa(i,j):=add(add(subimage(m,n),m=1..(2 .k+1),n=1..(2*k+1))) end do; end do;"

Error, unterminated loop

"for i from k+1 to (RowDimension(aa)-k-1) do     for j from k+1 to (ColumnDimension(aa)-k-1) do  subimage:=aa(i-k..i+k,j-k..j+k).~kerneld    newaa(i,j):=add(add(subimage(m,n),m=1..(2 .k+1),n=1..(2*k+1))) end do; end do;"

 

 

``


Download pak2.mw

I have the following mathematical expression

where a=0.2, b=0.09, c=0.57, p=0.3 and q=1-p=0.7, Now i want to find the value of n for which the value of the expression will be 1, i.e., for what value of n , A_n will be 1?

Hej hej,

is there a way to obtain confidence intervals for the parameters in a NonlinearFit? To give you an impression of the problem which I was working on, I created a minimial working example (not sure wheather that actually helps). In this particular case, I have two parameters to fit the coefficients of a binomial series to some data I obtained. Beyond the values of the parameters (in a least square fit), I'm also interested in some kind of confidence interval, to get a feeling about how realiable my values are. Is there a direct (or even indirect) way to obtain such a thing. Either directly as a Maple function (confidenceintervals is not supported for NonlinearFit, if I'm not mistaken) or as something I can implement myself (within a reasonable time frame, as in hours rather than days).
Thanks in advance!

Cheer,

Sören

restart; with(plots); with(Statistics)

alpha[0] := 1.000000000:

m__max := 4:

model := Fit(pochhammer(z__1, m)*h__exp^m/factorial(m), [seq(m, m = 0 .. m__max)], [seq(alpha[m], m = 0 .. m__max)], m, output = [leastsquaresfunction, residuals], weights = [seq(1/abs(alpha[m]), m = 0 .. m__max)], iterationlimit = 10000)

model := [pochhammer(1.42349754368085, m)*16.2763580438677^m/factorial(m), Vector[row](5, {(1) = 0., (2) = -0.120508651249829e-1, (3) = 0.113910530162494e-1, (4) = 0.348907003220054e-3, (5) = -0.305508272150429e-2})]

(1)

plots[multiple](logplot, [{seq([m, alpha[m]], m = 0 .. m__max)}, style = point, color = black], [{seq([m, model[1]], m = 0 .. m__max)}])

 

``

Download nonlinearfit-problem.mw

I'm trying to use Maple to show that the Hilbert transform of the natural log of |H(jw)| is -arctan(H(jw))

for a minimum phase network; The network I choose is the simplest filter there exists i.e. a low pass RC-filter

with transfer function H(jw)=1/(1+tau*j*omega) therefore |H(jw)|=1/sqrt(1+(tau*omega)^2))

Here is what I did:

assume(omega > 0); assume(tau > 0); interface(showassumed = 0);

result5 := (int((1/2)*log(1+(tau*nu)^2)/(nu-omega), nu = -infinity .. infinity, CauchyPrincipalValue))/Pi

simplify(result5, symbolic)

 

unfortunately this does not give me the expected result: -arctan(w*tau*omega)

can anyone here tell me what the right way to do it is?

 

thanks in advance

hugo

I have an equation,

     y = 2x2+7,

Plotting y against x will give a quadratic graph, but plotting y against x2 should give a straight line. The problem is I cannot do

  plot([y], x2 = -5 .. 5);

It gives me an error

    Error, (in plot) unexpected option: x^2 = -5 .. 5

I have searched online but no links. Can anyone help with this.

 

Thanks

Fairoz

 

 

Dear all,

I have a question regarding the dsolve procedure in Maple. I'm trying to construct a neutron star model using the Tolman-Oppenheimer-Volkoff equation using a polytropic equation of state (EOS) which requires me to solve the ode system:

diff(rho(r),r)=-(rho(r)*(1+K/(5/3-1)*rho(r)^(5/3-1))+K*rho(r)^(5/3))*(4*Pi*r^3*K*rho(r)^(5/3)+m(r))/(K*5/3*rho(r)^(5/3-1)*r*(r-2*m(r)))

diff(m(r),r)=4*Pi*rho(r)*(1+K/(5/3-1)*rho(r)^(5/3-1)

where I have used the EOS P(r)=K*rho(r)^(5/3) and K is a known constant. rho is the density of the star, m it's mass and P the pressure inside the star.

For the initial conditions I have chosen: rho(10^(-10))=rho_0 and m(10^-10)=0. I have chosen r=10^-10 as the innermost point for the integration, since the differential equation for rho is singular at r=0. rho_0 is the central density of the star.

I solve these equations numerically using:

TOV:=dsolve({ode,ics},numeric,output=listprocedure)

where ode is my system of differential equations and ics are my initial conditions. I need now the radius of the star (R_star), which is the maximum value of r, up until which Maple has carried out the integration.

My problem is, I don't know of any efficient way, to do this. What I'm doing currently is defining a procedure TOVr:=rhs(TOV[1]) and I evaluate it at a very high value of r, for which Maple returns me the error message: "Error, (in TOVr) cannot evaluate the solution further right of ..., probably a singularity". I then use the command TOVr('last') to call the maximum value of r and to store it.

I can use the above method, as long as I'm solving the ODEs only for a few different values of rho_0. But I would like to plot m(R_star) for values of rho_0 ranging from 10^(-14) to 10^(-12) in order to find the value of rho_0, for which I can obtain the maximum value for m(R_star). But this requires me to know the value of R_star for every rho_0 and using the above method is not feasible for say hundred different values of rho_0, since I can't write a loop, because it get's terminated as soon as Maple gives me the first error message.

I was thinking of using perhaps the 'events' command in dsolve, to stop the numeric integration once the value for the pressure drops very low, say below 10^(-46), since the radius at which P(r)=0 defines the stellar surface. I tried using:

TOV:=dsolve({ode,ics},numeric, events=[[K*rho(r)^(5/3)-10^(-46),halt]])

but if I try again to evaluate the solution at a large value of r, I get the above error message, and the integration doesn't get canceled, although the value 10^(-46) is bigger than the value for the pressure I would obtain for R_star using TOVr('last') and Maple shouldn't encounter a singularity.

Am I using the 'events' command wrong? And does somebody know of a more efficient method to obtain the maximum value of a variable after carying out a numerical integration using dsolve?

Sorry for the long post and thank you all.

Hello

Is there any option to create a vector with logaritmically spaced? somthing like "logspace" in matlab. (logspace(0:10:20))

Thank you.

Dear Community Members,

 

We have problem with calculation in Maple v11 and v18. when we make a calculation by using maple v11 and v18, we was not able to get the solution as you see enclosed. when we clicked to "enter + ; ", programme does not run.

 

First 1305 1306 1307 1308 1309 1310 1311 Last Page 1307 of 2429