MaplePrimes Questions

Hi Guys :)

 

I need some Help with solving a nonlinear system. 

I have 3 equations.

These 3 equations have 7 unknown variables in it. But 5 of them are constants which I don't want to solve. I just want to solve three of them.

I tried it with fsolve but I always get the error :

fsolve({eq1, eq3, eq5}, {a, b, c});
%;
Error, (in fsolve) {eq1, eq3, eq5} are in the equation, and are not solved for

 

i tried to define the variables as Parameters but then i get this error: 

Parameters(t1, t2, t3, t4, t5, t6, t7, b1, t, v1, v2, s1, s2, j, a, b, c);

fsolve({eq1, eq3, eq5}, {ca, cb, cc});
%;
Error, (in fsolve) {b1, eq3, eq5, j, t, t1, t2, t3, t4, t5, t6, t7} are in the equation, and are not solved for


Here is the script : Non-Linear_system.mw

 has sb an Idea?

 

I'm trying to define a monomial order - Monomials are first compared by their weighted degree, with ties broken by pure lexiocraphic order (plex). I want the monomial order just to find the LeadingTerm of polynomials.

Maple has wdeg(W,V) as a built in monomial order, which compares monomials first by their weights, but breaks ties using reverse lexicographic order (tdeg).

One way I could plausibly do this is using the 'matrix' constructor, and defining the plex order by a succession of weights, but this seems like overkill, and I would have a n*n matrix, where I'd like n to reach over 1000.

Is anyone aware of a simple way of defining such a monomial order?

result3.mw
 

NULL

with(LinearAlgebra); restart; delta := 0.407e-9; C := 2023.2; L := 5*delta

0.2035e-8

(1)

eq := (1/12)*delta^2*S^4+S^2+omega^2/C^2

0.1380408333e-19*S^4+S^2+0.2442993814e-6*omega^2

(2)

solve(eq, S)

0.7244233290e-6*(-0.6902041665e32+2760816666.*(-0.8430822546e19*omega^2+0.6250000000e45)^(1/2))^(1/2), -0.7244233290e-6*(-0.6902041665e32+2760816666.*(-0.8430822546e19*omega^2+0.6250000000e45)^(1/2))^(1/2), 0.7244233290e-6*(-0.6902041665e32-2760816666.*(-0.8430822546e19*omega^2+0.6250000000e45)^(1/2))^(1/2), -0.7244233290e-6*(-0.6902041665e32-2760816666.*(-0.8430822546e19*omega^2+0.6250000000e45)^(1/2))^(1/2)

(3)

U := _C1*exp(sqrt(-2*C*(3*C-sqrt(-3*delta^2*omega^2+9*C^2)))*x/(C*delta))+_C2*exp(-sqrt(-2*C*(3*C-sqrt(-3*delta^2*omega^2+9*C^2)))*x/(C*delta))+_C3*exp(sqrt(-2*C*(3*C+sqrt(-3*delta^2*omega^2+9*C^2)))*x/(C*delta))+_C4*exp(-sqrt(-2*C*(3*C+sqrt(-3*delta^2*omega^2+9*C^2)))*x/(C*delta))

U2 := diff(U, x)

