[Scilab-users] Antwort: Antwort: Re: Antwort: Re: Problem with solving this elegantly

Dang Ngoc Chan, Christophe Christophe.Dang at sidel.com
Tue Feb 27 14:35:07 CET 2018


Hello Pascal,

> De : Pascal Buehler
> Envoyé : mardi 27 février 2018 14:00
>
> So this is my attempt for the Mohrscher Spannungskreis.
>
> Please impruve the code.

Well, first improvement would be to comment your code,
especially if you want other people to read it :-)

Apart from this, here are a few things:
You create a matrix called Tensor but you barely use it as a matrix;
sometimes you use elements of it, e.g. Tensor(1,1),
sometimes you use the values with their original name, e.g. Sigmaxx.
This has probably no influence considering the memory needed and calculation time
but some consistency would not hurt.

When you compute several times the same value, you should create a variable for it, e.g.

cdS = cosd(Schnittwinkel)

sdS = sind(Schnittwinkel)

TKomponenten= Schnittspannungsvektor*[cdS ; sdS]

TKoordinatenkomponenten=[cdS, sdS ; -sdS, cdS]*TKomponenten

Foo = 2*Tauxy/(Sigmaxx - Sigmayy)

aFoo = 0.5*atand(foo)

bFoo = 0.5*atand(-foo)

Richtungen1 = [0, 90, 180] + aFoo*[1, 1, 1]

Richtungen2 = [0, 90, 180] + bFoo*[1, 1, 1]

Hope this helps

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


More information about the users mailing list