Giter Site home page Giter Site logo

proektsoftbg / calcpad Goto Github PK

View Code? Open in Web Editor NEW
338.0 15.0 42.0 5.93 GB

Free and open source software for mathematical and engineering calculations.

Home Page: https://calcpad.eu

License: MIT License

C# 14.90% HTML 85.09% Shell 0.01%
mathematics engineering structural numerical-methods units-of-measurement calculations programming-language interpreter

calcpad's Introduction

Calcpad Readme

Project Website: https://calcpad.eu

Calcpad is free software for mathematical and engineering calculations. It represents a flexible and modern programmable calculator with Html report generator. It is simple and easy to use, but it also includes many advanced features:

  • real and complex numbers;
  • units of measurement (SI, Imperial and USCS);
  • custom variables and units;
  • built-in library with common math functions;
  • custom functions of multiple parameters f(x; y; z; ...);
  • powerful numerical methods for root and extremum finding, numerical integration and differentiation;
  • finite sum, product and iteration procedures;
  • modules, macros and string variables;
  • program flow control with conditions and loops;
  • "titles" and 'text' comments in quotes;
  • support for Html and CSS in comments for rich formatting;
  • function plotting, images, tables, parametric SVG drawings, etc.;
  • automatic generation of Html forms for data input;
  • professional looking Html reports for viewing and printing;
  • export to Word documents (*.docx) and PDF;
  • variable substitution and smart rounding of numbers;
  • output visibility control and content folding;
  • support for plain text (*.txt, *.cpd) and binary (*.cpdz) file formats.

This software is developed using the C# programming language and the latest computer technologies. It automatically parses the input, substitutes the variables, calculates the expressions and displays the output. All results are sent to a professional looking Html report for viewing and printing.

Sample

Fields of application

This software is suitable for engineers and other professionals that need to perform repetitive calculations and present them in official documentation such as calculation notes. They can automate this task efficiently by creating powerful and reliable Calcpad worksheets. It can also help teachers to prepare calculation examples, papers, manuals, books etc. Students can use it to solve various problems, prepare homeworks, phd theses etc.

Installation

The installation is performed by the automated setup program calcpad-setup-en-x64.exe. Follow the instruction of the setup wizard. The software requires a 64 bit computer with Windows 10/11 and Microsoft .NET 8.0.
You can also use Calcpad directly in the browser from our website: https://calcpad.eu/Ide

Licensing and terms of use

This software is free for both commercial and non-commercial use. It is distributed under the MIT license:

Copyright © 2024 PROEKTSOFT EOOD®

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Any scripts, developed with Calcpad are property of the respective authors. They can be used without additional limitations except those appointed by the authors themselves.

Acknowledgments

This project uses some additional third party components, software and design. They are re-distributed free of charge, under the license conditions, provided by the respective authors.

  1. The new and beautiful icons are created using icons8.com.
  2. The pdf export was made possible thanks to the wkhtmltopdf.org project.
  3. Some symbols are displayed, using the Jost* font family by indestructible type*, under the SIL open font license. Square brackets are slightly modified to suit the application needs.

How it works

The software is quick and easy to use. Just follow these simple steps:

  1. Enter text and formulas into the "Code" box on the left.
  2. Press F5 or click Play to calculate. Results will appear in the "Output" box on the right as a professionally formatted Html report.
  3. Click PrintPreview to print or Copy to copy the output.
    You can also export it to Html Html, PDF PDF or MS Word Word document.

The language