1214414.026*_C1*(-24560029.44+4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*exp(1214414.026*(-24560029.44+4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*x)-1214414.026*_C2*(-24560029.44+4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*exp(-1214414.026*(-24560029.44+4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*x)+1214414.026*_C3*(-24560029.44-4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*exp(1214414.026*(-24560029.44-4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*x)-1214414.026*_C4*(-24560029.44-4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*exp(-1214414.026*(-24560029.44-4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*x)

(4)

A := simplify(Matrix(4, 4, [[coeff(subs(x = 0, U), _C1), coeff(subs(x = 0, U), _C2), coeff(subs(x = 0, U), _C3), coeff(subs(x = 0, U), _C4)], [coeff(subs(x = L, U), _C1), coeff(subs(x = L, U), _C2), coeff(subs(x = L, U), _C3), coeff(subs(x = L, U), _C4)], [coeff(subs(x = L, U2), _C1), coeff(subs(x = L, U2), _C2), coeff(subs(x = L, U2), _C3), coeff(subs(x = L, U2), _C4)], [coeff(subs(x = 0, U2), _C1), coeff(subs(x = 0, U2), _C2), coeff(subs(x = 0, U2), _C3), coeff(subs(x = 0, U2), _C4)]]))

Matrix(%id = 18446746958277761134)

(5)

solve(Determinant(A) = 0)

Warning,  computation interrupted

 

NULL

NULL

``


 

Download result3.mw
 

NULL

with(LinearAlgebra); restart; delta := 0.407e-9; C := 2023.2; L := 5*delta

0.2035e-8

(1)

eq := (1/12)*delta^2*S^4+S^2+omega^2/C^2

0.1380408333e-19*S^4+S^2+0.2442993814e-6*omega^2

(2)

solve(eq, S)

0.7244233290e-6*(-0.6902041665e32+2760816666.*(-0.8430822546e19*omega^2+0.6250000000e45)^(1/2))^(1/2), -0.7244233290e-6*(-0.6902041665e32+2760816666.*(-0.8430822546e19*omega^2+0.6250000000e45)^(1/2))^(1/2), 0.7244233290e-6*(-0.6902041665e32-2760816666.*(-0.8430822546e19*omega^2+0.6250000000e45)^(1/2))^(1/2), -0.7244233290e-6*(-0.6902041665e32-2760816666.*(-0.8430822546e19*omega^2+0.6250000000e45)^(1/2))^(1/2)

(3)

U := _C1*exp(sqrt(-2*C*(3*C-sqrt(-3*delta^2*omega^2+9*C^2)))*x/(C*delta))+_C2*exp(-sqrt(-2*C*(3*C-sqrt(-3*delta^2*omega^2+9*C^2)))*x/(C*delta))+_C3*exp(sqrt(-2*C*(3*C+sqrt(-3*delta^2*omega^2+9*C^2)))*x/(C*delta))+_C4*exp(-sqrt(-2*C*(3*C+sqrt(-3*delta^2*omega^2+9*C^2)))*x/(C*delta))

U2 := diff(U, x)

1214414.026*_C1*(-24560029.44+4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*exp(1214414.026*(-24560029.44+4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*x)-1214414.026*_C2*(-24560029.44+4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*exp(-1214414.026*(-24560029.44+4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*x)+1214414.026*_C3*(-24560029.44-4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*exp(1214414.026*(-24560029.44-4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*x)-1214414.026*_C4*(-24560029.44-4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*exp(-1214414.026*(-24560029.44-4046.4*(-0.496947e-18*omega^2+36840044.16)^(1/2))^(1/2)*x)

(4)

A := simplify(Matrix(4, 4, [[coeff(subs(x = 0, U), _C1), coeff(subs(x = 0, U), _C2), coeff(subs(x = 0, U), _C3), coeff(subs(x = 0, U), _C4)], [coeff(subs(x = L, U), _C1), coeff(subs(x = L, U), _C2), coeff(subs(x = L, U), _C3), coeff(subs(x = L, U), _C4)], [coeff(subs(x = L, U2), _C1), coeff(subs(x = L, U2), _C2), coeff(subs(x = L, U2), _C3), coeff(subs(x = L, U2), _C4)], [coeff(subs(x = 0, U2), _C1), coeff(subs(x = 0, U2), _C2), coeff(subs(x = 0, U2), _C3), coeff(subs(x = 0, U2), _C4)]]))

Matrix(%id = 18446746958277761134)

(5)

solve(Determinant(A) = 0)

Warning,  computation interrupted

 

NULL

NULL

``


 

Download result3.mw

 

 

I am trying maplemint for first time, but some of the messages it generates do not seem to make sense to me and they all seem to be false alarms.

And not sure how make maplemint generate true warnings to make it easier to filter the real problems from the not real ones. For example, I made some module to try

my_module:=module()

export foo;
local  f,A,n,x;

#private stuff here
f:= x -> x^2:

A := int(f(x)*sin(n*x),x=0..Pi) assuming n::integer;

#public stuff here
foo:= proc()
        A;
end proc;     
    
end module;

maplemint(my_module) generates

Module my_module() 
  These local variables were never used:  x
  These local variables were used but never assigned a value:  n
  These local variables were assigned a value, but otherwise unused:  f

Well, "x" is clearly used. It is the integration variable?  And I can't assign value to "n", it is just a symbol used in the symbolic integration and assumed to be integer.

It also says "f" is not used. But "f" is used in definition of "A" inside the integrand.

So all these messages are not really needed. Is there a way to make maplemint not generate these? I do not see how I could change the code to remove these messages. Is something wrong with my code above?

Code works as expected

my_module:-foo();  gives (-Pi^2*(-1)^n*n^2+2*(-1)^n-2)/n^3

Here is another simpler example of where maplemint messages can't be removed no matter what.

restart;
foo:= proc()
	 local x;
	 plot(sin(x),x=-Pi..Pi);
end proc;     

and maplemint(foo) gives

Procedure foo()
  These local variables were used but never assigned a value:  x

restart;
boo:= proc()	
	 plot(sin(x),x=-Pi..Pi);
end proc;

And now

maplemint(boo);
Procedure boo()
  These names were used as global names but were not declared:  x

Here is another example where maplemint complains about option names for plot3 being undeclared

restart;
foo:= proc()	
    local p,x,y;
    p:=plot3d(sin(x)*cos(y),x=0..Pi,y=0..Pi,
              axes = none, projection=0.9, 
              orientation=[-30,55,0], scaling=unconstrained
              ):
    p:
end proc:

And

maplemint(foo);
Procedure foo()
  These names were used as global names but were not declared:  
     axes, none, orientation, projection, scaling, unconstrained

  These local variables were used but never assigned a value:  
       x, y

If one has to go each time through 100's of messages like these in order to find 1 or 2 real ones which indicate real problems, then using maplemint is not going to an effective way to find problems in code.

I have a parameter k and I'm simply trying to make a list of symbols m1,m2...,m2(k-1),m2k to which I'm attempting to assign dx1,dy1,...,dxk,dyk. I've tried

m := i -> 'parse(cat(m, i))'

dx:= i->'eval(cat(dx,i))'

dy:=i ->'eval(cat(dy,i))'

PW > ms := eval(seq(op([m(2*i-1), m(2*i)]), i = 1 .. k));
PW > xys := eval(seq(op([dx(i), dy(i)]), i = 1 .. k));
F > assign(ms = xys);

for loops, $ expressions, and I feel just about anything else but I can't seem to resolve this rather basic issue.

 

I'm trying to solve a very simple trigonometric equation but for some reason Maple shows me only a single solution where there are more than one.

For example in this code:

restart;

f:=sin(x);

solve(f,x);

Maple returns x=0. eventhough there's another solution x=180 (or pi).

Anyone knows how to force Maple to return all the solutions?

 

Thanks

I just noticed something funny. If I use the left side tool of Maple to define a matrix with zero entries and then change some entries and take determinant, then Maple treats zeros as symbold!!!! If I have to define my matrix completely myself, then what is the use of this tool?

Basic question on Maple scoping, having hard time finding it doing search.

I noticed when I do this

get_plot:= proc()     
    plot(sin(x),x=-Pi..Pi);
end proc:

Maple did not complain that `x` inside the proc() was implicitly declared. So this tells me that `x` is set local in scope to the body of the plot() itself and this is done automatically. right?  This is same as in Mathematica actually.

But when I did this

get_plot := proc()  
    local x; 
    x:=10;     
    plot(sin(x),x=-Pi..Pi);
end proc:
get_plot();

I got an error that Error, (in plot) unexpected option: 10 = -Pi .. Pi. So my theory was wrong.

While in Mathematica, one can do the above and it will work

getPlot[]:=Module[{x},
  x=10;
  Plot[Sin[x],{x,0,10}]
];
getPlot[]

It works, becuase the x inside plot have local scope for the Plot command only and it is not the same as the x outside the plot.

But in Maple, it seems once I declared x to be local, then the plot will use that local x. 

So the question is, why did Maple not complain in the first example above that x is implicilty declared as normally happen when one does something like

foo := proc()     
    x:=10;     
end proc:

The 'x' is either local or not. which is it? Why above gives warning but not

foo:= proc() 
  plot(sin(x),x=-Pi..Pi); 
end proc:

Basically, I wanted to know if I should write like this

foo:= proc() 
  local x;
  plot(sin(x),x=-Pi..Pi); 
end proc:

or without the local x if not needed.

Ok so i have entered the code as follows for my input dialog, but I do not want to vary the size of the window, rather the size of the text window inside the dialog window that the student is prompted to enter a paragraph that is related to an algebraic expression in the adjacent container. I cannot see this option available in the help page for the maplet, so i was just wondering if there is a more appropriate choice of maplet i can use that will enable me to do this. 

> with(Maplets[Elements]); OpenCommentaryDialog := Maplet(InputDialog['ID1']("Enter comments relevant to the expression assigned for this IIRF", 'onapprove' = Shutdown(['ID1']), 'oncancel' = Shutdown(), resizable = true, width = 1000, height = 1000));
> Maplets[Display](OpenCommentaryDialog);
 

I also want the text content the student enters to be able to be passed to a data structure that stores all comments made for all expressions in the worksheet, again I was unable to find how to do this on the help page

Dear Friends, 

I would appreciate your help in resolving some issues. Let me describe my dummy code and the issues I am having. 

I want to know the proper value of two parameters beta and `ΔA` in a tripe integral function  by the NonlinearFit command.The triple integral function is complex.

The code of function is below:

int(tan(beta)^2*exp(-Pi*tan(beta)^2*((x-varepsilon)^2+(0-varsigma)^2)/eta^2)/eta^2, [eta = 22.83-sqrt((5.83+`ΔA`)^2-varepsilon^2) .. 22.83+sqrt((5.83+`ΔA`)^2-varepsilon^2), varepsilon = -5.83-`ΔA` .. 5.83+`ΔA`, varsigma = -1 .. 1])-(int(tan(beta)^2*exp(-Pi*tan(beta)^2*((x-varepsilon)^2+(0-varsigma)^2)/eta^2)/eta^2, [eta = 22.83-sqrt(5.83^2-varepsilon^2) .. 22.83+sqrt(5.83^2-varepsilon^2), varepsilon = -5.83 .. 5.83, varsigma = -1 .. 1])) 

And this is the complete code:

datax := [-8, -4.5, -.5, 4.5, 8, 11.5, 14.5];

datay := [0.287e-2, 0.266e-2, 0.259e-2, 0.199e-2, 0.164e-2, 0.113e-2, 0.78e-3];

f := NonlinearFit(int(tan(beta)^2*exp(-Pi*tan(beta)^2*((x-varepsilon)^2+(0-varsigma)^2)/eta^2)/eta^2, [eta = 22.83-sqrt((5.83+`ΔA`)^2-varepsilon^2) .. 22.83+sqrt((5.83+`ΔA`)^2-varepsilon^2), varepsilon = -5.83-`ΔA` .. 5.83+`ΔA`, varsigma = -1 .. 1])-(int(tan(beta)^2*exp(-Pi*tan(beta)^2*((x-varepsilon)^2+(0-varsigma)^2)/eta^2)/eta^2, [eta = 22.83-sqrt(5.83^2-varepsilon^2) .. 22.83+sqrt(5.83^2-varepsilon^2), varepsilon = -5.83 .. 5.83, varsigma = -1 .. 1])), datax, datay, x)

I try to run it and get the value of parameters beta and `ΔA` ,but I keep getting this error,

Error, (in Statistics:-NonlinearFit) integration range or variable must be specified in the second argument, got HFloat(1.0) = HFloat(16.073603031200726) .. HFloat(29.58639696879927)
Does someone how to deal with this problem?

I would sincerely appreciate any inputs in this regard. 

 

Ok so as title says that is what i need, or the process of changing the document property listing that is generated when i start a new worksheet. 

 

The reason being is that of course the obvious solution is for me to have a personalized template for a worksheet with the desired attribute listing, which i have, but the trouble is i have already generated a large number of archive entries in a database or "library" of worksheets that i am building that have the standard attribute listing, and for the new functionality that i have chosen i rely on having the specific custom attribute listing for the new template, and i want to implement this functionality into use for the existing database entries as well as the future ones created, without having to copy and paste things for each of the existing entries for the obvious reason that this is boring and annoying

I've 2 equatoions that i wish to solve to get 2 values, which should be used as an input for the next step and so on,

I've managed to produce the equations, but i can't force the code to use the output of the first loop T1[1] and T2[1] into the 2nd loop and so on

It produces only equations, I'd appreciate it if anyone could tell me how to do that into an array or something similar

restart

k := 28:

Tinf := 200; -1; h := 45; -1; `Δt` := 15; -1; t_total := 150; -1; T1[0] := Tinf; -1; T2[0] := Tinf; -1; L := 0.4e-1; -1; M := 3; -1; `Δx` := L/(M-1); -1; tau := alpha*`Δt`/`Δx`^2; -1; for i from 0 to t_total/`Δt` do T1[i+1] = tau*(T0+T2[i])+(1-2*tau)*T1[i]+tau*g*`Δx`^2/k; 2*h*`Δx`*(Tinf-T2[i])/k+2*(T1[i]-T2[i])+g*`Δx`^2/k = (T2[i+1]-T2[i])/tau end do

T1[1] = 139.7321429

 

71.42857143 = 2.133333333*T2[1]-426.6666666

 

T1[2] = .4687500000*T2[1]+0.625000000e-1*T1[1]+33.48214286

 

84.28571429-2.064285714*T2[1]+2*T1[1] = 2.133333333*T2[2]-2.133333333*T2[1]

 

T1[3] = .4687500000*T2[2]+0.625000000e-1*T1[2]+33.48214286

 

84.28571429-2.064285714*T2[2]+2*T1[2] = 2.133333333*T2[3]-2.133333333*T2[2]

 

T1[4] = .4687500000*T2[3]+0.625000000e-1*T1[3]+33.48214286

 

84.28571429-2.064285714*T2[3]+2*T1[3] = 2.133333333*T2[4]-2.133333333*T2[3]

 

T1[5] = .4687500000*T2[4]+0.625000000e-1*T1[4]+33.48214286

 

84.28571429-2.064285714*T2[4]+2*T1[4] = 2.133333333*T2[5]-2.133333333*T2[4]

 

T1[6] = .4687500000*T2[5]+0.625000000e-1*T1[5]+33.48214286

 

84.28571429-2.064285714*T2[5]+2*T1[5] = 2.133333333*T2[6]-2.133333333*T2[5]

 

T1[7] = .4687500000*T2[6]+0.625000000e-1*T1[6]+33.48214286

 

84.28571429-2.064285714*T2[6]+2*T1[6] = 2.133333333*T2[7]-2.133333333*T2[6]

 

T1[8] = .4687500000*T2[7]+0.625000000e-1*T1[7]+33.48214286

 

84.28571429-2.064285714*T2[7]+2*T1[7] = 2.133333333*T2[8]-2.133333333*T2[7]

 

T1[9] = .4687500000*T2[8]+0.625000000e-1*T1[8]+33.48214286

 

84.28571429-2.064285714*T2[8]+2*T1[8] = 2.133333333*T2[9]-2.133333333*T2[8]

 

T1[10] = .4687500000*T2[9]+0.625000000e-1*T1[9]+33.48214286

 

84.28571429-2.064285714*T2[9]+2*T1[9] = 2.133333333*T2[10]-2.133333333*T2[9]

 

T1[11] = .4687500000*T2[10]+0.625000000e-1*T1[10]+33.48214286

 

84.28571429-2.064285714*T2[10]+2*T1[10] = 2.133333333*T2[11]-2.133333333*T2[10]

(1)

``


 

Download Advheat-ex55.mwAdvheat-ex55.mw

I using Maple 18 (not Maple 2018) and I'm trying to figure out how to grab earthquake data from earthquakescanada database from here http://www.earthquakescanada.nrcan.gc.ca//stndon/NEDB-BNDS/bull-en.php using the HTTP requests.

First I used the default search within the web browser, and get a new address which I enter as the URL

HTTP:-Get("http://www.earthquakescanada.nrcan.gc.ca//stndon/NEDB-BNDS/bull-en.php?time_start=2018%2F04%2F23+22%3A47%3A00&time_end=2018%2F05%2F23+22%3A47%3A00&depth_min=0&depth_max=100&mag_min=-3&mag_max=9.9&shape_type=region&radius_center_lat=50&radius_center_lon=-95&radius_radius=1000&region_north=90&region_south=41&region_east=-40&region_west=-150&eq_type_L=1&display_list=1&list_sort=date&list_order=a&tpl_output=html&submited=1"

It takes a long time to download the information and would require HTML surgery but changing the option for output to txt or csv, it's faster and in a much more readable form.  However it's not in a table or Array format, it has become a string.

Is there any way to use ImportMatrix, or ImportData to get a better format of the information?  - both give errors in Maple18.  Or am I stuck trying to use string surgery in Maple 18?  The Import command isn't available until Maple 2016 (I don't mean the Import command within ExcelTools) and I believe that works in Maple 2018 however I'm at a loss for trying to use it in Maple 18. 

I need some help. I'm trying to solve this system of equations, but maple says the solutions may have been lost.

I don't know why. Here are the equations:

I have four equations,very unknown variables in the equation.

I am trying to solve for any 4 unknowns ,not must had be Zoo1.Zoo2.th1.th2,it can be Za1.Za2.Zb1.Zb2.  

Any help  would be greatly appreciated.

e1 := (1-u__1)*lambda__M*S__H-alpha__M*E__M-mu*E__M;
e2 := alpha__M*E__M-eta*lambda__T*I__M-I*(a*u__2+kappa__1)-(delta__M+mu)*I__M;
e3 := eta*lambda__T*I__M-varphi__T*`I__MET `-(delta__M+mu)*I__MET;
e4 := -E__T*mu-E__T*alpha__T+S__H*lambda__T;
e5 := alpha__T*E__T+(a__2*u__2+c__3*u__4)*I__TM-varphi*lambda__M*I__T-(c*u__4+kappa__2)*I__T-(delta__T+mu)*I__T;
e6 := varphi*lambda__M*I__T-epsilon__M*I__TEM-(delta__T+mu)*I__TEM;
e7 := varphi__T*I__MET-epsilon__T*L__MT-(delta__T+mu)*L__MT;
e8 := epsilon__T*L__MT+epsilon__T*I__TEM-(a__2*u__2+c__3*u__4+kappa__3)*I__TM-(delta__TM+mu)*I__TM;
e9 := lambda__V*S__V-alpha__V*E__V-(b__1*u__1+d*u__3+mu__V)*E__V;
e10 := alpha__V*E__V-(b__1*u__1+d*u__3+mu*v)*E__V;
 

First 819 820 821 822 823 824 825 Last Page 821 of 2427