Skip to content

Commit

Permalink
PSE 5E PROBLEM 5.26
Browse files Browse the repository at this point in the history
  • Loading branch information
dharmatech committed Mar 29, 2013
1 parent cae0063 commit f0c6865
Show file tree
Hide file tree
Showing 5 changed files with 265 additions and 0 deletions.
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9B655E4F-E859-4E61-AF03-98621165F87C}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PSE_5E_PROBLEM_5._26_KITE_FLYING_CONTEST</RootNamespace>
<AssemblyName>PSE 5E PROBLEM 5.26 KITE-FLYING CONTEST</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Physics\Physics.csproj">
<Project>{73E0C26D-5333-4575-A3E9-5388E975446E}</Project>
<Name>Physics</Name>
</ProjectReference>
<ProjectReference Include="..\Symbolism\Symbolism.csproj">
<Project>{067278C5-2A0F-42DE-838B-855EFB652608}</Project>
<Name>Symbolism</Name>
</ProjectReference>
<ProjectReference Include="..\Utils\Utils.csproj">
<Project>{A3F0F5DB-7EB2-488F-B79C-F667C4E5AB02}</Project>
<Name>Utils</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
75 changes: 75 additions & 0 deletions PSE 5E PROBLEM 5.26 KITE-FLYING CONTEST/Program.cs
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Symbolism;
using Physics;
using Utils;

namespace PSE_5E_PROBLEM_5._26_KITE_FLYING_CONTEST
{
class Program
{
static void Main(string[] args)
{
// You are a judge in a children’s kite-flying contest, and
// two children will win prizes for the kites that pull most
// strongly and least strongly on their strings. To measure
// string tensions, you borrow a weight hanger, some slotted
// weights, and a protractor from your physics teacher
// and use the following protocol, illustrated in Figure
// P5.26: Wait for a child to get her kite well-controlled,
// hook the hanger onto the kite string about 30 cm from
// her hand, pile on weights until that section of string is
// horizontal, record the mass required, and record the
// angle between the horizontal and the string running up
// to the kite. (a) Explain how this method works. As you
// construct your explanation, imagine that the children’s
// parents ask you about your method, that they might
// make false assumptions about your ability without concrete
// evidence, and that your explanation is an opportunity to
// give them confidence in your evaluation tech-nique.
// (b) Find the string tension if the mass required
// to make the string horizontal is 132 g and the angle of
// the kite string is 46.3°.

var F1 = new Symbol("F1");
var F2 = new Symbol("F2");
var F3 = new Symbol("F3");

var th1 = new Symbol("th1");
var th2 = new Symbol("th2");
var th3 = new Symbol("th3");

var _F1 = new Point() { angle = th1 };
var _F2 = new Point() { angle = th2 };
var _F3 = new Point() { magnitude = F3, angle = th3 };

var m = new Symbol("m");

var obj = new Obj();

obj.acceleration.x = 0;
obj.acceleration.y = 0;

obj.mass = m;

obj.forces.Add(_F1);
obj.forces.Add(_F2);
obj.forces.Add(_F3);

"Tension in line to kite:".Disp(); "".Disp();

obj.ForceMagnitude(_F2)
.Substitute(th1, (180).ToRadians())
.Substitute(th2, (46.3 * Math.PI / 180))
.Substitute(th3, (270).ToRadians())
.Substitute(F3, 0.132 * 9.8)
.Substitute(Trig.Pi, Math.PI)
.Disp();

Console.ReadLine();
}
}
}
36 changes: 36 additions & 0 deletions PSE 5E PROBLEM 5.26 KITE-FLYING CONTEST/Properties/AssemblyInfo.cs
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PSE 5E PROBLEM 5.26 KITE-FLYING CONTEST")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PSE 5E PROBLEM 5.26 KITE-FLYING CONTEST")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3ff4e071-86af-4ba8-80ac-e7ae25a582bc")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
12 changes: 12 additions & 0 deletions Symbolism.sln
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PSE 5E Problem 5.21 Block R
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PSE 5E PROBLEM 5.24 BAG OF CEMENT", "PSE 5E PROBLEM 5.24 BAG OF CEMENT\PSE 5E PROBLEM 5.24 BAG OF CEMENT.csproj", "{EEE7C2F8-43D4-48B6-BF53-4EB7C8CD7AC7}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PSE 5E PROBLEM 5.24 BAG OF CEMENT", "PSE 5E PROBLEM 5.24 BAG OF CEMENT\PSE 5E PROBLEM 5.24 BAG OF CEMENT.csproj", "{EEE7C2F8-43D4-48B6-BF53-4EB7C8CD7AC7}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PSE 5E PROBLEM 5.26 KITE-FLYING CONTEST", "PSE 5E PROBLEM 5.26 KITE-FLYING CONTEST\PSE 5E PROBLEM 5.26 KITE-FLYING CONTEST.csproj", "{9B655E4F-E859-4E61-AF03-98621165F87C}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -191,6 +193,16 @@ Global
{EEE7C2F8-43D4-48B6-BF53-4EB7C8CD7AC7}.Release|Mixed Platforms.Build.0 = Release|x86 {EEE7C2F8-43D4-48B6-BF53-4EB7C8CD7AC7}.Release|Mixed Platforms.Build.0 = Release|x86
{EEE7C2F8-43D4-48B6-BF53-4EB7C8CD7AC7}.Release|x86.ActiveCfg = Release|x86 {EEE7C2F8-43D4-48B6-BF53-4EB7C8CD7AC7}.Release|x86.ActiveCfg = Release|x86
{EEE7C2F8-43D4-48B6-BF53-4EB7C8CD7AC7}.Release|x86.Build.0 = Release|x86 {EEE7C2F8-43D4-48B6-BF53-4EB7C8CD7AC7}.Release|x86.Build.0 = Release|x86
{9B655E4F-E859-4E61-AF03-98621165F87C}.Debug|Any CPU.ActiveCfg = Debug|x86
{9B655E4F-E859-4E61-AF03-98621165F87C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{9B655E4F-E859-4E61-AF03-98621165F87C}.Debug|Mixed Platforms.Build.0 = Debug|x86
{9B655E4F-E859-4E61-AF03-98621165F87C}.Debug|x86.ActiveCfg = Debug|x86
{9B655E4F-E859-4E61-AF03-98621165F87C}.Debug|x86.Build.0 = Debug|x86
{9B655E4F-E859-4E61-AF03-98621165F87C}.Release|Any CPU.ActiveCfg = Release|x86
{9B655E4F-E859-4E61-AF03-98621165F87C}.Release|Mixed Platforms.ActiveCfg = Release|x86
{9B655E4F-E859-4E61-AF03-98621165F87C}.Release|Mixed Platforms.Build.0 = Release|x86
{9B655E4F-E859-4E61-AF03-98621165F87C}.Release|x86.ActiveCfg = Release|x86
{9B655E4F-E859-4E61-AF03-98621165F87C}.Release|x86.Build.0 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
Expand Down
71 changes: 71 additions & 0 deletions Tests/Tests.cs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -871,6 +871,77 @@ static void Main(string[] args)
} }
#endregion #endregion