Calcpad uses a simple programming language that includes the following elements:

  • Real numbers: digits 0 - 9 and decimal point ".";
  • Complex numbers: re ± imi (e.g. 3 - 2i);
  • Variables:
      - Latin letters: a - z, A - Z;
      - Greek letters: α - ω, Α - Ω;
      - digits: 0 - 9;
      - comma: " , ";
      - prime symbols: ′ , ″ , ‴ , ⁗ ;
      - superscripts: ⁰ , ¹ , ² , ³ , ⁴ , ⁵ , ⁶ , ⁷ , ⁸ , ⁹ , ⁿ , ⁺ , ⁻ ;
      - special symbols: ‾ , ø , Ø , ° , ∡ ;
      - " _ " for subscript;
    A variable name must start with a letter. Names are case sensitive.
  • Operators:
      "!" - factorial;
      "^" - exponent;
      "/" - division;
      "÷" - force division bar;
      "\" - integer division;
      "" - modulo (remainder);
      "*" - multiplication;
      "-" - minus;
      "+" - plus;
      "" - equal to;
      "" - not equal to;
      "<" - less than;
      ">" - greater than;
      "" - less or equal;
      "" - greater or equal;
      "" - logical "AND";
      "" - logical "OR";
      "" - logical "XOR";
      "=" - assignment;
  • Custom functions of type f (x; y; z; ... );
  • Built-in functions:
      Trigonometric:
        sin(x) - sine;
        cos(x) - cosine;
        tan(x) - tangent;
        csc(x) - cosecant;
        sec(x) - secant;
        cot(x) - cotangent;
      Hyperbolic:
        sinh(x) - hyperbolic sine;
        cosh(x) - hyperbolic cosine;
        tanh(x) - hyperbolic tangent;
        csch(x) - hyperbolic cosecant;
        sech(x) - hyperbolic secant;
        coth(x) - hyperbolic cotangent;
      Inverse trigonometric:
        asin(x) - inverse sine;
        acos(x) - inverse cosine;
        atan(x) - inverse tangent;
        atan2(x; y) - the angle whose tangent is the quotient of y and x;
        acsc(x) - inverse cosecant;
        asec(x) - inverse secant;
        acot(x) - inverse cotangent;
      Inverse hyperbolic:
        asinh(x) - inverse hyperbolic sine;
        acosh(x) - inverse hyperbolic cosine;
        atanh(x) - inverse hyperbolic tangent;
        acsch(x) - inverse hyperbolic cosecant;
        asech(x) - inverse hyperbolic secant;
        acoth(x) - inverse hyperbolic cotangent;
      Logarithmic, exponential and roots:
        log(x) - decimal logarithm;
        ln(x) - natural logarithm;
        log_2(x) - binary logarithm;
        exp(x) - natural exponent;
        sqr(x) / sqrt(x) - square root;
        cbrt(x) - cubic root;
        root(x; n) - n-th root;
      Rounding:
        round(x) - round to the nearest integer;
        floor(x) - round to the smaller integer (towards -∞);
        ceiling(x) - round to the greater integer (towards +∞);
        trunc(x) - round to the smaller integer (towards zero);
      Integer:
        mod(x; y) - the remainder of an integer division;
        gcd(x; y; z...) - the greatest common divisor of several integers;
        lcm(x; y; z...) - the least common multiple of several integers;
      Complex:
        abs(x) - absolute value/magnitude;
        re(x) - the real part of a complex number;
        im(x) - the imaginary part of a complex number;
        phase(x) - the phase of a complex number;
      Aggregate and interpolation:
        min(x; y; z...) - minimum of multiple values;
        max(x; y; z...) - maximum of multiple values;
        sum(x; y; z...) - sum of multiple values = x + y + z...;
        sumsq(x; y; z...) - sum of squares = x² + y² + z²...;
        srss(x; y; z...) - square root of sum of squares = sqrt(x² + y² + z²...);
        average(x; y; z...) - average of multiple values = (x + y + z...)/n;
        product(x; y; z...) - product of multiple values = x·y·z...;
        mean(x; y; z...) - geometric mean = n-th root(x·y·z...);
        take(n; a; b; c...) - returns the n-th element from the list;
        line(x; a; b; c...) - linear interpolation;
        spline(x; a; b; c...) - Hermite spline interpolation;
      Conditional and logical:
        if(cond; value-if-true; value-if-false) - conditional evaluation;
        switch(cond1; value1; cond2; value2; … ; default) - selective evaluation;
        not(x) - logical "NOT";
        and(x; y; z...) - logical "AND";
        or(x; y; z...) - logical "OR";
        xor(x; y; z...) - logical "XOR";
      Other:
        sign(x) - the sign of a number;
        random(x) - random number between 0 and x;
  • Comments: "Title" or 'text' in double or single quotes, respectively. HTML, CSS, JS and SVG are allowed.
  • Graphing and plotting:
      $Plot { f(x) @ x = a : b } - simple plot;
      $Plot { x(t) | y(t) @ t = a : b } - parametric;
      $Plot { f1(x) & f2(x) & ... @ x = a : b } - multiple;
      $Plot { x1(t) | y1(t) & x2(t) | y2(t) & ... @ x = a : b } - multiple parametric;
      $Map { f(x; y) @ x = a : b & y = c : d } - 2D color map of a 3D surface;
      PlotHeight - height of plot area in pixels;
      PlotWidth - width of plot area in pixels;
  • Iterative and numerical methods:
      $Root { f(x) = const @ x = a : b } - root finding for f(x) = const;
      $Root { f(x) @ x = a : b } - root finding for f(x) = 0;
      $Find { f(x) @ x = a : b } - similar to above, but x is not required to be a precise solution;
      $Sup { f(x) @ x = a : b } - local maximum of a function;
      $Inf { f(x) @ x = a : b } - local minimum of a function;
      $Area { f(x) @ x = a : b } - adaptive Gauss-Lobatto numerical integration;
      $Integral { f(x) @ x = a : b } - Tanh-Sinh numerical integration;
      $Slope { f(x) @ x = a } - numerical differentiation;
      $Sum { f(k) @ k = a : b } - iterative sum;
      $Product { f(k) @ k = a : b } - iterative product;
      $Repeat { f(k) @ k = a : b } - general inline iterative procedure;
      Precision - relative precision for numerical methods [10-2; 10-16] (default is 10-12)
  • Program flow control:
      Simple:
        #if condition
          Your code goes here
        #end if
      Alternative:
        #if condition
          Your code goes here
        #else
          Some other code
        #end if
      Complete:
        #if condition1
          Your code goes here
        #else if condition2
          Your code goes here
        #else
          Some other code
        #end if
    You can add or omit as many "#else if's" as needed. Only one "#else" is allowed. You can omit this too.
  • Iteration blocks:
      Simple:
        #repeat number of repetitions
          Your code goes here
        #loop
      With conditional break/coutinue:
        #repeat number of repetitions
          Your code goes here
          #if condition
            #break or #continue
          #end if
          Some more code
        #loop
  • Modules and macros/string variables:
      Modules:
        #include filename - include external file (module);
        #local - start local section (not to be included);
        #global - start global section (to be included);
      Inline string variable:
        #def variable_name$ = content
      Multiline string variable:
        #def variable_name$
          content line 1
          content line 2
          ...
        #end def
      Inline string macro:
        #def macro_name$(param1$; param2$;...) = content
      Multiline string macro:
        #def macro_name$(param1$; param2$;...)
          content line 1
          content line 2
          ...
        #end def
  • Output control:
      #hide - hide the report contents;
      #show - always show the contents (default);
      #pre - show the next contents only before calculations;
      #post - show the next contents only after calculations;
      #val - show only the final result, without the equation;
      #equ - show complete equations and results (default);
      #noc - show only equations without results (no calculations);
      #nosub - do not substitute variables (no substitution);
      #novar - show equations only with substituted values (no variables);
      #varsub - show equations with variables and substituted values (default);
      #split - split equations that do not fit on a single line;
      #wrap - wrap equations that do not fit on a single line (default);
      #round n - rounds to n digits after the decimal point.
      Each of the above commands is effective after the current line until the end of the report or another command that overwrites it.
  • Breakpoints for step-by-step execution:
      #pause - calculates to the current line and waits until resumed manually;
      #input - renders an input form to the current line and waits for user input.
  • Switches for trigonometric units: #deg - degrees, #rad - radians, #gra - gradians;
  • Separator for target units: |, for example: 3ft + 12in|cm will show 121.92 cm;
  • Dimensionless: %, ‰;
  • Angle units: °, ′, ″, deg, rad, grad, rev;
  • Metric units (SI and compatible):
      Mass: g, hg, kg, t, kt, Mt, Gt, dg, cg, mg, μg, Da, u;
      Length: m, km, dm, cm, mm, μm, nm, pm, AU, ly;
      Time: s, ms, μs, ns, ps, min, h, d, w, y;
      Frequency: Hz, kHz, MHz, GHz, THz, mHz, μHz, nHz, pHz, rpm;
      Speed: kmh;
      Electric current: A, kA, MA, GA, TA, mA, μA, nA, pA;
      Temperature: °C, Δ°C, K;
      Amount of substance: mol;
      Luminous intensity: cd;
      Area: a, daa, ha;
      Volume: L, daL, hL, dL, cL, mL, μL, nL, pL;
      Force: dyn N, daN, hN, kN, MN, GN, TN, gf, kgf, tf;
      Moment: Nm, kNm;
      Pressure: Pa, daPa, hPa, kPa, MPa, GPa, TPa, dPa, cPa, mPa, μPa, nPa, pPa,
           bar, mbar, μbar, atm, at, Torr, mmHg;
      Viscosity: P, cP, St, cSt;
      Energy work: J, kJ, MJ, GJ, TJ, mJ, μJ, nJ, pJ,
            Wh, kWh, MWh, GWh, TWh, mWh, μWh, nWh, pWh
            eV, keV, MeV, GeV, TeV, PeV, EeV, cal, kcal, erg;
      Power: W, kW, MW, GW, TW, mW, μW, nW, pW, hpM, ks;
          VA, kVA, MVA, GVA, TVA, mVA, μVA, nVA, pVA,
          VAR, kVAR, MVAR, GVAR, TVAR, mVAR, μVAR, nVAR, pVAR, hpM, ks;
      Electric charge: C, kC, MC, GC, TC, mC, μC, nC, pC, Ah, mAh;
      Potential: V, kV, MV, GV, TV, mV, μV, nV, pV;
      Capacitance: F, kF, MF, GF, TF, mF, μF, nF, pF;
      Resistance: Ω, kΩ, MΩ, GΩ, TΩ, mΩ, μΩ, nΩ, pΩ;
      Conductance: S, kS, MS, GS, TS, mS, μS, nS, pS, ℧, k℧, M℧, G℧, T℧, m℧, μ℧, n℧, p℧;
      Magnetic flux: Wb , kWb, MWb, GWb, TWb, mWb, μWb, nWb, pWb;
      Magnetic flux density: T, kT, MT, GT, TT, mT, μT, nT, pT;
      Inductance: H, kH, MH, GH, TH, mH, μH, nH, pH;
      Luminous flux: lm;
      Illuminance: lx;
      Radioactivity: Bq, kBq, MBq, GBq, TBq, mBq, μBq, nBq, pBq, Ci, Rd;
      Absorbed dose: Gy, kGy, MGy, GGy, TGy, mGy, μGy, nGy, pGy;
      Equivalent dose: Sv, kSv, MSv, GSv, TSv, mSv, μSv, nSv, pSv;
      Catalytic activity: kat;
  • Non-metric units (Imperial/US):
      Mass: gr, dr, oz, lb (or lbm, lb_m), klb, kipm (or kip_m), st, qr,
          cwt (or cwt_UK, cwt_US), ton (or ton_UK, ton_US), slug;
      Length: th, in, ft, yd, ch, fur, mi, ftm (or ftm_UK, ftm_US),
           cable (or cable_UK, cable_US), nmi, li, rod, pole, perch, lea;
      Speed: mph, knot;
      Temperature: °F, Δ°F, °R;
      Area: rood, ac;
      Volume, fluid: fl_oz, gi, pt, qt, gal, bbl, or:
          fl_oz_UK, gi_UK, pt_UK, qt_UK, gal_UK, bbl_UK,
          fl_oz_US, gi_US, pt_US, qt_US, gal_US, bbl_US,
      Volume, dry: (US) pt_dry, (US) qt_dry, (US) gal_dry, (US) bbl_dry,
          pk (or pk_UK, pk_US), bu (or bu_UK, bu_US);
      Force: ozf (or oz_f), lbf (or lb_f), kip (or kipf, kip_f), tonf (or ton_f), pdl;
      Pressure: osi, osf psi, psf, ksi, ksf, tsi, tsf, inHg;
      Energy/work: BTU, therm, (or therm_UK, therm_US), quad;
      Power: hp, hpE, hpS;
  • Custom units - .Name = expression.
    Names can include currency symbols: €, £, ₤, ¥, ¢, ₽, ₹, ₩, ₪.

