Simplifying a fraction with sums of polynomials in the numerator - polynomials

I'm trying to simplifying the following in maxima:
(6*C*b3m*ω+(8*%i*R0^3*b^3-24*%i*R0^3*a*b^2+24*%i*R0^3*a^2*b-8*%i*R0^3*a^3)*Γ+3*A*E*a3p*k+2*%i*K*b3m)/(6*C*ω+3*A*E*k+2*%i*K)
So far, here's what I get :
But I can easily see that the quantity in brackets there is nothing but (8*R0**3*(b-a)**3)*Γ. In fact I can see this by just evaluating this :
It's frustrating to see maxima miss this and I don't know what to do to simplify this. Any help will be appreciated!

If ex is your original expression, try substpart(factor(piece),ex,1,1).

ratsubst(bma,b-a,your_expression)
shows most of the structure you seem to wish to see.
If you have questions about maxima specifically, posting on the maxima mailing list may get a faster response. Make sure your post includes enough detail (version, exact transcript) so that anyone can reproduce your interaction. Have fun!

I sent this through the maxima mailing list and got a response from Barton Willis (willisb#unk.edu). I'm posting the answer here so it will be useful for others:
Try using scanmap('factor,%); thus:
(%i10)
(6Cb3mω+(8%iR0^3b^3-24*%iR0^3ab^2+24%iR0^3a^2b-8%iR0^3a^3)Γ+3AEa3pk+2%iKb3m)/(6Cω+3AEk+2%i*K)$
(%i11) scanmap('factor,%);
(%o11)
(6Cb3mω+8%iR0^3(b-a)^3Γ+3AEa3pk+2%iKb3m)/(6Cω+3AEk+2%i*K)
--Barton
Here's the expression in wxmaxima:

Related

GNU Radio simulation stuck

I have attached a screenshot of my design here:
when I start simulating it stuck and only plot a few vectors of data.
I think it's becasue of variable time shift block, it's a hierarchy block, when I connect a constant source to i'ts float input the design works perfectly but when I connect output of short to float it does not work,
I think it's becasue Argmax block produces one output for every vector but the variable time shift needs that output constantly.
how can i fix this?
I've written an answer to this question that you also posted on the discuss-gnuradio mailing list (archive):
Hi Mohammad,
to try, you could just use the repeat block.
Best regards, Marcus
I hope that solved your issue, since I haven't heard back from you :)

CRC8 calculation with initialization

I am new to CRC8 calculation. But I want to perform CRC8 calculation with initial 0xFF. I have no idea how to use this initial 0xFF. Earlier, I was using this method as mentioned in "Error Detection With CRC" in http://computing.dcu.ie/~humphrys/Notes/Networks/data.polynomial.html.
My Msg Data is :8012h and Frame is 12D.
Please guide me.
It sounds like you don't quite know why you want an initial 0xff or what it's for. You should read Ross William's excellent CRC tutorial, which will give you a grounding in CRCs. (I provided five different links for the same article, in case the stackoverflow police come around complaining about stale links in answers. The last one is in Russian, just for kicks.)
You need to provide more information about what CRC-8 you are trying to generate. Are you trying to match some standard? What standard? Some interface? What interface?

Method setTextColor:range: on NSTextView is ridiculously slow

I'm creating a simple editor in Mac OS X and I've come to the point where my editor needs to do some highlighting of code, for example, comments.
I am using Regex to find all comments, which I initially thought, was slow. Turns out, it does rather amazing job. For example, for 387 comments, regex needs "only" 0.008404 s to find them and returns array of NSRanges.
But here comes disaster. When I try to set different color to my text with method setTextColor:range: it completes very slow. It needs additional 9.872964 s (for those 387 comments I mentioned before) and it gets worse really fast when number of comments is increased.
So... Is there any way to do this faster? With NSAttributedStrings, perhaps?
I'm really sorry guys, but stackoverflow gave me suggestion on similar question (which I didn't found when I was searching).
It turns out you simply have to tell NSTextViews TextStorage that you will begin doing some editing. And when you finish, you commit those changes. Code looks like:
[textView.textStorage beginEditing];
// do some stuff here
[textview.textStorage endEditing];
Now I ran code with 456 comments, Regex needed 0.013887 s and coloring 0.215761 s, which is amazing drop!
Anyway, I hope someone will find that useful.

How to access facebook insight datas for consecutive months?

I'm new to Facebook app development I hope I can get an answer here.
Is that possible to retrieve Facebook insight data for consecutive months?
I tried end_time=2010-01-01 to since=2010-01-31 and period=month but I got
The specified date range cannot exceed 3024000 seconds!!
How will I get like 2010-02-01 to 2010-02-28 and 2010-03-01 to 2010-03-31?
I have tried and used lots of examples but I couldn't succeed: How can I solve this problem?
The thing that has worked for me is very similar to what you are doing, with the difference being that I use the UNIX timestamp for SINCE and UNTIL.
Example:
https://graph.facebook.com/212686148747689/insights/
page_impressions_by_city_unique/week/?
access_token=QWERTYUI&since=1315699200&until=1320796800
(That's all supposed to be on one line, but it's easier to read it this way, at least for me.)
With this approach, you want to be careful and make sure that the difference between SINCE and UNTIL is not bigger that 90 days. Otherwise, you'll get an error, like so:
(#604) The specified date range cannot exceed 7776000 seconds
Finally, if you don't have a way of generating the UNIX timestamp automatically, go to a web site like:
http://www.epochconverter.com/
If anyone else has some better insights, please share. I hope this helps.

Generate words that fit in Guids (just for fun)

I have some tests that use guids. The guids used don't need to be enormously unique, they just need to be guids. Random guids are boring - so I'm trying to find fun guid words. Right now, I don't have anything better than "00000000-feed-dada-iced-c0ffee000000". Ideally I'd generate a list of verbs, nouns, prepositions.
Having only spent a few minutes on this problem, here's where I am:
I have a word list (somewhat
large) from puzzlers.org.
Apply
this regex to identify words that
could be used in a Guid (o=0, i=1)
^[ABCDEFOI]{1,8}$
Squint.
Why doesn't someone have a funny guid generator available for my immediate gratification? How would you approach this? Any suggestions on how to improve this special guid generation process are welcome.
The solution you started is exactly how I would approach it. And it looks like someone already did the work for you:
http://nedbatchelder.com/text/hexwords.html
This isn't a technical answer but:
The Daily WTF had a post a while back, describing a guy who wrote the exact type of thing that you are trying to create, the reason it was Daily WTF material is because the generator ended up spitting out things that sounded like curse words.
From The Daily WTF - The Automated Curse Generator
Markov chains!" he blurted. "We can use statistical textual analysis to generate random words built up from natural phonemic combinations. They won't be real words, but they will match expected English patterns, and people will be able to pronounce and read them completely naturally."
I bet if you read that post you will get ideas about how to improve upon what you already have working.