#region PSE 5E PROBLEM 5.26
{
// You are a judge in a children’s kite-flying contest, and
// two children will win prizes for the kites that pull most
// strongly and least strongly on their strings. To measure
// string tensions, you borrow a weight hanger, some slotted
// weights, and a protractor from your physics teacher
// and use the following protocol, illustrated in Figure
// P5.26: Wait for a child to get her kite well-controlled,
// hook the hanger onto the kite string about 30 cm from
// her hand, pile on weights until that section of string is
// horizontal, record the mass required, and record the
// angle between the horizontal and the string running up
// to the kite. (a) Explain how this method works. As you
// construct your explanation, imagine that the children’s
// parents ask you about your method, that they might
// make false assumptions about your ability without concrete
// evidence, and that your explanation is an opportunity to
// give them confidence in your evaluation tech-nique.
// (b) Find the string tension if the mass required
// to make the string horizontal is 132 g and the angle of
// the kite string is 46.3°.

var F1 = new Symbol("F1");
var F2 = new Symbol("F2");
var F3 = new Symbol("F3");

var th1 = new Symbol("th1");
var th2 = new Symbol("th2");
var th3 = new Symbol("th3");

var _F1 = new Point() { angle = th1 };
var _F2 = new Point() { angle = th2 };
var _F3 = new Point() { magnitude = F3, angle = th3 };

var m = new Symbol("m");

var obj = new Obj();

obj.acceleration.x = 0;
obj.acceleration.y = 0;

obj.mass = m;

obj.forces.Add(_F1);
obj.forces.Add(_F2);
obj.forces.Add(_F3);

//"Tension in line to kite:".Disp(); "".Disp();

//obj.ForceMagnitude(_F2)
// .Substitute(th1, (180).ToRadians())
// .Substitute(th2, (46.3 * Math.PI / 180))
// .Substitute(th3, (270).ToRadians())
// .Substitute(F3, 0.132 * 9.8)
// .Substitute(Trig.Pi, Math.PI)
// .Disp();

AssertEqual(
obj.ForceMagnitude(_F2)
.Substitute(th1, (180).ToRadians())
.Substitute(th2, (46.3 * Math.PI / 180))
.Substitute(th3, (270).ToRadians())
.Substitute(F3, 0.132 * 9.8)
.Substitute(Trig.Pi, Math.PI),
1.7892929261294661);

//Console.ReadLine();
}
#endregion

Console.WriteLine("Testing complete"); Console.WriteLine("Testing complete");


Console.ReadLine(); Console.ReadLine();
Expand Down

0 comments on commit f0c6865

Please sign in to comment.