calcpad's People

Contributors

ayipeko avatar hildebrandopsj avatar idealkindom avatar kaloyansarafov avatar proektsoftbg avatar ystar0211 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calcpad's Issues

Time units handled incorrectly

Description

When using the Online IDE with Calcpad, time units (s, min, h, Hz) are not handled correctly. This makes calculations such as Rotations Per Minute quite prone to error.
A specific example is 1 / 1min = 1 h^-1 in calcpad. As well, the default units of multiplications of 1 min * 1 ms are h.

Screenshots

image

To Reproduce

I used the following to show unexpected bahaviour

t = 1min
1/t
t * 1 Hz
t_2 = 1 ms
1/t_2
t * t_2

Some easy improvements

Hello here are some easy features that I think would improve everyday use:
1- It would be great to add a menu in the "insert" as "advanced HTLM" with some of these:
- SOURCE :
image
- RECTANGLE BORDER :
image
- TEXT SPACING
2- Adding a command to "Reset all variables" (to ensure you are not reusing old variables in different chapters for example)
3- It would be great if Calcpad would remember our setting preferences such as unchecking "Substitue" or "round to 3".
4- Perhaps I am missing something simple but all the commands in Insert=>Drawing/SVG does not seems to output anything
image

Thank you again for the great work!

[enhancement] Latex export

