Items tagged with range range Tagged Items Feed

Hey,

I want to solve this equation and looking at the plot there are at least 3 solutions. I want the greatest/smallest negative solution. Unfortunately using solve with assumptions produces no results and solve without assumptions only finds two solutions.

Can you please help me?

#select greatest negative value from solution

restart:

expr:= ax*cos(lambda)+ay*sin(lambda)-(a+b*lambda)

ax*cos(lambda)+ay*sin(lambda)-b*lambda-a

(1)

ax:=1:ay:=2:a:=0.5:b:=0.25: #examplanatory values

plot(expr)

 

 

assume(-2*Pi<lambda,lambda<0): #does not work

 

sol_lambda:=[solve(expr=0,lambda, useassumptions)];# returns empty list even though without assumption one solution is found

Warning, solutions may have been lost

 

[]

(2)

sol_lambda:=[solve(expr=0,lambda)]; #returns only two solutions even though looking at the plot 3 are there

Warning, solve may be ignoring assumptions on the input variables.

 

Warning, solutions may have been lost

 

[2.190357220, -.2688724573]

(3)

sol_l_v:=evalb~(sol_lambda<~0); #dirty workaraound

[false, true]

(4)

sol_l_add:=[ListTools:-SearchAll(true,sol_l_v)] ; #this seems overly complicated

 

[2]

(5)

lambda:=sol_lambda[sol_l_add[-1]];  #to select the last entry

 

-.2688724573

(6)

expr; #test

 

0.

(7)

 


Download select_solution.mw

Thanks!

Honigmelone

eq1 := z = y*log(x): eq2 := z = y+x*log(x):

DispIntersecting := implicitplot3d([eq1, eq2], x = 0 .. 10, y = -30 .. 30, z = -40 .. 40, color = [blue, green]):

solve({eq1, eq2}, [x, y, z]);

assign(%):

DispIntersection := spacecurve([x, y, z], x = 0.1e-2 .. 10, color = red, view = [0 .. 10, -30 .. 30, -40 .. 40]):

display(DispIntersecting, DispIntersection, axes = boxed, scaling = constrained);

Hello,

I have a procedure which plots a graph. I need the x-axes, which in this case is theta, to range between -3 and +3. However, I am not sure as to how I can create this restricted range. Any help is greatly appreciated! Thank you in advance!

Kind regards,

Gambia Man

with(plots):

a := 1.501*10^9:

Th := sqrt(4*Pi^2*a^3/(G*(Mh+Msat))):

HyperionOrbit := proc (`&theta;IC`, `&omega;IC`, n, nopoints) local a, Mh, Msat, G, e, beta, M, Eqns, ICs, soln; option remember; global `&omega;H`, Th; a := 1.501*10^9; Mh := 5.5855*10^18; Msat := 5.6832*10^26; G := 6.67259/10^11; e := .232; beta := .89; M := Mh+Msat; Eqns := diff(theta(t), t) = omega(t), diff(omega(t), t) = -G*Msat*beta^2*(xH(t)*sin(theta(t))-yH(t)*cos(theta(t)))*(xH(t)*cos(theta(t))+yH(t)*sin(theta(t)))/(xH(t)^2+yH(t)^2)^2.5, diff(xH(t), t) = vxH(t), diff(vxH(t), t) = -G*M*xH(t)/(xH(t)^2+yH(t)^2)^(3/2), diff(yH(t), t) = vyH(t), diff(vyH(t), t) = -G*M*yH(t)/(xH(t)^2+yH(t)^2)^(3/2); ICs := xH(0) = a*(1+e), yH(0) = 0, vxH(0) = 0, vyH(0) = sqrt(G*M*(1-e)/(a*(1+e))), theta(0) = `&theta;IC`, omega(0) = `&omega;IC`; soln := dsolve({Eqns, ICs}, numeric, maxfun = 0, output = array([seq(i, i = 0 .. n*Th, Th)])); plots:-odeplot(soln, [theta(t), omega(t)/`&omega;H`], 0 .. n*Th, numpoints = nopoints, labels = ["&theta;(t)","&omega;(t)/&omega;H"], axes = boxed, style = plottools:-point) end proc:

plots:-display(seq(HyperionOrbit(i, `&omega;H`*i, 1, 1), i = -3 .. 3))

 

NULL

NULL

 

Download Poincare_section_Boyd_plot.mw

with(plots):

a := 1.501*10^9:

Th := sqrt(4*Pi^2*a^3/(G*(Mh+Msat))):

HyperionOrbit := proc (`&theta;IC`, `&omega;IC`, n, nopoints) local a, Mh, Msat, G, e, beta, M, Eqns, ICs, soln; option remember; global `&omega;H`, Th; a := 1.501*10^9; Mh := 5.5855*10^18; Msat := 5.6832*10^26; G := 6.67259/10^11; e := .232; beta := .89; M := Mh+Msat; Eqns := diff(theta(t), t) = omega(t), diff(omega(t), t) = -G*Msat*beta^2*(xH(t)*sin(theta(t))-yH(t)*cos(theta(t)))*(xH(t)*cos(theta(t))+yH(t)*sin(theta(t)))/(xH(t)^2+yH(t)^2)^2.5, diff(xH(t), t) = vxH(t), diff(vxH(t), t) = -G*M*xH(t)/(xH(t)^2+yH(t)^2)^(3/2), diff(yH(t), t) = vyH(t), diff(vyH(t), t) = -G*M*yH(t)/(xH(t)^2+yH(t)^2)^(3/2); ICs := xH(0) = a*(1+e), yH(0) = 0, vxH(0) = 0, vyH(0) = sqrt(G*M*(1-e)/(a*(1+e))), theta(0) = `&theta;IC`, omega(0) = `&omega;IC`; soln := dsolve({Eqns, ICs}, numeric, maxfun = 0, output = array([seq(i, i = 0 .. n*Th, Th)])); plots:-odeplot(soln, [theta(t), omega(t)/`&omega;H`], 0 .. n*Th, numpoints = nopoints, labels = ["&theta;(t)","&omega;(t)/&omega;H"], axes = boxed, style = plottools:-point) end proc:

plots:-display(seq(HyperionOrbit(i, `&omega;H`*i, 1, 1), i = -3 .. 3))

 

NULL

NULL

 

Download Poincare_section_Boyd_plot.mw

restart;

with(DETools, diff_table);

kB := 0.138064852e-22;

R := 287.058;

T := 293;

p := 101325;

rho := 0.1e-2*p/(R*T);

vr := diff_table(v_r(r, z));

vz := diff_table(v_z(r, z));

eq_r := 0 = 0;

eq_p := (vr[z]-vz[r])*vr[] = (vr[]*(vr[r, z]-vz[r, r])+vz[]*(vr[z, z]-vz[z, r]))*r;

eq_z := 0 = 0;

eq_m := r*vr[r]+r*vz[z]+vr[] = 0;

pde := {eq_m, eq_p};

IBC := {v_r(1, z) = 0, v_r(r, 0) = 0, v_z(1, z) = 0, v_z(r, 0) = r^2-1};

sol := pdsolve(pde, IBC, numeric, time = z, range = 0 .. 1);

 

what am I doing wrong?

it's telling me: Error, (in pdsolve/numeric/par_hyp) Incorrect number of boundary conditions, expected 3, got 2
but i did just as in the example :-/

Is there any simple way to extract the feasible range for the variables from solve result ?

For example, when I do solve({x-y = 10, x+y < 100}) I get {x = y + 10, y < 45}

From here, I need -inf<y<45 and -inf<x<55. Is it possible ? (I tried few methods, but it is not working for all cases.)

I have been trying to fit a function to experimental data. To do this i was using

.

