dharr

Dr. David Harrington

5804 Reputation

19 years, 241 days
University of Victoria
Professor or university staff

Social Networks and Content at Maplesoft.com

I am a professor of chemistry at the University of Victoria, BC, Canada, where my research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

worksheetdir...

@PeterTang To find the directory of a (previously saved) worksheet from the worksheet, use

interface(worksheetdir)

Lucky eyeball...

@Carl Love Lucky eyeball!

rescaling...

@vs140580 It is a good general rule that data for processing numerically not differ by too many orders of magnitude from one. So scale independent or dependent data until it is all like this. This is what I did in your case - after scaling all columns had data of similar magnitude, with most values around 1-10.

You say C1 cannot be zero, but it was calculated as zero because of the numerical issue. After scaling, it was evident that it was not zero.

values...

@William Han Sorry for the misleading answer. Here is one way to do it, another variation of the replies from the others.

Research.mw

specific case...

@toran You can adapt into an algorithm, but it is always best to look at things.

 >
 >
 >

 >

 >

Check these values are a pair of roots.

 >

choose an x value...

@toran Use implicitplot to look at your function in the region you are interested in - you can see where the roots are. Then choose an x value and find the corresponding y by something like

fsolve(eval(P,x=1.0),y=0..2)

where the y range is where you can see there is a root. (These values would work for the above plot)

If it is an isolated root you want, then algcurves:-singularities may be needed.

Perhaps if you supply the polynomial here, you can get more specific advice.

ditto...

@nicolesharp100 As a shortcut you can use %,%%, and %%% to refer to the last result (in time), 2nd to last and third-to-last. I use them within an execution group but not across execution groups, to avoid confusing results in time with results by location. I think they work on the command line.

equivalent...

@nicolesharp100 I don't know how to do this. I rarely use eqn numbers (in fact my default is not to show them). But I just put every result in a variable, and that is how I refer to them in the next execution group.

example...

@nicolesharp100 Try this

The result should be this:

LinesAfter.mw

Otherwise, I'm not sure I understand.

ctrl-L...

@nicolesharp100 To refer to a previous line number use ctrl-L. Then the automatic renumbering should work correctly.

function conversion...

@nicolesharp100 Maple's StringTools package can do quite sophisticated substitutions based on pattern matching but here Subs (substitute all) and Substitute (substitute the first) will do the trick.

 > restart;
 > with(StringTools):
 > str:="f(x,y):=sin(x)*cos(y);";

 > str2:=Substitute(Subs([":=" = "->"],str), "(", ":=(" );

 > parse(str2);

 >

operator syntax...

@nicolesharp100 f(x,y):=x*y is an alternative way to enter an operator definition. The f:=(x,y)->x*y; (which I prefer) emphasizes that you are storing a procedure in the variable f; f:=proc(x,y) x*y end proc; does the same thing. If you use the arrow notation (also used in math), then f(0,0):=1 is used to set (in a remember table) a specific value for arguments (0,0).

similar question...

You seem to have asked a similar question here.

yes...

@acer Yes, I saw that; I said "as documented" in my question. My point is I'm not sure why it is designed that way. Functionally, if I make a Matrix with fill=6 and assign some values with an initializer or by later assigning values, I use that Matrix knowing all the others values I retrieve will be 6. Now I decide I only have a few values to assign, so I think I'll change to storage = sparse. So now I would think it can functionally work the same; the fill value is just stored once and returned when I request an unstored value. It seems strange I now have to write a custom indexing function for a situation that is not that different. In fact the default fill value of zero works in just this way for sparse storage; it just can't be changed to some other value.

For backward compatibility, I'm sure modifying the way fill works is a bad idea, but I think some way to change the default fill value to other than zero would be useful.

you understood correctly...

@mmcdara Yes, you understood correctly.

 First 19 20 21 22 23 24 25 Last Page 21 of 59
﻿