It would be brilliant to have latex export options. As Word is compatible with latex notation and I assume you already use it, the base structure to achieve this might already be there. I thought of two useful "modes" for this.

  • just export the equations as plain latex.
  • export each line in a \newcommand{\name}[count]{definition} so the file can just be included, and every line just added by executing it

The problem with the second approach would be to keep track of line naming/comandnname if a new line is inserted before or after a line. But if this is solved, you could write a Latex document and change values all over the finished document just by exporting again.
That way, calcpad doesn't have to be a text editor and calculator at once. Not a programmer but just wanted to share this Idea. I enjoy using Calcpad without also.

default apps when exports & opening Docx

every time i try to export in Docx, it seems the programs not only exporting but opening the files also.

however, on my PC the default application to opening of file is not as in Windows setting. any hints?

Strings data

How it works without string data:

R_y = 265MPa
R_u = 430MPa
#hide
CARBON = 1
AUSTENITIC = 2
steel = CARBON
#show
#if steel ≡ CARBON
    'Steel is CARBON'
    #if R_y/R_u ≥ 0.7
        n_y = 2.7'- for 'R_y/R_u'≥0.7:
    #else
        n_y = 2.3' - for 'R_y/R_u'<0.7:
    #end if
    #else if steel ≡ AUSTENITIC
        'steel is AUSTENITIC
    n_y = 1.8
#end if
R_yn = R_y/n_y

With string data:

R_y = 265MPa
R_u = 430MPa
#hide
steel = `CARBON`
#val
'Steel is 'steel
#if steel ≡ `CARBON`
    #if R_y/R_u ≥ 0.7
        n_y = 2.7'- for 'R_y/R_u'≥0.7:
    #else
        n_y = 2.3' - for 'R_y/R_u'<0.7:
    #end if
#else if steel ≡ `AUSTENITIC`
    n_y = 1.8
#end if
    R_yn = R_y/n_y

It looks much better, don't you think so?

insert drawing not shown a results

i'm using latest versions (v5.6.1) in learning step of Calcpad to migrates. All equations, calculation and branching is working properly except for drawing.

there's shown no result even a simple example from insert menus, drawing and line. it display as in code text formatted not a drawing i expected.

could you reproduce my problems?

usual function parsing bug - missing ')'

a = 1/2
switch(a ≡ 1/2; max(1mm; 2mm); 0mm)

Shows error: Error in "switch(a ≡ 1/2; max(1mm; 2mm); 0mm)" on line [2]: Missing right bracket ')'.
If fraction or mm missing - works correctly.

shortcut to typing Greek characters

i did not found an options to submit a proposed enhancement or discussion, so this may be deleted if inappropriate.

regarding to typing engineering and mathematic equation, the document may contains lot of Greek characters. using a shortcut could be useful features since typing is accelerated and faster. user did not required to switch between keyboard and mouse mode.

below are common in similar applications, with shortcut as pressing Ctrl+G and the same keystrokes for uppercase

'α' (Alpha) press 'a' and then shortcut.
'β' (Beta) press 'b' and then shortcut.
'γ' (Gamma) press 'g' and then shortcut.
'δ' (Delta) press 'd' and then shortcut.
'ε' (Epsilon) press 'e' and then shortcut.
'ζ' (Zeta) press 'z' and then shortcut.
'η' (Eta) press 'h' and then shortcut.
'θ' (Theta) press 'q' and then shortcut.
'ι' (Iota) press 'i' and then shortcut.
'κ' (Kappa) press 'k' and then shortcut.
'λ' (Lambda) press 'l' and then shortcut.
'μ' (Mu) press 'm' and then shortcut.
'ν' (Nu) press 'n' and then shortcut.
'ξ' (Xi) press 'x' and then shortcut.
'ο' (Omicron) press 'o' and then shortcut.
'π' (Pi) press 'p' and then shortcut.
'ρ' (Rho) press 'r' and then shortcut.
'σ' (Sigma) press 's' and then shortcut.
'τ' (Tau) press 't' and then shortcut.
'υ' (Upsilon) press 'u' and then shortcut.
'φ' (Phi) press 'f' and then shortcut.
'χ' (Chi) press 'c' and then shortcut.
'ψ' (Psi) press 'y' and then shortcut.
'ω' (Omega) press 'w' and then shortcut.