The data is of the type

.

When I use initialvalues, I get a result, that fits the data well, but is clearly not the desired minimum. Maple delivers g always bigger than 10000 which is nowhere near -7, where it has to be for physical reasons. When using parameterranges I get the error

Warning, no iterations performed as initial point satisfies first-order conditions.

He stopps computing and simply prints out my initialvalues or the first value that is in the parameterrange with a huge RSS.

How can I use initialvalues and parameterranges together for my data?

In a 3d coordinate system I have a circular spacecurve with z-minimum -4 and z-maximum +4. In the same 3d coordinate system I have a 3d surface plot with z-minimum -0.5 and z-maximum +1.3 . When I choose the color option "Z(Hue)" in order to color-code the z-values on the 3d surface and make the topography more clear, I mostly get a totally green 3d surface. It seems that the color scaling is coupled with the spacecurve with z-values of +-4 . How can I uncouple the color scaling from the spacecurve and couple it with the z-range of the surface, while the color-limits shall be at +-1.3 ?

I've got a piece-wise function(for which I've made the procedure) f defined over x<=-1, -1<x<1 and x>=1 which I am trying to plot over the range of (-2,2). I've tried using plot(f,-2..2) but it doesn't show any curve. Should I add a few more parameters to plot()?

int(int(y, 0 <= y, x^2+y^2+z^2 <= 1));

Error, (in int) integration range or variable must be specified in the second argument, got 0 <= y

int(int(y, y = 0, x^2+y^2+z^2 = 1));

Error, (in int) integration range or variable must be specified in the second argument, got y = 0

Hello,

 

I have a function, lets say g(x,y,...), that depends on many other functions. But I don´t want the results that are inside certain intervals, and I need to receive the results of those functions as something like NULL when asking for a result that is inside any of those intervals. That way, g(x,y,...) would also have to result in something like NULL if any of the lesser functions are NULL fora any given values.

 

I tryied using the piecewise command, and for the intervals that I wanted, it worked, but for those I wanted to be NULL, they were understood as 0, and so G(x,y,..) continued to exist but with a very different value.

 

To clarify what I need, I will try an exemple:

 

Imagine I have the function f(x)=x

 

I want to disconsider the results for x<2 and x>6, in a way that if I try the command 'f(1)', I will receive something like NULL and know that it is outside the range.

 

In the same way, I need the plot of this function f(X) to show the function only from 2 to 6, but not existing for the delimited intervals.

 

Ad if I continue and make g(x)=f(x)+10 , I don´t want g(x) to exist if f(x) doesn´t exist, and same for the g(x) plot, which shouldn´t be shown in the intervals where f(x) don´t exist.

 

 

Thank you very much for your atention!

 

 

I have a plot of a sinusoidal function(cos_phi) which changes with incrementing values of variable k. When this function goes above 1 or below -1 I would like to have the range of k for which it occurs outputed somehow. Would anybody know how to do this?

Hi,

I want to calculate a range.

eg. j=1...n-1 will use this equation

P(j,n):={((m/(2-1))(m/(2))^(j-1))/(2(m/(2))^(n)-1))} 

j=n will use other equation.

How to create the command? I keep receive errors.

 

Thank you.

Lina

 

 

Hello!

Im a regular student and Math is a really difficult topic for me, and every once in a while i run into a problen that i am unable to solve. This time i would like to ask this commmunity for some help. Many thanks in advance.

The function itself is: y = sqrt((x^2-5*x+6)/log[10]((x+10)^2))

I was able to determine the domain (X), but i am having very big trouble with finding the range (Y). Also i should be able to do it with pen on paper, but so far i have wasted 2 days and many papers on pointless scribblig.

Could anyone please explain how could i find the range of that function and provide a step by step solution? 

Maple is saying 'Error, Vector index out of range'. Can you see how maple executes all steps, so I can see where exactly the problem is?

1 2 3 Page 1 of 3