longrob

Mr. Robert Long

1409 Reputation

18 Badges

15 years, 18 days
Leeds, United Kingdom

Social Networks and Content at Maplesoft.com

Business Consultant Data Scientist Statistician

MaplePrimes Activity


These are replies submitted by longrob

@lovinash  It looks like the way you form the filename for the export is wrong. 

Export(L, sprintf("C:/Validateallslope/NailInc=%a ,cutheight=%a,cutangle=%a, backslopeangle=%a, Maxheight=%a .xlsx", ang, cutheight, angle1, angle2, eq4), "Sheet0", "B11")

I think it should be

Export(L, sprintf("C:/Validateallslope/Nail%a%a%a%a%a.xlsx", ang, cutheight, angle1, angle2, eq4), "Sheet0", "B11")

@Markiyan Hirnyk  I think this new problem has to do with the conversion to 1d. Using the amended worksheet allslopes3.mw by Markiyan Hirnyk the problem is with if statements using expressions such as  B<b<=HmaxX as a condition, which doesn't work in 1d. I think those need to be changed to further if..then..else or if ..and.. contructs.

It may be better to work with the original worksheet in 2d. 

@Markiyan Hirnyk  I think this new problem has to do with the conversion to 1d. Using the amended worksheet allslopes3.mw by Markiyan Hirnyk the problem is with if statements using expressions such as  B<b<=HmaxX as a condition, which doesn't work in 1d. I think those need to be changed to further if..then..else or if ..and.. contructs.

It may be better to work with the original worksheet in 2d. 

@samiyare  Int is the "inert" form of int which does not evaluate the integral. It's often useful to prevent Maple trying to symbolically evaluate the integral which in some cases (perhaps yours) can take a long time and if a numeric result is desired you can avoid this overhead, and then just use evalf when needed.

@samiyare  Int is the "inert" form of int which does not evaluate the integral. It's often useful to prevent Maple trying to symbolically evaluate the integral which in some cases (perhaps yours) can take a long time and if a numeric result is desired you can avoid this overhead, and then just use evalf when needed.

Your worksheet is not attached.

@epostma That's good to know :-)

@epostma That's good to know :-)

Great. That helps a lot acer - thanks !

Great. That helps a lot acer - thanks !

You are right. I didn't understand your question. Sorry about that. Unfortunately I'm not sure I understand now :(

Given a system of equations you want Maple to return whatever unique solution it can find and the subset of equations in the system that produce that solution ?

So for example, given

S = { a + b = 1, c = a + b +1, d = a + c}

you want to get back

{ a +b = 1, c = a +b +1 },{ c =2 }

?

You are right. I didn't understand your question. Sorry about that. Unfortunately I'm not sure I understand now :(

Given a system of equations you want Maple to return whatever unique solution it can find and the subset of equations in the system that produce that solution ?

So for example, given

S = { a + b = 1, c = a + b +1, d = a + c}

you want to get back

{ a +b = 1, c = a +b +1 },{ c =2 }

?

@hisasugi8338 there is another, much faster way to find the maxima, but it doesn't work in all cases. I don't know why:

 
RootFinding:-NextZero(unapply(diff(subs(ga = 0.8, TSales),delta),delta),0.01);
1.062593448
 
RootFinding:-NextZero(unapply(diff(subs(ga = 0.2, TSales),delta),delta),0.01);
                         FAIL

The method I posted above does, however, work in all cases I've tried,
though it is quite slow:
 
qq:=diff(subs(ga = 0.8, TSales),delta):
pq:=proc(x) global qq;return eval(qq,delta=x); end proc:
fsolve(pq(z)=0,z);
                          1.062593448
 
qq:=diff(subs(ga = 0.2, TSales),delta):
pq:=proc(x) global qq;return eval(qq,delta=x); end proc:
fsolve(pq(z)=0,z);
0.2289590991
 
Note to anyone else reading this, to avoid having to download the worksheet, TSales is
int((50-50*delta)*(50+50*delta)*(0.3e-1+(.36*(1-exp(-.39*t)))/(12.00000000*exp(-.39*t)+1))*(1-(1-exp(-.39*t))/(12.00000000*exp(-.39*t)+1))/1.08^t, t = 0 .. -2.564102564*ln((1.+5.*delta)/(53.+5.*delta)))+(500.*(-1.-5.*delta))*(-(1.*(1.+4.*ga))/(-53.+48.*ga))^.197336002905/((-1.+1.*ga)*(1.+delta)*((1.+5.*delta)/(53.+5.*delta))^.197336002905)
 


 
 

@hisasugi8338 there is another, much faster way to find the maxima, but it doesn't work in all cases. I don't know why:

 
RootFinding:-NextZero(unapply(diff(subs(ga = 0.8, TSales),delta),delta),0.01);
1.062593448
 
RootFinding:-NextZero(unapply(diff(subs(ga = 0.2, TSales),delta),delta),0.01);
                         FAIL

The method I posted above does, however, work in all cases I've tried,
though it is quite slow:
 
qq:=diff(subs(ga = 0.8, TSales),delta):
pq:=proc(x) global qq;return eval(qq,delta=x); end proc:
fsolve(pq(z)=0,z);
                          1.062593448
 
qq:=diff(subs(ga = 0.2, TSales),delta):
pq:=proc(x) global qq;return eval(qq,delta=x); end proc:
fsolve(pq(z)=0,z);
0.2289590991
 
Note to anyone else reading this, to avoid having to download the worksheet, TSales is
int((50-50*delta)*(50+50*delta)*(0.3e-1+(.36*(1-exp(-.39*t)))/(12.00000000*exp(-.39*t)+1))*(1-(1-exp(-.39*t))/(12.00000000*exp(-.39*t)+1))/1.08^t, t = 0 .. -2.564102564*ln((1.+5.*delta)/(53.+5.*delta)))+(500.*(-1.-5.*delta))*(-(1.*(1.+4.*ga))/(-53.+48.*ga))^.197336002905/((-1.+1.*ga)*(1.+delta)*((1.+5.*delta)/(53.+5.*delta))^.197336002905)
 


 
 

The following generates a 3dpoint plot of the maxima on the 3dplot.  If you rotate the plot you see that some of the points are just above the surface and some just below. I suppose this is due to slight numerical inacuracy finding the maxima.

spq:=proc(w) # simple procedure to ease the generation of points to plot
local q,prq;
q:=diff(subs(ga = w, TSales),delta):
prq:=proc(x) return eval(q,delta=x); end proc:
fsolve(prq(z)=0,z);
end proc :


pts:={seq([m,spq(m),eval(TSales,{ga=m,delta=spq(m)})],m=0.0..0.5,0.1)}:
pp:=plots:-pointplot3d(pts,symbol=solidsphere ,color=black,symbolsize=10):
p1:=plot3d(TSales, delta = 0 .. 2,ga = 0 .. .5, axes = boxed):
plots:-display(pp,p1);
1 2 3 4 5 6 7 Last Page 3 of 13