Re: Antwort: Antwort: Re: Antwort: Re: Problem with solving this elegantly

classic Classic list List threaded Threaded
2 messages Options
Christophe Dang Ngoc Chan Christophe Dang Ngoc Chan
Reply | Threaded
Open this post in threaded view
|

Re: Antwort: Antwort: Re: Antwort: Re: Problem with solving this elegantly

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.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Pascal Buehler Pascal Buehler
Reply | Threaded
Open this post in threaded view
|

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

OK, i will try.

with best regards / mit freundlichen Grüssen / cordialement

Pascal Bühler
Qualität-Hardware / Prüfingenieur
SAUTER HeadOffice
Fr. Sauter AG
Im Surinam 55, CH-4016 Basel
Telefon +41 (0)61 695 5646
Telefax +41 (0)61 695 5619
http://www.sauter-controls.com

DISCLAIMER:
This communication, and the information it contains is for the sole use of
the intended recipient. It is confidential, may be legally privileged and
protected by law. Unauthorized use, copying or disclosure of any part
thereof may be unlawful. If you have received this communication in error,
please destroy all copies and kindly notify the sender.

Before printing out this e-mail or its attachments, please consider whether
it is really necessary to do so.
Using less paper helps the environment.




Von:        "Dang Ngoc Chan, Christophe" <[hidden email]>
An:        Users mailing list for Scilab <[hidden email]>,
Datum:        27.02.2018 14:35
Betreff:        Re: [Scilab-users] Antwort: Antwort: Re: Antwort: Re: Problem with solving this elegantly
Gesendet von:        "users" <[hidden email]>




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.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users