some special character for variable definition

this is related to concrete strength notation in ACI318 with typing as f'_c and contains a character. unfortunately Calcpad thrown an error messages. could it be accepted in the next or future versions?

2022-02-16 18_04_41-2022-02-16 18_02_01-Untitled 1 - OpenOffice Writer

2022-02-16 18_04_01-2022-02-16 17_49_41-Calcpad 5 6 1

Tables with input data, vectors, arrays

As far as I understand, there is no way to input a series of data here?
Maybe there is an opportunity to implement a vector (without matrix at least, only with nested vectors allowing)?

x = [[1 2 3]
       4 5 6 10]
       [7 8 9]]
x[1][1]→1
x[1,1]→1 'alternative notation
x[1][2]→2
x[1][4]→NaN
x[2][4]→10
x[1]→[1 2 3]
rows(x)→3
cols(x)→4
cols(x[1])→3
cols(x[2])→4
col(x,2)→[2 5 8]
col(x,4)→[NaN 10 NaN]

It's a strange situation - tables can be output, but tabular data cannot be entered. What to do?

Old bug with html/svg single tags breaking

This a same old bug that now it's already annoying.
The code '<span/>' shows this: <span/ id="line1">
Expected <span/> or <span id="line1"/>
('<span></span>' works correctly: <span id="line2"></span>)

units for Electrical engineering are not correctly displayed

I'm having issues with proper conversion of electrical engineering units for example 1A1V does not equal 1W but I get kgm^2/s^3.

This seems to apply for any equation involving Volts,Amps,Ohms, and Watts.

Also, if this is not possible, is there a way to create custom units ?

Any help would be appreciated

F4 / F5

@Proektsoftbg, i notice when i press F5 to calculate and press F5 again, all the input data is gone.

I notice too when after i press F5 for the first time and press F4, we don't return to input form. I don't know if this is a bug or not.

Some features needed but I have not found in Calcpad

1.How could I define of standalone function and call it from another worksheet? The problem is easy to understand.

2.How could I convert a parameter's unit in the worksheet? Is there any special function or syntax for that?

Dimension of "g"

In Calcpad "g" equals to 9.81, However I think it should also include its dimension as"m/s^2", which really matters when you do calculation with unit conversion in a physics problem.

≡,≤,≥ unexpected replacing

When I open this file

'==TITLE==

It converts to this:

'≡TITLE≡

It's expected that Calcpad will change == to ≡ on input, and don't touch already inputed text

Overlap in output

Hello, it seems there is still some cases where the variable background overlaps and hide the division line in the output window.
Not a big deal but it can make it hard to read.
image
image

Bug with Select in Html

@Proektsoftbg i notice that any of my worksheets that have select option using HTML does not work now. They worked before the update

Example:

