Edited by sentaro21, 10 December 2017 - 11:05 AM.
#81
Posted 10 December 2017 - 11:03 AM
#82
Posted 10 December 2017 - 11:49 AM
Thank your for your answer. I tried it out:
Locate 1,2," ":
works.
i% is a correct.
works too. The empty loop runs much much faster.
To give you and the community something back: I simulated the combination of diffusion and convection in a small ducht. It is a refrence case for a real fluid simulation with mass transfer.
Some of the variables:
Mc field of concentrations
D diffusion coefficient
c concentration at the border
v free stream velocity
u velocity in the boundary layer
t time step
T total time
n number of layers
m number of columns
x size of an element of Mc in flow direction
y size of an element of Mc in diffusion direction
~
l leftward concentration before correction
Set the number of time steps in the k loop (or replace it by an input).
'diffusion layer
Next
Inspect Mc after the run.
Edited by piu58, 10 December 2017 - 12:17 PM.
#83
Posted 10 December 2017 - 01:10 PM
#84
Posted 11 December 2017 - 12:11 PM
Hi sentaro21 and piu58
I'm so interested in the new feature of FKeyMenu( commamnd that allow us to directly set number of system function icon as 2nd parameter.
In order to know the icon and its number, I made System Function Icon Scanner; SysFunc.g1m.
I think this program should work on fx-9860G at this time.
#85
Posted 13 December 2017 - 05:26 PM
Eventual I printed the manual and experimented with the new features. My fx-9860 did not have String operations - until now! Very great.
Strings are stored in matrices. What I don't understand: Why are the sprintf results stored in numbered Strings? How can I convert these?
I also love that I can store matrices as files. These matrices can be transferred to a PC. I would like to have a description of the binary layout of the float numbers. I could then write a small C routine which extracts this to a text file and vice versa. Therewith I could calculated something at the fx and later use it in a program at the PC.
#86
Posted 15 December 2017 - 10:32 AM
#87
Posted 07 January 2018 - 07:23 PM
Dear Sentaro,
again I have a problem with screen refresh, this time with the graphics screen.
A few background: I am a hobby astronomer. From time to time I write a program, which is not particular useful, but helps to understand things. This time I experiment with projection of Maps (like Mercator projection). At the end I write a Python program for my friends. But for experimenting I love my calculator.
In the first step I wrote a program which has a few points in it which represent Greenland and Africa. In the Mercator projection they are of similar size, which doesn't reflect the reality. I want to show in the future, how different projections change this.
In the very first step I implemented the rectangular projection, which uses x for lambda and y for phi (the very simples projection at all).
I have the problem, that the last point is not plotted. I added an extra plot command (second last line after the next), then all points are given but this extra point is not given.
It is not a large problem, because it is always possible to set an extra point. But it is against my sense for aesthetics.
Is there a reason for that behavior?
The program:
'experiments with map projections Deg ClrGraph:CoordOff:AxesOff:GridOff:LabelOff ViewWindow 0,126,0,0,62,0 'grenland and afrika {12,2}->Dim Mat c 'Greenland (-)60->Mat c[0,0]:83.5->Mat c[0,1] -25->Mat c[1,0]:83.5->Mat c[1,1] -72->Mat c[2,0]:78->Mat c[2,1] -20->Mat c[3,0]:70->Mat c[3,1] -45->Mat c[4,0]:60->Mat c[4,1] ' Africa -5->Mat c[5,0]:37.5->Mat c[5,1] -17->Mat c[6,0]:20->Mat c[6,1] -8->Mat c[7,0]:4->Mat c[7,1] 10->Mat c[8,0]:4->Mat c[8,1] 20->Mat c[9,0]:-35->Mat c[9,1] 41->Mat c[10,0]:-15->Mat c[10,1] 51->Mat c[11,0]:11->Mat c[11,1] 30->Mat c[12,0]:30->Mat c[12,1] 'quadratic projection For 0->i To 12 Mat c[i,0]->l Mat c[i,1]->f l->x f->y Plot 63+x/3,31+y/3 Next Plot 1,1 Text 58,125,">"_
#88
Posted 09 January 2018 - 07:00 AM
#89
Posted 09 January 2018 - 07:18 AM
> setup(RefrshCtr DD) to cancel this frame rate contro
I found it out by myself. Thank you for supporting my work.
I put here a complete world map in the next few day. In contradiction to other maps it contains real coordinates, which may be used to experiment with different mapping procedures.
BTW: Is there a way to read the dimensions of a matrix? I used the C.Basic replacement for DATA lines, which is direct assignment of a matrix with the [ [ ] [ ] ] command. Very cool! But it is cumbersome to count the amount of [] every time something is added.
Edited by piu58, 09 January 2018 - 07:19 AM.
#90
Posted 10 January 2018 - 03:22 AM
BTW: Is there a way to read the dimensions of a matrix? I used the C.Basic replacement for DATA lines, which is direct assignment of a matrix with the [ [ ] [ ] ] command. Very cool! But it is cumbersome to count the amount of [] every time something is added.
- piu58 likes this
#91
Posted 10 January 2018 - 01:55 PM
Thank you for your answer. It works fine!
The error with the last point still exists. I tried to give the smallest program which it shows:
ClrGraph:CoordOff:AxesOff:GridOff:LabelOff ViewWindow 0,126,0,0,62,0 Plot 10,10 'Plot 10,10 Text 58,125,">"_
I use the Text command to avoid the cursor around the last point. If I do this, the last point is not given. If you delete the ' before the second plot command, the first point comes.
~
If you want to play with my world map program,please download it. The goal of the program is the comparison of different map projections and the mathematics behind them.
Link to the program:
http://fg-kometen.vd...mp/KARTENWU.g1m
(@all: I delete this link after a few days. If someone is interested in that thing later, please mail me)
Edited by piu58, 10 January 2018 - 02:00 PM.
#92
Posted 11 January 2018 - 01:16 AM
Thank you for your answer. It works fine!
The error with the last point still exists. I tried to give the smallest program which it shows:
ClrGraph:CoordOff:AxesOff:GridOff:LabelOff ViewWindow 0,126,0,0,62,0 Plot 10,10 'Plot 10,10 Text 58,125,">"_I use the Text command to avoid the cursor around the last point. If I do this, the last point is not given. If you delete the ' before the second plot command, the first point comes.
Edited by sentaro21, 11 January 2018 - 01:42 AM.
#93
Posted 11 January 2018 - 06:47 AM
Thank you for that explanation. I stay with Plot, but add an extra Plot command to the Text line, which is necessary anyway.
I installed the new version, thank you for maintaining it.
#94
Posted 12 January 2018 - 02:08 AM
Thank you for that explanation. I stay with Plot, but add an extra Plot command to the Text line, which is necessary anyway.
I installed the new version, thank you for maintaining it.
#95
Posted 12 January 2018 - 06:40 AM
Hi, piu58
~
If you want to play with my world map program,please download it. The goal of the program is the comparison of different map projections and the mathematics behind them.
I did enjoy the world map. I also googled about math of different mapping.
Thank you for the interesting program.
At first I got an error (Dimension ERROR) and then I found Matrix base should be 0, not 1.
As my default setting, I set different matrix base. So I added '#Mat 0. This is just for others who try this program.
#96
Posted 13 January 2018 - 06:18 AM
Thank you for that hint. I use this setting because of the similarity to C, Java an so on. I did not know that the #Mat 0 command exists.
~
Some words to this program. I am hobby astronomers and try to explain my fellows physical or mathematical principles with the help of computer programs (in the end Python). Mapping is an area which is connected to astronomy.
The easiest way to map is to use lambda and phi as x any y (equirectangular). To come form this to an isogonal Mercator map you have to consider: Every circle of latitude is extended by a factor of (1/cos phi). To come to a map where everywhere 1 degree in longitude is exactly as large as one degree in latitude, you have to expand the (local) longitude by 1/cos phi too. The y value is the sum of all thes small extension, in fact an integral. The mathematical solution of this is
ln (tan phi +1/cos phi)
which you can fin in the program. In the end I comment this line out an replace it by a summation (numerical integration) of tiny 1/cos phi bits for educational purposes.
All the other maps are equal area ones. In this case you have to shorten the local longitude by cos phi, to remain the local area. The integral of cos is sin, which you may find in the map. All the equal area maps are equivalent by stretched in y direction to have the neutral zone at another latitude. In this zone longitude and latitude are equal and you don't have any distortions.
~
If you have an interest in other programs of similar complexity (which is low I think) please drop a line here. I upload it when ready and give a small explanation like this.
My goal is that the readers of my articles of our magazine experiment with the program and get a deeper understanding of what happens.
> If you are interested in CG series,
Some years ago, when I bought (again) a programmable calculator (in fact two of them, one at home and one at work), I want to have something different of a computer. Especially don't like a background lit screen. The most advanced one is the 9860, so I bought it.
FYI: I started programing with a pocket calculator. My first one was a russian BS-34 . It has only 98 programming steps and 14 memory registers which could be used as a list. Even with this I wrote a simple simulation program for heat transfer, which simulates thermal diffusion.
__________
after half a day: I implemented the numerical integration as a first projection. If you use any number beyond the ones in the menu it will be calculated.
The difference between Lambert and Mercator is very small instead /cos(phi) *cos(phi) and some tweaking of the output size:
5=t=>Goto b 'num integration For 0->i To z-1 Mat c[i,0]->l Mat c[i,1]->f l->x 1->s Abs f>1\exp(-)9=>f/Abs f->s 1->y For 1->j To Abs f y+1*cos j->y'/cos->m, *cos->l Next ys->y Plot 63+x/3,31+y/3'/5->m,/3->l Next Goto e Lbl q 'equirect For 0->i To z-1
As you can see I have to take the signum into account. There is no sgn function in the fx, so I simulated it by x/Abs(x) (which requires that I exclude zero).
I replaced the program at the store place.
Edited by piu58, 13 January 2018 - 03:41 PM.
#97
Posted 13 January 2018 - 08:06 PM
Hi,
is there any documentation what SysCall(), Call(), Poke(), and Peek() do?
Kfftfuftur
#98
Posted 13 January 2018 - 08:33 PM
I think three of them are quite clear:
Call calls a processor routine at a given address
Peek reads a memory place form the processors memory
poke writes an integer to a memory place
#99
Posted 13 January 2018 - 08:45 PM
Call and Peek apear to work with one argument, but i havent managed to run Poke without a Syntax error.
i am also unsure about wether they would take hexadecimal or decimal numbers as input
#100
Posted 13 January 2018 - 09:04 PM
I tried it out.
peek(1234)->a works but I had to reboot afterwards
I assume you may use poke(address,content) where both are integers.
#101
Posted 15 January 2018 - 01:12 AM
Hi piu58
Call and Peek apear to work with one argument, but i havent managed to run Poke without a Syntax error.
i am also unsure about wether they would take hexadecimal or decimal numbers as input
#102
Posted 17 January 2018 - 01:38 PM
Dear Sentaro and all,
I have written another program which calculates the solar magnetic fieild. Explanation in the next entry,
'solar magnetic field 10->t 400->e Deg ClrGraph:CoordOff:AxesOff:GridOff:LabelOff ViewWindow 0,126,0,0,62,0 0->T 'init {2161,1}->Dim Mat m 'coordinates For 0->i To 2160 0->Mat m[i,0] 90-i/12->f f->Mat m[i,1] Next Do 'plot ClrGraph:CoordOff:AxesOff:GridOff:LabelOff ViewWindow 0,126,0,0,62,0 Text 58,115,T For 0->i To 2160 'modif lambert Mat m[i,0]->l Mat m[i,1]->f l->x 57.3sin f->y Plot 63+x/3,31+y/2 Next 'calc For 1->j To t For 0->i To 2160 'phi - differential rotation Mat m[i,1]->f 90-Abs f->F'poldistanz 1.124\exp(-)6FFF+2.583\exp(-)4FF+0.0188F->d'diff rot Mat m[i,0]+d->w w>180=>w-360->w w->Mat m[i,0] 'lambda - meridional flow Mat m[i,1]->l 0->d Abs f<60=>0.142sin (f/3)->d f+d->Mat m[i,1] Next Next T+t->T LpWhile T<e Plot 125,5:Plot 125,5:Text 58,125,">":_
#103
Posted 17 January 2018 - 01:44 PM
The solar magnetic filed is coupled with plasma at the surface of the sun. The plasma rotates faster at the equator. So the field gets twisted.
Beside this, ther are a movement toward the poles, the meridional flow.
I approximated the differential rotation by a polynomial of degree 3 (calculated from tables I found) and the merdionale flow by a sine function.
I started wit a single magnetic line form nort to sout. I set so many points at this line I could, because I want that it remains a line even when twisted. This works for a while, but at the end you see single dots in the equator region. You need more memory for this.
The magnetic field gets denser and denser. My graph is a map which preserves area (Lambert type). The more black the display the stronger the magnetic field.
If the field gets too strong magnetic shortcuts evolve, which are visible in solar spots. This spots start at phi~35 degree, and destry the field here. The field gets stronger after that in lower latitudes and the spots move to here (butterfly diagram). This process cannot be simulated with this tiny program.
The first solar spots occur after one or two years. The program calculates until 400 days now (e), the graphic gets new after 10 simulated days (t). You may change this. You can calulated the latidude where the magentic lines are densest. Look at the screen and measure where it is from the middle of the screen (s). The you need the size of the half screen (h). The latidude of the first spots is
arcsin (s/d)
You have to use the arcsin because of the projection function of Lambert type maps.My result is around 45-50 degs, which is higher than real. But the effect can be seen in principle. Which ist the main goal of the program.
I used a lot of memory. It may be that you have to delete some stored programs and optimize the memory (Menu cos).
Edited by piu58, 17 January 2018 - 02:00 PM.
#104
Posted 18 January 2018 - 08:56 AM
#105
Posted 18 January 2018 - 09:58 AM
The line you mentioned is
1.124e-6*F*F*F+2.583e-4*F*F+0.0188*F->d
I set all the multiplication signs here which I omitted in the real formula.
This is the polynomial of third degree which calculates the diffential rotation. F is the polar distance. So the value is alway 0 at the poles. It becomes around 4.6 (degrees per day)at the equator.
The \exp comes from my transformation program which is casform_10.0 .
> to lack of the memory,
Because the result is symmetric to the equator it is possible to calculate half of the area only. The graphics will be better too in this case.
Edited by piu58, 18 January 2018 - 10:01 AM.
#106
Posted 19 January 2018 - 04:51 AM
The line you mentioned is
1.124e-6*F*F*F+2.583e-4*F*F+0.0188*F->dI set all the multiplication signs here which I omitted in the real formula.
This is the polynomial of third degree which calculates the diffential rotation. F is the polar distance. So the value is alway 0 at the poles. It becomes around 4.6 (degrees per day)at the equator.
The \exp comes from my transformation program which is casform_10.0 .
> to lack of the memory,
Because the result is symmetric to the equator it is possible to calculate half of the area only. The graphics will be better too in this case.
Ok!
Thanks !
#107
Posted 10 February 2018 - 01:21 PM
#108
Posted 12 February 2018 - 05:53 AM
Dear Sentaro,
thank you for work on C.Basic. I installed this version at my two calculators immediately.
With C.Basic my fx9860 calculators changed in total different devices. In the context of the capabilities of a pocket computer I can now program at a decent level.
Generally, I like the fx basic has single character variables. For the small programs I make at this tiny device this is sufficient. The advantage is that I can use an algebraic formulation without superfluous asterisks or parenthesizes.
C.Basic gives a decent editor (I like the small font), the chance to insert lines and small letter variabel which I can read much easier. Of course it runs much faster too.
I very like that I can organize my programs in folders.
All in all, working with C.Basic feels very different form fx basic. It changes the pocket computer into a real serious programming device.
~
Ar the moment I use it for auxillary programs to my fluid dynamics simulations which I rund at a real computer of course.
#109
Posted 14 February 2018 - 08:52 AM
#110
Posted 14 February 2018 - 11:18 PM
Hi sentaro21
Is this (minor) version latest than one you have already announced in Japanese site (e-Gadget in Japanese)?
Thank you
#111
Posted 15 February 2018 - 04:40 AM
#112
Posted 18 February 2018 - 01:31 PM
Hi sentaro21
OK, at this moment, I realized latest version is 1.71 beta.
http://pm.matrix.jp/...ASIC171beta.zip
Thanks
#113
Posted 21 February 2018 - 11:39 AM
#114
Posted 25 February 2018 - 08:37 AM
Edited by sentaro21, 25 February 2018 - 08:38 AM.
#115
Posted 16 March 2018 - 11:53 AM
#116
Posted 18 March 2018 - 08:47 PM
Casio will add a MicroPython 1.9.x shell to the fx-CG50 OS coming this fall: https://tiplanet.org...=228657#p228657
#117
Posted 19 March 2018 - 08:21 AM
Casio will add a MicroPython 1.9.x shell to the fx-CG50 OS coming this fall: https://tiplanet.org...=228657#p228657
#118
Posted 20 March 2018 - 02:40 AM
Casio will add a MicroPython 1.9.x shell to the fx-CG50 OS coming this fall: https://tiplanet.org...=228657#p228657
I'm looking forward to it. Now just curious about capability of the Micro-Python, command set, libraries, etc..
#120
Posted 23 March 2018 - 03:09 AM
Also tagged with one or more of these keywords: Casio Basic C.Basic
General →
Your Projects →
Inside Casio Basic is now to be preparedStarted by Krtyski , 02 Dec 2016 Casio Basic C.Basic |
|
|
5 user(s) are reading this topic
0 members, 4 guests, 0 anonymous users
-
Google (1)