Scot Gould

## 717 Reputation

11 years, 140 days
Claremont McKenna, Pitzer, Scripps College
Professor of Physics
Upland, California, United States
Dr. Scot Gould is a professor of physics in the W.M. Keck Science Department of Claremont McKenna, Pitzer, and Scripps Colleges - members of The Claremont Colleges in California. He was involved in the early development of the atomic force microscope. His research has included numerous studies and experiments using scanning probe microscopes, particularly those involving natural fibers such as spider silk. More recently, he was involved in developing and sustaining AISS. This full-year multi-unit, non-traditional, interdisciplinary undergraduate science education course integrated topics from biology, chemistry, physics, mathematics, and computer science. His current interest is integrating computational topics into the physics curriculum. He teaches the use of Maple's computer algebraic and numerical systems to assist students in modeling and visualizing physical and biological systems. His Dirac-notation-based quantum mechanics course is taught solely through Maple.

## Are you sure x is a constant?...

@ReactionUra Based on these chemical reactions, I'm guessing x is NOT a constant, but rather a variable. However, since I'm not a traditionally trained chemist, this answer includes x = 0.

Since what you want are numerical values, i.e., floating point values, for the unknowns, I suggested fsolve

(To save space, I have made a sequence (seq) of equations which Maple reads as as eq||n where n is an integer that counts from 1 to 12 by increments of 1. 12 equations, 12 unknowns.)

That said, many of the values are negative. Does this make physical sense to you? (Because it does not to me.)  I'm wondering if there may be sign problems in the equations.

fsolve_example.mw

## Pardon my ignorance...

I am not concerned about the first problem. In my view, readability and comprehension of what is being asked is more imporant than execution speed since it is likley it is more helpful to the person in understanding why drdt:=t->diff(r(t),t) does not work.

## Asked for the time and learned how to bu...

@acer This is all appreciated.  From your fun exercise, I can already envision how it will be useful to me in the future.

## This works as exactly as needed...

@acer And yep, for the ASCII characters I desire, I'll have to pull out of the Unicode (not UTF-8) set of characters. So I truly appreciate both bits of info.

An aside: what frustrates me in this example, as it does for other examples, is that after conducting mutilple searches, and combing through pages of help and the programming manual, other than Chapter 2, I was unable, and am still unable, to locate an example that says something like printf("&#%a;", c) or  printf("&#%d;", c). How did you know to inlcude the  semi-colon?

(And a question more of style/intent - why sscanf in the first line and not convert to decimal from hex?)

## Example provided...

@tomleslie Thanks for the advice. I've edited the question to include an example. Unfortunately, HTML input/output is not what I want, but the command did educate me on unicodes.

## Looking at errors...

What tends to work for me is to write out one line a time and see if there are errors in the line before moving on. Notice all the lines in your calculation are in one execution group (>).

For what you post, the error occurs in the 3rd line of the big execution goup  where you write something with "z". As @gkokovidis points out, there appears to be a missing "mutiplication" sign between the "z" and the "x". While I don't think you need to convert to Maple input mode, (I use 2D input all the time), I do agree it should say "z * x(t)"

The rest suggests you have copied from some other source. My experience is that it is best to understand each line well before moving on to the next.  There are some incredibly smart and gifted folks here who are likely to help you out before I have a chance to look at the rest.

(P.S. Thank you for the complement.)

Search for Fit, which is the command to perform regression and the 2nd listing is this one: https://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics/Fit

We discover that :

 >

Build the X vector with the number of elements (upperbound works too) for the size.

 >
 (1)

The next is to identify a equation to plot. Again, lots to try, but what sort of works well is a power fit of the format:

Let's try it and plot to see how it looks:

 >

To see the values of a basic curve that fits the data, use Fit in the Statistics package.  Let Maple figure out which type of fit command to call. It will output the equation

 >
 (2)

Now let's extract the residuals. Same command, but asking for a different output

 >

Now you want to plot just the residuals?

 >
 >

## Understood now - teletype...

@nm You are asking for something like the old teletype printer as if the screen were a roll of paper. That might be a potentially useful option because you are correct, that is not how it works currently. For those situations, may I suggest continuously holding down the page-down button?  Using the page-down technique might  be an even more useful than a continuous-scrolling system, since the page-down technique will allow you to stop scrolling when you see a line or set of lines that are particularly interesting.

## How large is your output?...

Maple 2020.1 in Windows 10 - worksheet mode.

I tried to reproduce your situation. I wrote a do loop to print out 10,000 lines of numbers.  Yes, the scrollbar did shrink, but it never reached the microscopic size you are describing. The scrollbar was still manageable.

For me, when the Maple output is beyond a 100 lines, I find it so extensive that it is incomprehensible.   I’m pleased how quickly ‘ctrl-d’ cleans up the mess.

## Makes sense...

@acer I understand your explaination and your example. I wonder how the numbers are represented in 2D-Input so that the simplification process never occurs.

Regardless, it appear that this happens, and it is an unexpected outcome. (So much for my attempt understand Carl's discussion about evalf.) Much thanks.

## MaplePrimes is another Chegg?...

@Rouben Rostamian  At my institution, multiple students were suspended for a semester for receiving answers to questions like these on Chegg.   (Interestingly, it was the students who had turned in nonsensical solutions who were caught.)

evalf[30](3^(6/5)) in Maple Input does produce all 30 digits.

However, I may have found a possible answer from a post by @Carl Love from 5 years ago regarding the output of evalf. That is, the output of evalf is not accurate to n digits, rather that all subcomputations are performed using approximately n digits. I recongize there is a limit, but I thought 15 digits is attainable and the output shown would be to at least 15 digits, regardless of the type style of input used. Certainly, I have seen many Maple examples by Maplesoft imply evalf does produce the output of "give me the value to n digits."

## Double brackets...

@tomleslie I noticed the units in your output are enclosed by double brackets. According to help, the double brakets were shown prior to Maple 2015. Is this the case for you because 2019, 2020, do not show double brackets? I would like them to be displayed and I can't figure out how to show them.

## Portal of Maple 2020...

Since you do have access to Maple 2020, I encourage you to look at the Maple Portal.  It has lots of great help, and is organized to assume that the person using Maple has no experience with it. I encourage you to spend time watching the very short introductory videos and clicking the numerous useful links under "How do I..."

I assure you - it is worth the effort. (I'm guessing you are a student. My students feel sorry for the students in other could who don't spend time becoming able to implement the power of Maple.)

## Interpretation...

@acer Yes, this clarrifies why StringBuffer is not defined as an object or Object. even though the wording in the help does tend to mix terms:

The StringBuffer constructor returns a string buffer object.

 The StringBuffer object returned by the constructor is a module with six methods: clear, append, appendf, newline, space, and value.

The first line in help is basically is the same wording in the Today command, without mentioning the word module. Hence the source of confusion.

Anyway, I'm working toward chapter 9 of the programming manual, and currently view modules as "static classes" while objects are "dynamics classes".  Your example below matches my interpretation of these ideas in an OOL.

 First 13 14 15 16 17 18 19 Last Page 15 of 23
﻿