#pre
'<h3> Dimensionamento de Seções</h3>'
'<hr />
'<h4>Materiais</h4>'
'<h5>Coeficientes de Ponderação</h5>'
'Coeficiente de minoração do aço
γ_s = ? 
'Coeficiente de minoração do concreto
γ_c = ? 
'<h4>Concreto</h4>'
'<p>Escolha o fck: 
'<select data-target="fck">
'<option value=15>C15</option > 
'<option value=18>C18</option>
'<option value=20>C20</option>
'<option value=25>C25</option>
'<option value=30>C30</option>
'<option value=35>C35</option>
'<option value=40>C40</option>
'<option value=45>C45</option>
'<option value=50>C50</option>
'<option value=55>C55</option>
'<option value=60>C60</option>
'<option value=65>C65</option>
'<option value=70>C70</option>
'<option value=75>C75</option>
'<option value=80>C80</option>
'<option value=85>C85</option>
'<option value=90>C90</option>
'</select></p>
'<p id="fck" style="display:none;">'f_ck = ? '</p>
'<p>Escolha o agregado: 
'<select data-target="agregado">
'<option value=1.2>Basalto ou diabásio</option > 
'<option value=1>Granito ou Gnaisse</option>
'<option value=0.9>Calcário</option>
'<option value=0.7>Arenito</option>
'</select></p>
'<p id="agregado" style="display:none;">'α_e = ? '</p>
'<h4>Aço</h4>'
'<p>Escolha o aço utilizado para a armadura longitudinal:
'<select data-target="fyk">
'<option value=250>CA25</option > 
'<option value=500>CA50</option>
'<option value=600>CA60</option>
'</select></p>
'<p id="fyk" style="display:none;">'f_yk = ? MPa'</p>
'<p>Escolha o aço utilizado para a armadura transversal : 
'<select data-target="fywk">
'<option value=250>CA25</option > 
'<option value=500>CA50</option>
'<option value=600>CA60</option>
'</select></p>
'<p id="fywk" style="display:none;">'f_ywk = ? MPa'</p>
'<h4>Flexão</h4>'
'Coeficiente de redistribuição dos momentos'δ = ? 
#post
'<h3>Propriedades dos Materiais</h3>'
'<hr />
'<h4>Concreto</h4>'
'<h5>Parâmetros relativos à resistência do concreto</h5>'
'Fator de eficiência do concreto
α_v2 = 1 - f_ck/250
'Parâmetro em função da natureza do agregado que influencia o módulo de elasticidade
α_e
'Parâmetro utilizado para estimar o módulo de deformação secante
α_i = 0.8 + 0.2*(f_ck/80)
'Resistência característica à compressão do concreto
f_ck'MPa
'Resistência de cálculo à compressão do concreto
f_cd = f_ck/γ_c'MPa
'Resistência média à tração do concreto
#if f_ck ≤ 50
f_ctm = 0.3*f_ck^(2/3)'MPa
#else
f_ctm = 2.12*ln(1 + 0.11*f_ck)'MPa
#end if
'Resistência inferior à tração do concreto
f_ctk,inf = 0.7*f_ctm'MPa
'Resistência superior à tração do concreto
f_ctk,sup = 1.3*f_ctm'MPa
'Resistência à tração de projeto do concreto
f_ctd = f_ctk,inf/γ_c'MPa
#if f_ck ≤ 50
'Módulo de elasticidade ou módulo de deformação tangente inicial do concreto
E_ci = α_e*5600*sqrt(f_ck)'MPa
'Módulo de deformação secante do concreto
E_cs = α_i*E_ci'MPa
#else
'Módulo de elasticidade ou módulo de deformação tangente inicial do concreto
E_ci = 21.5*10^3*α_e*(0.1*f_ck + 1.25)^(1/3)'MPa
'Módulo de deformação secante do concreto
E_cs = α_i*E_ci'MPa
#end if
'<h5>Parâmetros relativos ao diagrama parábola-retângulo</h5>'
#if f_ck ≤ 50
'Relação entre a profundidade y do diagrama retangular de compressão equivalente e a profundidade efetiva x da linha neutra
λ = 0.80
'Parâmetro de redução da resistência do concreto na compressão
α_c = 0.85
'Deformação específica de encurtamento do concreto no início do patamar plástico
ε_c2 = 2/1000
'Deformação específica de encurtamento do concreto na ruptura
ε_cu = 3.5/1000
'Relação limite entre linha neutra x e altura efetiva d
β_lim = 0.8*δ - 0.35
#else
'Relação entre a profundidade y do diagrama retangular de compressão equivalente e a profundidade efetiva x da linha neutra
λ = 0.80 - (f_ck - 50)/400
'Parâmetro de redução da resistência do concreto na compressão
α_c = 0.85*(1 - (f_ck - 50)/200)
'Deformação específica de encurtamento do concreto no início do patamar plástico
ε_c2 = 2.6/1000 + 0.085/1000*(f_ck - 50)^0.53
'Deformação específica de encurtamento do concreto na ruptura
ε_cu = 2.6/1000 + 35/1000*((90 - f_ck)/100)^4
β_lim = 0.8*δ - 0.45
#end if
'<hr />
'<h4>Aço</h4>'
'Módulo de elasticidade do aço de armadura passiva
E_s = 210000MPa
'Resistência característica ao escoamento do aço de armadura passiva longitudinal
f_yk
'Resistência de projeto ao escoamento do aço de armadura passiva longitudinal
f_yd = f_yk/γ_s
'Resistência característica ao escoamento do aço de armadura passiva transversal
f_ywk
'Resistência de projeto ao escoamento do aço de armadura passiva transversal
f_ywd = f_ywk/γ_s
#Hide
f_ck = f_ck*MPa
f_cd = f_cd*MPa
f_ctk,inf = f_ctk,inf*MPa
f_ctk,sup = f_ctk,sup*MPa
f_ctm = f_ctm*MPa
f_ctd = f_ctd*MPa
E_ci = E_ci*MPa
E_cs = E_cs*MPa

Select Data Target

Hi,

I trying to create a selection list to a variable called fck, but indepent of the selection made it bring the results of previous variables:

image
image

Here is the code:

'<h3> Dimensionamento de Seções</h3>'
'<hr />
'<h4>Materiais</h4>'
'<h5>Coeficientes de Ponderação</h5>'
'Coeficiente de minoração do aço
γ_s = ? 
'Coeficiente de minoração do concreto
γ_c = ? 
'<h4>Concreto</h4>'
#pre
'<p>Escolha o fck - 
'<select data-target="fck">
'<option value=15>C15</option>
'<option value=18>C18</option>
'<option value=20>C20</option>
'<option value=25>C25</option>
'<option value=30>C30</option>
'<option value=35>C35</option>
'<option value=40>C40</option>
'<option value=45>C45</option>
'<option value=50>C50</option>
'<option value=55>C55</option>
'<option value=60>C60</option>
'<option value=65>C65</option>
'<option value=70>C70</option>
'<option value=75>C75</option>
'<option value=80>C80</option>
'<option value=85>C85</option>
'<option value=90>C90</option>
'</select></p>
#post
'<table id="fck">
'<tr><td>'f_ck = ? '</td></tr>
'</table>
f_cd = f_ck/γ_c
α_v2 = 1 - f_ck/250
#if f_ck ≤ 50
f_ctm = 0.3*f_ck^(2/3)
#else
f_ctm = 2.12*ln(1 + 0.11*f_ck)
#end if

Someone can tell me what i'm doing wrong?

Best regards

Now it's failing on Ctrl+F

Version 5.7.1 crashes when trying to call the search from the menu or by Ctrl+F (it doesn't matter what is open or written in the text field)

possibility to auto-calculation or live document

hi,

many similar apps doing auto-calculation and makes the document live, every single change in variable values, units or equation/formula will give instant answer at the display.

another unfamiliarity is in typing of longer calculation pages, still required 'enter' or 'run' button pressed. the display calculations always bring to the top of pages by default. so the user need to scroll down to the last equation previously typing to review.

hopefully these feature and behavior as similar apps been interested to implement.

best wishes,

Output visual

Hello,

It seems something changed in the recent versions of the software in the output windows, now the variables are stacked and hide some part of the divisors. Zooming in or out does not seems to change anything.

Version 5.8.5:
image

Version 5.8.1:
image

reading list of data from matrix table

hi,

is there any similar function to LookUp as in Spreadsheet? required to read a list of data (row/column) based on specific reference.

best,

for clarity, bellow figures are an example user function of Smath i've got from community

2022-07-11 03_21_14-

Macro: replace order bug(?)

There some problem that short variables can to brake more long variables:

#def MACRO1$(Dx$; x$)
    x$ + Dx$
#end def
#def MACRO2$(x$; Dx$)
    x$ + Dx$
#end def

MACRO1$(10; 20)'shows 20+10=30
MACRO2$(10; 20)'Error in "10 + D10" on line [2]: Undefined variable or units: "D10".

I'm not shure is it bug or not, but can we replace variables from long to short order?

Plotting function with min/max problem

I try to plot:

$Plot{min(3; 14/(9*a)) @ a = 0.1 : 3}

But was: Unexpected error: Index was outside the bounds of the array. Please check the expression consistency.
This works correctly:

$Plot{14/(9*a)*(14/(9*a) ≤ 3) + 3*(14/(9*a) > 3) @ a = 0.1 : 3}

So, is it simple mistake or deep calculation problem?
$Area works nomally with this function, $Integral doesn't works too.

CSS and Javascript

Hey Guys! It's the first time i write, this project is amazing! I want to know how to insert some CSS and Javascript inside the program, if anyone have some examples to share.

Best regards from Brazil

About selection of html

  1. I tried a html coding Group selection list in web browser and it works fine, while it errors in Calcpad. So how could I realise the Group selection list in Calcpad.

  2. Maybe there is a need for structural engineer, i.e. input some patameters in the prosess of calculation, because judgements should be made according to some trial calculation. Whether it is possible in Calcpad worksheet?

  3. Inputing a greek letter with a Latin letter plus Ctrl+G is not so efficient, how about Esc plus a Latin letter, or a Latin letter plus Tab?

  4. I found <= and >= are not recognizable in Calcpad. I think using mouse to click and input logical symbols is not so convenient.

Multiline functions

It seems that only one way to implement multiline functions exists (fast and clear):

  1. Use includes instead of functions;
    #include filename
    
    It's works like simple text insertion in this place (several includes in different parts of the file are allowed)
  2. Use variable replaces with #include (include bonus)
    file main.cpd:
    τ_max=200MPa
    τ=150MPa
    #include check_stress: τ->σ; τ_max->σ_max
    
    file check_stress.cpd:
    #if σ ≤ σ_max
      '<font color="green">It is all OK ('σ' ≤ 'σ_max')</font>
    #else
      '<font color="red">It is problem ('σ' > 'σ_max')</font>
    #end if
    
    file main.cdp processed like this single file:
    τ_max=200MPa
    τ=150MPa
    #if τ ≤ τ_max
      '<font color="green">It is all OK ('τ' ≤ 'τ_max')</font>
    #else
      '<font color="red">It is problem ('τ' > 'τ_max')</font>
    #end if
    
  3. namespaces instead of local variables
    It's just an invisible prefixes for variables.
    Bonus - block #namespace...#namespace end - to make it more automatic
    a=10'       shows a=10
    b=20'       shows b=20
    ns1::a=11'  shows a=11
    a'          shows a=10
    ::a'        shows a=10
    ns1::a'     shows a=11
    b'          shows b=20
    ::b'        shows b=20
    #namespace ns1
      a'        shows a=11
      b'        shows b=20 - if b missing for this namespace search in top namespace
      b=21'     when assigning - use current namespace
      b'        shows b=21
      ::b'      shows b=20
      ns1::a'   shows a=11
      ::a'      shows a=10
    #end namespace
    a'          shows a=10
    b'          shows b=20
    ns1::a'     shows a=11
    ns1::b'     shows b=21
    #namespace ns1
      a'        shows a=11
    #end namespace
    

P.S. Includes is the most wanted feature here. Even if nothing else will be implemented. (it's solves problems with big file navigation, very nice to extract generated svg images/methods into separate files, it's partly solves problems with missing string values)

some error message in OpenOffice when exported to docx

i tested to export in docx format, it's succeed to create the files and can be opening by OnlyOffice (v7.0.0.127) . however some error message shown by OpenOffice (v4.1.11) as General Error. General input/output error.

this behavior also the same when i manually opening the docx files with OpenOffice. reading Calcpad blogs, the ODT file format has been supported, how could i get this files since there's no options in save as dialog?

Feature request: showing equations as is

In table header or in description we must write something like σ<sub>y</sub> or σ_$(y) (with custom macros _$) to show variable names like σ_y.
If we need to show variable name in macros separately from value - it can't be passed as is, it's need to second variable with value like 'σy'
For equations with fractions/square roots it's much more difficult. We can use macroses (for example frac$(x;sqrt$(y)+1)), but they can't be copied as is if values will be required later.
I would like to use CalcPad instead of MarkText for engineering notes, but these problems are hindering me.

Is it possible to introduce special syntax "AS IS" for equations? Or special embedded macros AsIs$ at least?
Syntax:

x = 2
^^y = x^2 + sqrt(x)'            shows y = x² + √x
^^y = x^2 + sqrt(x) + z'        shows y = x² + √x + z event if z is not defined
^^x_min                         shows xₘᵢₙ
y = x^2 + sqrt(x)'              shows y = x² + √x = 2²+√2 = 5.41

Or embedded macros:

AsIs$(y=x^2+sqrt(x))'           shows y = x² + √x

Syntax ^^ seems to be better.

Not intuitive Find and replace focus

Steps to reproduce:

  • Press Ctlr+F - it shows find and replace dialog
  • Write text to find
  • Press Enter - it select first occurence - all works as expected
    But then something unexpected happens: It focus on text area with code and after enter pressing - it insert a new line. And after all, Esc doesn't hide dialog.

Expected behaviour like a Notepad++/CudaText/Sublime Text/Notepad3/LibreOffice Writer/Microsoft Word. Focus must be on dialog, and after second enter pressing it must search next word. When Esc pressing - it hides dialog and focus moves to text area with code.

rewriting variable units

Calcpad has unique feature in rewriting variable at calculation. however, some US units not displayed as original units.

2022-02-25 10_45_44-Calcpad 5 6 2

as can be seen, the units of 'A_se' variable is displayed as original, but 'f_uta' does not.

Units improvements

Hello,

Some suggestions to improve the units conversion:
1- The built-in "g" value is 9.81 without units. I think it would be more useful to have it with units : 9.81m/s²
2- While trying to enter energy density such as E = 5J/g It considers g as "9.81" instead of as "gram". Thus there is a confusion between the two. I'm ot too sure how to solve this. Perhaps having g as "gram" per default unless g is stated as "9.81m/s^2".
3- Adding the units of viscosity : Poise, Centipoise, Stokes, Centistoke could be useful. Those units are always a hassle to play with.

Thanks for your great work

force units conversions (kip)

some behavior is not as expected for me, converting units of force from 'kN' to 'kip' thrown an error message and reported as incompatible.

2022-02-25 00_16_05-Calcpad 5 6 2

Inserting image at cursor

Hi,

When inserting an image in the document using the "Insert Image" button, the image is inserted at the top of document, instead of the cursor position. Maybe it can be inserted below or above the current line.

Thanks.

° as unit like in Mathcad

So, using unit ° in Mathcad is more simple clear that #rad/#deg switching.
I suggest to introduce ° unit (the lone symbol is not occupied, am I right?) without #rad/#deg behaviour chaning:

α=90°
α
α|°

Shows:

α=90°
α=1.5708
α=90°

The main point is that unitless and ° must be compatible.
When #rad using the value of sin(90°) is 1 - it's clear.
What happened when #deg enabled and sin(90°) using? - It's a problem, but let it shows 0.2741 - backward compatibility is more expensive. Another problem is default mode #deg - may be it's need to show "⚠RECOMMENDED TO USE #rad MODE WITH °" if ° exists in code and #rad missing.

Rounding error

I noticed that all those give small values when they should return 0.
It is not a big deal since the values are very close to zero anyway.

image

Personalization of CPDZ archives

Hi @Proektsoftbg ,

I think it's a nice feature if we have tha ability to insert some properties in the final CPDZ for distribution, like:

  • Copyright
  • Change the icon of CPDZ (It's very useful to know what script i need to use in windows 10)

In smath we can do this:
image
image

Thin bug with substitution

So, this is a problem:

#def ____$ = &emsp;&emsp;
#def EQU_M$(equ$; macro$)
    #hide
    macro$$
    #show
    '<p align="center">'equ$',</p>
    macro$$
#end def

'This shows x²+y²+z²=10²+20²+0²=1400
#def VARS$
    'where'x = 10
    '____$'y = 20
    '____$'z = 30
#end def
EQU_M$(x^2 + y^2 + z^2; VARS)

It shows 0² instead of 30², but result is correct. Generated code is correct too and works normally. It seems that it's a problem with calling macros inside macros, may be output is correct because it shows after 2 times replacer calling but substitution is processed after 1-st time.

Unexpected error on inconsistent units

I found and fixed a small bug:

When you enter for example:
1 + 2m
You should get "Inconsistent units" error, but you get "Unexpected error" instead.

I ammended the latest release v5.8.7, so, you can download it again and re-install it. Uninstall the old one first.

Can't load pictures by relative url

Is it possible to setup view for search inside folder with current *.cpd file?
Otherwise it turns out inflexible and inconvenient:

<img src="D:\path\path2\illustration.svg"/>

Expected that it works if the file is in the same folder:

<img src="illustration.svg"/>

#noc: Unexpected error for missing function

Another unexpected error with #noc:

#noc
x = 2*β(T)

Shows: Error in "x = 2*β(T)" on line [2]: Invalid function: "β"
It's strange to define functions for show it "as is"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.